Advanced Multi-Physics (AMP)
On-Line Documentation
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
AMP::LinearAlgebra::DenseSerialMatrixOperations Class Reference

#include <DenseSerialMatrixOperations.h>

Inheritance diagram for AMP::LinearAlgebra::DenseSerialMatrixOperations:
Inheritance graph
[legend]

Public Member Functions

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.
 
uint64_t getID () const
 Get a unique id hash for the vector operation.
 
virtual void registerChildObjects (AMP::IO::RestartManager *manager) const
 Register any child objects.
 
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.
 

Protected Attributes

uint64_t d_hash = 0
 unique hash for object
 

Private Member Functions

void axpy (AMP::Scalar alpha, const MatrixData &X, MatrixData &Y) override
 Compute the linear combination of two matrices.
 
void copy (const MatrixData &x, MatrixData &y) override
 Set this matrix with the same non-zero and distributed structure as x and copy the coefficients.
 
void extractDiagonal (MatrixData const &A, std::shared_ptr< Vector > buf) override
 Extract the diagonal values into a vector.
 
void getRowSums (MatrixData const &, std::shared_ptr< Vector >) override
 Extract the row sums into a vector.
 
void getRowSumsAbsolute (MatrixData const &, std::shared_ptr< Vector >, const bool) override
 Extract the absolute row sums into a vector.
 
AMP::Scalar LinfNorm (const MatrixData &X) const override
 Compute the maximum row sum.
 
void matMatMult (std::shared_ptr< MatrixData > A, std::shared_ptr< MatrixData > B, std::shared_ptr< MatrixData > C) override
 Compute the product of two matrices.
 
void mult (std::shared_ptr< const Vector > x, MatrixData const &A, std::shared_ptr< Vector > y) override
 Matrix-vector multiplication.
 
void multTranspose (std::shared_ptr< const Vector > in, MatrixData const &A, std::shared_ptr< Vector > out) override
 Matrix transpose-vector multiplication.
 
void scale (AMP::Scalar alpha, MatrixData &A) override
 Scale the matrix by a scalar.
 
void scale (AMP::Scalar, std::shared_ptr< const Vector >, MatrixData &) override
 Scale the matrix by a scalar and diagonal matrix.
 
void scaleInv (AMP::Scalar, std::shared_ptr< const Vector >, MatrixData &) override
 Scale the matrix by a scalar and inverse of diagonal matrix.
 
void setDiagonal (std::shared_ptr< const Vector > in, MatrixData &A) override
 Set the diagonal to the values in a vector.
 
void setIdentity (MatrixData &A) override
 Set the matrix to the identity matrix.
 
void setScalar (AMP::Scalar alpha, MatrixData &A) override
 Set the non-zeros of the matrix to a scalar.
 
void zero (MatrixData &A) override
 Set the non-zeros of the matrix to zero.
 

Detailed Description

Definition at line 8 of file DenseSerialMatrixOperations.h.

Member Function Documentation

◆ axpy()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::axpy ( AMP::Scalar  alpha,
const MatrixData X,
MatrixData Y 
)
overrideprivatevirtual

Compute the linear combination of two matrices.

Parameters
[in]alphascalar
[in]Xmatrix
[out]YThe output matrix

Compute \(\mathbf{THIS} = \alpha\mathbf{X} + \mathbf{THIS}\)

Implements AMP::LinearAlgebra::MatrixOperations.

◆ copy()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::copy ( const MatrixData x,
MatrixData y 
)
overrideprivatevirtual

Set this matrix with the same non-zero and distributed structure as x and copy the coefficients.

Parameters
[in]xmatrix data to copy from
[in]ymatrix data to copy to

Implements AMP::LinearAlgebra::MatrixOperations.

◆ copyCast()

virtual void AMP::LinearAlgebra::MatrixOperations::copyCast ( const MatrixData x,
MatrixData y 
)
virtualinherited

Set this matrix with the same non-zero and distributed structure as x and copy the coefficients after up/down casting.

Parameters
[in]xmatrix data to copy from
[in]ymatrix data to copy to after up/down casting the coefficients

Reimplemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, and AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >.

◆ extractDiagonal()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::extractDiagonal ( MatrixData const &  A,
std::shared_ptr< Vector buf 
)
overrideprivatevirtual

Extract the diagonal values into a vector.

Parameters
[in]AThe matrix to read from
[out]bufBuffer to write row sums into

Implements AMP::LinearAlgebra::MatrixOperations.

◆ getID()

uint64_t AMP::LinearAlgebra::MatrixOperations::getID ( ) const
inherited

Get a unique id hash for the vector operation.

◆ getRowSums()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::getRowSums ( MatrixData const &  ,
std::shared_ptr< Vector  
)
overrideprivatevirtual

Extract the row sums into a vector.

Reimplemented from AMP::LinearAlgebra::MatrixOperations.

◆ getRowSumsAbsolute()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::getRowSumsAbsolute ( MatrixData const &  ,
std::shared_ptr< Vector ,
const bool   
)
overrideprivatevirtual

Extract the absolute row sums into a vector.

Reimplemented from AMP::LinearAlgebra::MatrixOperations.

◆ LinfNorm()

AMP::Scalar AMP::LinearAlgebra::DenseSerialMatrixOperations::LinfNorm ( const MatrixData X) const
overrideprivatevirtual

Compute the maximum row sum.

Returns
The L-infinity norm of the matrix
Parameters
[in]XData for the input matrix

Implements AMP::LinearAlgebra::MatrixOperations.

◆ matMatMult()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::matMatMult ( std::shared_ptr< MatrixData A,
std::shared_ptr< MatrixData B,
std::shared_ptr< MatrixData C 
)
overrideprivatevirtual

Compute the product of two matrices.

Parameters
[in]AA multiplicand
[in]BA multiplicand
[in]CThe product \(\mathbf{AB}\).

Implements AMP::LinearAlgebra::MatrixOperations.

◆ mult()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::mult ( std::shared_ptr< const Vector x,
MatrixData const &  A,
std::shared_ptr< Vector y 
)
overrideprivatevirtual

Matrix-vector multiplication.

Parameters
[in]xThe vector to multiply
[in]AThe input matrix A
[out]yThe resulting vectory

Compute \(\mathbf{Ax} = \mathbf{y}\).

Implements AMP::LinearAlgebra::MatrixOperations.

◆ multTranspose()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::multTranspose ( std::shared_ptr< const Vector in,
MatrixData const &  A,
std::shared_ptr< Vector out 
)
overrideprivatevirtual

Matrix transpose-vector multiplication.

Parameters
[in]inThe vector to multiply
[in]AThe input matrix A
[out]outThe resulting vectory

Compute \(\mathbf{A}^T\mathbf{in} = \mathbf{out}\).

Implements AMP::LinearAlgebra::MatrixOperations.

◆ registerChildObjects()

virtual void AMP::LinearAlgebra::MatrixOperations::registerChildObjects ( AMP::IO::RestartManager manager) const
virtualinherited

Register any child objects.

This function will register child objects with the manager

Parameters
managerRestart manager

◆ scale() [1/2]

void AMP::LinearAlgebra::DenseSerialMatrixOperations::scale ( AMP::Scalar  alpha,
MatrixData A 
)
overrideprivatevirtual

Scale the matrix by a scalar.

Parameters
[in]alphaThe value to scale by
[in,out]AThe matrix A

Compute \(\mathbf{A} = \alpha\mathbf{A}\)

Implements AMP::LinearAlgebra::MatrixOperations.

◆ scale() [2/2]

void AMP::LinearAlgebra::DenseSerialMatrixOperations::scale ( AMP::Scalar  ,
std::shared_ptr< const Vector ,
MatrixData  
)
overrideprivatevirtual

Scale the matrix by a scalar and diagonal matrix.

Implements AMP::LinearAlgebra::MatrixOperations.

◆ scaleInv()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::scaleInv ( AMP::Scalar  ,
std::shared_ptr< const Vector ,
MatrixData  
)
overrideprivatevirtual

Scale the matrix by a scalar and inverse of diagonal matrix.

Implements AMP::LinearAlgebra::MatrixOperations.

◆ setDiagonal()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::setDiagonal ( std::shared_ptr< const Vector in,
MatrixData A 
)
overrideprivatevirtual

Set the diagonal to the values in a vector.

Parameters
[in]inThe values to set the diagonal to
[out]AThe matrix to set

Implements AMP::LinearAlgebra::MatrixOperations.

◆ setIdentity()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::setIdentity ( MatrixData A)
overrideprivatevirtual

Set the matrix to the identity matrix.

Parameters
[out]AThe matrix to set

Implements AMP::LinearAlgebra::MatrixOperations.

◆ setScalar()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::setScalar ( AMP::Scalar  alpha,
MatrixData A 
)
overrideprivatevirtual

Set the non-zeros of the matrix to a scalar.

Parameters
[in]alphaThe value to set the non-zeros to
[out]AThe input matrix A

Implements AMP::LinearAlgebra::MatrixOperations.

◆ type()

virtual std::string AMP::LinearAlgebra::MatrixOperations::type ( ) const
inlinevirtualinherited

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.

◆ writeRestart()

virtual void AMP::LinearAlgebra::MatrixOperations::writeRestart ( int64_t  fid) const
virtualinherited

Write restart data to file.

This function will write the mesh to an HDF5 file

Parameters
fidFile identifier to write

Reimplemented in AMP::LinearAlgebra::CSRMatrixOperationsDefault< Config >, and AMP::LinearAlgebra::CSRMatrixOperationsDevice< Config >.

◆ zero()

void AMP::LinearAlgebra::DenseSerialMatrixOperations::zero ( MatrixData A)
overrideprivatevirtual

Set the non-zeros of the matrix to zero.

May not deallocate space.

Parameters
[in]AThe input matrix A

Implements AMP::LinearAlgebra::MatrixOperations.

Member Data Documentation

◆ d_hash

uint64_t AMP::LinearAlgebra::MatrixOperations::d_hash = 0
protectedinherited

unique hash for object

Definition at line 169 of file MatrixOperations.h.


The documentation for this class was generated from the following file:



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:42.
Comments on this page