42#ifndef _TEUCHOS_SERIALDENSEHELPERS_HPP_
43#define _TEUCHOS_SERIALDENSEHELPERS_HPP_
75template<
typename OrdinalType,
typename ScalarType>
90 "Teuchos::symMatTripleProduct<>() : "
91 "Num Rows/Cols B (" <<
B.numRows() <<
") inconsistent with W ("<<
B_nrowcols <<
")");
93 "Teuchos::symMatTripleProduct<>() : "
122 blas.GEMV(
transw,
W_nrows,
j+1, one,
W.values(),
W.stride(),
AW[
j], 1, zero, &
B(0,
j), 1 );
126 blas.GEMV(
transw,
W_nrows,
B_nrowcols-
j, one,
W[
j],
W.stride(),
AW[
j], 1, zero, &
B(
j,
j), 1 );
140 blas.GEMV(
transw, 1,
A_nrowcols, one, &
AW(
i,0),
AW.stride(), &
W(
j,0),
W.stride(), zero, &
B(
i,
j), 1 );
145 blas.GEMV(
transw, 1,
A_nrowcols, one, &
AW(
i,0),
AW.stride(), &
W(
j,0),
W.stride(), zero, &
B(
i,
j), 1 );
161template<
typename OrdinalType,
typename ScalarType>
177template<
typename OrdinalType,
typename ScalarType>
182 if (
v.length() !=
A.numRows())
return false;
184 std::copy(
v.values(),
v.values()+
v.length(),
A[
col]);
194template <
typename OrdinalType,
typename ScalarType>
237template<
typename OrdinalType,
typename ScalarType>
248 "SerialBandDenseSolver<T>::generalToBanded: A is an empty SerialDenseMatrix<T>!");
250 "SerialBandDenseSolver<T>::generalToBanded: The lower bandwidth kl is invalid!");
252 "SerialBandDenseSolver<T>::generalToBanded: The upper bandwidth ku is invalid!");
260 (*AB)(
i,
j) = (*
A)(
i,
j);
273template<
typename OrdinalType,
typename ScalarType>
285 "SerialBandDenseSolver<T>::bandedToGeneral: AB is an empty SerialBandDenseMatrix<T>!");
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
#define TEUCHOS_MIN(x, y)
#define TEUCHOS_MAX(x, y)
Teuchos::DataAccess Mode enumerable type.
Defines basic traits for the scalar field type.
Templated serial dense matrix class.
Templated serial dense matrix class.
Templated serial dense vector class.
Templated serial, dense, symmetric matrix class.
static Teuchos::RCP< const Comm< OrdinalType > > getComm()
Return the default global communicator.
Smart reference counting pointer class for automatic garbage collection.
Teuchos::RCP< SerialBandDenseMatrix< OrdinalType, ScalarType > > generalToBanded(const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &A, const OrdinalType kl, const OrdinalType ku, const bool factorFormat)
A templated, non-member, helper function for converting a SerialDenseMatrix to a SerialBandDenseMatri...
Teuchos::RCP< SerialDenseMatrix< OrdinalType, ScalarType > > bandedToGeneral(const RCP< SerialBandDenseMatrix< OrdinalType, ScalarType > > &AB)
A templated, non-member, helper function for converting a SerialBandDenseMatrix to a SerialDenseMatri...
Concrete serial communicator subclass.
void randomSyncedMatrix(Teuchos::SerialDenseMatrix< OrdinalType, ScalarType > &A)
A templated, non-member, helper function for generating a random SerialDenseMatrix that is synchroniz...
bool setCol(const SerialDenseVector< OrdinalType, ScalarType > &v, const OrdinalType col, SerialDenseMatrix< OrdinalType, ScalarType > &A)
A templated, non-member, helper function for setting a SerialDenseMatrix column using a SerialDenseVe...
SerialDenseVector< OrdinalType, ScalarType > getCol(DataAccess CV, SerialDenseMatrix< OrdinalType, ScalarType > &A, const OrdinalType col)
A templated, non-member, helper function for viewing or copying a column of a SerialDenseMatrix as a ...
void symMatTripleProduct(ETransp transw, const ScalarType alpha, const SerialSymDenseMatrix< OrdinalType, ScalarType > &A, const SerialDenseMatrix< OrdinalType, ScalarType > &W, SerialSymDenseMatrix< OrdinalType, ScalarType > &B)
A templated, non-member, helper function for computing the matrix triple-product: B = alpha*W^T*A*W o...
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
TEUCHOSNUMERICS_LIB_DLL_EXPORT const char ETranspChar[]
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
This structure defines some basic traits for a scalar field type.
static T one()
Returns representation of one for this scalar type.
static T zero()
Returns representation of zero for this scalar type.