Belos Version of the Day
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
Belos::DenseMatTraits< ScalarType, DM > Class Template Reference

Virtual base class which defines basic traits for the multi-vector type. More...

#include <BelosDenseMatTraits.hpp>

Static Public Member Functions

static Teuchos::RCP< DM > Create ()
 Creates a new empty DM with no dimension.
 
static Teuchos::RCP< DM > Create (const int numrows, const int numcols, bool initZero=true)
 Creates a new empty DM containing numvecs columns. Will be initialized to zeros if last parameter is true.
 
static Teuchos::RCP< DM > CreateCopy (const DM &dm, bool transpose=false)
 Create a new copy DM, possibly transposed.
 
static ScalarTypeGetRawHostPtr (DM &dm)
 Returns a raw pointer to the (non-const) data on the host.
 
static ScalarType constGetConstRawHostPtr (const DM &dm)
 Returns a raw pointer to const data on the host.
 
static Teuchos::RCP< DM > Subview (DM &source, int numRows, int numCols, int startRow=0, int startCol=0)
 Marks host data modified to avoid device sync errors.
 
static Teuchos::RCP< const DM > SubviewConst (const DM &source, int numRows, int numCols, int startRow=0, int startCol=0)
 
static Teuchos::RCP< DM > SubviewCopy (const DM &source, int numRows, int numCols, int startRow=0, int startCol=0)
 Returns a deep copy of the requested subview.
 
static int GetNumRows (const DM &dm)
 Obtain the number of rows of dm.
 
static int GetNumCols (const DM &dm)
 Obtain the number of columns of dm.
 
static int GetStride (const DM &dm)
 Obtain the stride between the columns of dm.
 
static void Reshape (DM &dm, const int numrows, const int numcols, bool initZero=false)
 
static ScalarTypeValue (DM &dm, const int i, const int j)
 Access a reference to the (i,j) entry of dm, e_i^T dm e_j.
 
static const ScalarTypeValueConst (const DM &dm, const int i, const int j)
 Access a const reference to the (i,j) entry of dm, e_i^T dm e_j.
 
static void SyncDeviceToHost (DM &dm)
 
static void SyncHostToDevice (DM &dm)
 
static void Add (DM &thisDM, const DM &sourceDM)
 Adds sourceDM to thisDM and returns answer in thisDM.
 
static void PutScalar (DM &dm, ScalarType value=Teuchos::ScalarTraits< ScalarType >::zero())
 Fill all entries with value. Value is zero if not specified.
 
static void Scale (DM &dm, ScalarType value)
 Multiply all entries by a scalar. DM = value.*DM.
 
static void Randomize (DM &dm)
 Fill the DM with random entries.
 
static void Assign (DM &thisDM, const DM &sourceDM)
 Copies entries of sourceDM to thisDM (deep copy).
 
static Teuchos::ScalarTraits< ScalarType >::magnitudeType NormFrobenius (const DM &dm)
 Returns the Frobenius norm of the dense matrix.
 
static Teuchos::ScalarTraits< ScalarType >::magnitudeType NormOne (const DM &dm)
 Returns the one-norm of the dense matrix.
 
static Teuchos::RCP< DenseSolver< ScalarType, DM > > createDenseSolver ()
 Returns a dense solver object for the dense matrix.
 

Detailed Description

template<class ScalarType, class DM>
class Belos::DenseMatTraits< ScalarType, DM >

Virtual base class which defines basic traits for the multi-vector type.

An adapter for this traits class must exist for the DM type. If not, this class will produce a compile-time error.

Definition at line 51 of file BelosDenseMatTraits.hpp.

Member Function Documentation

◆ Create() [1/2]

template<class ScalarType , class DM >
static Teuchos::RCP< DM > Belos::DenseMatTraits< ScalarType, DM >::Create ( )
inlinestatic

Creates a new empty DM with no dimension.

Returns
Reference-counted pointer to a new dense matrix of type DM.

Definition at line 61 of file BelosDenseMatTraits.hpp.

◆ Create() [2/2]

template<class ScalarType , class DM >
static Teuchos::RCP< DM > Belos::DenseMatTraits< ScalarType, DM >::Create ( const int  numrows,
const int  numcols,
bool  initZero = true 
)
inlinestatic

Creates a new empty DM containing numvecs columns. Will be initialized to zeros if last parameter is true.

Returns
Reference-counted pointer to a new dense matrix of type DM.

Definition at line 69 of file BelosDenseMatTraits.hpp.

◆ CreateCopy()

template<class ScalarType , class DM >
static Teuchos::RCP< DM > Belos::DenseMatTraits< ScalarType, DM >::CreateCopy ( const DM &  dm,
bool  transpose = false 
)
inlinestatic

Create a new copy DM, possibly transposed.

Returns
Reference-counted pointer to a new dense matrix of type DM.

Definition at line 76 of file BelosDenseMatTraits.hpp.

◆ GetRawHostPtr()

template<class ScalarType , class DM >
static ScalarType * Belos::DenseMatTraits< ScalarType, DM >::GetRawHostPtr ( DM &  dm)
inlinestatic

Returns a raw pointer to the (non-const) data on the host.

Note
We assume that return data in in a column-major format because this is what is expected by LAPACK.
This raw pointer is intended only for passing data to LAPACK functions. Other operations on the raw data may result in undefined behavior!

Definition at line 95 of file BelosDenseMatTraits.hpp.

◆ GetConstRawHostPtr()

template<class ScalarType , class DM >
static ScalarType const * Belos::DenseMatTraits< ScalarType, DM >::GetConstRawHostPtr ( const DM &  dm)
inlinestatic

Returns a raw pointer to const data on the host.

Definition at line 99 of file BelosDenseMatTraits.hpp.

◆ Subview()

template<class ScalarType , class DM >
static Teuchos::RCP< DM > Belos::DenseMatTraits< ScalarType, DM >::Subview ( DM &  source,
int  numRows,
int  numCols,
int  startRow = 0,
int  startCol = 0 
)
inlinestatic

Marks host data modified to avoid device sync errors.

Note
Belos developers must call this function after EVERY call to LAPACK that modifies dense matrix data accessed via raw pointer.

Returns an RCP to a DM which has a subview of the given DM.

Definition at line 117 of file BelosDenseMatTraits.hpp.

◆ SubviewConst()

template<class ScalarType , class DM >
static Teuchos::RCP< const DM > Belos::DenseMatTraits< ScalarType, DM >::SubviewConst ( const DM &  source,
int  numRows,
int  numCols,
int  startRow = 0,
int  startCol = 0 
)
inlinestatic

Definition at line 120 of file BelosDenseMatTraits.hpp.

◆ SubviewCopy()

template<class ScalarType , class DM >
static Teuchos::RCP< DM > Belos::DenseMatTraits< ScalarType, DM >::SubviewCopy ( const DM &  source,
int  numRows,
int  numCols,
int  startRow = 0,
int  startCol = 0 
)
inlinestatic

Returns a deep copy of the requested subview.

Definition at line 124 of file BelosDenseMatTraits.hpp.

◆ GetNumRows()

template<class ScalarType , class DM >
static int Belos::DenseMatTraits< ScalarType, DM >::GetNumRows ( const DM &  dm)
inlinestatic

Obtain the number of rows of dm.

Definition at line 131 of file BelosDenseMatTraits.hpp.

◆ GetNumCols()

template<class ScalarType , class DM >
static int Belos::DenseMatTraits< ScalarType, DM >::GetNumCols ( const DM &  dm)
inlinestatic

Obtain the number of columns of dm.

Definition at line 135 of file BelosDenseMatTraits.hpp.

◆ GetStride()

template<class ScalarType , class DM >
static int Belos::DenseMatTraits< ScalarType, DM >::GetStride ( const DM &  dm)
inlinestatic

Obtain the stride between the columns of dm.

Definition at line 139 of file BelosDenseMatTraits.hpp.

◆ Reshape()

template<class ScalarType , class DM >
static void Belos::DenseMatTraits< ScalarType, DM >::Reshape ( DM &  dm,
const int  numrows,
const int  numcols,
bool  initZero = false 
)
inlinestatic

Definition at line 156 of file BelosDenseMatTraits.hpp.

◆ Value()

template<class ScalarType , class DM >
static ScalarType & Belos::DenseMatTraits< ScalarType, DM >::Value ( DM &  dm,
const int  i,
const int  j 
)
inlinestatic

Access a reference to the (i,j) entry of dm, e_i^T dm e_j.

Definition at line 164 of file BelosDenseMatTraits.hpp.

◆ ValueConst()

template<class ScalarType , class DM >
static const ScalarType & Belos::DenseMatTraits< ScalarType, DM >::ValueConst ( const DM &  dm,
const int  i,
const int  j 
)
inlinestatic

Access a const reference to the (i,j) entry of dm, e_i^T dm e_j.

Definition at line 168 of file BelosDenseMatTraits.hpp.

◆ SyncDeviceToHost()

template<class ScalarType , class DM >
static void Belos::DenseMatTraits< ScalarType, DM >::SyncDeviceToHost ( DM &  dm)
inlinestatic

Definition at line 171 of file BelosDenseMatTraits.hpp.

◆ SyncHostToDevice()

template<class ScalarType , class DM >
static void Belos::DenseMatTraits< ScalarType, DM >::SyncHostToDevice ( DM &  dm)
inlinestatic

Definition at line 174 of file BelosDenseMatTraits.hpp.

◆ Add()

template<class ScalarType , class DM >
static void Belos::DenseMatTraits< ScalarType, DM >::Add ( DM &  thisDM,
const DM &  sourceDM 
)
inlinestatic

Adds sourceDM to thisDM and returns answer in thisDM.

Definition at line 181 of file BelosDenseMatTraits.hpp.

◆ PutScalar()

template<class ScalarType , class DM >
static void Belos::DenseMatTraits< ScalarType, DM >::PutScalar ( DM &  dm,
ScalarType  value = Teuchos::ScalarTraits<ScalarType>::zero() 
)
inlinestatic

Fill all entries with value. Value is zero if not specified.

Definition at line 185 of file BelosDenseMatTraits.hpp.

◆ Scale()

template<class ScalarType , class DM >
static void Belos::DenseMatTraits< ScalarType, DM >::Scale ( DM &  dm,
ScalarType  value 
)
inlinestatic

Multiply all entries by a scalar. DM = value.*DM.

Definition at line 189 of file BelosDenseMatTraits.hpp.

◆ Randomize()

template<class ScalarType , class DM >
static void Belos::DenseMatTraits< ScalarType, DM >::Randomize ( DM &  dm)
inlinestatic

Fill the DM with random entries.

Entries are assumed to be the same on each MPI rank (each matrix copy).

Definition at line 194 of file BelosDenseMatTraits.hpp.

◆ Assign()

template<class ScalarType , class DM >
static void Belos::DenseMatTraits< ScalarType, DM >::Assign ( DM &  thisDM,
const DM &  sourceDM 
)
inlinestatic

Copies entries of sourceDM to thisDM (deep copy).

Definition at line 198 of file BelosDenseMatTraits.hpp.

◆ NormFrobenius()

template<class ScalarType , class DM >
static Teuchos::ScalarTraits< ScalarType >::magnitudeType Belos::DenseMatTraits< ScalarType, DM >::NormFrobenius ( const DM &  dm)
inlinestatic

Returns the Frobenius norm of the dense matrix.

Definition at line 202 of file BelosDenseMatTraits.hpp.

◆ NormOne()

template<class ScalarType , class DM >
static Teuchos::ScalarTraits< ScalarType >::magnitudeType Belos::DenseMatTraits< ScalarType, DM >::NormOne ( const DM &  dm)
inlinestatic

Returns the one-norm of the dense matrix.

Definition at line 206 of file BelosDenseMatTraits.hpp.

◆ createDenseSolver()

template<class ScalarType , class DM >
static Teuchos::RCP< DenseSolver< ScalarType, DM > > Belos::DenseMatTraits< ScalarType, DM >::createDenseSolver ( )
inlinestatic

Returns a dense solver object for the dense matrix.

Definition at line 213 of file BelosDenseMatTraits.hpp.


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

Generated for Belos by doxygen 1.9.8