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

#include <CSRLocalMatrixOperationsDevice.h>

Public Types

using allocator_type = typename Config::allocator_type
 
using gidx_t = typename Config::gidx_t
 
using lidx_t = typename Config::lidx_t
 
using scalar_t = typename Config::scalar_t
 

Static Public Member Functions

static void axpy (scalar_t alpha, std::shared_ptr< LocalMatrixData > X, std::shared_ptr< LocalMatrixData > Y)
 Compute the linear combination of two matrices.
 
static void copy (std::shared_ptr< const LocalMatrixData > X, std::shared_ptr< LocalMatrixData > 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 > 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 > A, scalar_t *buf)
 Extract the diagonal values into a vector.
 
static void LinfNorm (std::shared_ptr< LocalMatrixData > A, scalar_t *rowSums)
 Compute the maximum row sum.
 
static void mult (const scalar_t *in, std::shared_ptr< LocalMatrixData > A, scalar_t *out)
 Matrix-vector multiplication.
 
static void multTranspose (const scalar_t *in, std::shared_ptr< LocalMatrixData > A, std::vector< scalar_t > &vvals, std::vector< size_t > &rcols)
 Matrix transpose-vector multiplication.
 
static void scale (scalar_t alpha, std::shared_ptr< LocalMatrixData > A)
 Scale the matrix by a scalar.
 
static void setDiagonal (const scalar_t *in, std::shared_ptr< LocalMatrixData > A)
 Set the diagonal to the values in a vector.
 
static void setIdentity (std::shared_ptr< LocalMatrixData > A)
 Set the matrix to the identity matrix.
 
static void setScalar (scalar_t alpha, std::shared_ptr< LocalMatrixData > A)
 Set the non-zeros of the matrix to a scalar.
 
static void zero (std::shared_ptr< LocalMatrixData > A)
 Set the non-zeros of the matrix to zero.
 

Detailed Description

template<typename Config, typename LocalMatrixData = CSRLocalMatrixData<Config>>
class AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >

Definition at line 7 of file CSRLocalMatrixOperationsDevice.h.

Member Typedef Documentation

◆ allocator_type

template<typename Config , typename LocalMatrixData = CSRLocalMatrixData<Config>>
using AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::allocator_type = typename Config::allocator_type

Definition at line 13 of file CSRLocalMatrixOperationsDevice.h.

◆ gidx_t

template<typename Config , typename LocalMatrixData = CSRLocalMatrixData<Config>>
using AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::gidx_t = typename Config::gidx_t

Definition at line 10 of file CSRLocalMatrixOperationsDevice.h.

◆ lidx_t

template<typename Config , typename LocalMatrixData = CSRLocalMatrixData<Config>>
using AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::lidx_t = typename Config::lidx_t

Definition at line 11 of file CSRLocalMatrixOperationsDevice.h.

◆ scalar_t

template<typename Config , typename LocalMatrixData = CSRLocalMatrixData<Config>>
using AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::scalar_t = typename Config::scalar_t

Definition at line 12 of file CSRLocalMatrixOperationsDevice.h.

Member Function Documentation

◆ axpy()

template<typename Config , typename LocalMatrixData = CSRLocalMatrixData<Config>>
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::axpy ( scalar_t  alpha,
std::shared_ptr< LocalMatrixData >  X,
std::shared_ptr< LocalMatrixData >  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 , typename LocalMatrixData = CSRLocalMatrixData<Config>>
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::copy ( std::shared_ptr< const LocalMatrixData >  X,
std::shared_ptr< LocalMatrixData >  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 , typename LocalMatrixData = CSRLocalMatrixData<Config>>
template<typename ConfigIn >
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::copyCast ( std::shared_ptr< CSRLocalMatrixData< typename ConfigIn::template set_alloc_t< Config::allocator > > >  X,
std::shared_ptr< LocalMatrixData >  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 , typename LocalMatrixData = CSRLocalMatrixData<Config>>
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::extractDiagonal ( std::shared_ptr< LocalMatrixData >  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

◆ LinfNorm()

template<typename Config , typename LocalMatrixData = CSRLocalMatrixData<Config>>
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::LinfNorm ( std::shared_ptr< LocalMatrixData >  A,
scalar_t rowSums 
)
static

Compute the maximum row sum.

Parameters
[in]AData for the input matrix
[out]rowSumsL-infinity norm of the matrix

◆ mult()

template<typename Config , typename LocalMatrixData = CSRLocalMatrixData<Config>>
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::mult ( const scalar_t in,
std::shared_ptr< LocalMatrixData >  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 , typename LocalMatrixData = CSRLocalMatrixData<Config>>
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::multTranspose ( const scalar_t in,
std::shared_ptr< LocalMatrixData >  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()

template<typename Config , typename LocalMatrixData = CSRLocalMatrixData<Config>>
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::scale ( scalar_t  alpha,
std::shared_ptr< LocalMatrixData >  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}\)

◆ setDiagonal()

template<typename Config , typename LocalMatrixData = CSRLocalMatrixData<Config>>
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::setDiagonal ( const scalar_t in,
std::shared_ptr< LocalMatrixData >  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 , typename LocalMatrixData = CSRLocalMatrixData<Config>>
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::setIdentity ( std::shared_ptr< LocalMatrixData >  A)
static

Set the matrix to the identity matrix.

Parameters
[out]AThe matrix to set

◆ setScalar()

template<typename Config , typename LocalMatrixData = CSRLocalMatrixData<Config>>
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::setScalar ( scalar_t  alpha,
std::shared_ptr< LocalMatrixData >  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 , typename LocalMatrixData = CSRLocalMatrixData<Config>>
static void AMP::LinearAlgebra::CSRLocalMatrixOperationsDevice< Config, LocalMatrixData >::zero ( std::shared_ptr< LocalMatrixData >  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