Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Related Functions | List of all members
Teuchos::SerialDenseMatrix< OrdinalType, ScalarType > Class Template Reference

This class creates and provides basic support for dense rectangular matrix of templated type. More...

#include <Teuchos_SerialDenseMatrix.hpp>

Inheritance diagram for Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >:
Inheritance graph
[legend]

Public Types

typedef OrdinalType ordinalType
 Typedef for ordinal type. More...
 
typedef ScalarType scalarType
 Typedef for scalar type. More...
 
- Public Types inherited from Teuchos::DefaultBLASImpl< OrdinalType, ScalarType >
typedef details::GivensRotator
< ScalarType >::c_type 
rotg_c_type
 The type used for c in ROTG. More...
 

Protected Member Functions

void copyMat (ScalarType *inputMatrix, OrdinalType strideInput, OrdinalType numRows, OrdinalType numCols, ScalarType *outputMatrix, OrdinalType strideOutput, OrdinalType startRow, OrdinalType startCol, ScalarType alpha=ScalarTraits< ScalarType >::zero())
 
void deleteArrays ()
 
void checkIndex (OrdinalType rowIndex, OrdinalType colIndex=0) const
 

Static Protected Member Functions

static ScalarType * allocateValues (const OrdinalType numRows, const OrdinalType numCols)
 

Protected Attributes

OrdinalType numRows_ = 0
 
OrdinalType numCols_ = 0
 
OrdinalType stride_ = 0
 
bool valuesCopied_ = false
 
ScalarType * values_ = nullptr
 
- Protected Attributes inherited from Teuchos::CompObject
FlopsflopCounter_
 

Related Functions

(Note that these are not member functions.)

template<typename OrdinalType , typename ScalarType >
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 SerialDenseVector. More...
 
template<typename OrdinalType , typename ScalarType >
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 SerialDenseVector. More...
 
template<typename OrdinalType , typename ScalarType >
void randomSyncedMatrix (Teuchos::SerialDenseMatrix< OrdinalType, ScalarType > &A)
 A templated, non-member, helper function for generating a random SerialDenseMatrix that is synchronized in parallel. More...
 

Constructor/Destructor methods.

 SerialDenseMatrix ()=default
 Default Constructor. More...
 
 SerialDenseMatrix (OrdinalType numRows, OrdinalType numCols, bool zeroOut=true)
 Shaped Constructor. More...
 
 SerialDenseMatrix (DataAccess CV, ScalarType *values, OrdinalType stride, OrdinalType numRows, OrdinalType numCols)
 Shaped Constructor with Values. More...
 
 SerialDenseMatrix (const SerialDenseMatrix< OrdinalType, ScalarType > &Source, ETransp trans=Teuchos::NO_TRANS)
 Copy Constructor. More...
 
 SerialDenseMatrix (DataAccess CV, const SerialDenseMatrix< OrdinalType, ScalarType > &Source)
 Copy Constructor. More...
 
 SerialDenseMatrix (DataAccess CV, const SerialDenseMatrix< OrdinalType, ScalarType > &Source, OrdinalType numRows, OrdinalType numCols, OrdinalType startRow=0, OrdinalType startCol=0)
 Submatrix Copy Constructor. More...
 
virtual ~SerialDenseMatrix ()
 Destructor. More...
 

Shaping methods.

int shape (OrdinalType numRows, OrdinalType numCols)
 Shape method for changing the size of a SerialDenseMatrix, initializing entries to zero. More...
 
int shapeUninitialized (OrdinalType numRows, OrdinalType numCols)
 Same as shape() except leaves uninitialized. More...
 
int reshape (OrdinalType numRows, OrdinalType numCols)
 Reshaping method for changing the size of a SerialDenseMatrix, keeping the entries. More...
 

Set methods.

SerialDenseMatrix< OrdinalType,
ScalarType > & 
operator= (const SerialDenseMatrix< OrdinalType, ScalarType > &Source)
 Copies values from one matrix to another. More...
 
SerialDenseMatrix< OrdinalType,
ScalarType > & 
assign (const SerialDenseMatrix< OrdinalType, ScalarType > &Source)
 Copies values from one matrix to another. More...
 
SerialDenseMatrix< OrdinalType,
ScalarType > & 
operator= (const ScalarType value)
 Set all values in the matrix to a constant value. More...
 
int putScalar (const ScalarType value=Teuchos::ScalarTraits< ScalarType >::zero())
 Set all values in the matrix to a constant value. More...
 
void swap (SerialDenseMatrix< OrdinalType, ScalarType > &B)
 Swap values between this matrix and incoming matrix. More...
 
int random ()
 Set all values in the matrix to be random numbers. More...
 

Accessor methods.

ScalarType & operator() (OrdinalType rowIndex, OrdinalType colIndex)
 Element access method (non-const). More...
 
const ScalarType & operator() (OrdinalType rowIndex, OrdinalType colIndex) const
 Element access method (const). More...
 
ScalarType * operator[] (OrdinalType colIndex)
 Column access method (non-const). More...
 
const ScalarType * operator[] (OrdinalType colIndex) const
 Column access method (const). More...
 
ScalarType * values () const
 Data array access method. More...
 

Mathematical methods.

SerialDenseMatrix< OrdinalType,
ScalarType > & 
operator+= (const SerialDenseMatrix< OrdinalType, ScalarType > &Source)
 Add another matrix to this matrix. More...
 
SerialDenseMatrix< OrdinalType,
ScalarType > & 
operator-= (const SerialDenseMatrix< OrdinalType, ScalarType > &Source)
 Subtract another matrix from this matrix. More...
 
SerialDenseMatrix< OrdinalType,
ScalarType > & 
operator*= (const ScalarType alpha)
 Scale this matrix by alpha; *this = alpha**this. More...
 
int scale (const ScalarType alpha)
 Scale this matrix by alpha; *this = alpha**this. More...
 
int scale (const SerialDenseMatrix< OrdinalType, ScalarType > &A)
 Point-wise scale this matrix by A; i.e. *this(i,j) *= A(i,j) More...
 
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. More...
 
int multiply (ESide sideA, ScalarType alpha, const SerialSymDenseMatrix< OrdinalType, ScalarType > &A, const SerialDenseMatrix< OrdinalType, ScalarType > &B, ScalarType beta)
 Multiply A and B and add them to this; this = beta * this + alpha*A*B or this = beta * this + alpha*B*A. More...
 

Comparison methods.

bool operator== (const SerialDenseMatrix< OrdinalType, ScalarType > &Operand) const
 Equality of two matrices. More...
 
bool operator!= (const SerialDenseMatrix< OrdinalType, ScalarType > &Operand) const
 Inequality of two matrices. More...
 

Attribute methods.

OrdinalType numRows () const
 Returns the row dimension of this matrix. More...
 
OrdinalType numCols () const
 Returns the column dimension of this matrix. More...
 
OrdinalType stride () const
 Returns the stride between the columns of this matrix in memory. More...
 
bool empty () const
 Returns whether this matrix is empty. More...
 

Norm methods.

ScalarTraits< ScalarType >
::magnitudeType 
normOne () const
 Returns the 1-norm of the matrix. More...
 
ScalarTraits< ScalarType >
::magnitudeType 
normInf () const
 Returns the Infinity-norm of the matrix. More...
 
ScalarTraits< ScalarType >
::magnitudeType 
normFrobenius () const
 Returns the Frobenius-norm of the matrix. More...
 

I/O methods.

virtual std::ostream & print (std::ostream &os) const
 Print method. Defines the behavior of the std::ostream << operator. More...
 

Detailed Description

template<typename OrdinalType, typename ScalarType>
class Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >

This class creates and provides basic support for dense rectangular matrix of templated type.

Definition at line 67 of file Teuchos_SerialDenseMatrix.hpp.

Member Typedef Documentation

template<typename OrdinalType, typename ScalarType>
typedef OrdinalType Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::ordinalType

Typedef for ordinal type.

Definition at line 72 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
typedef ScalarType Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::scalarType

Typedef for scalar type.

Definition at line 74 of file Teuchos_SerialDenseMatrix.hpp.

Constructor & Destructor Documentation

template<typename OrdinalType, typename ScalarType>
Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::SerialDenseMatrix ( )
default

Default Constructor.

Creates a empty matrix of no dimension. The Shaping methods should be used to size this matrix. Values of this matrix should be set using the [], (), or = operators.

template<typename OrdinalType , typename ScalarType >
Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::SerialDenseMatrix ( OrdinalType  numRows,
OrdinalType  numCols,
bool  zeroOut = true 
)

Shaped Constructor.

Parameters
numRows- Number of rows in matrix.
numCols- Number of columns in matrix.
zeroOut- Initializes values to 0 if true (default)

Creates a shaped matrix with numRows rows and numCols 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 415 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::SerialDenseMatrix ( DataAccess  CV,
ScalarType *  values,
OrdinalType  stride,
OrdinalType  numRows,
OrdinalType  numCols 
)

Shaped Constructor with Values.

Parameters
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.
numRows- Number of rows in matrix.
numCols- Number of columns in matrix.

Definition at line 430 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::SerialDenseMatrix ( const SerialDenseMatrix< OrdinalType, ScalarType > &  Source,
ETransp  trans = Teuchos::NO_TRANS 
)

Copy Constructor.

Note
A deep copy of the Source transposed can be obtained if trans=Teuchos::TRANS, else a non-transposed copy of Source is made. There is no storage of the transpose state of the matrix within the SerialDenseMatrix class, so this information will not propogate to any operation performed on a matrix that has been copy constructed in transpose.

Definition at line 450 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::SerialDenseMatrix ( DataAccess  CV,
const SerialDenseMatrix< OrdinalType, ScalarType > &  Source 
)

Copy Constructor.

Note
Only a non-transposed deep copy or view of Source is made with this copy constructor.

Definition at line 505 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::SerialDenseMatrix ( DataAccess  CV,
const SerialDenseMatrix< OrdinalType, ScalarType > &  Source,
OrdinalType  numRows,
OrdinalType  numCols,
OrdinalType  startRow = 0,
OrdinalType  startCol = 0 
)

Submatrix Copy Constructor.

Parameters
CV- Enumerated type set to Teuchos::Copy or Teuchos::View.
Source- Reference to another dense matrix from which values are to be copied.
numRows- The number of rows in this matrix.
numCols- The number of columns in this matrix.
startRow- The row of Source from which the submatrix copy should start.
startCol- The column of Source from which the submatrix copy should start.

Creates a shaped matrix with numRows rows and numCols columns, which is a submatrix of Source. If startRow and startCol are not given, then the submatrix is the leading submatrix of Source. Otherwise, the (1,1) entry in the copied matrix is the (startRow, startCol) entry of Source.

Definition at line 522 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::~SerialDenseMatrix ( )
virtual

Destructor.

Definition at line 544 of file Teuchos_SerialDenseMatrix.hpp.

Member Function Documentation

template<typename OrdinalType , typename ScalarType >
int Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::shape ( OrdinalType  numRows,
OrdinalType  numCols 
)

Shape method for changing the size of a SerialDenseMatrix, initializing entries to zero.

Parameters
numRows- The number of rows in this matrix.
numCols- The number of columns in this matrix.

This method allows the user to define the dimensions of a SerialDenseMatrix at any point. This method can be called at any point after construction. Any values previously in this object will be destroyed and the resized matrix starts of with all zero values.

Returns
Integer error code, set to 0 if successful.

Definition at line 554 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
int Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::shapeUninitialized ( OrdinalType  numRows,
OrdinalType  numCols 
)

Same as shape() except leaves uninitialized.

Definition at line 569 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
int Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::reshape ( OrdinalType  numRows,
OrdinalType  numCols 
)

Reshaping method for changing the size of a SerialDenseMatrix, keeping the entries.

Parameters
numRows- The number of rows in this matrix.
numCols- The number of columns in this matrix.

This method allows the user to redefine the dimensions of a SerialDenseMatrix at any point. This method can be called at any point after construction. Any values previously in this object will be copied into the reshaped matrix.

Returns
Integer error code, set 0 if successful.

Definition at line 583 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
SerialDenseMatrix< OrdinalType, ScalarType > & Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::operator= ( const SerialDenseMatrix< OrdinalType, ScalarType > &  Source)

Copies values from one matrix to another.

The operator= copies the values from one existing SerialDenseMatrix 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 669 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
SerialDenseMatrix< OrdinalType, ScalarType > & Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::assign ( const SerialDenseMatrix< OrdinalType, ScalarType > &  Source)

Copies values from one matrix to another.

Copies the values from one existing SerialDenseMatrix to another if the dimension of both matrices are the same. If not, this matrix will be returned unchanged.

Definition at line 750 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
SerialDenseMatrix<OrdinalType, ScalarType>& Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::operator= ( const ScalarType  value)
inline

Set all values in the matrix to a constant value.

Parameters
value- Value to use;

Definition at line 197 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
int Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::putScalar ( const ScalarType  value = Teuchos::ScalarTraits<ScalarType>::zero())

Set all values in the matrix to a constant value.

Parameters
value- Value to use; zero if none specified.
Returns
Integer error code, set to 0 if successful.

Definition at line 615 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
void Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::swap ( SerialDenseMatrix< OrdinalType, ScalarType > &  B)

Swap values between this matrix and incoming matrix.

Swaps pointers and associated state without copying the matrix data.

Definition at line 629 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
int Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::random ( )

Set all values in the matrix to be random numbers.

Definition at line 654 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
ScalarType & Teuchos::SerialDenseMatrix< 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, the expression A[j][i] will return the same element.

\return Element from the specified \c rowIndex row and \c colIndex column.
Warning
The validity of rowIndex and colIndex will only be checked if Teuchos is configured with –enable-teuchos-abc.

Definition at line 770 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
const ScalarType & Teuchos::SerialDenseMatrix< 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, the expression A[j][i] will return the same element.

\return Element from the specified \c rowIndex row and \c colIndex column.
Warning
The validity of rowIndex and colIndex will only be checked if Teuchos is configured with –enable-teuchos-abc.

Definition at line 779 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
ScalarType * Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::operator[] ( OrdinalType  colIndex)
inline

Column access method (non-const).

Returns the pointer to the ScalarType array at the jth column if A[j] is specified, the expression A[j][i] will return the same element as A(i,j).

Returns
Pointer to the ScalarType array at the colIndex column ( values_+colIndex*stride_ ).

Definition at line 797 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
const ScalarType * Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::operator[] ( OrdinalType  colIndex) const
inline

Column access method (const).

Returns the pointer to the ScalarType array at the jth column if A[j] is specified, the expression A[j][i] will return the same element as A(i,j).

Returns
Pointer to the ScalarType array at the colIndex column ( values_+colIndex*stride_ ).

Definition at line 788 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
ScalarType* Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::values ( ) const
inline

Data array access method.

Returns
Pointer to the ScalarType data array contained in the object.

Definition at line 258 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
SerialDenseMatrix< OrdinalType, ScalarType > & Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::operator+= ( const SerialDenseMatrix< OrdinalType, ScalarType > &  Source)

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 726 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
SerialDenseMatrix< OrdinalType, ScalarType > & Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::operator-= ( const SerialDenseMatrix< OrdinalType, ScalarType > &  Source)

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 738 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
SerialDenseMatrix< OrdinalType, ScalarType > & Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::operator*= ( const ScalarType  alpha)

Scale this matrix by alpha; *this = alpha**this.

Parameters
alphaScalar to multiply this by.

Definition at line 909 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
int Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::scale ( const ScalarType  alpha)

Scale this matrix by alpha; *this = alpha**this.

Parameters
alphaScalar to multiply this by.
Returns
Integer error code, set to 0 if successful.

Definition at line 916 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
int Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::scale ( const SerialDenseMatrix< OrdinalType, ScalarType > &  A)

Point-wise scale this matrix by A; i.e. *this(i,j) *= A(i,j)

The values of *this matrix will be point-wise scaled by the values in A. If A and this matrix are not the same dimension this will be returned unchanged.

Parameters
BTeuchos::SerialDenseMatrix used to perform element-wise scaling of this.
Returns
Integer error code, set to 0 if successful.

Definition at line 931 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
int Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::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.

Parameters
transa- Use the transpose of A if transa = Teuchos::TRANS, else don't use the transpose if transa = Teuchos::NO_TRANS.
transb- Use the transpose of B if transb = Teuchos::TRANS, else don't use the transpose if transb = Teuchos::NO_TRANS.
alpha- The scaling factor for A * B.
A- SerialDenseMatrix
B- SerialDenseMatrix
beta- The scaling factor for this.

If the matrices A and B are not of the right dimension, consistent with this, then this matrix will not be altered and -1 will be returned.

Returns
Integer error code, set to 0 if successful.

Definition at line 951 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
int Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::multiply ( ESide  sideA,
ScalarType  alpha,
const SerialSymDenseMatrix< OrdinalType, ScalarType > &  A,
const SerialDenseMatrix< OrdinalType, ScalarType > &  B,
ScalarType  beta 
)

Multiply A and B and add them to this; this = beta * this + alpha*A*B or this = beta * this + alpha*B*A.

Parameters
sideA- Which side is A on for the multiplication to B, A*B (Teuchos::LEFT_SIDE) or B*A (Teuchos::RIGHT_SIDE).
alpha- The scaling factor for A * B, or B * A.
A- SerialSymDenseMatrix (a serial SPD dense matrix)
B- SerialDenseMatrix (a serial dense matrix)
beta- The scaling factor for this.

If the matrices A and B are not of the right dimension, consistent with this, then this matrix will not be altered and -1 will be returned.

Returns
Integer error code, set to 0 if successful.

Definition at line 976 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
bool Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::operator== ( const SerialDenseMatrix< OrdinalType, ScalarType > &  Operand) const

Equality of two matrices.

Returns
True if this matrix and Operand are of the same shape (rows and columns) and have the same entries, else False will be returned.

Definition at line 874 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
bool Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::operator!= ( const SerialDenseMatrix< OrdinalType, ScalarType > &  Operand) const

Inequality of two matrices.

Returns
True if this matrix and Operand of not of the same shape (rows and columns) or don't have the same entries, else False will be returned.

Definition at line 899 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
OrdinalType Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::numRows ( ) const
inline

Returns the row dimension of this matrix.

Definition at line 353 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
OrdinalType Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::numCols ( ) const
inline

Returns the column dimension of this matrix.

Definition at line 356 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
OrdinalType Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::stride ( ) const
inline

Returns the stride between the columns of this matrix in memory.

Definition at line 359 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
bool Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::empty ( ) const
inline

Returns whether this matrix is empty.

Definition at line 362 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
ScalarTraits< ScalarType >::magnitudeType Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::normOne ( ) const

Returns the 1-norm of the matrix.

Definition at line 810 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
ScalarTraits< ScalarType >::magnitudeType Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::normInf ( ) const

Returns the Infinity-norm of the matrix.

Definition at line 836 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
ScalarTraits< ScalarType >::magnitudeType Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::normFrobenius ( ) const

Returns the Frobenius-norm of the matrix.

Definition at line 854 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
std::ostream & Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::print ( std::ostream &  os) const
virtual

Print method. Defines the behavior of the std::ostream << operator.

Reimplemented in Teuchos::SerialDenseVector< OrdinalType, ScalarType >.

Definition at line 1007 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
void Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::copyMat ( ScalarType *  inputMatrix,
OrdinalType  strideInput,
OrdinalType  numRows,
OrdinalType  numCols,
ScalarType *  outputMatrix,
OrdinalType  strideOutput,
OrdinalType  startRow,
OrdinalType  startCol,
ScalarType  alpha = ScalarTraits<ScalarType>::zero() 
)
protected

Definition at line 1056 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
void Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::deleteArrays ( void  )
protected

Definition at line 1045 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType , typename ScalarType >
void Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::checkIndex ( OrdinalType  rowIndex,
OrdinalType  colIndex = 0 
) const
inlineprotected

Definition at line 1035 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
static ScalarType* Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::allocateValues ( const OrdinalType  numRows,
const OrdinalType  numCols 
)
inlinestaticprotected

Definition at line 393 of file Teuchos_SerialDenseMatrix.hpp.

Friends And Related Function Documentation

template<typename OrdinalType , typename ScalarType >
SerialDenseVector< OrdinalType, ScalarType > getCol ( DataAccess  CV,
SerialDenseMatrix< OrdinalType, ScalarType > &  A,
const OrdinalType  col 
)
related

A templated, non-member, helper function for viewing or copying a column of a SerialDenseMatrix as a SerialDenseVector.

Parameters
CV- [in] Enumerated type set to Teuchos::Copy or Teuchos::View
A- [in] SerialDenseMatrix
col- [in] Integer indicating which column of A to return
Note
The syntax for calling this function is: Teuchos::SerialDenseVector<int,double> col_j = Teuchos::getCol<int,double>( Teuchos::View, A, j )

Definition at line 163 of file Teuchos_SerialDenseHelpers.hpp.

template<typename OrdinalType , typename ScalarType >
bool setCol ( const SerialDenseVector< OrdinalType, ScalarType > &  v,
const OrdinalType  col,
SerialDenseMatrix< OrdinalType, ScalarType > &  A 
)
related

A templated, non-member, helper function for setting a SerialDenseMatrix column using a SerialDenseVector.

Parameters
v- [in] SerialDenseVector
col- [in] Integer indicating which column of A to replace with v
A- [out] SerialDenseMatrix
Note
The syntax for calling this function is: bool err = Teuchos::setCol<int,double>( v, j, A )

Definition at line 178 of file Teuchos_SerialDenseHelpers.hpp.

template<typename OrdinalType , typename ScalarType >
void randomSyncedMatrix ( Teuchos::SerialDenseMatrix< OrdinalType, ScalarType > &  A)
related

A templated, non-member, helper function for generating a random SerialDenseMatrix that is synchronized in parallel.

Parameters
A- [in/out] SerialDenseMatrix to be filled with random numbers that are the same across processors

Definition at line 195 of file Teuchos_SerialDenseHelpers.hpp.

Member Data Documentation

template<typename OrdinalType, typename ScalarType>
OrdinalType Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::numRows_ = 0
protected

Definition at line 403 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
OrdinalType Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::numCols_ = 0
protected

Definition at line 404 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
OrdinalType Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::stride_ = 0
protected

Definition at line 405 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
bool Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::valuesCopied_ = false
protected

Definition at line 406 of file Teuchos_SerialDenseMatrix.hpp.

template<typename OrdinalType, typename ScalarType>
ScalarType* Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::values_ = nullptr
protected

Definition at line 407 of file Teuchos_SerialDenseMatrix.hpp.


The documentation for this class was generated from the following files: