#include "Teuchos_Version.hpp"
int main(int argc, char* argv[])
{
std::cout << Teuchos::Teuchos_Version() << std::endl << std::endl;
int rows, cols, stride;
My_Copy1.putScalar( 1.0 );
My_Copy1 = 1.0;
My_Copy2(1,1) = 10.0;
Empty_Matrix = My_Matrix;
My_GenMatrix = 1.0;
My_Copy2 += My_Matrix;
My_Copy2 *= 0.5;
if (Empty_Matrix == My_Matrix) {
std::cout<< "The matrices are the same!" <<std::endl;
}
if (My_Copy2 != My_Matrix) {
std::cout<< "The matrices are different!" <<std::endl;
}
double norm_one, norm_inf, norm_fro;
std::cout << std::endl << "|| My_Matrix ||_1 = " << norm_one << std::endl;
std::cout << "|| My_Matrix ||_Inf = " << norm_inf << std::endl;
std::cout << "|| My_Matrix ||_F = " << norm_fro << std::endl << std::endl;
X = 1.0;
X = 0.0;
int info = 0;
if (info != 0)
std::cout << "Teuchos::SerialSpdDenseSolver::factor() returned : " << info << std::endl;
info = My_Solver.
solve();
if (info != 0)
std::cout << "Teuchos::SerialSpdDenseSolver::solve() returned : " << info << std::endl;
double alpha=0.5;
A1(0,0) = 1.0, A1(1,1) = 2.0;
A2(0,0) = 1.0, A2(1,1) = 2.0, A2(2,2) = 3.00;
W = 1.0;
Teuchos::symMatTripleProduct<int,double>(
Teuchos::TRANS, alpha, A2, W, C2 );
std::cout<< printMat(My_Matrix) << std::endl;
std::cout<< printMat(X) << std::endl;
return 0;
}
Reference-counted pointer class and non-member templated function implementations.
Non-member helper functions on the templated serial, dense matrix/vector classes.
Templated serial dense matrix class.
Templated class for constructing and using Hermitian positive definite dense matrices.
Templated serial, dense, symmetric matrix class.
This class creates and provides basic support for dense rectangular matrix of templated type.
int multiply(ETransp transa, ETransp transb, ScalarType alpha, const SerialDenseMatrix< OrdinalType, ScalarType > &A, const SerialDenseMatrix< OrdinalType, ScalarType > &B, ScalarType beta)
Multiply A * B and add them to this; this = beta * this + alpha*A*B.
A class for constructing and using Hermitian positive definite dense matrices.
int setMatrix(const RCP< SerialSymDenseMatrix< OrdinalType, ScalarType > > &A_in)
Sets the pointers for coefficient matrix.
int solve()
Computes the solution X to AX = B for the this matrix and the B provided to SetVectors()....
int setVectors(const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &X, const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &B)
Sets the pointers for left and right hand side vector(s).
int factor()
Computes the in-place Cholesky factorization of the matrix using the LAPACK routine DPOTRF.
This class creates and provides basic support for symmetric, positive-definite dense matrices of temp...
int shape(OrdinalType numRowsCols)
Set dimensions of a Teuchos::SerialSymDenseMatrix object; init values to zero.
ScalarTraits< ScalarType >::magnitudeType normFrobenius() const
Returns the Frobenius-norm of the matrix.
OrdinalType stride() const
Returns the stride between the columns of this matrix in memory.
OrdinalType numCols() const
Returns the column dimension of this matrix.
int random(const ScalarType bias=0.1 *Teuchos::ScalarTraits< ScalarType >::one())
Set all values in the active area (upper/lower triangle) of this matrix to be random numbers.
ScalarTraits< ScalarType >::magnitudeType normInf() const
Returns the Infinity-norm of the matrix.
int reshape(OrdinalType numRowsCols)
Reshape a Teuchos::SerialSymDenseMatrix object.
OrdinalType numRows() const
Returns the row dimension of this matrix.
ScalarTraits< ScalarType >::magnitudeType normOne() const
Returns the 1-norm of the matrix.
#define TEUCHOS_ASSERT_EQUALITY(val1, val2)
This macro is checks that to numbers are equal and if not then throws an exception with a good error ...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.