#include <Teuchos_SerialSymDenseMatrix.hpp>
Public Member Functions | |
Constructor/Destructor Methods | |
SerialSymDenseMatrix () | |
Default constructor; defines a zero size object. | |
SerialSymDenseMatrix (OrdinalType numRowsCols, bool zeroOut=true) | |
Basic constructor; defines a matrix of numRowsCols size and (optionally) initializes it. | |
SerialSymDenseMatrix (DataAccess CV, bool upper, ScalarType *values, OrdinalType stride, OrdinalType numRowsCols) | |
Set object values from two-dimensional array. | |
SerialSymDenseMatrix (const SerialSymDenseMatrix< OrdinalType, ScalarType > &Source) | |
Teuchos::SerialSymDenseMatrix copy constructor. | |
SerialSymDenseMatrix (DataAccess CV, const SerialSymDenseMatrix< OrdinalType, ScalarType > &Source, OrdinalType numRowCols, OrdinalType startRowCol=0) | |
Submatrix Copy Constructor. | |
virtual | ~SerialSymDenseMatrix () |
Teuchos::SerialSymDenseMatrix destructor. | |
Shaping Methods | |
int | shape (OrdinalType numRowsCols) |
Set dimensions of a Teuchos::SerialSymDenseMatrix object; init values to zero. | |
int | shapeUninitialized (OrdinalType numRowsCols) |
Set dimensions of a Teuchos::SerialSymDenseMatrix object; don't initialize values. | |
int | reshape (OrdinalType numRowsCols) |
Reshape a Teuchos::SerialSymDenseMatrix object. | |
void | setLower () |
Specify that the lower triangle of the this matrix should be used. | |
void | setUpper () |
Specify that the upper triangle of the this matrix should be used. | |
Set methods. | |
SerialSymDenseMatrix < OrdinalType, ScalarType > & | operator= (const SerialSymDenseMatrix< OrdinalType, ScalarType > &Source) |
Copies values from one matrix to another. | |
SerialSymDenseMatrix < OrdinalType, ScalarType > & | assign (const SerialSymDenseMatrix< OrdinalType, ScalarType > &Source) |
Copies values from one matrix to another. | |
int | putScalar (const ScalarType value=Teuchos::ScalarTraits< ScalarType >::zero(), bool fullMatrix=false) |
Set all values in the matrix to a constant value. | |
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. | |
Accessor methods. | |
ScalarType & | operator() (OrdinalType rowIndex, OrdinalType colIndex) |
Element access method (non-const). | |
const ScalarType & | operator() (OrdinalType rowIndex, OrdinalType colIndex) const |
Element access method (const). | |
ScalarType * | values () const |
Returns the pointer to the ScalarType data array contained in the object. | |
Query methods | |
bool | upper () const |
Returns true if upper triangular part of this matrix has and will be used. | |
char | UPLO () const |
Returns character value of UPLO used by LAPACK routines. | |
Mathematical Methods | |
SerialSymDenseMatrix < OrdinalType, ScalarType > & | operator*= (const ScalarType alpha) |
Inplace scalar-matrix product A = alpha*A . | |
SerialSymDenseMatrix < OrdinalType, ScalarType > & | operator+= (const SerialSymDenseMatrix< OrdinalType, ScalarType > &Source) |
Add another matrix to this matrix. | |
SerialSymDenseMatrix < OrdinalType, ScalarType > & | operator-= (const SerialSymDenseMatrix< OrdinalType, ScalarType > &Source) |
Subtract another matrix from this matrix. | |
Comparison methods. | |
bool | operator== (const SerialSymDenseMatrix< OrdinalType, ScalarType > &Operand) |
Equality of two matrices. | |
bool | operator!= (const SerialSymDenseMatrix< OrdinalType, ScalarType > &Operand) |
Inequality of two matrices. | |
Attribute methods. | |
OrdinalType | numRows () const |
Returns the row dimension of this matrix. | |
OrdinalType | numCols () const |
Returns the column dimension of this matrix. | |
OrdinalType | stride () const |
Returns the stride between the columns of this matrix in memory. | |
bool | empty () const |
Returns whether this matrix is empty. | |
Norm methods. | |
ScalarTraits< ScalarType > ::magnitudeType | normOne () const |
Returns the 1-norm of the matrix. | |
ScalarTraits< ScalarType > ::magnitudeType | normInf () const |
Returns the Infinity-norm of the matrix. | |
ScalarTraits< ScalarType > ::magnitudeType | normFrobenius () const |
Returns the Frobenius-norm of the matrix. | |
I/O methods. | |
virtual void | print (std::ostream &os) const |
Print method. Defines the behavior of the std::ostream << operator inherited from the Object class. | |
Protected Member Functions | |
void | scale (const ScalarType alpha) |
void | copyMat (bool inputUpper, ScalarType *inputMatrix, OrdinalType inputStride, OrdinalType numRowCols, bool outputUpper, ScalarType *outputMatrix, OrdinalType outputStride, OrdinalType startRowCol, ScalarType alpha=ScalarTraits< ScalarType >::zero()) |
void | copyUPLOMat (bool inputUpper, ScalarType *inputMatrix, OrdinalType inputStride, OrdinalType inputRows) |
void | deleteArrays () |
void | checkIndex (OrdinalType rowIndex, OrdinalType colIndex=0) const |
Protected Attributes | |
OrdinalType | numRowCols_ |
OrdinalType | stride_ |
bool | valuesCopied_ |
ScalarType * | values_ |
bool | upper_ |
char | UPLO_ |
Definition at line 107 of file Teuchos_SerialSymDenseMatrix.hpp.
Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::SerialSymDenseMatrix | ( | ) | [inline] |
Default constructor; defines a zero size object.
Teuchos::SerialSymDenseMatrix objects defined by the default constructor should be sized with the Shape() or Reshape() functions. Values should be defined by using the [] or ()operators.
Note: By default the active part of the matrix is assumed to be the lower triangular part. To set the upper part as active, call SetUpper(). See Detailed Description section for further discussion.
Definition at line 408 of file Teuchos_SerialSymDenseMatrix.hpp.
Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::SerialSymDenseMatrix | ( | OrdinalType | numRowsCols, | |
bool | zeroOut = true | |||
) | [inline] |
Basic constructor; defines a matrix of numRowsCols
size and (optionally) initializes it.
numRowsCols | - Number of rows and columns in the matrix. | |
zeroOut | - Initializes values to 0 if true (default) |
numRowsCols
rows and cols. All values are initialized to 0 when zeroOut
is true. Values of this matrix should be set using the [] or the () operators.
Definition at line 413 of file Teuchos_SerialSymDenseMatrix.hpp.
Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::SerialSymDenseMatrix | ( | DataAccess | CV, | |
bool | upper, | |||
ScalarType * | values, | |||
OrdinalType | stride, | |||
OrdinalType | numRowsCols | |||
) | [inline] |
Set object values from two-dimensional array.
CV | - Enumerated type set to Teuchos::Copy or Teuchos::View. | |
values | - Pointer to an array of ScalarType. The first column starts at values , the second at values+stride , etc. | |
stride | - The stride between the columns of the matrix in memory. | |
numRowsCols | - Number of rows and columns in the matrix. |
Definition at line 423 of file Teuchos_SerialSymDenseMatrix.hpp.
Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::SerialSymDenseMatrix | ( | const SerialSymDenseMatrix< OrdinalType, ScalarType > & | Source | ) | [inline] |
Teuchos::SerialSymDenseMatrix copy constructor.
Definition at line 444 of file Teuchos_SerialSymDenseMatrix.hpp.
Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::SerialSymDenseMatrix | ( | DataAccess | CV, | |
const SerialSymDenseMatrix< OrdinalType, ScalarType > & | Source, | |||
OrdinalType | numRowCols, | |||
OrdinalType | startRowCol = 0 | |||
) | [inline] |
Submatrix Copy Constructor.
CV | - Enumerated type set to Teuchos::Copy or Teuchos::View. | |
Source | - Reference to another dense matrix from which values are to be copied. | |
numRowCols | - The number of rows and columns in this matrix. | |
startRowCol | - The row and column of Source from which the submatrix copy should start. |
numRowCols
rows and columns, which is a submatrix of Source
. If startRowCol
are not given, then the submatrix is the leading submatrix of Source
.
Definition at line 452 of file Teuchos_SerialSymDenseMatrix.hpp.
Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::~SerialSymDenseMatrix | ( | ) | [inline, virtual] |
Teuchos::SerialSymDenseMatrix destructor.
Definition at line 471 of file Teuchos_SerialSymDenseMatrix.hpp.
SerialSymDenseMatrix< OrdinalType, ScalarType > & Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::assign | ( | const SerialSymDenseMatrix< OrdinalType, ScalarType > & | Source | ) | [inline] |
Copies values from one matrix to another.
Copies the values from one existing SerialSymDenseMatrix to another if the dimension of both matrices are the same. If not, this matrix will be returned unchanged.
Definition at line 714 of file Teuchos_SerialSymDenseMatrix.hpp.
void Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::checkIndex | ( | OrdinalType | rowIndex, | |
OrdinalType | colIndex = 0 | |||
) | const [inline, protected] |
Definition at line 975 of file Teuchos_SerialSymDenseMatrix.hpp.
void Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::copyMat | ( | bool | inputUpper, | |
ScalarType * | inputMatrix, | |||
OrdinalType | inputStride, | |||
OrdinalType | numRowCols, | |||
bool | outputUpper, | |||
ScalarType * | outputMatrix, | |||
OrdinalType | outputStride, | |||
OrdinalType | startRowCol, | |||
ScalarType | alpha = ScalarTraits<ScalarType>::zero() | |||
) | [inline, protected] |
Definition at line 996 of file Teuchos_SerialSymDenseMatrix.hpp.
void Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::copyUPLOMat | ( | bool | inputUpper, | |
ScalarType * | inputMatrix, | |||
OrdinalType | inputStride, | |||
OrdinalType | inputRows | |||
) | [inline, protected] |
Definition at line 1079 of file Teuchos_SerialSymDenseMatrix.hpp.
void Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::deleteArrays | ( | void | ) | [inline, protected] |
Definition at line 985 of file Teuchos_SerialSymDenseMatrix.hpp.
bool Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::empty | ( | ) | const [inline] |
Returns whether this matrix is empty.
Definition at line 352 of file Teuchos_SerialSymDenseMatrix.hpp.
ScalarTraits< ScalarType >::magnitudeType Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::normFrobenius | ( | ) | const [inline] |
Returns the Frobenius-norm of the matrix.
Definition at line 833 of file Teuchos_SerialSymDenseMatrix.hpp.
ScalarTraits< ScalarType >::magnitudeType Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::normInf | ( | ) | const [inline] |
Returns the Infinity-norm of the matrix.
Definition at line 790 of file Teuchos_SerialSymDenseMatrix.hpp.
ScalarTraits< ScalarType >::magnitudeType Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::normOne | ( | ) | const [inline] |
OrdinalType Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::numCols | ( | ) | const [inline] |
Returns the column dimension of this matrix.
Definition at line 346 of file Teuchos_SerialSymDenseMatrix.hpp.
OrdinalType Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::numRows | ( | ) | const [inline] |
Returns the row dimension of this matrix.
Definition at line 343 of file Teuchos_SerialSymDenseMatrix.hpp.
bool Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::operator!= | ( | const SerialSymDenseMatrix< OrdinalType, ScalarType > & | Operand | ) | [inline] |
Inequality of two matrices.
Operand
of not of the same shape (rows / columns) or don't have the same entries in the active (upper / lower triangular), else False will be returned. Definition at line 886 of file Teuchos_SerialSymDenseMatrix.hpp.
const ScalarType & Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::operator() | ( | OrdinalType | rowIndex, | |
OrdinalType | colIndex | |||
) | const [inline] |
Element access method (const).
Returns the element in the ith row and jth column if A(i,j) is specified.
rowIndex
row and colIndex
column. rowIndex
and colIndex
will only be checked if Teuchos is configured with --enable-teuchos-abc. Definition at line 758 of file Teuchos_SerialSymDenseMatrix.hpp.
ScalarType & Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::operator() | ( | OrdinalType | rowIndex, | |
OrdinalType | colIndex | |||
) | [inline] |
Element access method (non-const).
Returns the element in the ith row and jth column if A(i,j) is specified.
rowIndex
row and colIndex
column. rowIndex
and colIndex
will only be checked if Teuchos is configured with --enable-teuchos-abc. Definition at line 736 of file Teuchos_SerialSymDenseMatrix.hpp.
SerialSymDenseMatrix< OrdinalType, ScalarType > & Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::operator*= | ( | const ScalarType | alpha | ) | [inline] |
Inplace scalar-matrix product A = alpha*A
.
Scale a matrix, entry-by-entry using the value alpha. This method is sensitive to the UPLO() parameter.
alpha | - Scalar to multiply with A. |
Definition at line 683 of file Teuchos_SerialSymDenseMatrix.hpp.
SerialSymDenseMatrix< OrdinalType, ScalarType > & Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::operator+= | ( | const SerialSymDenseMatrix< OrdinalType, ScalarType > & | Source | ) | [inline] |
Add another matrix to this matrix.
Add Source
to this if the dimension of both matrices are the same. If not, this matrix will be returned unchanged.
Definition at line 690 of file Teuchos_SerialSymDenseMatrix.hpp.
SerialSymDenseMatrix< OrdinalType, ScalarType > & Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::operator-= | ( | const SerialSymDenseMatrix< OrdinalType, ScalarType > & | Source | ) | [inline] |
Subtract another matrix from this matrix.
Subtract Source
from this if the dimension of both matrices are the same. If not, this matrix will be returned unchanged.
Definition at line 702 of file Teuchos_SerialSymDenseMatrix.hpp.
SerialSymDenseMatrix< OrdinalType, ScalarType > & Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::operator= | ( | const SerialSymDenseMatrix< OrdinalType, ScalarType > & | Source | ) | [inline] |
Copies values from one matrix to another.
The operator= copies the values from one existing SerialSymDenseMatrix to another. If Source
is a view (i.e. CV = Teuchos::View), then this method will return a view. Otherwise, it will return a copy of Source
. this object will be resized if it is not large enough to copy Source
into.
Definition at line 620 of file Teuchos_SerialSymDenseMatrix.hpp.
bool Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::operator== | ( | const SerialSymDenseMatrix< OrdinalType, ScalarType > & | Operand | ) | [inline] |
Equality of two matrices.
Operand
are of the same shape (rows / columns) and have the same entries in the active (upper / lower triangular) area of the matrix, else False will be returned. Definition at line 866 of file Teuchos_SerialSymDenseMatrix.hpp.
void Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print method. Defines the behavior of the std::ostream << operator inherited from the Object class.
Reimplemented from Teuchos::Object.
Definition at line 945 of file Teuchos_SerialSymDenseMatrix.hpp.
int Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::putScalar | ( | const ScalarType | value = Teuchos::ScalarTraits<ScalarType>::zero() , |
|
bool | fullMatrix = false | |||
) | [inline] |
Set all values in the matrix to a constant value.
value | - Value to use; zero if none specified. | |
fullMatrix | - set full matrix entries to value , not just active portion of symmetric matrix. |
Definition at line 553 of file Teuchos_SerialSymDenseMatrix.hpp.
int Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::random | ( | const ScalarType | bias = 0.1*Teuchos::ScalarTraits<ScalarType>::one() |
) | [inline] |
Set all values in the active area (upper/lower triangle) of this matrix to be random numbers.
Definition at line 586 of file Teuchos_SerialSymDenseMatrix.hpp.
int Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::reshape | ( | OrdinalType | numRowsCols | ) | [inline] |
Reshape a Teuchos::SerialSymDenseMatrix object.
numRowsCols | - Number of rows and columns in object. |
Definition at line 504 of file Teuchos_SerialSymDenseMatrix.hpp.
void Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::scale | ( | const ScalarType | alpha | ) | [inline, protected] |
Definition at line 896 of file Teuchos_SerialSymDenseMatrix.hpp.
void Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::setLower | ( | ) | [inline] |
Specify that the lower triangle of the this matrix should be used.
Definition at line 531 of file Teuchos_SerialSymDenseMatrix.hpp.
void Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::setUpper | ( | ) | [inline] |
Specify that the upper triangle of the this matrix should be used.
Definition at line 542 of file Teuchos_SerialSymDenseMatrix.hpp.
int Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::shape | ( | OrdinalType | numRowsCols | ) | [inline] |
Set dimensions of a Teuchos::SerialSymDenseMatrix object; init values to zero.
numRowsCols | - Number of rows and columns in object. |
Definition at line 481 of file Teuchos_SerialSymDenseMatrix.hpp.
int Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::shapeUninitialized | ( | OrdinalType | numRowsCols | ) | [inline] |
Set dimensions of a Teuchos::SerialSymDenseMatrix object; don't initialize values.
numRowsCols | - Number of rows and columns in object. |
Definition at line 493 of file Teuchos_SerialSymDenseMatrix.hpp.
OrdinalType Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::stride | ( | ) | const [inline] |
Returns the stride between the columns of this matrix in memory.
Definition at line 349 of file Teuchos_SerialSymDenseMatrix.hpp.
char Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::UPLO | ( | ) | const [inline] |
Returns character value of UPLO used by LAPACK routines.
Definition at line 293 of file Teuchos_SerialSymDenseMatrix.hpp.
bool Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::upper | ( | ) | const [inline] |
Returns true if upper triangular part of this matrix has and will be used.
Definition at line 290 of file Teuchos_SerialSymDenseMatrix.hpp.
ScalarType* Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::values | ( | ) | const [inline] |
Returns the pointer to the ScalarType data array contained in the object.
Definition at line 282 of file Teuchos_SerialSymDenseMatrix.hpp.
OrdinalType Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::numRowCols_ [protected] |
Definition at line 393 of file Teuchos_SerialSymDenseMatrix.hpp.
OrdinalType Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::stride_ [protected] |
Definition at line 394 of file Teuchos_SerialSymDenseMatrix.hpp.
char Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::UPLO_ [protected] |
Definition at line 398 of file Teuchos_SerialSymDenseMatrix.hpp.
bool Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::upper_ [protected] |
Definition at line 397 of file Teuchos_SerialSymDenseMatrix.hpp.
ScalarType* Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::values_ [protected] |
Definition at line 396 of file Teuchos_SerialSymDenseMatrix.hpp.
bool Teuchos::SerialSymDenseMatrix< OrdinalType, ScalarType >::valuesCopied_ [protected] |
Definition at line 395 of file Teuchos_SerialSymDenseMatrix.hpp.