queso-0.55.0
Matrix.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_MATRIX_H
26 #define UQ_MATRIX_H
27 
28 #include <queso/Environment.h>
29 #include <queso/Vector.h>
30 #include <iostream>
31 
32 namespace QUESO {
33 
46 class Matrix
47 {
48 public:
50 
51  Matrix(const BaseEnvironment& env, const Map& map);
53 
55  virtual ~Matrix();
57 
59 
60  const BaseEnvironment& env () const;
61  const Map& map () const;
62  unsigned int numOfProcsForStorage() const;
64 
66 
67  virtual unsigned int numRowsLocal () const = 0;
69 
71  virtual unsigned int numRowsGlobal () const = 0;
72 
74  virtual unsigned int numCols () const = 0;
76 
78 
79  virtual int chol () = 0;
82 
83 
85 
86  virtual void zeroLower (bool includeDiagonal = false) = 0;
88 
90  virtual void zeroUpper (bool includeDiagonal = false) = 0;
92 
94 
95  virtual void print (std::ostream& os) const = 0;
97 
99  void setPrintHorizontally(bool value) const; // Yes, 'const'
100 
102  bool getPrintHorizontally() const;
103 
105  void setInDebugMode (bool value) const; // Yes, 'const'
106 
108  bool getInDebugMode () const;
110 
111 protected:
113  virtual void base_copy (const Matrix& src);
114 
117 
118 #ifdef QUESO_CLASSES_INSTANTIATE_NEW_MAPS
119 
121  const Map m_map;
122 
123 #else
124 
126  const Map& m_map;
127 
128 #endif
129 
131  mutable bool m_printHorizontally;
132 
134  mutable bool m_inDebugMode;
135 
136 private:
138  Matrix();
139 };
140 
141 } // End namespace QUESO
142 
143 #endif // UQ_MATRIX_H
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
const Map & m_map
Mapping variable.
Definition: Matrix.h:126
Class for matrix operations (virtual).
Definition: Matrix.h:46
bool getInDebugMode() const
Checks if QUESO will run through this class in debug mode.
Definition: Matrix.C:92
A class for partitioning vectors and matrices.
Definition: Map.h:49
const Map & map() const
Definition: Matrix.C:54
bool getPrintHorizontally() const
Checks if matrix will be is printed horizontally.
Definition: Matrix.C:77
virtual void zeroUpper(bool includeDiagonal=false)=0
Sets to zero all the elements above (including or not) the diagonal of the matrix.
void setPrintHorizontally(bool value) const
Determines whether the matrix should be printed horizontally.
Definition: Matrix.C:69
Matrix()
Default constructor.
virtual void print(std::ostream &os) const =0
Print this matrix.
virtual int chol()=0
Performs Cholesky factorization of the matrix.
virtual unsigned int numRowsGlobal() const =0
Returns the number of rows global of the matrix.
const BaseEnvironment & env() const
Definition: Matrix.C:47
virtual void zeroLower(bool includeDiagonal=false)=0
Sets to zero all the elements bellow (including or not) the diagonal of the matrix.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:193
void setInDebugMode(bool value) const
Determines whether QUESO will run through this class in debug mode.
Definition: Matrix.C:84
unsigned int numOfProcsForStorage() const
Definition: Matrix.C:62
const BaseEnvironment & m_env
QUESO environment variable.
Definition: Matrix.h:116
virtual unsigned int numCols() const =0
Returns the number of columns local of the matrix.
virtual unsigned int numRowsLocal() const =0
Returns the number of rows local of the matrix.
virtual void base_copy(const Matrix &src)
Copies base data from matrix src to this matrix.
Definition: Matrix.C:99
virtual ~Matrix()
Virtual Destructor.
Definition: Matrix.C:41

Generated on Fri Jun 17 2016 14:17:40 for queso-0.55.0 by  doxygen 1.8.5