queso-0.53.0
Vector.C
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 #include <queso/Vector.h>
26 #include <queso/Defines.h>
27 
28 namespace QUESO {
29 
30 // Shaped constructor --------------------------------
31 Vector::Vector(const BaseEnvironment& env, const Map& map)
32  :
33  m_env (env),
34  m_map (map),
35  m_printHorizontally(true),
36  m_printScientific (false) // for compatibility with previous regression tests
37 {
38  //std::cout << "Entering Vector::constructor(env,map)" << std::endl;
39 
40  //std::cout << "In Vector::constructor(env,map)" // mox
41  // << ", m_map.NumMyElements() = " << m_map.NumMyElements()
42  // << std::endl;
43 
44  //std::cout << "Leaving Vector::constructor(env,map)" << std::endl;
45 }
46 
47 // Destructor ---------------------------------------
49 {
50 }
51 
52 // Environment and Map methods ----------------------
53 const BaseEnvironment&
54 Vector::env() const
55 {
56  return m_env;
57 }
58 
59 // --------------------------------------------------
60 const Map&
61 Vector::map() const
62 {
63  return m_map;
64 }
65 
66 // --------------------------------------------------
67 unsigned int
69 {
70  return m_map.Comm().NumProc();
71 }
72 
73 // I/O and Miscellaneous methods --------------------
74 void
76 {
77  m_printHorizontally = value;
78  return;
79 }
80 // --------------------------------------------------
81 bool
83 {
84  return m_printHorizontally;
85 }
86 // --------------------------------------------------
87 void
88 Vector::setPrintScientific(bool value) const
89 {
90  m_printScientific = value;
91  return;
92 }
93 // --------------------------------------------------
94 bool
96 {
97  return m_printScientific;
98 }
99 // --------------------------------------------------
100 void
102 {
103  //m_env = src.env;
104  //m_map = src.map; // prudenci 2010-06-17
107 
108  return;
109 }
110 
111 } // End namespace QUESO
Class for vector operations (virtual).
Definition: Vector.h:47
const BaseEnvironment & m_env
Environment variable.
Definition: Vector.h:117
virtual void base_copy(const Vector &src)
Copies base data from vector src to this vector.
Definition: Vector.C:101
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
bool m_printHorizontally
Flag for either or not print this matrix horizontally.
Definition: Vector.h:130
bool getPrintHorizontally() const
Checks if vector is printed horizontally.
Definition: Vector.C:82
const BaseEnvironment & env() const
Definition: Vector.C:54
void setPrintHorizontally(bool value) const
Determines whether vector should be printed horizontally.
Definition: Vector.C:75
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:193
bool m_printScientific
Flag for either or not print this matrix in scientific notation.
Definition: Vector.h:133
bool getPrintScientific() const
Checks if the vector should be printed in Scientific Notation.
Definition: Vector.C:95
unsigned int numOfProcsForStorage() const
Definition: Vector.C:68
virtual ~Vector()
Virtual Destructor.
Definition: Vector.C:48
void setPrintScientific(bool value) const
Determines whether vector should be printed in Scientific Notation.
Definition: Vector.C:88
const Map & map() const
Definition: Vector.C:61
A class for partitioning vectors and matrices.
Definition: Map.h:49
Vector()
Default Constructor.
const Map & m_map
Mapping variable.
Definition: Vector.h:126

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