10#ifndef BELOS_DENSE_MAT_TRAITS_HPP
11#define BELOS_DENSE_MAT_TRAITS_HPP
19#include "Teuchos_RCP.hpp"
20#include "Teuchos_ScalarTraits.hpp"
32 template<
class ScalarType,
class DM >
50 template<
class ScalarType,
class DM>
202 static typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
NormFrobenius(
const DM&
dm)
206 static typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
NormOne(
const DM&
dm)
Virtual base class which defines solvers for dense matrix type.
Virtual base class which defines basic traits for the multi-vector type.
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< DM > SubviewCopy(const DM &source, int numRows, int numCols, int startRow=0, int startCol=0)
Returns a deep copy of the requested subview.
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 ...
static void SyncHostToDevice(DM &dm)
static void PutScalar(DM &dm, ScalarType value=Teuchos::ScalarTraits< ScalarType >::zero())
Fill all entries with value. Value is zero if not specified.
static int GetNumRows(const DM &dm)
Obtain the number of rows of dm.
static void Scale(DM &dm, ScalarType value)
Multiply all entries by a scalar. DM = value.*DM.
static Teuchos::RCP< DM > CreateCopy(const DM &dm, bool transpose=false)
Create a new copy DM, possibly transposed.
static ScalarType * GetRawHostPtr(DM &dm)
Returns a raw pointer to the (non-const) data on the host.
static const ScalarType & ValueConst(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 Assign(DM &thisDM, const DM &sourceDM)
Copies entries of sourceDM to thisDM (deep copy).
static Teuchos::RCP< DenseSolver< ScalarType, DM > > createDenseSolver()
Returns a dense solver object for the dense matrix.
static Teuchos::RCP< const DM > SubviewConst(const DM &source, int numRows, int numCols, int startRow=0, int startCol=0)
static void Add(DM &thisDM, const DM &sourceDM)
Adds sourceDM to thisDM and returns answer in thisDM.
static void Randomize(DM &dm)
Fill the DM with random entries.
static void Reshape(DM &dm, const int numrows, const int numcols, bool initZero=false)
static ScalarType const * GetConstRawHostPtr(const DM &dm)
Returns a raw pointer to const data on the host.
static ScalarType & Value(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 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 int GetStride(const DM &dm)
Obtain the stride between the columns of dm.
static Teuchos::RCP< DM > Create()
Creates a new empty DM with no dimension.
static int GetNumCols(const DM &dm)
Obtain the number of columns of dm.
Alternative run-time polymorphic interface for operators.
This is the default struct used by DenseMatrixTraits<OrdinalType, ScalarType> class to produce a comp...
static ScalarType notDefined()
This function should not compile if there is an attempt to instantiate!