#include <MatrixOperations.h>

Public Member Functions | |
| virtual void | axpy (AMP::Scalar alpha, const MatrixData &X, MatrixData &Y)=0 |
| Compute the linear combination of two matrices. | |
| virtual void | copy (const MatrixData &x, MatrixData &y)=0 |
| Set this matrix with the same non-zero and distributed structure as x and copy the coefficients. | |
| virtual void | copyCast (const MatrixData &x, MatrixData &y) |
| Set this matrix with the same non-zero and distributed structure as x and copy the coefficients after up/down casting. | |
| virtual void | extractDiagonal (MatrixData const &A, std::shared_ptr< Vector > buf)=0 |
| Extract the diagonal values into a vector. | |
| uint64_t | getID () const |
| Get a unique id hash for the vector operation. | |
| virtual void | getRowSums (MatrixData const &A, std::shared_ptr< Vector > buf) |
| Extract the row sums into a vector. | |
| virtual void | getRowSumsAbsolute (MatrixData const &A, std::shared_ptr< Vector > buf, const bool remove_zeros=false) |
| Extract the absolute row sums into a vector. | |
| virtual AMP::Scalar | LinfNorm (const MatrixData &X) const =0 |
| Compute the maximum row sum. | |
| virtual void | matMatMult (std::shared_ptr< MatrixData > A, std::shared_ptr< MatrixData > B, std::shared_ptr< MatrixData > C)=0 |
| Compute the product of two matrices. | |
| virtual void | mult (std::shared_ptr< const Vector > x, MatrixData const &A, std::shared_ptr< Vector > y)=0 |
| Matrix-vector multiplication. | |
| virtual void | multTranspose (std::shared_ptr< const Vector > in, MatrixData const &A, std::shared_ptr< Vector > out)=0 |
| Matrix transpose-vector multiplication. | |
| virtual void | registerChildObjects (AMP::IO::RestartManager *manager) const |
| Register any child objects. | |
| virtual void | scale (AMP::Scalar alpha, MatrixData &A)=0 |
| Scale the matrix by a scalar. | |
| virtual void | scale (AMP::Scalar alpha, std::shared_ptr< const Vector > D, MatrixData &A)=0 |
| Scale the matrix by a scalar and diagonal matrix. | |
| virtual void | scaleInv (AMP::Scalar alpha, std::shared_ptr< const Vector > D, MatrixData &A)=0 |
| Scale the matrix by a scalar and inverse of diagonal matrix. | |
| virtual void | setDiagonal (std::shared_ptr< const Vector > in, MatrixData &A)=0 |
| Set the diagonal to the values in a vector. | |
| virtual void | setIdentity (MatrixData &A)=0 |
| Set the matrix to the identity matrix. | |
| virtual void | setScalar (AMP::Scalar alpha, MatrixData &A)=0 |
| Set the non-zeros of the matrix to a scalar. | |
| virtual std::string | type () const |
| Return the type of the matrix operations class. | |
| virtual void | writeRestart (int64_t fid) const |
| Write restart data to file. | |
| virtual void | zero (MatrixData &A)=0 |
| Set the non-zeros of the matrix to zero. | |
| virtual | ~MatrixOperations () |
| Destructor. | |
Protected Member Functions | |
| MatrixOperations () | |
Protected Attributes | |
| uint64_t | d_hash = 0 |
| unique hash for object | |
Definition at line 16 of file MatrixOperations.h.
|
inlinevirtual |
Destructor.
Definition at line 20 of file MatrixOperations.h.
|
protected |
|
pure virtual |
Compute the linear combination of two matrices.
| [in] | alpha | scalar |
| [in] | X | matrix |
| [out] | Y | Output matrix Y |
Compute \(\mathbf{THIS} = \alpha\mathbf{X} + \mathbf{THIS}\)
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
pure virtual |
Set this matrix with the same non-zero and distributed structure as x and copy the coefficients.
| [in] | x | matrix data to copy from |
| [in] | y | matrix data to copy to |
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
virtual |
Set this matrix with the same non-zero and distributed structure as x and copy the coefficients after up/down casting.
| [in] | x | matrix data to copy from |
| [in] | y | matrix data to copy to after up/down casting the coefficients |
Reimplemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, and AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >.
|
pure virtual |
Extract the diagonal values into a vector.
| [in] | A | The matrix to get the diagonal from |
| [in] | buf | Vector to store the diagonal to |
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
| uint64_t AMP::LinearAlgebra::MatrixOperations::getID | ( | ) | const |
Get a unique id hash for the vector operation.
|
virtual |
Extract the row sums into a vector.
| [in] | A | The matrix to get the row sums from |
| [in] | buf | Vector to store the row sums to |
Reimplemented in AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, and AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >.
|
virtual |
Extract the absolute row sums into a vector.
| [in] | A | The matrix to get the row sums from |
| [in] | buf | Vector to store the row sums to |
| [in] | remove_zeros | If true zero values in sum are replaced with ones |
Reimplemented in AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, and AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >.
|
pure virtual |
Compute the maximum row sum.
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
pure virtual |
Compute the product of two matrices.
| [in] | A | A multiplicand |
| [in] | B | A multiplicand |
| [out] | C | The product \(\mathbf{AB}\). |
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
pure virtual |
Matrix-vector multiplication.
| [in] | x | The vector to multiply |
| [in] | A | The input matrix A |
| [out] | y | The resulting vectory |
Compute \(\mathbf{Ax} = \mathbf{y}\).
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
pure virtual |
Matrix transpose-vector multiplication.
| [in] | in | The vector to multiply |
| [in] | A | The input matrix A |
| [out] | out | The resulting vectory |
Compute \(\mathbf{A}^T\mathbf{in} = \mathbf{out}\).
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
virtual |
Register any child objects.
This function will register child objects with the manager
| manager | Restart manager |
|
pure virtual |
Scale the matrix by a scalar.
| [in] | alpha | The value to scale by |
| [in] | A | The input matrix A |
Compute \(\mathbf{A} = \alpha\mathbf{A}\)
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
pure virtual |
Scale the matrix by a scalar and diagonal matrix.
| [in] | alpha | The value to scale by |
| [in] | D | A vector representing the diagonal matrix |
| [in] | A | The input matrix A |
Compute \(\mathbf{A} = \alpha\mathbf{D}\mathbf{A}\)
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
pure virtual |
Scale the matrix by a scalar and inverse of diagonal matrix.
| [in] | alpha | The value to scale by |
| [in] | D | A vector representing the diagonal matrix |
| [in] | A | The input matrix A |
Compute \(\mathbf{A} = \alpha\mathbf{D}^{-1}\mathbf{A}\)
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
pure virtual |
Set the diagonal to the values in a vector.
| [in] | in | The values to set the diagonal to |
| [out] | A | The matrix A to set |
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
pure virtual |
Set the matrix to the identity matrix.
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
pure virtual |
Set the non-zeros of the matrix to a scalar.
| [in] | alpha | The value to set the non-zeros to |
| [out] | A | Matrix to set |
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
inlinevirtual |
Return the type of the matrix operations class.
Reimplemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, and AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >.
Definition at line 143 of file MatrixOperations.h.
|
virtual |
Write restart data to file.
This function will write the mesh to an HDF5 file
| fid | File identifier to write |
Reimplemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, and AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >.
|
pure virtual |
Set the non-zeros of the matrix to zero.
May not deallocate space.
Implemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, AMP::LinearAlgebra::DenseSerialMatrixOperations, AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >, AMP::LinearAlgebra::NativePetscMatrixOperations, and AMP::LinearAlgebra::EpetraMatrixOperations.
|
protected |
unique hash for object
Definition at line 169 of file MatrixOperations.h.
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:42. Comments on this page |