queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Miscellaneous.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-2017 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_MISCELLANEOUS_H
26 #define UQ_MISCELLANEOUS_H
27 
28 #include <queso/Environment.h>
29 #include <queso/RngBase.h>
30 #include <string>
31 #include <vector>
32 #include <math.h>
33 
34 namespace QUESO {
35 
36 void MiscReadDoublesFromString (const std::string& inputString,
37  std::vector<double>& outputDoubles);
38 void MiscReadWordsFromString (const std::string& inputString,
39  std::vector<std::string>& outputWords);
40 #if 0
41 void MiscExtractDoubleFromString (std::string& inputString,
42  double& outputDouble);
43 void MiscExtractWordFromString (std::string& inputString,
44  std::string& outputWord);
45 #endif
46 int MiscReadStringAndDoubleFromFile(std::ifstream& ifs,
47  std::string& termString,
48  double* termValue);
49 int MiscReadCharsAndDoubleFromFile (std::ifstream& ifs,
50  std::string& termString,
51  double* termValue,
52  bool& endOfLineAchieved);
53 double MiscGammar (double a,
54  double b,
55  const RngBase* rngObject);
56 double MiscGetEllapsedSeconds (struct timeval* timeval0);
57 double MiscHammingWindow (unsigned int N,
58  unsigned int j);
59 double MiscGaussianDensity (double x,
60  double mu,
61  double sigma);
62 unsigned int MiscUintDebugMessage (unsigned int value,
63  const char* message);
64 int MiscIntDebugMessage (int value,
65  const char* message);
66 double MiscDoubleDebugMessage (double value,
67  const char* message);
68 
69 int CheckFilePath (const char* path);
70 int GRVY_CheckDir (const char* dirname);
71 
72 template <class T>
73 bool MiscCheckForSameValueInAllNodes(T & inputValue, // Yes, 'not' const
74  double acceptableTreshold, const MpiComm& comm, const char * whereString);
75 
76 template <class V>
77 void MiscComputePositionsBetweenMinMax(V minValues, V maxValues,
78  std::vector<V*>& positions);
79 
80 template <class V1,class V2>
81 void MiscCheckTheParallelEnvironment(const V1& vec1, const V2& vec2);
82 
83 } // End namespace QUESO
84 
85 #endif // UQ_MISCELLANEOUS_H
int MiscReadStringAndDoubleFromFile(std::ifstream &ifs, std::string &termString, double *termValue)
int GRVY_CheckDir(const char *dirname)
double MiscHammingWindow(unsigned int N, unsigned int j)
double MiscGammar(double a, double b, const RngBase *rngObject)
void MiscExtractWordFromString(std::string &inputString, std::string &outputWord)
double MiscDoubleDebugMessage(double value, const char *message)
int CheckFilePath(const char *path)
double MiscGaussianDensity(double x, double mu, double sigma)
int MiscIntDebugMessage(int value, const char *message)
unsigned int MiscUintDebugMessage(unsigned int value, const char *message)
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
Definition: Miscellaneous.C:40
void MiscComputePositionsBetweenMinMax(V minValues, V maxValues, std::vector< V * > &positions)
bool MiscCheckForSameValueInAllNodes(T &inputValue, double acceptableTreshold, const MpiComm &comm, const char *whereString)
void MiscExtractDoubleFromString(std::string &inputString, double &outputDouble)
int MiscReadCharsAndDoubleFromFile(std::ifstream &ifs, std::string &termString, double *termValue, bool &endOfLineAchieved)
void MiscReadWordsFromString(const std::string &inputString, std::vector< std::string > &outputWords)
Definition: Miscellaneous.C:92
double MiscGetEllapsedSeconds(struct timeval *timeval0)
void MiscCheckTheParallelEnvironment(const V1 &vec1, const V2 &vec2)

Generated on Tue Jun 5 2018 19:48:55 for queso-0.57.1 by  doxygen 1.8.5