Advanced Multi-Physics (AMP)
On-Line Documentation
Public Types | Static Public Member Functions | List of all members
AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config > Class Template Reference

#include <CSRLocalMatrixOperationsDefault.h>

Public Types

using allocator_type = typename Config::allocator_type
 
using config_type = Config
 
using gidx_t = typename Config::gidx_t
 
using lidx_t = typename Config::lidx_t
 
using localmatrixdata_t = CSRLocalMatrixData< Config >
 
using scalar_t = typename Config::scalar_t
 

Static Public Member Functions

static void axpy (scalar_t alpha, std::shared_ptr< localmatrixdata_t > X, std::shared_ptr< localmatrixdata_t > Y)
 Compute the linear combination of two matrices.
 
static void copy (std::shared_ptr< const localmatrixdata_t > X, std::shared_ptr< localmatrixdata_t > Y)
 Set this matrix with the same non-zero and distributed structure as x and copy the coefficients.
 
template<typename ConfigIn >
static void copyCast (std::shared_ptr< CSRLocalMatrixData< typename ConfigIn::template set_alloc_t< Config::allocator > > > X, std::shared_ptr< localmatrixdata_t > Y)
 Set Y matrix with the same non-zero and distributed structure as X and copy the coefficients after up/down casting.
 
static void extractDiagonal (std::shared_ptr< localmatrixdata_t > A, scalar_t *buf)
 Extract the diagonal values into a vector.
 
static void getRowSums (std::shared_ptr< localmatrixdata_t > A, scalar_t *buf)
 Extract the row sums into a vector.
 
static void getRowSumsAbsolute (std::shared_ptr< localmatrixdata_t > A, scalar_t *buf)
 Extract the absolute row sums into a vector.
 
static void mult (const scalar_t *in, std::shared_ptr< localmatrixdata_t > A, scalar_t *out)
 Matrix-vector multiplication.
 
static void multTranspose (const scalar_t *in, std::shared_ptr< localmatrixdata_t > A, std::vector< scalar_t > &vvals, std::vector< size_t > &rcols)
 Matrix transpose-vector multiplication.
 
static void scale (scalar_t alpha, const scalar_t *D, std::shared_ptr< localmatrixdata_t > A)
 Scale the matrix by a scalar and diagonal matrix.
 
static void scale (scalar_t alpha, std::shared_ptr< localmatrixdata_t > A)
 Scale the matrix by a scalar.
 
static void scaleInv (scalar_t alpha, const scalar_t *D, std::shared_ptr< localmatrixdata_t > A)
 Scale the matrix by a scalar and inverse of diagonal matrix.
 
static void setDiagonal (const scalar_t *in, std::shared_ptr< localmatrixdata_t > A)
 Set the diagonal to the values in a vector.
 
static void setIdentity (std::shared_ptr< localmatrixdata_t > A)
 Set the matrix to the identity matrix.
 
static void setScalar (scalar_t alpha, std::shared_ptr< localmatrixdata_t > A)
 Set the non-zeros of the matrix to a scalar.
 
static void zero (std::shared_ptr< localmatrixdata_t > A)
 Set the non-zeros of the matrix to zero.
 

Detailed Description

template<typename Config>
class AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >

Definition at line 7 of file CSRLocalMatrixOperationsDefault.h.

Member Typedef Documentation

◆ allocator_type

template<typename Config >
using AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::allocator_type = typename Config::allocator_type

Definition at line 11 of file CSRLocalMatrixOperationsDefault.h.

◆ config_type

template<typename Config >
using AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::config_type = Config

Definition at line 10 of file CSRLocalMatrixOperationsDefault.h.

◆ gidx_t

template<typename Config >
using AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::gidx_t = typename Config::gidx_t

Definition at line 13 of file CSRLocalMatrixOperationsDefault.h.

◆ lidx_t

template<typename Config >
using AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::lidx_t = typename Config::lidx_t

Definition at line 14 of file CSRLocalMatrixOperationsDefault.h.

◆ localmatrixdata_t

template<typename Config >
using AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::localmatrixdata_t = CSRLocalMatrixData<Config>

Definition at line 12 of file CSRLocalMatrixOperationsDefault.h.

◆ scalar_t

template<typename Config >
using AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::scalar_t = typename Config::scalar_t

Definition at line 15 of file CSRLocalMatrixOperationsDefault.h.

Member Function Documentation

◆ axpy()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::axpy ( scalar_t  alpha,
std::shared_ptr< localmatrixdata_t X,
std::shared_ptr< localmatrixdata_t Y 
)
static

Compute the linear combination of two matrices.

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

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

◆ copy()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::copy ( std::shared_ptr< const localmatrixdata_t X,
std::shared_ptr< localmatrixdata_t Y 
)
static

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

◆ copyCast()

template<typename Config >
template<typename ConfigIn >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::copyCast ( std::shared_ptr< CSRLocalMatrixData< typename ConfigIn::template set_alloc_t< Config::allocator > > >  X,
std::shared_ptr< localmatrixdata_t Y 
)
static

Set Y 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

◆ extractDiagonal()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::extractDiagonal ( std::shared_ptr< localmatrixdata_t A,
scalar_t buf 
)
static

Extract the diagonal values into a vector.

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

◆ getRowSums()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::getRowSums ( std::shared_ptr< localmatrixdata_t A,
scalar_t buf 
)
static

Extract the row sums into a vector.

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

◆ getRowSumsAbsolute()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::getRowSumsAbsolute ( std::shared_ptr< localmatrixdata_t A,
scalar_t buf 
)
static

Extract the absolute row sums into a vector.

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

◆ mult()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::mult ( const scalar_t in,
std::shared_ptr< localmatrixdata_t A,
scalar_t out 
)
static

Matrix-vector multiplication.

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

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

◆ multTranspose()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::multTranspose ( const scalar_t in,
std::shared_ptr< localmatrixdata_t A,
std::vector< scalar_t > &  vvals,
std::vector< size_t > &  rcols 
)
static

Matrix transpose-vector multiplication.

Parameters
[in]inThe vector to multiply
[in]AThe input matrix A
[out]vvalsValues accumulated into from product
[out]rcolsIndices where vvals correspond to

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

◆ scale() [1/2]

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::scale ( scalar_t  alpha,
const scalar_t D,
std::shared_ptr< localmatrixdata_t A 
)
static

Scale the matrix by a scalar and diagonal matrix.

Parameters
[in]alphaThe value to scale by
[in]DVector holding diagonal matrix entries
[in,out]AThe matrix A

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

◆ scale() [2/2]

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::scale ( scalar_t  alpha,
std::shared_ptr< localmatrixdata_t A 
)
static

Scale the matrix by a scalar.

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

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

◆ scaleInv()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::scaleInv ( scalar_t  alpha,
const scalar_t D,
std::shared_ptr< localmatrixdata_t A 
)
static

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

Parameters
[in]alphaThe value to scale by
[in]DVector holding diagonal matrix entries
[in,out]AThe matrix A

Compute \(\mathbf{A} = \alpha\mathbf{D}^{-1}\mathbf{A}\)

◆ setDiagonal()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::setDiagonal ( const scalar_t in,
std::shared_ptr< localmatrixdata_t A 
)
static

Set the diagonal to the values in a vector.

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

◆ setIdentity()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::setIdentity ( std::shared_ptr< localmatrixdata_t A)
static

Set the matrix to the identity matrix.

Parameters
[out]AThe matrix to set

◆ setScalar()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::setScalar ( scalar_t  alpha,
std::shared_ptr< localmatrixdata_t A 
)
static

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

◆ zero()

template<typename Config >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDefault< Config >::zero ( std::shared_ptr< localmatrixdata_t A)
static

Set the non-zeros of the matrix to zero.

Parameters
[in]AThe input matrix A

May not deallocate space.


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