SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWSymMat< TypeT > Class Template Reference

Represents a symmetric matrix. More...

#include <rw/lapack/symmat.h>

Public Member Functions

 RWSymMat ()
 
 RWSymMat (const RWMathVec< TypeT > &data, unsigned n, unsigned nAgain)
 
 RWSymMat (const RWSymMat< double > &re, const RWSymMat< double > &im)
 
 RWSymMat (const RWSymMat< TypeT > &A)
 
 RWSymMat (const typename rw_linear_algebra_traits< TypeT >::generic_sym_mat &re)
 
 RWSymMat (unsigned n, unsigned nAgain)
 
 RWSymMat (unsigned n, unsigned nAgain, TypeT initval)
 
RWSymMat< TypeT > apply (typename rw_linear_algebra_traits< TypeT >::lapkFunType func) const
 
TypeT & bcref (int i, int j)
 
TypeT bcset (int i, int j, TypeT x)
 
TypeT bcval (int i, int j) const
 
unsigned binaryStoreSize () const
 
unsigned cols () const
 
RWSymMat< TypeT > copy () const
 
TypeT * data ()
 
RWMathVec< TypeT > dataVec ()
 
RWSymMat< TypeT > deepCopy () const
 
void deepenShallowCopy ()
 
RWSymMat< TypeT > leadingSubmatrix (int k)
 
bool operator!= (const RWSymMat< TypeT > &X)
 
TypeT & operator() (int i, int j)
 
TypeT operator() (int i, int j) const
 
RWSymMat< TypeT > & operator*= (const RWSymMat< TypeT > &A)
 
RWSymMat< TypeT > & operator*= (TypeT x)
 
RWSymMat< TypeT > & operator++ ()
 
RWSymMat< TypeT > & operator+= (const RWSymMat< TypeT > &A)
 
RWSymMat< TypeT > & operator+= (TypeT x)
 
RWSymMat< TypeT > & operator-- ()
 
RWSymMat< TypeT > & operator-= (const RWSymMat< TypeT > &A)
 
RWSymMat< TypeT > & operator-= (TypeT x)
 
RWSymMat< TypeT > & operator/= (const RWSymMat< TypeT > &A)
 
RWSymMat< TypeT > & operator/= (TypeT x)
 
RWSymMat< TypeT > & operator= (const RWSymMat< TypeT > &A)
 
RWSymMat< TypeT > & operator= (TypeT x)
 
bool operator== (const RWSymMat< TypeT > &X)
 
void printOn (std::ostream &) const
 
TypeT & ref (int i, int j)
 
RWSymMat< TypeT > & reference (RWSymMat< TypeT > &m)
 
void resize (unsigned n, unsigned nAgain)
 
void restoreFrom (RWFile &)
 
void restoreFrom (RWvistream &)
 
unsigned rows () const
 
void saveOn (RWFile &) const
 
void saveOn (RWvostream &) const
 
void scanFrom (std::istream &)
 
TypeT set (int i, int j, TypeT x)
 
TypeT val (int i, int j) const
 
void zero ()
 

Related Symbols

(Note that these are not member symbols.)

template<class TypeT >
RWSymMat< typename rw_numeric_traits< TypeT >::norm_type > abs (const RWSymMat< TypeT > &M)
 
RWSymMat< double > arg (const RWSymMat< DComplex > &A)
 
RWSymMat< double > atan2 (const RWSymMat< double > &, const RWSymMat< double > &)
 
RWSymMat< float > atan2 (const RWSymMat< float > &, const RWSymMat< float > &)
 
RWSymMat< DComplexconj (const RWSymMat< DComplex > &A)
 
RWSymMat< double > imag (const RWSymMat< DComplex > &A)
 
template<class TypeT >
RWSymMat< TypeT > lowerToSymMat (const RWGenMat< TypeT > &A)
 
double maxValue (const RWSymMat< double > &A)
 
float maxValue (const RWSymMat< float > &A)
 
double minValue (const RWSymMat< double > &A)
 
float minValue (const RWSymMat< float > &A)
 
RWSymMat< double > norm (const RWSymMat< DComplex > &A)
 
template<class TypeT >
RWSymMat< TypeT > operator* (const RWSymMat< TypeT > &, const RWSymMat< TypeT > &)
 
template<class TypeT >
RWSymMat< TypeT > operator* (const RWSymMat< TypeT > &A, TypeT x)
 
template<class TypeT >
RWSymMat< TypeT > operator* (TypeT x, const RWSymMat< TypeT > &A)
 
template<class TypeT >
RWSymMat< TypeT > operator+ (const RWSymMat< TypeT > &)
 
template<class TypeT >
RWSymMat< TypeT > operator+ (const RWSymMat< TypeT > &, const RWSymMat< TypeT > &)
 
template<class TypeT >
RWSymMat< TypeT > operator+ (const RWSymMat< TypeT > &A, TypeT x)
 
template<class TypeT >
RWSymMat< TypeT > operator+ (TypeT x, const RWSymMat< TypeT > &A)
 
template<class TypeT >
RWSymMat< TypeT > operator- (const RWSymMat< TypeT > &)
 
template<class TypeT >
RWSymMat< TypeT > operator- (const RWSymMat< TypeT > &, const RWSymMat< TypeT > &)
 
template<class TypeT >
RWSymMat< TypeT > operator- (const RWSymMat< TypeT > &A, TypeT x)
 
template<class TypeT >
RWSymMat< TypeT > operator- (TypeT x, const RWSymMat< TypeT > &A)
 
template<class TypeT >
RWSymMat< TypeT > operator/ (const RWSymMat< TypeT > &, const RWSymMat< TypeT > &)
 
template<class TypeT >
RWSymMat< TypeT > operator/ (const RWSymMat< TypeT > &A, TypeT x)
 
template<class TypeT >
RWSymMat< TypeT > operator/ (TypeT x, const RWSymMat< TypeT > &A)
 
template<class TypeT >
std::ostream & operator<< (std::ostream &s, const RWSymMat< TypeT > &m)
 
template<class TypeT >
std::istream & operator>> (std::istream &s, RWSymMat< TypeT > &m)
 
template<class TypeT >
RWMathVec< TypeT > product (const RWMathVec< TypeT > &x, const RWSymMat< TypeT > &A)
 
template<class TypeT >
RWMathVec< TypeT > product (const RWSymMat< TypeT > &A, const RWMathVec< TypeT > &x)
 
RWSymMat< double > real (const RWSymMat< DComplex > &A)
 
template<class TypeT >
RWSymMat< TypeT > toSymMat (const RWGenMat< TypeT > &A)
 
template<class TypeT >
RWSymMat< TypeT > transpose (const RWSymMat< TypeT > &)
 
template<class TypeT >
RWSymMat< TypeT > upperToSymMat (const RWGenMat< TypeT > &A)
 

Detailed Description

template<class TypeT>
class RWSymMat< TypeT >

The class RWSymMat represents symmetric matrices. A symmetric matrix is defined by the requirement that \( A_{ij} = A_{ji} \), and so a symmetric matrix is equal to its transpose.

Synopsis
#include <rw/lapack/symmat.h>
Represents a symmetric matrix.
Definition symmat.h:112
Example
#include <rw/lapack/symmat.h>
int main() {
RWSymMat<double> S(4, 4, 3.1); // initialize to 3.1
RWSymMat<double> A = 4.0 * S;
return 0;
}

Storage Scheme

The upper triangle of the matrix is stored in column major order. The lower triangle is then calculated implicitly. This storage scheme was chosen so that the leading part of the matrix was always located in contiguous memory.

For example, given the following symmetric matrix:

\[ \begin{bmatrix} A_{11} & A_{12} & A_{13} & \dots & A_{1n} \\ A_{12} & A_{22} & A_{23} & \dots & A_{2n} \\ A_{13} & A_{23} & A_{33} & \dots & A_{3n} \\ \vdots \\ A_{1n} & A_{2n} & A_{3n} & \dots & A_{nn} \end{bmatrix} \]

The data is stored in the following order:

\[ \left[ \begin{array}{cccccccccccc} A_{11} & A_{12} & A_{22} & A_{13} & A_{23} & A_{33} & \dots & A_{1n} & A_{2n} & A_{3n} & \dots & A_{nn} \end{array} \right] \]

The mapping between the array and storage vector is as follows:

\[ A(i+1, j+1) \to \begin{cases} \text{vec}[j(j+1)/2+i], & i \leq j \\ \text{vec}[i(i+1)/2+j], & j \leq i \end{cases} \]

Constructor & Destructor Documentation

◆ RWSymMat() [1/7]

template<class TypeT >
RWSymMat< TypeT >::RWSymMat ( )

Default constructor. Builds a matrix of size 0 x 0. This constructor is necessary to declare a matrix with no explicit constructor or to declare an array of matrices.

◆ RWSymMat() [2/7]

template<class TypeT >
RWSymMat< TypeT >::RWSymMat ( const RWSymMat< TypeT > & A)

Builds a copy of its parameter, A. Note that the new matrix references A's data. To construct a matrix with its own copy of the data, you can use either the copy() or deepenShallowCopy() member functions.

◆ RWSymMat() [3/7]

template<class TypeT >
RWSymMat< TypeT >::RWSymMat ( unsigned n,
unsigned nAgain )

Defines an uninitialized matrix of size n x nAgain. Both parameters must be equal or a runtime error occurs. This constructor is used, rather than a constructor that takes only a single parameter, to avoid type conversion problems.

◆ RWSymMat() [4/7]

template<class TypeT >
RWSymMat< TypeT >::RWSymMat ( unsigned n,
unsigned nAgain,
TypeT initval )

Defines a matrix of size n x nAgain where each element is initialized to initval. Both parameters must be equal or a runtime error occurs.

◆ RWSymMat() [5/7]

template<class TypeT >
RWSymMat< TypeT >::RWSymMat ( const RWMathVec< TypeT > & data,
unsigned n,
unsigned nAgain )

Constructs a size n x nAgain matrix using the data in the passed vector. This data must be stored in the format described in the Storage Scheme section. The resultant matrix references the data in vector data.

◆ RWSymMat() [6/7]

template<class TypeT >
RWSymMat< TypeT >::RWSymMat ( const typename rw_linear_algebra_traits< TypeT >::generic_sym_mat & re)

Constructs a complex matrix from the real part supplied. Imaginary part is assumed to be 0.

◆ RWSymMat() [7/7]

template<class TypeT >
RWSymMat< TypeT >::RWSymMat ( const RWSymMat< double > & re,
const RWSymMat< double > & im )

Constructs a complex matrix from the real and imaginary parts supplied.

Member Function Documentation

◆ apply()

template<class TypeT >
RWSymMat< TypeT > RWSymMat< TypeT >::apply ( typename rw_linear_algebra_traits< TypeT >::lapkFunType func) const

Returns the result of applying the passed function func to every element in the matrix. If TypeT is DComplex, func takes and returns a DComplex. For all other TypeT, func takes and returns a double.

◆ bcref()

template<class TypeT >
TypeT & RWSymMat< TypeT >::bcref ( int i,
int j )

Returns a reference to the ij th element of the matrix, after doing bounds checking.

◆ bcset()

template<class TypeT >
TypeT RWSymMat< TypeT >::bcset ( int i,
int j,
TypeT x )

Sets the ij th element of the matrix equal to x, after doing bounds checking.

◆ bcval()

template<class TypeT >
TypeT RWSymMat< TypeT >::bcval ( int i,
int j ) const

Returns the value of the ij th element of the matrix, after doing bounds checking.

◆ binaryStoreSize()

template<class TypeT >
unsigned RWSymMat< TypeT >::binaryStoreSize ( ) const

Returns the number of bytes that it would take to write the matrix to a file using saveOn().

◆ cols()

template<class TypeT >
unsigned RWSymMat< TypeT >::cols ( ) const
inline

Returns the number of columns in the matrix.

◆ copy()

template<class TypeT >
RWSymMat< TypeT > RWSymMat< TypeT >::copy ( ) const

Creates a copy of this matrix with distinct data. The stride of the data vector in the new matrix is guaranteed to be 1.

◆ data()

template<class TypeT >
TypeT * RWSymMat< TypeT >::data ( )
inline

Returns a pointer to the first item of data in the vector storing the matrix's data. You can use this (with caution!) to pass the matrix's data to C or FORTRAN subroutines. Be aware that the stride of the data vector may not be 1.

◆ dataVec()

template<class TypeT >
RWMathVec< TypeT > RWSymMat< TypeT >::dataVec ( )
inline

Returns the matrix's data vector. This is where the explicitly stored entries in the matrix are kept.

◆ deepCopy()

template<class TypeT >
RWSymMat< TypeT > RWSymMat< TypeT >::deepCopy ( ) const
inline

Creates a copy of this matrix with distinct data. The stride of the data vector in the new matrix is guaranteed to be 1.

◆ deepenShallowCopy()

template<class TypeT >
void RWSymMat< TypeT >::deepenShallowCopy ( )
inline

Ensures that the data in the matrix is not shared by any other matrix or vector. Also ensures that the stride in the data vector is equal to 1. If necessary, a new copy of the data vector is made.

◆ leadingSubmatrix()

template<class TypeT >
RWSymMat< TypeT > RWSymMat< TypeT >::leadingSubmatrix ( int k)

Returns the k x k upper left corner of the matrix. The submatrix and the matrix share the same data.

◆ operator!=()

template<class TypeT >
bool RWSymMat< TypeT >::operator!= ( const RWSymMat< TypeT > & X)
inline

Boolean operator. Two matrices are considered equal if they have the same size and their elements are all exactly the same. Be aware that floating point arithmetic is not exact; matrices that are theoretically equal are not always numerically equal.

◆ operator()() [1/2]

template<class TypeT >
TypeT & RWSymMat< TypeT >::operator() ( int i,
int j )
inline

Accesses the ij th element when self is not a const matrix. A reference type is returned, so this operator can be used for assigning or accessing an element. Using this operator is equivalent to calling the ref() member function. Bounds checking is done if the preprocessor symbol RWBOUNDS_CHECK is defined before including the header file.

◆ operator()() [2/2]

template<class TypeT >
TypeT RWSymMat< TypeT >::operator() ( int i,
int j ) const
inline

Accesses the ij th element when self is a const matrix. A value is returned, so this operator can be used only for accessing an element. Using this operator is equivalent to calling the val() member function. Bounds checking is done if the preprocessor symbol RWBOUNDS_CHECK is defined before including the header file.

◆ operator*=() [1/2]

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator*= ( const RWSymMat< TypeT > & A)

Performs element-by-element arithmetic on the data in the matrices.

Note
For matrix-matrix inner product multiplication, use the product() global function.

◆ operator*=() [2/2]

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator*= ( TypeT x)

Performs the indicated operation on each element of the matrix.

◆ operator++()

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator++ ( )

Increments each element in the matrix.

◆ operator+=() [1/2]

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator+= ( const RWSymMat< TypeT > & A)

Performs element-by-element arithmetic on the data in the matrices.

◆ operator+=() [2/2]

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator+= ( TypeT x)

Performs the indicated operation on each element of the matrix.

◆ operator--()

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator-- ( )

Decrements each element in the matrix.

◆ operator-=() [1/2]

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator-= ( const RWSymMat< TypeT > & A)

Performs element-by-element arithmetic on the data in the matrices.

◆ operator-=() [2/2]

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator-= ( TypeT x)

Performs the indicated operation on each element of the matrix.

◆ operator/=() [1/2]

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator/= ( const RWSymMat< TypeT > & A)

Performs element-by-element arithmetic on the data in the matrices.

◆ operator/=() [2/2]

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator/= ( TypeT x)

Performs the indicated operation on each element of the matrix.

◆ operator=() [1/2]

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator= ( const RWSymMat< TypeT > & A)

Sets the matrix elements equal to the elements of A. The two matrices must be the same size. To make the matrix reference the same data as A, you can use the reference() member function.

◆ operator=() [2/2]

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::operator= ( TypeT x)
inline

Sets each element in the matrix equal to x.

◆ operator==()

template<class TypeT >
bool RWSymMat< TypeT >::operator== ( const RWSymMat< TypeT > & X)

Boolean operator. Two matrices are considered equal if they have the same size and their elements are all exactly the same. Be aware that floating point arithmetic is not exact; matrices that are theoretically equal are not always numerically equal.

◆ printOn()

template<class TypeT >
void RWSymMat< TypeT >::printOn ( std::ostream & ) const

Prints the matrix to an output stream in human readable format.

◆ ref()

template<class TypeT >
TypeT & RWSymMat< TypeT >::ref ( int i,
int j )
inline

Returns a reference to the ij th element of the matrix. Bounds checking is done if the preprocessor symbol RWBOUNDS_CHECK is defined when the header file is read. The member function bcref() does the same thing with guaranteed bounds checking.

◆ reference()

template<class TypeT >
RWSymMat< TypeT > & RWSymMat< TypeT >::reference ( RWSymMat< TypeT > & m)

Makes this matrix a reference to the parameter matrix. The two matrices share the same data. The matrices do not have to be the same size before calling reference(). To copy a matrix into another of the same size, use the operator=() member operator.

◆ resize()

template<class TypeT >
void RWSymMat< TypeT >::resize ( unsigned n,
unsigned nAgain )

Resizes the matrix. Any new entries in the matrix are set to 0. Both parameters must be the same.

◆ restoreFrom() [1/2]

template<class TypeT >
void RWSymMat< TypeT >::restoreFrom ( RWFile & )

Reads in a matrix from an RWFile. The matrix must have been stored to the file using the saveOn() member function.

◆ restoreFrom() [2/2]

template<class TypeT >
void RWSymMat< TypeT >::restoreFrom ( RWvistream & )

Reads in a matrix from an RWvistream, the Rogue Wave virtual input stream class. The matrix must have been stored to the stream using the saveOn() member function.

◆ rows()

template<class TypeT >
unsigned RWSymMat< TypeT >::rows ( ) const
inline

Returns the number of rows in the matrix.

◆ saveOn() [1/2]

template<class TypeT >
void RWSymMat< TypeT >::saveOn ( RWFile & ) const

Stores a matrix to an RWFile. The matrix can be read using the restoreFrom() member function.

◆ saveOn() [2/2]

template<class TypeT >
void RWSymMat< TypeT >::saveOn ( RWvostream & ) const

Stores a matrix to an RWvostream, the Rogue Wave virtual output stream class. The matrix can be read using the restoreFrom() member function.

◆ scanFrom()

template<class TypeT >
void RWSymMat< TypeT >::scanFrom ( std::istream & )

Reads a matrix from an input stream. The format of the matrix is the same as the format output by the printOn() member function. Below is a sample matrix that could be input. Note that extra white space and any text preceding the dimension specification are ignored. Only the symmetric part of the matrix is used.

3x3 [ 4 5 7
5 9 5
7 5 3 ]

◆ set()

template<class TypeT >
TypeT RWSymMat< TypeT >::set ( int i,
int j,
TypeT x )
inline

Sets the ij th element of the matrix equal to x. Bounds checking is done if the preprocessor symbol RWBOUNDS_CHECK is defined when the header file is read. The member function bcset() does the same thing with guaranteed bounds checking.

◆ val()

template<class TypeT >
TypeT RWSymMat< TypeT >::val ( int i,
int j ) const
inline

Returns the value of the ij th element of the matrix. Bounds checking is done if the preprocessor symbol RWBOUNDS_CHECK is defined when the header file is read. The member function bcval() does the same thing with guaranteed bounds checking.

◆ zero()

template<class TypeT >
void RWSymMat< TypeT >::zero ( )
inline

Sets every element of the matrix to 0.

Friends And Related Symbol Documentation

◆ abs()

template<class TypeT >
RWSymMat< typename rw_numeric_traits< TypeT >::norm_type > abs ( const RWSymMat< TypeT > & M)
related

Returns a matrix whose entries are the absolute value of the parameter. The absolute value of a complex number is considered to be the sum of the absolute values of its real and imaginary parts. To get the norm of a complex matrix, you can use the norm() function.

◆ arg()

template<class TypeT >
RWSymMat< double > arg ( const RWSymMat< DComplex > & A)
related

Returns a matrix where each element is the argument of the corresponding element in the matrix A.

◆ atan2() [1/2]

template<class TypeT >
RWSymMat< double > atan2 ( const RWSymMat< double > & ,
const RWSymMat< double > &  )
related

Returns a matrix where each element is formed by applying the appropriate function to corresponding elements of the parameter matrices.

◆ atan2() [2/2]

template<class TypeT >
RWSymMat< float > atan2 ( const RWSymMat< float > & ,
const RWSymMat< float > &  )
related

Returns a matrix where each element is formed by applying the appropriate function to corresponding elements of the parameter matrices.

◆ conj()

template<class TypeT >
RWSymMat< DComplex > conj ( const RWSymMat< DComplex > & A)
related

Returns a matrix where each element is the complex conjugate of the corresponding element in the matrix A.

◆ imag()

template<class TypeT >
RWSymMat< double > imag ( const RWSymMat< DComplex > & A)
related

Returns a matrix where each element is the imaginary part of the corresponding element in the matrix A.

◆ lowerToSymMat()

template<class TypeT >
RWSymMat< TypeT > lowerToSymMat ( const RWGenMat< TypeT > & A)
related

Builds a symmetric matrix that matches the lower triangular part of A. The upper triangle of A is not referenced.

◆ maxValue() [1/2]

template<class TypeT >
double maxValue ( const RWSymMat< double > & A)
related

Returns the maximum entry in the matrix.

◆ maxValue() [2/2]

template<class TypeT >
float maxValue ( const RWSymMat< float > & A)
related

Returns the maximum entry in the matrix.

◆ minValue() [1/2]

template<class TypeT >
double minValue ( const RWSymMat< double > & A)
related

Returns the minimum entry in the matrix.

◆ minValue() [2/2]

template<class TypeT >
float minValue ( const RWSymMat< float > & A)
related

Returns the minimum entry in the matrix.

◆ norm()

template<class TypeT >
RWSymMat< double > norm ( const RWSymMat< DComplex > & A)
related

Returns a matrix where each element is the norm (magnitude) of the corresponding element in the matrix A.

◆ operator*() [1/3]

template<class TypeT >
RWSymMat< TypeT > operator* ( const RWSymMat< TypeT > & ,
const RWSymMat< TypeT > &  )
related

Performs element-by-element operations on the parameters. To do inner product matrix multiplication, you can use the product() global function.

◆ operator*() [2/3]

template<class TypeT >
RWSymMat< TypeT > operator* ( const RWSymMat< TypeT > & A,
TypeT x )
related

Performs element-by-element operations on the parameters.

◆ operator*() [3/3]

template<class TypeT >
RWSymMat< TypeT > operator* ( TypeT x,
const RWSymMat< TypeT > & A )
related

Performs element-by-element operations on the parameters.

◆ operator+() [1/4]

template<class TypeT >
RWSymMat< TypeT > operator+ ( const RWSymMat< TypeT > & )
related

Unary plus operator. Returns a copy of the matrix.

◆ operator+() [2/4]

template<class TypeT >
RWSymMat< TypeT > operator+ ( const RWSymMat< TypeT > & ,
const RWSymMat< TypeT > &  )
related

Performs element-by-element operations on the parameters.

◆ operator+() [3/4]

template<class TypeT >
RWSymMat< TypeT > operator+ ( const RWSymMat< TypeT > & A,
TypeT x )
related

Performs element-by-element operations on the parameters.

◆ operator+() [4/4]

template<class TypeT >
RWSymMat< TypeT > operator+ ( TypeT x,
const RWSymMat< TypeT > & A )
related

Performs element-by-element operations on the parameters.

◆ operator-() [1/4]

template<class TypeT >
RWSymMat< TypeT > operator- ( const RWSymMat< TypeT > & )
related

Unary minus operator. Returns negation of the matrix.

◆ operator-() [2/4]

template<class TypeT >
RWSymMat< TypeT > operator- ( const RWSymMat< TypeT > & ,
const RWSymMat< TypeT > &  )
related

Performs element-by-element operations on the parameters.

◆ operator-() [3/4]

template<class TypeT >
RWSymMat< TypeT > operator- ( const RWSymMat< TypeT > & A,
TypeT x )
related

Performs element-by-element operations on the parameters.

◆ operator-() [4/4]

template<class TypeT >
RWSymMat< TypeT > operator- ( TypeT x,
const RWSymMat< TypeT > & A )
related

Performs element-by-element operations on the parameters.

◆ operator/() [1/3]

template<class TypeT >
RWSymMat< TypeT > operator/ ( const RWSymMat< TypeT > & ,
const RWSymMat< TypeT > &  )
related

Performs element-by-element operations on the parameters.

◆ operator/() [2/3]

template<class TypeT >
RWSymMat< TypeT > operator/ ( const RWSymMat< TypeT > & A,
TypeT x )
related

Performs element-by-element operations on the parameters.

◆ operator/() [3/3]

template<class TypeT >
RWSymMat< TypeT > operator/ ( TypeT x,
const RWSymMat< TypeT > & A )
related

Performs element-by-element operations on the parameters.

◆ operator<<()

template<class TypeT >
std::ostream & operator<< ( std::ostream & s,
const RWSymMat< TypeT > & m )
related

Writes the matrix to the stream. This is equivalent to calling the printOn() member function.

◆ operator>>()

template<class TypeT >
std::istream & operator>> ( std::istream & s,
RWSymMat< TypeT > & m )
related

Reads the matrix from the stream. This is equivalent to calling the scanFrom() member function.

◆ product() [1/2]

template<class TypeT >
RWMathVec< TypeT > product ( const RWMathVec< TypeT > & x,
const RWSymMat< TypeT > & A )
related

Returns the inner product (matrix-vector product) of x and A. This is equal to the product of A transpose and x.

◆ product() [2/2]

template<class TypeT >
RWMathVec< TypeT > product ( const RWSymMat< TypeT > & A,
const RWMathVec< TypeT > & x )
related

Returns the inner product (matrix-vector product) of A and x.

◆ real()

template<class TypeT >
RWSymMat< double > real ( const RWSymMat< DComplex > & A)
related

Returns a matrix where each element is the real part of the corresponding element in the matrix A.

◆ toSymMat()

template<class TypeT >
RWSymMat< TypeT > toSymMat ( const RWGenMat< TypeT > & A)
related

Extracts the symmetric part of a square matrix. The symmetric part of matrix A is \( (A+A^{T})/2 \).

◆ transpose()

template<class TypeT >
RWSymMat< TypeT > transpose ( const RWSymMat< TypeT > & )
related

Returns the transpose of the parameter matrix. Since a symmetric matrix is its own transpose, this function just returns itself.

◆ upperToSymMat()

template<class TypeT >
RWSymMat< TypeT > upperToSymMat ( const RWGenMat< TypeT > & A)
related

Builds a symmetric matrix that matches the upper triangular part of A. The lower triangle of A is not referenced.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.