queso-0.53.0
Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
QUESO::Matrix Class Referenceabstract

Class for matrix operations (virtual). More...

#include <Matrix.h>

Inheritance diagram for QUESO::Matrix:
Inheritance graph
[legend]
Collaboration diagram for QUESO::Matrix:
Collaboration graph
[legend]

Public Member Functions

Constructor/Destructor methods
 Matrix (const BaseEnvironment &env, const Map &map)
 Shaped constructor. More...
 
virtual ~Matrix ()
 Virtual Destructor. More...
 
Environment and Map methods
const BaseEnvironmentenv () const
 
const Mapmap () const
 
unsigned int numOfProcsForStorage () const
 
Attribute methods
virtual unsigned int numRowsLocal () const =0
 Returns the number of rows local of the matrix. More...
 
virtual unsigned int numRowsGlobal () const =0
 Returns the number of rows global of the matrix. More...
 
virtual unsigned int numCols () const =0
 Returns the number of columns local of the matrix. More...
 
Mathematical methods
virtual int chol ()=0
 Performs Cholesky factorization of the matrix. More...
 
Get/Set methods
virtual void zeroLower (bool includeDiagonal=false)=0
 Sets to zero all the elements bellow (including or not) the diagonal of the matrix. More...
 
virtual void zeroUpper (bool includeDiagonal=false)=0
 Sets to zero all the elements above (including or not) the diagonal of the matrix. More...
 
I/O and Miscellaneous methods
virtual void print (std::ostream &os) const =0
 Print this matrix. More...
 
void setPrintHorizontally (bool value) const
 Determines whether the matrix should be printed horizontally. More...
 
bool getPrintHorizontally () const
 Checks if matrix will be is printed horizontally. More...
 
void setInDebugMode (bool value) const
 Determines whether QUESO will run through this class in debug mode. More...
 
bool getInDebugMode () const
 Checks if QUESO will run through this class in debug mode. More...
 

Protected Member Functions

virtual void base_copy (const Matrix &src)
 Copies base data from matrix src to this matrix. More...
 

Protected Attributes

const BaseEnvironmentm_env
 QUESO environment variable. More...
 
const Mapm_map
 Mapping variable. More...
 
bool m_printHorizontally
 Flag for either or not print this matrix. More...
 
bool m_inDebugMode
 Flag for either or not QUESO is in debug mode. More...
 

Private Member Functions

 Matrix ()
 Default constructor. More...
 

Detailed Description

Class for matrix operations (virtual).

Base matrix class. The matrix class is an abstract class designed to be used as a base class for different matrix implementations (all actual matrix classes in QUESO).

Definition at line 46 of file Matrix.h.

Constructor & Destructor Documentation

QUESO::Matrix::Matrix ( const BaseEnvironment env,
const Map map 
)

Shaped constructor.

Definition at line 31 of file Matrix.C.

32  :
33  m_env (env),
34  m_map (map),
35  m_printHorizontally(true),
36  m_inDebugMode (false)
37 {
38 }
const BaseEnvironment & m_env
QUESO environment variable.
Definition: Matrix.h:116
bool m_printHorizontally
Flag for either or not print this matrix.
Definition: Matrix.h:131
const BaseEnvironment & env() const
Definition: Matrix.C:47
const Map & m_map
Mapping variable.
Definition: Matrix.h:126
bool m_inDebugMode
Flag for either or not QUESO is in debug mode.
Definition: Matrix.h:134
const Map & map() const
Definition: Matrix.C:54
QUESO::Matrix::~Matrix ( )
virtual

Virtual Destructor.

Definition at line 41 of file Matrix.C.

42 {
43 }
QUESO::Matrix::Matrix ( )
private

Default constructor.

Member Function Documentation

void QUESO::Matrix::base_copy ( const Matrix src)
protectedvirtual

Copies base data from matrix src to this matrix.

Definition at line 99 of file Matrix.C.

References m_inDebugMode, and m_printHorizontally.

Referenced by QUESO::GslMatrix::GslMatrix().

100 {
101  //m_env = src.env;
102  //m_map = src.map;
103  m_printHorizontally = src.m_printHorizontally;
104  m_inDebugMode = src.m_inDebugMode;
105 
106  return;
107 }
bool m_printHorizontally
Flag for either or not print this matrix.
Definition: Matrix.h:131
bool m_inDebugMode
Flag for either or not QUESO is in debug mode.
Definition: Matrix.h:134
virtual int QUESO::Matrix::chol ( )
pure virtual

Performs Cholesky factorization of the matrix.

Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.

const BaseEnvironment & QUESO::Matrix::env ( ) const

Definition at line 47 of file Matrix.C.

References m_env.

Referenced by QUESO::GslMatrix::mpiSum(), and QUESO::operator*().

48 {
49  return m_env;
50 }
const BaseEnvironment & m_env
QUESO environment variable.
Definition: Matrix.h:116
bool QUESO::Matrix::getInDebugMode ( ) const

Checks if QUESO will run through this class in debug mode.

Definition at line 92 of file Matrix.C.

References m_inDebugMode.

93 {
94  return m_inDebugMode;
95 }
bool m_inDebugMode
Flag for either or not QUESO is in debug mode.
Definition: Matrix.h:134
bool QUESO::Matrix::getPrintHorizontally ( ) const

Checks if matrix will be is printed horizontally.

Definition at line 77 of file Matrix.C.

References m_printHorizontally.

78 {
79  return m_printHorizontally;
80 }
bool m_printHorizontally
Flag for either or not print this matrix.
Definition: Matrix.h:131
const Map & QUESO::Matrix::map ( ) const

Definition at line 54 of file Matrix.C.

References m_map.

Referenced by QUESO::GslMatrix::internalSvd(), QUESO::operator*(), and QUESO::GslMatrix::svdSolve().

55 {
56  return m_map;
57  //return (const Map&) (m_mat->Map());
58 }
const Map & m_map
Mapping variable.
Definition: Matrix.h:126
virtual unsigned int QUESO::Matrix::numCols ( ) const
pure virtual

Returns the number of columns local of the matrix.

Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.

unsigned int QUESO::Matrix::numOfProcsForStorage ( ) const

Definition at line 62 of file Matrix.C.

References QUESO::Map::Comm(), m_map, and QUESO::MpiComm::NumProc().

Referenced by QUESO::GslMatrix::subReadContents(), and QUESO::GslMatrix::subWriteContents().

63 {
64  return m_map.Comm().NumProc();
65 }
const MpiComm & Comm() const
Access function for MpiComm communicator.
Definition: Map.C:131
int NumProc() const
Returns total number of processes.
Definition: MpiComm.C:103
const Map & m_map
Mapping variable.
Definition: Matrix.h:126
virtual unsigned int QUESO::Matrix::numRowsGlobal ( ) const
pure virtual

Returns the number of rows global of the matrix.

Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.

virtual unsigned int QUESO::Matrix::numRowsLocal ( ) const
pure virtual

Returns the number of rows local of the matrix.

Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.

virtual void QUESO::Matrix::print ( std::ostream &  os) const
pure virtual

Print this matrix.

Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.

void QUESO::Matrix::setInDebugMode ( bool  value) const

Determines whether QUESO will run through this class in debug mode.

Definition at line 84 of file Matrix.C.

References m_inDebugMode.

85 {
86  m_inDebugMode = value;
87  return;
88 }
bool m_inDebugMode
Flag for either or not QUESO is in debug mode.
Definition: Matrix.h:134
void QUESO::Matrix::setPrintHorizontally ( bool  value) const

Determines whether the matrix should be printed horizontally.

Definition at line 69 of file Matrix.C.

References m_printHorizontally.

70 {
71  m_printHorizontally = value;
72  return;
73 }
bool m_printHorizontally
Flag for either or not print this matrix.
Definition: Matrix.h:131
virtual void QUESO::Matrix::zeroLower ( bool  includeDiagonal = false)
pure virtual

Sets to zero all the elements bellow (including or not) the diagonal of the matrix.

Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.

virtual void QUESO::Matrix::zeroUpper ( bool  includeDiagonal = false)
pure virtual

Sets to zero all the elements above (including or not) the diagonal of the matrix.

Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.

Member Data Documentation

const BaseEnvironment& QUESO::Matrix::m_env
protected
bool QUESO::Matrix::m_inDebugMode
mutableprotected

Flag for either or not QUESO is in debug mode.

Definition at line 134 of file Matrix.h.

Referenced by base_copy(), getInDebugMode(), QUESO::GslMatrix::invertMultiply(), and setInDebugMode().

const Map& QUESO::Matrix::m_map
protected
bool QUESO::Matrix::m_printHorizontally
mutableprotected

Flag for either or not print this matrix.

Definition at line 131 of file Matrix.h.

Referenced by base_copy(), getPrintHorizontally(), QUESO::GslMatrix::print(), and setPrintHorizontally().


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

Generated on Thu Jun 11 2015 13:52:34 for queso-0.53.0 by  doxygen 1.8.5