|
Teko Version of the Day
|
#include "Teko_ConfigDefs.hpp"#include "Tpetra_CrsMatrix.hpp"#include "Teuchos_VerboseObject.hpp"#include "Thyra_LinearOpBase.hpp"#include "Thyra_PhysicallyBlockedLinearOpBase.hpp"#include "Thyra_ProductVectorSpaceBase.hpp"#include "Thyra_VectorSpaceBase.hpp"#include "Thyra_ProductMultiVectorBase.hpp"#include "Thyra_MultiVectorStdOps.hpp"#include "Thyra_MultiVectorBase.hpp"#include "Thyra_VectorBase.hpp"#include "Thyra_VectorStdOps.hpp"#include "Thyra_DefaultBlockedLinearOp.hpp"#include "Thyra_DefaultMultipliedLinearOp.hpp"#include "Thyra_DefaultScaledAdjointLinearOp.hpp"#include "Thyra_DefaultAddedLinearOp.hpp"#include "Thyra_DefaultIdentityLinearOp.hpp"#include "Thyra_DefaultZeroLinearOp.hpp"Go to the source code of this file.
Functions | |
| RCP< Tpetra::CrsMatrix< ST, LO, GO, NT > > | Teko::buildGraphLaplacian (int dim, ST *coords, const Tpetra::CrsMatrix< ST, LO, GO, NT > &stencil) |
| Build a graph Laplacian stenciled on a Epetra_CrsMatrix. | |
| RCP< Tpetra::CrsMatrix< ST, LO, GO, NT > > | Teko::buildGraphLaplacian (ST *x, ST *y, ST *z, GO stride, const Tpetra::CrsMatrix< ST, LO, GO, NT > &stencil) |
| Build a graph Laplacian stenciled on a Epetra_CrsMatrix. | |
| const Teuchos::RCP< Teuchos::FancyOStream > | Teko::getOutputStream () |
| Function used internally by Teko to find the output stream. | |
LinearOp utilities | ||||||||||
Let the blocked operator know that you are going to set the sub blocks. typedef Teuchos::RCP<Thyra::PhysicallyBlockedLinearOpBase<ST> > BlockedLinearOp; typedef Teuchos::RCP<const Thyra::LinearOpBase<ST> > LinearOp; typedef Teuchos::RCP<Thyra::LinearOpBase<ST> > InverseLinearOp; typedef Teuchos::RCP<Thyra::LinearOpBase<ST> > ModifiableLinearOp; Build a square zero operator from a single vector space inline LinearOp zero(const VectorSpace &vs) { return Thyra::zero<ST>(vs, vs); } inline LinearOp zero(const VectorSpace &range, const VectorSpace &domain) { return Thyra::zero<ST>(range, domain); } Replace nonzeros with a scalar value, used to zero out an operator Get the range space of a linear operator inline VectorSpace rangeSpace(const LinearOp &lo) { return lo->range(); } Get the domain space of a linear operator inline VectorSpace domainSpace(const LinearOp &lo) { return lo->domain(); } Converts a LinearOp to a BlockedLinearOp inline BlockedLinearOp toBlockedLinearOp(LinearOp &clo) { Teuchos::RCP<Thyra::LinearOpBase<double> > lo = Teuchos::rcp_const_cast<Thyra::LinearOpBase<double> >(clo); return Teuchos::rcp_dynamic_cast<Thyra::PhysicallyBlockedLinearOpBase<double> >(lo); } Converts a LinearOp to a BlockedLinearOp inline const BlockedLinearOp toBlockedLinearOp(const LinearOp &clo) { Teuchos::RCP<Thyra::LinearOpBase<double> > lo = Teuchos::rcp_const_cast<Thyra::LinearOpBase<double> >(clo); return Teuchos::rcp_dynamic_cast<Thyra::PhysicallyBlockedLinearOpBase<double> >(lo); } Convert to a LinearOp from a BlockedLinearOp inline LinearOp toLinearOp(BlockedLinearOp &blo) { return blo; } Convert to a LinearOp from a BlockedLinearOp inline const LinearOp toLinearOp(const BlockedLinearOp &blo) { return blo; } Convert to a LinearOp from a BlockedLinearOp inline LinearOp toLinearOp(ModifiableLinearOp &blo) { return blo; } Convert to a LinearOp from a BlockedLinearOp inline const LinearOp toLinearOp(const ModifiableLinearOp &blo) { return blo; } Get the row count in a block linear operator inline int blockRowCount(const BlockedLinearOp &blo) { return blo->productRange()->numBlocks(); } Get the column count in a block linear operator inline int blockColCount(const BlockedLinearOp &blo) { return blo->productDomain()->numBlocks(); } Get the Set the Build a new blocked linear operator inline BlockedLinearOp createBlockedOp() { return rcp(new Thyra::DefaultBlockedLinearOp<double>()); } /** Let the blocked operator know that you are going to set the sub blocks. This is a simple wrapper around the member function of the same name in Thyra.
| ||||||||||
| enum | Teko::DiagonalType { Teko::Diagonal , Teko::Lumped , Teko::AbsRowSum , Teko::BlkDiag , Teko::NotDiag } | |||||||||
| void | Teko::beginBlockFill (BlockedLinearOp &blo) | |||||||||
| Let the blocked operator know that you are going to set the sub blocks. | ||||||||||
| BlockedLinearOp | Teko::getUpperTriBlocks (const BlockedLinearOp &blo, bool callEndBlockFill) | |||||||||
| Get the strictly upper triangular portion of the matrix. | ||||||||||
| BlockedLinearOp | Teko::getLowerTriBlocks (const BlockedLinearOp &blo, bool callEndBlockFill) | |||||||||
| Get the strictly lower triangular portion of the matrix. | ||||||||||
| BlockedLinearOp | Teko::zeroBlockedOp (const BlockedLinearOp &blo) | |||||||||
| Build a zero operator mimicing the block structure of the passed in matrix. | ||||||||||
| ModifiableLinearOp | Teko::getAbsRowSumMatrix (const LinearOp &op) | |||||||||
| Compute absolute row sum matrix. | ||||||||||
| ModifiableLinearOp | Teko::getAbsRowSumInvMatrix (const LinearOp &op) | |||||||||
| Compute inverse of the absolute row sum matrix. | ||||||||||
| ModifiableLinearOp | Teko::getLumpedMatrix (const LinearOp &op) | |||||||||
| Compute the lumped version of this matrix. | ||||||||||
| ModifiableLinearOp | Teko::getInvLumpedMatrix (const LinearOp &op) | |||||||||
| Compute the inverse of the lumped version of this matrix. | ||||||||||
| void | Teko::applyOp (const LinearOp &A, const MultiVector &x, MultiVector &y, double alpha, double beta) | |||||||||
| Apply a linear operator to a multivector (think of this as a matrix vector multiply). | ||||||||||
| void | Teko::applyTransposeOp (const LinearOp &A, const MultiVector &x, MultiVector &y, double alpha, double beta) | |||||||||
| Apply a transposed linear operator to a multivector (think of this as a matrix vector multiply). | ||||||||||
| void | Teko::applyOp (const LinearOp &A, const BlockedMultiVector &x, BlockedMultiVector &y, double alpha=1.0, double beta=0.0) | |||||||||
| Apply a linear operator to a blocked multivector (think of this as a matrix vector multiply). | ||||||||||
| void | Teko::applyTransposeOp (const LinearOp &A, const BlockedMultiVector &x, BlockedMultiVector &y, double alpha=1.0, double beta=0.0) | |||||||||
| Apply a transposed linear operator to a blocked multivector (think of this as a matrix vector multiply). | ||||||||||
| void | Teko::update (double alpha, const MultiVector &x, double beta, MultiVector &y) | |||||||||
Update the y vector so that | ||||||||||
| const ModifiableLinearOp | Teko::getDiagonalOp (const LinearOp &op) | |||||||||
| Get the diaonal of a linear operator. | ||||||||||
| const MultiVector | Teko::getDiagonal (const LinearOp &op) | |||||||||
| Get the diagonal of a linear operator. | ||||||||||
| const ModifiableLinearOp | Teko::getInvDiagonalOp (const LinearOp &op) | |||||||||
| Get the diaonal of a linear operator. | ||||||||||
| const LinearOp | Teko::explicitMultiply (const LinearOp &opl, const LinearOp &opm, const LinearOp &opr) | |||||||||
| Multiply three linear operators. | ||||||||||
| const ModifiableLinearOp | Teko::explicitMultiply (const LinearOp &opl, const LinearOp &opm, const LinearOp &opr, const ModifiableLinearOp &destOp) | |||||||||
| Multiply three linear operators. | ||||||||||
| const LinearOp | Teko::explicitMultiply (const LinearOp &opl, const LinearOp &opr) | |||||||||
| Multiply two linear operators. | ||||||||||
| const ModifiableLinearOp | Teko::explicitMultiply (const LinearOp &opl, const LinearOp &opr, const ModifiableLinearOp &destOp) | |||||||||
| Multiply two linear operators. | ||||||||||
| const LinearOp | Teko::explicitAdd (const LinearOp &opl_in, const LinearOp &opr_in) | |||||||||
| Add two linear operators. | ||||||||||
| const ModifiableLinearOp | Teko::explicitAdd (const LinearOp &opl_in, const LinearOp &opr_in, const ModifiableLinearOp &destOp) | |||||||||
| Add two linear operators. | ||||||||||
| const ModifiableLinearOp | Teko::explicitSum (const LinearOp &op, const ModifiableLinearOp &destOp) | |||||||||
| Sum an operator. | ||||||||||
| const LinearOp | Teko::explicitTranspose (const LinearOp &op) | |||||||||
| const LinearOp | Teko::explicitScale (double scalar, const LinearOp &op) | |||||||||
| double | Teko::frobeniusNorm (const LinearOp &op_in) | |||||||||
| const LinearOp | Teko::buildDiagonal (const MultiVector &v, const std::string &lbl="ANYM") | |||||||||
| Take the first column of a multivector and build a diagonal linear operator. | ||||||||||
| const LinearOp | Teko::buildInvDiagonal (const MultiVector &v, const std::string &lbl="ANYM") | |||||||||
| Using the first column of a multivector, take the elementwise build a inverse and build the inverse diagonal operator. | ||||||||||
| double | Teko::computeSpectralRad (const Teuchos::RCP< const Thyra::LinearOpBase< double > > &A, double tol, bool isHermitian=false, int numBlocks=5, int restart=0, int verbosity=0) | |||||||||
| Compute the spectral radius of a matrix. | ||||||||||
| double | Teko::computeSmallestMagEig (const Teuchos::RCP< const Thyra::LinearOpBase< double > > &A, double tol, bool isHermitian=false, int numBlocks=5, int restart=0, int verbosity=0) | |||||||||
| Compute the smallest eigenvalue of an operator. | ||||||||||
| ModifiableLinearOp | Teko::getDiagonalOp (const Teko::LinearOp &A, const DiagonalType &dt) | |||||||||
| ModifiableLinearOp | Teko::getInvDiagonalOp (const Teko::LinearOp &A, const Teko::DiagonalType &dt) | |||||||||
| const MultiVector | Teko::getDiagonal (const LinearOp &op, const DiagonalType &dt) | |||||||||
| Get the diagonal of a sparse linear operator. | ||||||||||
| std::string | Teko::getDiagonalName (const DiagonalType &dt) | |||||||||
| DiagonalType | Teko::getDiagonalType (std::string name) | |||||||||
| double | Teko::norm_1 (const MultiVector &v, std::size_t col) | |||||||||
| double | Teko::norm_2 (const MultiVector &v, std::size_t col) | |||||||||
MultiVector utilities | |
| MultiVector | Teko::toMultiVector (BlockedMultiVector &bmv) |
| Convert to a MultiVector from a BlockedMultiVector. | |
| const MultiVector | Teko::toMultiVector (const BlockedMultiVector &bmv) |
| Convert to a MultiVector from a BlockedMultiVector. | |
| const BlockedMultiVector | Teko::toBlockedMultiVector (const MultiVector &bmv) |
| Convert to a BlockedMultiVector from a MultiVector. | |
| int | Teko::blockCount (const BlockedMultiVector &bmv) |
| Get the column count in a block linear operator. | |
| MultiVector | Teko::getBlock (int i, const BlockedMultiVector &bmv) |
Get the ith block from a BlockedMultiVector object. | |
| MultiVector | Teko::deepcopy (const MultiVector &v) |
| Perform a deep copy of the vector. | |
| MultiVector | Teko::copyAndInit (const MultiVector &v, double scalar) |
| Perform a deep copy of the vector. | |
| BlockedMultiVector | Teko::deepcopy (const BlockedMultiVector &v) |
| Perform a deep copy of the blocked vector. | |
| MultiVector | Teko::datacopy (const MultiVector &src, MultiVector &dst) |
| Copy the contents of a multivector to a destination vector. | |
| BlockedMultiVector | Teko::datacopy (const BlockedMultiVector &src, BlockedMultiVector &dst) |
| Copy the contents of a blocked multivector to a destination vector. | |
| BlockedMultiVector | Teko::buildBlockedMultiVector (const std::vector< MultiVector > &mvv) |
| build a BlockedMultiVector from a vector of MultiVectors | |
This file contains a number of useful functions and classes used in Teko. They are distinct from the core functionality of the preconditioner factory, however, the functions are critical to construction of the preconditioners themselves.
Definition in file Teko_Utilities.hpp.
| enum Teko::DiagonalType |
Definition at line 809 of file Teko_Utilities.hpp.
| Teuchos::RCP< Tpetra::CrsMatrix< ST, LO, GO, NT > > Teko::buildGraphLaplacian | ( | int | dim, |
| ST * | coords, | ||
| const Tpetra::CrsMatrix< ST, LO, GO, NT > & | stencil ) |
Build a graph Laplacian stenciled on a Epetra_CrsMatrix.
This function builds a graph Laplacian given a (locally complete) vector of coordinates and a stencil Epetra_CrsMatrix (could this be a graph of Epetra_RowMatrix instead?). The resulting matrix will have the negative of the inverse distance on off diagonals. And the sum of the positive inverse distance of the off diagonals on the diagonal. If there are no off diagonal entries in the stencil, the diagonal is set to 0.
| [in] | dim | Number of physical dimensions (2D or 3D?). |
| [in] | coords | A vector containing the coordinates, with the i-th coordinate beginning at coords[i*dim]. |
| [in] | stencil | The stencil matrix used to describe the connectivity of the graph Laplacian matrix. |
stencil matrix. Definition at line 201 of file Teko_Utilities.cpp.
| Teuchos::RCP< Tpetra::CrsMatrix< ST, LO, GO, NT > > Teko::buildGraphLaplacian | ( | ST * | x, |
| ST * | y, | ||
| ST * | z, | ||
| GO | stride, | ||
| const Tpetra::CrsMatrix< ST, LO, GO, NT > & | stencil ) |
Build a graph Laplacian stenciled on a Epetra_CrsMatrix.
This function builds a graph Laplacian given a (locally complete) vector of coordinates and a stencil Epetra_CrsMatrix (could this be a graph of Epetra_RowMatrix instead?). The resulting matrix will have the negative of the inverse distance on off diagonals. And the sum of the positive inverse distance of the off diagonals on the diagonal. If there are no off diagonal entries in the stencil, the diagonal is set to 0.
| [in] | x | A vector containing the x-coordinates, with the i-th coordinate beginning at coords[i*stride]. |
| [in] | y | A vector containing the y-coordinates, with the i-th coordinate beginning at coords[i*stride]. |
| [in] | z | A vector containing the z-coordinates, with the i-th coordinate beginning at coords[i*stride]. |
| [in] | stride | Stride between entries in the (x,y,z) coordinate array |
| [in] | stencil | The stencil matrix used to describe the connectivity of the graph Laplacian matrix. |
stencil matrix. Definition at line 344 of file Teko_Utilities.cpp.
| const Teuchos::RCP< Teuchos::FancyOStream > Teko::getOutputStream | ( | ) |
Function used internally by Teko to find the output stream.
Function used internally by Teko to find the output stream.
Definition at line 94 of file Teko_Utilities.cpp.
|
inline |
Convert to a MultiVector from a BlockedMultiVector.
Definition at line 192 of file Teko_Utilities.hpp.
|
inline |
Convert to a MultiVector from a BlockedMultiVector.
Definition at line 195 of file Teko_Utilities.hpp.
|
inline |
Convert to a BlockedMultiVector from a MultiVector.
Definition at line 198 of file Teko_Utilities.hpp.
|
inline |
Get the column count in a block linear operator.
Definition at line 203 of file Teko_Utilities.hpp.
|
inline |
Get the ith block from a BlockedMultiVector object.
Definition at line 206 of file Teko_Utilities.hpp.
|
inline |
Perform a deep copy of the vector.
Definition at line 211 of file Teko_Utilities.hpp.
|
inline |
Perform a deep copy of the vector.
Definition at line 214 of file Teko_Utilities.hpp.
|
inline |
Perform a deep copy of the blocked vector.
Definition at line 221 of file Teko_Utilities.hpp.
|
inline |
Copy the contents of a multivector to a destination vector.
Copy the contents of a multivector to a new vector. If the destination vector is null, a deep copy of the source multivector is made to a newly allocated vector. Also, if the destination and the source do not match, a new destination object is allocated and returned to the user.
| [in] | src | Source multivector to be copied. |
| [in] | dst | Destination multivector. If null a new multivector will be allocated. |
Definition at line 238 of file Teko_Utilities.hpp.
|
inline |
Copy the contents of a blocked multivector to a destination vector.
Copy the contents of a blocked multivector to a new vector. If the destination vector is null, a deep copy of the source multivector is made to a newly allocated vector. Also, if the destination and the source do not match, a new destination object is allocated and returned to the user.
| [in] | src | Source multivector to be copied. |
| [in] | dst | Destination multivector. If null a new multivector will be allocated. |
Definition at line 264 of file Teko_Utilities.hpp.
| BlockedMultiVector Teko::buildBlockedMultiVector | ( | const std::vector< MultiVector > & | mvv | ) |
build a BlockedMultiVector from a vector of MultiVectors
Definition at line 2444 of file Teko_Utilities.cpp.
|
inline |
Let the blocked operator know that you are going to set the sub blocks.
Let the blocked operator know that you are going to set the sub blocks. This is a simple wrapper around the member function of the same name in Thyra.
| [in,out] | blo | Blocked operator to have its fill stage activated |
Definition at line 393 of file Teko_Utilities.hpp.
| *Get the strictly upper triangular portion of the matrix BlockedLinearOp Teko::getUpperTriBlocks | ( | const BlockedLinearOp & | blo, |
| bool | callEndBlockFill ) |
Get the strictly upper triangular portion of the matrix.
Definition at line 461 of file Teko_Utilities.cpp.
| *Get the strictly lower triangular portion of the matrix BlockedLinearOp Teko::getLowerTriBlocks | ( | const BlockedLinearOp & | blo, |
| bool | callEndBlockFill ) |
Get the strictly lower triangular portion of the matrix.
Definition at line 497 of file Teko_Utilities.cpp.
| BlockedLinearOp Teko::zeroBlockedOp | ( | const BlockedLinearOp & | blo | ) |
Build a zero operator mimicing the block structure of the passed in matrix.
Build a zero operator mimicing the block structure of the passed in matrix. Currently this function assumes that the operator is "block" square. Also, this function calls beginBlockFill but does not call endBlockFill. This is so that the user can fill the matrix as they wish once created.
| [in] | blo | Blocked operator with desired structure. |
blo.\notes The caller is responsible for calling endBlockFill on the returned blocked operator.
Build a zero operator mimicing the block structure of the passed in matrix. Currently this function assumes that the operator is "block" square. Also, this function calls beginBlockFill but does not call endBlockFill. This is so that the user can fill the matrix as they wish once created.
| [in] | blo | Blocked operator with desired structure. |
blo.endBlockFill on the returned blocked operator. Definition at line 551 of file Teko_Utilities.cpp.
| ModifiableLinearOp Teko::getAbsRowSumMatrix | ( | const LinearOp & | op | ) |
Compute absolute row sum matrix.
Compute the absolute row sum matrix. That is a diagonal operator composed of the absolute value of the row sum.
Definition at line 672 of file Teko_Utilities.cpp.
| ModifiableLinearOp Teko::getAbsRowSumInvMatrix | ( | const LinearOp & | op | ) |
Compute inverse of the absolute row sum matrix.
Compute the inverse of the absolute row sum matrix. That is a diagonal operator composed of the inverse of the absolute value of the row sum.
Definition at line 713 of file Teko_Utilities.cpp.
| ModifiableLinearOp Teko::getLumpedMatrix | ( | const LinearOp & | op | ) |
Compute the lumped version of this matrix.
Compute the lumped version of this matrix. That is a diagonal operator composed of the row sum.
Definition at line 807 of file Teko_Utilities.cpp.
| ModifiableLinearOp Teko::getInvLumpedMatrix | ( | const LinearOp & | op | ) |
Compute the inverse of the lumped version of this matrix.
Compute the inverse of the lumped version of this matrix. That is a diagonal operator composed of the row sum.
Definition at line 829 of file Teko_Utilities.cpp.
| *name Mathematical functions void Teko::applyOp | ( | const LinearOp & | A, |
| const MultiVector & | x, | ||
| MultiVector & | y, | ||
| double | alpha, | ||
| double | beta ) |
Apply a linear operator to a multivector (think of this as a matrix vector multiply).
Apply a linear operator to a multivector. This also permits arbitrary scaling and addition of the result. This function gives

| [in] | A | |
| [in] | x | |
| [in,out] | y | |
| [in] |
alpha
| [in] |
beta
Apply a linear operator to a multivector. This also permits arbitrary scaling and addition of the result. This function gives

It is required that the range space of A is compatible with y and the domain space of A is compatible with x.
| [in] | A | |
| [in] | x | |
| [in,out] | y | |
| [in] | alpha | |
| [in] | beta |
Definition at line 422 of file Teko_Utilities.cpp.
| void Teko::applyTransposeOp | ( | const LinearOp & | A, |
| const MultiVector & | x, | ||
| MultiVector & | y, | ||
| double | alpha, | ||
| double | beta ) |
Apply a transposed linear operator to a multivector (think of this as a matrix vector multiply).
Apply a transposed linear operator to a multivector. This also permits arbitrary scaling and addition of the result. This function gives

| [in] | A | |
| [in] | x | |
| [in,out] | y | |
| [in] |
alpha
| [in] |
beta
Apply a transposed linear operator to a multivector. This also permits arbitrary scaling and addition of the result. This function gives

It is required that the domain space of A is compatible with y and the range space of A is compatible with x.
| [in] | A | |
| [in] | x | |
| [in,out] | y | |
| [in] | alpha | |
| [in] | beta |
Definition at line 441 of file Teko_Utilities.cpp.
|
inline |
Apply a linear operator to a blocked multivector (think of this as a matrix vector multiply).
Apply a linear operator to a blocked multivector. This also permits arbitrary scaling and addition of the result. This function gives

It is required that the range space of A is compatible with y and the domain space of A is compatible with x.
| [in] | A | |
| [in] | x | |
| [in,out] | y | |
| [in] | alpha | |
| [in] | beta |
Definition at line 532 of file Teko_Utilities.hpp.
|
inline |
Apply a transposed linear operator to a blocked multivector (think of this as a matrix vector multiply).
Apply a transposed linear operator to a blocked multivector. This also permits arbitrary scaling and addition of the result. This function gives

It is required that the domain space of A is compatible with y and the range space of A is compatible with x.
| [in] | A | |
| [in] | x | |
| [in,out] | y | |
| [in] | alpha | |
| [in] | beta |
Definition at line 557 of file Teko_Utilities.hpp.
| void Teko::update | ( | double | alpha, |
| const MultiVector & | x, | ||
| double | beta, | ||
| MultiVector & | y ) |
Update the y vector so that 
Compute the linear combination 
| [in] | alpha | |
| [in] | x | |
| [in] | beta | |
| [in,out] | y |
Definition at line 448 of file Teko_Utilities.cpp.
| *name Epetra_Operator specific functions const ModifiableLinearOp Teko::getDiagonalOp | ( | const LinearOp & | op | ) |
Get the diaonal of a linear operator.
Get the diagonal of a linear operator. Currently it is assumed that the underlying operator is an Epetra_RowMatrix.
| [in] | op | The operator whose diagonal is to be extracted. |
Definition at line 900 of file Teko_Utilities.cpp.
| const MultiVector Teko::getDiagonal | ( | const LinearOp & | op | ) |
Get the diagonal of a linear operator.
Get the diagonal of a linear operator, putting it in the first column of a multivector.
Definition at line 932 of file Teko_Utilities.cpp.
| const ModifiableLinearOp Teko::getInvDiagonalOp | ( | const LinearOp & | op | ) |
Get the diaonal of a linear operator.
Get the inverse of the diagonal of a linear operator. Currently it is assumed that the underlying operator is an Epetra_RowMatrix.
| [in] | op | The operator whose diagonal is to be extracted and inverted |
Definition at line 986 of file Teko_Utilities.cpp.
| const LinearOp Teko::explicitMultiply | ( | const LinearOp & | opl, |
| const LinearOp & | opm, | ||
| const LinearOp & | opr ) |
Multiply three linear operators.
Multiply three linear operators. This currently assumes that the underlying implementation uses Epetra_CrsMatrix. The exception is that opm is allowed to be an diagonal matrix.
| [in] | opl | Left operator (assumed to be a Epetra_CrsMatrix) |
| [in] | opm | Middle operator (assumed to be a diagonal matrix) |
| [in] | opr | Right operator (assumed to be a Epetra_CrsMatrix) |
Multiply three linear operators. This currently assumes that the underlying implementation uses Epetra_CrsMatrix. The exception is that opm is allowed to be an diagonal matrix.
| [in] | opl | Left operator (assumed to be a Epetra_CrsMatrix) |
| [in] | opm | Middle operator (assumed to be a Epetra_CrsMatrix or a diagonal matrix) |
| [in] | opr | Right operator (assumed to be a Epetra_CrsMatrix) |
Definition at line 1070 of file Teko_Utilities.cpp.
| const ModifiableLinearOp Teko::explicitMultiply | ( | const LinearOp & | opl, |
| const LinearOp & | opm, | ||
| const LinearOp & | opr, | ||
| const ModifiableLinearOp & | destOp ) |
Multiply three linear operators.
Multiply three linear operators. This currently assumes that the underlying implementation uses Epetra_CrsMatrix. The exception is that opm is allowed to be an diagonal matrix.
| [in] | opl | Left operator (assumed to be a Epetra_CrsMatrix) |
| [in] | opm | Middle operator (assumed to be a Epetra_CrsMatrix or a diagonal matrix) |
| [in] | opr | Right operator (assumed to be a Epetra_CrsMatrix) |
| [in,out] | destOp | The operator to be used as the destination operator, if this is null this function creates a new operator |
Definition at line 1321 of file Teko_Utilities.cpp.
| const LinearOp Teko::explicitMultiply | ( | const LinearOp & | opl, |
| const LinearOp & | opr ) |
Multiply two linear operators.
Multiply two linear operators. This currently assumes that the underlying implementation uses Epetra_CrsMatrix.
| [in] | opl | Left operator (assumed to be a Epetra_CrsMatrix) |
| [in] | opr | Right operator (assumed to be a Epetra_CrsMatrix) |
Definition at line 1452 of file Teko_Utilities.cpp.
| const ModifiableLinearOp Teko::explicitMultiply | ( | const LinearOp & | opl, |
| const LinearOp & | opr, | ||
| const ModifiableLinearOp & | destOp ) |
Multiply two linear operators.
Multiply two linear operators. This currently assumes that the underlying implementation uses Epetra_CrsMatrix. The exception is that opm is allowed to be an diagonal matrix.
| [in] | opl | Left operator (assumed to be a Epetra_CrsMatrix) |
| [in] | opr | Right operator (assumed to be a Epetra_CrsMatrix) |
| [in,out] | destOp | The operator to be used as the destination operator, if this is null this function creates a new operator |
Definition at line 1687 of file Teko_Utilities.cpp.
| const LinearOp Teko::explicitAdd | ( | const LinearOp & | opl_in, |
| const LinearOp & | opr_in ) |
Add two linear operators.
Add two linear operators. This currently assumes that the underlying implementation uses Epetra_CrsMatrix.
| [in] | opl | Left operator (assumed to be a Epetra_CrsMatrix) |
| [in] | opr | Right operator (assumed to be a Epetra_CrsMatrix) |
Definition at line 1927 of file Teko_Utilities.cpp.
| const ModifiableLinearOp Teko::explicitAdd | ( | const LinearOp & | opl_in, |
| const LinearOp & | opr_in, | ||
| const ModifiableLinearOp & | destOp ) |
Add two linear operators.
Add two linear operators. This currently assumes that the underlying implementation uses Epetra_CrsMatrix.
| [in] | opl | Left operator (assumed to be a Epetra_CrsMatrix) |
| [in] | opr | Right operator (assumed to be a Epetra_CrsMatrix) |
| [in,out] | destOp | The operator to be used as the destination operator, if this is null this function creates a new operator |
Definition at line 2075 of file Teko_Utilities.cpp.
| const ModifiableLinearOp Teko::explicitSum | ( | const LinearOp & | op, |
| const ModifiableLinearOp & | destOp ) |
Sum an operator.
Sum into the modifiable linear op.
Definition at line 2239 of file Teko_Utilities.cpp.
| const LinearOp Teko::explicitTranspose | ( | const LinearOp & | op | ) |
Build an explicit transpose of a linear operator. (Concrete data underneath.
Definition at line 2264 of file Teko_Utilities.cpp.
| const LinearOp Teko::explicitScale | ( | double | scalar, |
| const LinearOp & | op ) |
Explicitely scale a linear operator.
Definition at line 2307 of file Teko_Utilities.cpp.
| double Teko::frobeniusNorm | ( | const LinearOp & | op | ) |
Rturn the frobenius norm of a linear operator
Definition at line 2337 of file Teko_Utilities.cpp.
| const LinearOp Teko::buildDiagonal | ( | const MultiVector & | src, |
| const std::string & | lbl ) |
Take the first column of a multivector and build a diagonal linear operator.
Definition at line 2428 of file Teko_Utilities.cpp.
| const LinearOp Teko::buildInvDiagonal | ( | const MultiVector & | src, |
| const std::string & | lbl ) |
Using the first column of a multivector, take the elementwise build a inverse and build the inverse diagonal operator.
Definition at line 2435 of file Teko_Utilities.cpp.
| double Teko::computeSpectralRad | ( | const Teuchos::RCP< const Thyra::LinearOpBase< double > > & | A, |
| double | tol, | ||
| bool | isHermitian = false, | ||
| int | numBlocks = 5, | ||
| int | restart = 0, | ||
| int | verbosity = 0 ) |
Compute the spectral radius of a matrix.
Compute the spectral radius of matrix A. This utilizes the Trilinos-Anasazi BlockKrylovShcur method for computing eigenvalues. It attempts to compute the largest (in magnitude) eigenvalue to a given level of tolerance.
| [in] | A | matrix whose spectral radius is needed |
| [in] | tol | The most accuracy needed (the algorithm will run until it reaches this level of accuracy and then it will quit). If this level is not reached it will return something to indicate it has not converged. |
| [in] | isHermitian | Is the matrix Hermitian |
| [in] | numBlocks | The size of the orthogonal basis built (like in GMRES) before restarting. Increase the memory usage by O(restart*n). At least restart=3 is required. |
| [in] | restart | How many restarts are permitted |
| [in] | verbosity | See the Anasazi documentation |
NaN is returned there was a problem constructing the Anasazi problem | double Teko::computeSmallestMagEig | ( | const Teuchos::RCP< const Thyra::LinearOpBase< double > > & | A, |
| double | tol, | ||
| bool | isHermitian = false, | ||
| int | numBlocks = 5, | ||
| int | restart = 0, | ||
| int | verbosity = 0 ) |
Compute the smallest eigenvalue of an operator.
Compute the smallest eigenvalue of matrix A. This utilizes the Trilinos-Anasazi BlockKrylovShcur method for computing eigenvalues. It attempts to compute the smallest (in magnitude) eigenvalue to a given level of tolerance.
| [in] | A | matrix whose spectral radius is needed |
| [in] | tol | The most accuracy needed (the algorithm will run until it reaches this level of accuracy and then it will quit). If this level is not reached it will return something to indicate it has not converged. |
| [in] | isHermitian | Is the matrix Hermitian |
| [in] | numBlocks | The size of the orthogonal basis built (like in GMRES) before restarting. Increase the memory usage by O(restart*n). At least restart=3 is required. |
| [in] | restart | How many restarts are permitted |
| [in] | verbosity | See the Anasazi documentation |
NaN is returned there was a problem constructing the Anasazi problem | ModifiableLinearOp Teko::getDiagonalOp | ( | const Teko::LinearOp & | A, |
| const DiagonalType & | dt ) |
Get a diagonal operator from a matrix. The mechanism for computing the diagonal is specified by a DiagonalType arugment.
| [in] | A | Epetra_CrsMatrix to extract the diagonal from. |
| [in] | dt | Specifies the type of diagonal that is desired. |
Definition at line 2664 of file Teko_Utilities.cpp.
| ModifiableLinearOp Teko::getInvDiagonalOp | ( | const Teko::LinearOp & | A, |
| const Teko::DiagonalType & | dt ) |
Get the inverse of a diagonal operator from a matrix. The mechanism for computing the diagonal is specified by a DiagonalType arugment.
| [in] | A | Epetra_CrsMatrix to extract the diagonal from. |
| [in] | dt | Specifies the type of diagonal that is desired. |
Definition at line 2684 of file Teko_Utilities.cpp.
| const MultiVector Teko::getDiagonal | ( | const LinearOp & | op, |
| const DiagonalType & | dt ) |
Get the diagonal of a sparse linear operator.
| [in] | Op | Sparse linear operator to get diagonal of |
| [in] | dt | Type of diagonal operator required. |
Definition at line 967 of file Teko_Utilities.cpp.
| std::string Teko::getDiagonalName | ( | const DiagonalType & | dt | ) |
Get a string corresponding to the type of diagonal specified.
| [in] | dt | The type of diagonal. |
Get a string corresponding to the type of digaonal specified.
| [in] | dt | The type of diagonal. |
Definition at line 2702 of file Teko_Utilities.cpp.
| DiagonalType Teko::getDiagonalType | ( | std::string | name | ) |
Get a type corresponding to the name of a diagonal specified.
| [in] | name | String representing the diagonal type |
NotDiag Definition at line 2722 of file Teko_Utilities.cpp.
| double Teko::norm_1 | ( | const MultiVector & | v, |
| std::size_t | col ) |
Get the one norm of the vector
Definition at line 2748 of file Teko_Utilities.cpp.
| double Teko::norm_2 | ( | const MultiVector & | v, |
| std::size_t | col ) |
Get the two norm of the vector
Definition at line 2755 of file Teko_Utilities.cpp.