Tpetra parallel linear algebra  Version of the Day
Classes | Functions
Tpetra::Experimental Namespace Reference

Namespace for new Tpetra features that are not ready for public release, but are ready for evaluation by friendly expert users. More...

Classes

class  BlockCrsMatrix
 Constant block CRS matrix class. More...
 
class  BlockMultiVector
 MultiVector for multiple degrees of freedom per mesh point. More...
 
class  BlockVector
 Vector for multiple degrees of freedom per mesh point. More...
 
class  LittleBlock
 Nonowning view of a square dense block in a block matrix. More...
 
class  LittleVector
 Nonowning view of a set of degrees of freedom corresponding to a mesh point in a block vector or multivector. More...
 

Functions

template<class Scalar , class LO , class GO , class Node >
void blockCrsMatrixWriter (BlockCrsMatrix< Scalar, LO, GO, Node > const &A, std::string const &fileName)
 Helper function to write a BlockCrsMatrix. Calls the 3-argument version. More...
 
template<class Scalar , class LO , class GO , class Node >
void blockCrsMatrixWriter (BlockCrsMatrix< Scalar, LO, GO, Node > const &A, std::string const &fileName, Teuchos::ParameterList const &params)
 Helper function to write a BlockCrsMatrix. Calls the 3-argument version. More...
 
template<class Scalar , class LO , class GO , class Node >
void blockCrsMatrixWriter (BlockCrsMatrix< Scalar, LO, GO, Node > const &A, std::ostream &os)
 Helper function to write a BlockCrsMatrix. Calls the 3-argument version. More...
 
template<class Scalar , class LO , class GO , class Node >
void blockCrsMatrixWriter (BlockCrsMatrix< Scalar, LO, GO, Node > const &A, std::ostream &os, Teuchos::ParameterList const &params)
 Helper function to write a BlockCrsMatrix. More...
 
template<class Scalar , class LO , class GO , class Node >
void writeMatrixStrip (BlockCrsMatrix< Scalar, LO, GO, Node > const &A, std::ostream &os, Teuchos::ParameterList const &params)
 Helper function called by blockCrsMatrixWriter. More...
 
template<class Scalar , class LO , class GO , class Node >
RCP< BlockCrsMatrix< Scalar, LO, GO, Node > > convertToBlockCrsMatrix (const Tpetra::CrsMatrix< Scalar, LO, GO, Node > &pointMatrix, const LO &blockSize)
 Non-member constructor that creates a BlockCrsMatrix from an existing point CrsMatrix. More...
 
template<class LO , class GO , class Node >
RCP< const Tpetra::Map< LO, GO, Node > > createMeshMap (LO const &blockSize, const Tpetra::Map< LO, GO, Node > &pointMap)
 Helper function to generate a mesh map from a point map. Important! It's assumed that point GIDs associated with a single mesh GID appear consecutively in pointMap. More...
 
template<class LO , class GO , class Node >
Teuchos::RCP< const Tpetra::Map< LO, GO, Node > > createMeshMap (const LO &blockSize, const Tpetra::Map< LO, GO, Node > &pointMap)
 Helper function to generate a mesh map from a point map. Important! It's assumed that point GIDs associated with a single mesh GID appear consecutively in pointMap. More...
 
template<class ViewType , class CoefficientType , class LayoutType = typename ViewType::array_layout, class IndexType = int, const int rank = ViewType::rank>
void SCAL (const CoefficientType &alpha, const ViewType &x)
 x := alpha*x, where x is either rank 1 (a vector) or rank 2 (a matrix). More...
 
template<class CoefficientType , class ViewType1 , class ViewType2 , class LayoutType1 = typename ViewType1::array_layout, class LayoutType2 = typename ViewType2::array_layout, class IndexType = int, const int rank = ViewType1::rank>
void AXPY (const CoefficientType &alpha, const ViewType1 &x, const ViewType2 &y)
 y := y + alpha * x (dense vector or matrix update) More...
 
template<class ViewType1 , class ViewType2 , class LayoutType1 = typename ViewType1::array_layout, class LayoutType2 = typename ViewType2::array_layout, class IndexType = int, const int rank = ViewType1::rank>
void COPY (const ViewType1 &x, const ViewType2 &y)
 y := x, where x and y are either rank 1 (vectors) or rank 2 (matrices) with the same dimension(s). More...
 
template<class LittleVectorType1 , class LittleBlockType , class LittleVectorType2 , class CoefficientType , class IndexType = int>
void GEMV (const CoefficientType &alpha, const LittleBlockType &A, const LittleVectorType1 &x, const LittleVectorType2 &y)
 y := y + alpha * A * x (dense matrix-vector multiply) More...
 
template<class ViewType1 , class ViewType2 , class ViewType3 , class CoefficientType , class IndexType = int>
void GEMM (const char transA[], const char transB[], const CoefficientType &alpha, const ViewType1 &A, const ViewType2 &B, const CoefficientType &beta, const ViewType3 &C)
 Small dense matrix-matrix multiply: C := alpha*A*B + beta*C More...
 
template<class LittleBlockType , class LittleVectorType >
void GETF2 (const LittleBlockType &A, const LittleVectorType &ipiv, int &info)
 Computes A = P*L*U. More...
 
template<class LittleBlockType , class LittleIntVectorType , class LittleScalarVectorType >
void GETRS (const char mode[], const LittleBlockType &A, const LittleIntVectorType &ipiv, const LittleScalarVectorType &B, int &info)
 Solve the linear system(s) AX=B, using the result of GETRF or GETF2. More...
 
template<class LittleBlockType , class LittleIntVectorType , class LittleScalarVectorType >
void GETRI (const LittleBlockType &A, const LittleIntVectorType &ipiv, const LittleScalarVectorType &work, int &info)
 Compute inverse of A, using result of GETRF or GETF2. More...
 
template<class ST1 , class ST2 , class LO >
void deep_copy (const LittleBlock< ST2, LO > &dst, const LittleBlock< ST1, LO > &src, typename std::enable_if< std::is_convertible< ST1, ST2 >::value &&!std::is_const< ST2 >::value, int >::type *=NULL)
 Copy the LittleBlock src into the LittleBlock dst. More...
 
template<class ST1 , class ST2 , class LO >
void deep_copy (const LittleVector< ST2, LO > &dst, const LittleVector< ST1, LO > &src, typename std::enable_if< std::is_convertible< ST1, ST2 >::value &&!std::is_const< ST2 >::value, int >::type *=NULL)
 Copy the LittleVector src into the LittleVector dst. More...
 
template<class ST1 , class ST2 , class LO >
void deep_copy (const LittleBlock< ST2, LO > &dst, const ST1 &val, typename std::enable_if< std::is_convertible< ST1, ST2 >::value &&!std::is_const< ST2 >::value, int >::type *=NULL)
 Assign the scalar val to all entries of the LittleBlock dst. More...
 
template<class ST1 , class ST2 , class LO >
void deep_copy (const LittleVector< ST2, LO > &dst, const ST1 &val, typename std::enable_if< std::is_convertible< ST1, ST2 >::value &&!std::is_const< ST2 >::value, int >::type *=NULL)
 Assign the scalar val to all entries of the LittleVector dst. More...
 

Detailed Description

Namespace for new Tpetra features that are not ready for public release, but are ready for evaluation by friendly expert users.

Warning
Expect header files, classes, functions, and other interfaces to change or disappear. Anything in this namespace is under active development and evaluation. Documentation may be sparse or not exist yet. Generally, unit tests will exist, but coverage may be lacking. If you understand these caveats and accept them, please feel free to take a look inside and try things out.

Function Documentation

template<class Scalar , class LO , class GO , class Node >
void Tpetra::Experimental::blockCrsMatrixWriter ( BlockCrsMatrix< Scalar, LO, GO, Node > const &  A,
std::string const &  fileName 
)

Helper function to write a BlockCrsMatrix. Calls the 3-argument version.

Definition at line 55 of file Tpetra_Experimental_BlockCrsMatrix_Helpers_def.hpp.

template<class Scalar , class LO , class GO , class Node >
void Tpetra::Experimental::blockCrsMatrixWriter ( BlockCrsMatrix< Scalar, LO, GO, Node > const &  A,
std::string const &  fileName,
Teuchos::ParameterList const &  params 
)

Helper function to write a BlockCrsMatrix. Calls the 3-argument version.

Definition at line 63 of file Tpetra_Experimental_BlockCrsMatrix_Helpers_def.hpp.

template<class Scalar , class LO , class GO , class Node >
void Tpetra::Experimental::blockCrsMatrixWriter ( BlockCrsMatrix< Scalar, LO, GO, Node > const &  A,
std::ostream &  os 
)

Helper function to write a BlockCrsMatrix. Calls the 3-argument version.

Definition at line 70 of file Tpetra_Experimental_BlockCrsMatrix_Helpers_def.hpp.

template<class Scalar , class LO , class GO , class Node >
void Tpetra::Experimental::blockCrsMatrixWriter ( BlockCrsMatrix< Scalar, LO, GO, Node > const &  A,
std::ostream &  os,
Teuchos::ParameterList const &  params 
)

Helper function to write a BlockCrsMatrix.

Writes the block matrix to the specified ostream in point form. The following parameter list options are available:

  • "always use parallel algorithm" : on one process, this forces the use of the parallel strip-mining algorithm (default=false)
  • "print MatrixMarket header" : if false, don't print the MatrixMarket header (default=true)
  • "precision" : precision to be used in printing matrix entries (default=C++ default)
  • "zero-based indexing" : if true, print the matrix with 0-based indexing (default=false)

Definition at line 76 of file Tpetra_Experimental_BlockCrsMatrix_Helpers_def.hpp.

template<class Scalar , class LO , class GO , class Node >
void Tpetra::Experimental::writeMatrixStrip ( BlockCrsMatrix< Scalar, LO, GO, Node > const &  A,
std::ostream &  os,
Teuchos::ParameterList const &  params 
)

Helper function called by blockCrsMatrixWriter.

This function should not be called directly.

Definition at line 194 of file Tpetra_Experimental_BlockCrsMatrix_Helpers_def.hpp.

template<class Scalar , class LO , class GO , class Node >
RCP< BlockCrsMatrix< Scalar, LO, GO, Node > > Tpetra::Experimental::convertToBlockCrsMatrix ( const Tpetra::CrsMatrix< Scalar, LO, GO, Node > &  pointMatrix,
const LO &  blockSize 
)

Non-member constructor that creates a BlockCrsMatrix from an existing point CrsMatrix.

This function accepts an already constructed point version of the block matrix. Assumptions:

  • All point entries in a logical block must be stored in the CrsMatrix, even if the values are zero.
  • Point rows corresponding to a particular mesh node must be stored consecutively.

Definition at line 290 of file Tpetra_Experimental_BlockCrsMatrix_Helpers_def.hpp.

template<class LO , class GO , class Node >
RCP<const Tpetra::Map<LO,GO,Node> > Tpetra::Experimental::createMeshMap ( LO const &  blockSize,
const Tpetra::Map< LO, GO, Node > &  pointMap 
)

Helper function to generate a mesh map from a point map. Important! It's assumed that point GIDs associated with a single mesh GID appear consecutively in pointMap.

Definition at line 413 of file Tpetra_Experimental_BlockCrsMatrix_Helpers_def.hpp.

template<class LO , class GO , class Node >
Teuchos::RCP<const Tpetra::Map<LO,GO,Node> > Tpetra::Experimental::createMeshMap ( const LO &  blockSize,
const Tpetra::Map< LO, GO, Node > &  pointMap 
)

Helper function to generate a mesh map from a point map. Important! It's assumed that point GIDs associated with a single mesh GID appear consecutively in pointMap.

Definition at line 413 of file Tpetra_Experimental_BlockCrsMatrix_Helpers_def.hpp.

template<class ViewType , class CoefficientType , class LayoutType = typename ViewType::array_layout, class IndexType = int, const int rank = ViewType::rank>
void Tpetra::Experimental::SCAL ( const CoefficientType &  alpha,
const ViewType &  x 
)

x := alpha*x, where x is either rank 1 (a vector) or rank 2 (a matrix).

Definition at line 447 of file Tpetra_Experimental_BlockView.hpp.

template<class CoefficientType , class ViewType1 , class ViewType2 , class LayoutType1 = typename ViewType1::array_layout, class LayoutType2 = typename ViewType2::array_layout, class IndexType = int, const int rank = ViewType1::rank>
void Tpetra::Experimental::AXPY ( const CoefficientType &  alpha,
const ViewType1 &  x,
const ViewType2 &  y 
)

y := y + alpha * x (dense vector or matrix update)

This function follows the BLAS convention that if alpha == 0, then it does nothing. (This matters only if x contains Inf or NaN values.)

Definition at line 464 of file Tpetra_Experimental_BlockView.hpp.

template<class ViewType1 , class ViewType2 , class LayoutType1 = typename ViewType1::array_layout, class LayoutType2 = typename ViewType2::array_layout, class IndexType = int, const int rank = ViewType1::rank>
void Tpetra::Experimental::COPY ( const ViewType1 &  x,
const ViewType2 &  y 
)

y := x, where x and y are either rank 1 (vectors) or rank 2 (matrices) with the same dimension(s).

Parameters
x[in] The input vector / matrix.
y[out] The output vector / matrix.

We put the output argument last, because that's what the BLAS functions _XCOPY (replace _ with "S", "D", "C", or "Z") do.

Definition at line 487 of file Tpetra_Experimental_BlockView.hpp.

template<class LittleVectorType1 , class LittleBlockType , class LittleVectorType2 , class CoefficientType , class IndexType = int>
void Tpetra::Experimental::GEMV ( const CoefficientType &  alpha,
const LittleBlockType &  A,
const LittleVectorType1 &  x,
const LittleVectorType2 &  y 
)

y := y + alpha * A * x (dense matrix-vector multiply)

Parameters
alpha[in] Coefficient by which to multiply A*x
A[in] Small dense matrix (must have rank 2)
x[in] Small dense vector input (must have rank 1 and at least as many rows as A has columns)
y[in/out] Small dense vector output (must have rank 1 and at least as many rows as A has rows)

This function follows the BLAS convention that if alpha == 0, then it does nothing. (This matters only if x contains Inf or NaN values.)

Definition at line 511 of file Tpetra_Experimental_BlockView.hpp.

template<class ViewType1 , class ViewType2 , class ViewType3 , class CoefficientType , class IndexType = int>
void Tpetra::Experimental::GEMM ( const char  transA[],
const char  transB[],
const CoefficientType &  alpha,
const ViewType1 &  A,
const ViewType2 &  B,
const CoefficientType &  beta,
const ViewType3 &  C 
)

Small dense matrix-matrix multiply: C := alpha*A*B + beta*C

Template Parameters
ViewType1Type of the first matrix input A.
ViewType2Type of the second matrix input B.
ViewType3Type of the third matrix input/output C.
CoefficientTypeType of the scalar coefficients alpha and beta.
IndexTypeType of the index used in for loops; defaults to int.

Definition at line 544 of file Tpetra_Experimental_BlockView.hpp.

template<class LittleBlockType , class LittleVectorType >
void Tpetra::Experimental::GETF2 ( const LittleBlockType &  A,
const LittleVectorType &  ipiv,
int &  info 
)

Computes A = P*L*U.

Definition at line 683 of file Tpetra_Experimental_BlockView.hpp.

template<class LittleBlockType , class LittleIntVectorType , class LittleScalarVectorType >
void Tpetra::Experimental::GETRS ( const char  mode[],
const LittleBlockType &  A,
const LittleIntVectorType &  ipiv,
const LittleScalarVectorType &  B,
int &  info 
)

Solve the linear system(s) AX=B, using the result of GETRF or GETF2.

Warning
We have not implemented transpose yet, or multiple right-hand sides.

Definition at line 917 of file Tpetra_Experimental_BlockView.hpp.

template<class LittleBlockType , class LittleIntVectorType , class LittleScalarVectorType >
void Tpetra::Experimental::GETRI ( const LittleBlockType &  A,
const LittleIntVectorType &  ipiv,
const LittleScalarVectorType &  work,
int &  info 
)

Compute inverse of A, using result of GETRF or GETF2.

Template Parameters
LittleBlockTypeType of dense matrix A
LittleBlockTypeType of 1-D pivot array ipiv
LittleScalarVectorTypeType of 1-D work array work
Parameters
A[in/out] On input: output matrix resulting from running GETRF or GETF2 on a square matrix A. On output: inverse of the original matrix A.
ipiv[in] Pivot array from the LU factorization.
work[out] Temporary workspace; must be at least as long as the number of rows in A.
info[out] On output, 0 if the routine was successful, else nonzero.

Definition at line 941 of file Tpetra_Experimental_BlockView.hpp.

template<class ST1 , class ST2 , class LO >
void Tpetra::Experimental::deep_copy ( const LittleBlock< ST2, LO > &  dst,
const LittleBlock< ST1, LO > &  src,
typename std::enable_if< std::is_convertible< ST1, ST2 >::value &&!std::is_const< ST2 >::value, int >::type *  = NULL 
)
inline

Copy the LittleBlock src into the LittleBlock dst.

Parameters
dst[out] Output LittleBlock
src[in] Input LittleBlock; it must have at least as many rows and at least as many columns as src

Call this method with two arguments. Ignore the third argument; its purpose is to ensure, at compile time, that it is legal to assign an entry of src to an entry of dst.

This works exactly like Kokkos::deep_copy(dst, src). In fact, we intend for (2-D, unmanaged) Kokkos::View to replace LittleBlock, and for Kokkos::deep_copy to replace this function.

Definition at line 1387 of file Tpetra_Experimental_BlockView.hpp.

template<class ST1 , class ST2 , class LO >
void Tpetra::Experimental::deep_copy ( const LittleVector< ST2, LO > &  dst,
const LittleVector< ST1, LO > &  src,
typename std::enable_if< std::is_convertible< ST1, ST2 >::value &&!std::is_const< ST2 >::value, int >::type *  = NULL 
)
inline

Copy the LittleVector src into the LittleVector dst.

Parameters
dst[out] Output LittleVector
src[in] Input LittleVector; it must have at least as many rows and at least as many columns as src

Call this method with two arguments. Ignore the third argument; its purpose is to ensure, at compile time, that it is legal to assign an entry of src to an entry of dst.

This works exactly like Kokkos::deep_copy(dst, src). In fact, we intend for (1-D, unmanaged) Kokkos::View to replace LittleVector, and for Kokkos::deep_copy to replace this function.

Definition at line 1409 of file Tpetra_Experimental_BlockView.hpp.

template<class ST1 , class ST2 , class LO >
void Tpetra::Experimental::deep_copy ( const LittleBlock< ST2, LO > &  dst,
const ST1 &  val,
typename std::enable_if< std::is_convertible< ST1, ST2 >::value &&!std::is_const< ST2 >::value, int >::type *  = NULL 
)
inline

Assign the scalar val to all entries of the LittleBlock dst.

Parameters
dst[out] Output LittleBlock
val[in] Input scalar value; it must be assignable to an entry of dst

Call this method with two arguments. Ignore the third argument; its purpose is to ensure, at compile time, that it is legal to assign val to an entry of dst.

This works exactly like Kokkos::deep_copy(dst, val). In fact, we intend for (2-D, unmanaged) Kokkos::View to replace LittleBlock, and for Kokkos::deep_copy to replace this function.

Definition at line 1431 of file Tpetra_Experimental_BlockView.hpp.

template<class ST1 , class ST2 , class LO >
void Tpetra::Experimental::deep_copy ( const LittleVector< ST2, LO > &  dst,
const ST1 &  val,
typename std::enable_if< std::is_convertible< ST1, ST2 >::value &&!std::is_const< ST2 >::value, int >::type *  = NULL 
)
inline

Assign the scalar val to all entries of the LittleVector dst.

Parameters
dst[out] Output LittleVector
val[in] Input scalar value; it must be assignable to an entry of dst

Call this method with two arguments. Ignore the third argument; its purpose is to ensure, at compile time, that it is legal to assign val to an entry of dst.

This works exactly like Kokkos::deep_copy(dst, val). In fact, we intend for (2-D, unmanaged) Kokkos::View to replace LittleVector, and for Kokkos::deep_copy to replace this function.

Definition at line 1461 of file Tpetra_Experimental_BlockView.hpp.