queso-0.55.0
Classes | Typedefs | Functions | Variables
QUESO Namespace Reference

Classes

class  ArrayOfSequences
 Class for handling array samples (arrays of scalar sequences). More...
 
class  BoxSubset
 Class representing a subset of a vector space shaped like a hypercube. More...
 
class  ConcatenationSubset
 A templated class representing the concatenation of two vector subsets. More...
 
class  ConstantScalarFunction
 A class for handling scalar functions which image is a constant (real number). More...
 
class  ConstantVectorFunction
 A class for handling vector functions which image is constant. More...
 
class  DiscreteSubset
 A templated class representing the discrete vector subsets. More...
 
class  GenericScalarFunction
 A class for handling generic scalar functions. More...
 
class  GenericVectorFunction
 A class for handling generic vector functions. More...
 
class  IntersectionSubset
 A templated class representing the intersection of two vector sets. More...
 
class  BaseScalarFunction
 A templated (base) class for handling scalar functions. More...
 
class  ScalarFunctionSynchronizer
 A templated class for synchronizing the calls of scalar functions (BaseScalarFunction and derived classes). More...
 
class  ScalarSequence
 Class for handling scalar samples. More...
 
class  SequenceOfVectors
 Class for handling vector samples (sequence of vectors). More...
 
class  BaseVectorFunction
 A templated (base) class for handling vector functions. More...
 
class  VectorFunctionSynchronizer
 A templated class for synchronizing the calls of vector-valued functions. More...
 
class  BaseVectorSequence
 Base class for handling vector and array samples (sequence of vectors or arrays). More...
 
class  VectorSpace
 A class representing a vector space. More...
 
class  VectorSet
 A templated class for handling sets. More...
 
class  VectorSubset
 A templated class for handling subsets. More...
 
class  BaseInputOptionsParser
 
class  BasicPdfsBase
 TODO: Base class for basic PDFs (via either GSL or Boost). More...
 
class  BasicPdfsBoost
 TODO: Base class for basic PDFs using Boost library. More...
 
class  BasicPdfsGsl
 TODO: Base class for basic PDFs using Gsl library. More...
 
class  BoostInputOptionsParser
 
class  DistArray
 A class for partitioning vectors and matrices. More...
 
struct  FilePtrSetStruct
 Struct for handling data input and output from files. More...
 
class  BaseEnvironment
 This (virtual) class sets up the environment underlying the use of the QUESO library by an executable. More...
 
class  EmptyEnvironment
 This class sets up the environment underlying the use of the QUESO library by an executable. More...
 
class  FullEnvironment
 This class sets up the full environment underlying the use of the QUESO library by an executable. More...
 
class  EnvOptionsValues
 This class provides a suite options one can pass to a QUESO environment. More...
 
class  EnvironmentOptions
 This class reads options one can pass to a QUESO environment through an input file. More...
 
class  LogicError
 
class  NotImplemented
 
class  FileError
 
class  FunctionBase
 Abstract base class for function objects. More...
 
class  FunctionOperatorBuilder
 
class  GslBlockMatrix
 Class for representing block matrices using GSL library. More...
 
class  GslMatrix
 Class for matrix operations using GSL library. More...
 
class  GslOptimizer
 A base class for handling optimisation of scalar functions. More...
 
class  GslVector
 Class for vector operations using GSL library. More...
 
class  InfiniteDimensionalGaussian
 Class defining infinite dimensional Gaussian measures. More...
 
class  InfiniteDimensionalLikelihoodBase
 Abstract class representing the likelihood. Users must subclass this. More...
 
class  InfiniteDimensionalMCMCSamplerOptions
 This class defines the options that specify the behaviour of the MCMC sampler. More...
 
class  InfiniteDimensionalMeasureBase
 Abstract base class for infinite dimensional measures. More...
 
class  Map
 A class for partitioning vectors and matrices. More...
 
class  Matrix
 Class for matrix operations (virtual). More...
 
struct  data_type
 
class  DataType
 
class  StandardType
 
class  MpiComm
 The QUESO MPI Communicator Class. More...
 
class  OperatorBase
 Abstract base class for operator objects. Operators are assumed to be symmetric and positive-definite. More...
 
class  BaseOptimizer
 A base class for handling optimisation of scalar functions. More...
 
class  OptimizerMonitor
 Object to monitor convergence of optimizers. More...
 
class  RngBase
 Class for random number generation (base class for either GSL or Boost RNG). More...
 
class  RngBoost
 
class  RngGsl
 
class  Vector
 Class for vector operations (virtual). More...
 
class  ExperimentModel
 
class  EmOptionsValues
 
class  ExperimentModelOptions
 
class  ExperimentStorage
 
class  GcmExperimentInfo
 
class  GcmJointInfo
 
class  GcmJointTildeInfo
 
class  GcmSimulationInfo
 
class  GcmSimulationTildeInfo
 
class  GcmTotalInfo
 
class  GcmZInfo
 
class  GcmZTildeInfo
 
class  GPMSAEmulator
 
class  GPMSAFactory
 
class  GpmsaComputerModel
 
class  GcmOptionsValues
 
class  GpmsaComputerModelOptions
 
class  GPMSAOptions
 This class defines the options that specify the behaviour of the Gaussian process emulator. More...
 
class  SimulationModel
 
class  SmOptionsValues
 
class  SimulationModelOptions
 
class  SimulationStorage
 
class  Base1D1DFunction
 Class for one-dimensional functions. More...
 
class  Generic1D1DFunction
 Class for generic one-dimensional functions. More...
 
class  Constant1D1DFunction
 Class for constant one-dimensional functions. More...
 
class  Linear1D1DFunction
 Class for linear one-dimensional functions. More...
 
class  PiecewiseLinear1D1DFunction
 Class for piecewise-linear one-dimensional functions. More...
 
class  Quadratic1D1DFunction
 Class for one-dimensional quadratic functions. More...
 
class  Sampled1D1DFunction
 Class for one-dimensional sampled functions. More...
 
class  ScalarTimesFunc1D1DFunction
 Class for multiplication of a one-dimensional function by a scalar. More...
 
class  FuncTimesFunc1D1DFunction
 Class for multiplication of a one-dimensional function by another. More...
 
class  FuncPlusFunc1D1DFunction
 Class for addition of a one-dimensional function with another. More...
 
class  LagrangePolynomial1D1DFunction
 Class for one-dimensional Lagrange polynomials. More...
 
class  LagrangeBasis1D1DFunction
 Class for Lagrange polynomial basis. More...
 
class  Base1DQuadrature
 Base class for one-dimensional quadrature rules (numerical integration of functions). More...
 
class  Generic1DQuadrature
 Class for one-dimensional generic quadrature rules (numerical integration of functions). More...
 
class  UniformLegendre1DQuadrature
 Class for Legendre-Gauss quadrature rule for one-dimensional functions. More...
 
class  GaussianHermite1DQuadrature
 Class for Hermite-Gauss quadrature rule for one-dimensional functions. More...
 
class  WignerInverseChebyshev1st1DQuadrature
 Class for first type Chebyshev-Gauss quadrature rule for one-dimensional functions. More...
 
class  WignerChebyshev2nd1DQuadrature
 Class for second type Chebyshev-Gauss quadrature rule for one-dimensional functions. More...
 
class  TwoDArray
 Class for handling arrays of generic data. More...
 
class  ArrayOfOneDGrids
 Class to accommodate arrays of one-dimensional grid. More...
 
class  ArrayOfOneDTables
 Class to accommodate arrays of one-dimensional tables. More...
 
class  AsciiTable
 Class for reading ASCII values from a table in a file. More...
 
class  Fft
 Class for a Fast Fourier Transform (FFT) algorithm. More...
 
class  BaseOneDGrid
 Base class for accommodating one-dimensional grids. More...
 
class  StdOneDGrid
 Class for accommodating standard one-dimensional grids. More...
 
class  StreamUtilities
 
class  UniformOneDGrid
 Class for accommodating uniform one-dimensional grids. More...
 
class  BayesianJointPdf
 A class for handling Bayesian joint PDFs. More...
 
class  BetaJointPdf
 A class for handling Beta joint PDFs. More...
 
class  BetaVectorRealizer
 A class for handling sampling from a Beta probability density distribution. More...
 
class  BetaVectorRV
 A class representing a vector RV constructed via Beta distribution. More...
 
class  ConcatenatedJointPdf
 A class for handling concatenated PDFs. More...
 
class  ConcatenatedVectorRealizer
 A class for handling sampling from concatenated probability density distributions. More...
 
class  ConcatenatedVectorRV
 A class representing concatenated vector RVs. More...
 
class  ExponentialMatrixCovarianceFunction
 A class for exponential covariance matrices. More...
 
class  ExponentialScalarCovarianceFunction
 A class for exponential covariances. More...
 
class  FiniteDistribution
 A templated class for a finite distribution. More...
 
class  GammaJointPdf
 A class for handling Gamma joint PDFs. More...
 
class  GammaVectorRealizer
 A class for handling sampling from a Gamma probability density distribution. More...
 
class  GammaVectorRV
 A class representing a vector RV constructed via Gamma distribution. More...
 
class  GaussianJointPdf
 A class for handling Gaussian joint PDFs. More...
 
class  BaseGaussianLikelihood
 Base class for canned Gaussian likelihoods. More...
 
class  GaussianLikelihoodBlockDiagonalCovariance
 A class representing a Gaussian likelihood with block-diagonal covariance matrix. More...
 
class  GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients
 A class representing a Gaussian likelihood with block-diagonal covariance matrix. More...
 
class  GaussianLikelihoodDiagonalCovariance
 A class that represents a Gaussian likelihood with diagonal covariance matrix. More...
 
class  GaussianLikelihoodFullCovariance
 A class that represents a Gaussian likelihood with full covariance. More...
 
class  GaussianLikelihoodFullCovarianceRandomCoefficient
 A class that represents a Gaussian likelihood with full covariance and random coefficient. More...
 
class  GaussianLikelihoodScalarCovariance
 A class that represents a Gaussian likelihood with scalar covariance. More...
 
class  GaussianVectorCdf
 TODO: A class for handling Gaussian CDFs. More...
 
class  GaussianVectorMdf
 TODO: A class for handling Gaussian MDFs. More...
 
class  GaussianVectorRealizer
 A class for handling sampling from Gaussian probability density distributions. More...
 
class  GaussianVectorRV
 A class representing a Gaussian vector RV. More...
 
class  GenericJointPdf
 A class for handling generic joint PDFs. More...
 
class  GenericMatrixCovarianceFunction
 A class for generic covariance matrices. More...
 
class  GenericScalarCovarianceFunction
 A class for generic covariances. More...
 
class  GenericVectorCdf
 A class for handling generic vector CDFs. More...
 
class  GenericVectorMdf
 A class for handling generic MDFs of vector functions. More...
 
class  GenericVectorRealizer
 A class for handling sampling from generic probability density distributions. More...
 
class  GenericVectorRV
 A templated class for handling generic vector RVs. More...
 
class  HessianCovMatricesTKGroup
 This class allows the representation of a transition kernel with Hessians. More...
 
class  InverseGammaJointPdf
 A class for handling Inverse Gamma joint PDFs. More...
 
class  InverseGammaVectorRealizer
 A class for handling sampling from an Inverse Gamma probability density distribution. More...
 
class  InverseGammaVectorRV
 A class representing a vector RV constructed via Inverse Gamma distribution. More...
 
class  InvLogitGaussianJointPdf
 A class for handling hybrid (transformed) Gaussians with bounds. More...
 
class  InvLogitGaussianVectorRealizer
 A class for handling sampling from (transformed) Gaussian probability density distributions with bounds. More...
 
class  InvLogitGaussianVectorRV
 A class representing a (transformed) Gaussian vector RV with bounds. More...
 
class  JeffreysJointPdf
 A class for handling jeffreys joint PDFs. More...
 
class  JeffreysVectorRealizer
 A class for handling sampling from a jeffreys probability density distribution. More...
 
class  JeffreysVectorRV
 A class representing a jeffreys vector RV. More...
 
class  BaseJointPdf
 A templated (base) class for handling joint PDFs. More...
 
class  LogNormalJointPdf
 A class for handling Log-Normal joint PDFs. More...
 
class  LogNormalVectorRealizer
 A class for handling sampling from a Log-Normal probability density distribution. More...
 
class  LogNormalVectorRV
 A class representing a LogNormal vector RV. More...
 
class  MarkovChainPositionData
 A templated class that represents a Markov Chain. More...
 
class  BaseMatrixCovarianceFunction
 A templated (base) class to accommodate covariance matrix of (random) vector functions. More...
 
struct  MHRawChainInfoStruct
 A struct that represents a Metropolis-Hastings sample. More...
 
class  MetropolisHastingsSG
 A templated class that represents a Metropolis-Hastings generator of samples. More...
 
class  MhOptionsValues
 This class provides options for the Metropolis-Hastings generator of samples if no input file is available. More...
 
class  MetropolisHastingsSGOptions
 This class reads the options for the Metropolis-Hastings generator of samples from an input file. More...
 
struct  ExchangeInfoStruct
 
struct  BalancedLinkedChainControlStruct
 
struct  BalancedLinkedChainsPerNodeStruct
 
struct  UnbalancedLinkedChainControlStruct
 
struct  UnbalancedLinkedChainsPerNodeStruct
 
class  MLSampling
 A templated class that represents a Multilevel generator of samples. More...
 
class  MLSamplingLevelOptions
 This class provides options for each level of the Multilevel sequence generator if no input file is available. More...
 
class  MLSamplingOptions
 This class provides options for the Multilevel sequence generator if no input file is available. More...
 
class  ModelValidation
 A templated class for model validation of the example validationPyramid. More...
 
class  MonteCarloSG
 A templated class that implements a Monte Carlo generator of samples. More...
 
class  McOptionsValues
 This class provides options for the Monte Carlo sequence generator if no input file is available. More...
 
class  MonteCarloSGOptions
 This class reads the options for the Monte Carlo sequence generator from an input file. More...
 
class  PoweredJointPdf
 A class for handling a powered joint PDFs. More...
 
class  SampledScalarCdf
 A class for handling sampled CDFs. More...
 
class  SampledVectorCdf
 A class for handling sampled vector CDFs. More...
 
class  SampledVectorMdf
 A class for handling sampled vector MDFs. More...
 
class  BaseScalarCdf
 A templated (base) class for handling CDFs. More...
 
class  BaseScalarCovarianceFunction
 A templated (base) class to accommodate scalar covariance functions (of random variables). More...
 
class  ScalarGaussianRandomField
 A class for handling scalar Gaussian random fields (GRF). More...
 
class  ScaledCovMatrixTKGroup
 This class allows the representation of a transition kernel with a scaled covariance matrix. More...
 
class  SequentialVectorRealizer
 A class for handling sequential draws (sampling) from probability density distributions. More...
 
class  StatisticalForwardProblem
 This templated class represents a Statistical Forward Problem. More...
 
class  SfpOptionsValues
 This class provides options for a Statistical Forward Problem if no input file is available. More...
 
class  StatisticalForwardProblemOptions
 This class reads option values for a Statistical Forward Problem from an input file. More...
 
class  StatisticalInverseProblem
 This templated class represents a Statistical Inverse Problem. More...
 
class  SipOptionsValues
 This class provides options for a Statistical Inverse Problem if no input file is available. More...
 
class  StatisticalInverseProblemOptions
 This class reads option values for a Statistical Inverse Problem from an input file. More...
 
class  StdScalarCdf
 A class for handling standard CDFs. More...
 
class  BaseTKGroup
 This base class allows the representation of a transition kernel. More...
 
class  TransformedScaledCovMatrixTKGroup
 This class represents a transition kernel with a scaled covariance matrix on hybrid bounded/unbounded state spaces. More...
 
class  UniformJointPdf
 A class for handling uniform joint PDFs. More...
 
class  UniformVectorRealizer
 A class for handling sampling from a Uniform probability density distribution. More...
 
class  UniformVectorRV
 A class representing a uniform vector RV. More...
 
class  ValidationCycle
 A templated class for validation cycle of the examples validationCycle and validationCycle2. More...
 
class  BaseVectorCdf
 A templated (base) class for handling CDFs of vector functions. More...
 
class  VectorGaussianRandomField
 A class for handling vector Gaussian random fields (GRF). More...
 
class  BaseVectorMdf
 A templated (base) class for handling MDFs of vector functions. More...
 
class  BaseVectorRealizer
 A templated (base) class for handling sampling from vector RVs. More...
 
class  BaseVectorRV
 A templated base class for handling vector RV. More...
 
class  WignerJointPdf
 A class for handling Wigner joint PDFs. More...
 
class  WignerVectorRealizer
 A class for handling sampling from a Wigner probability density distribution. More...
 
class  WignerVectorRV
 A class representing a vector RV constructed via Wigner distribution. More...
 
class  InterpolationSurrogateData
 
class  InterpolationSurrogateBase
 Base class for interpolation-based surrogates. More...
 
class  InterpolationSurrogateBuilder
 Build interpolation-based surrogate. More...
 
class  InterpolationSurrogateDataSet
 Container class for multiple, consistent InterpolationSurrogateData objects. More...
 
class  InterpolationSurrogateHelper
 
class  InterpolationSurrogateIOASCII
 
class  InterpolationSurrogateIOBase
 
class  LinearLagrangeInterpolationSurrogate
 Linear Lagrange interpolation surrogate. More...
 
class  SurrogateBase
 Base class for surrogates of models. More...
 
class  SurrogateBuilderBase
 Base class for builders of surrogates. More...
 

Typedefs

typedef int RawType_MPI_Comm
 
typedef int RawType_MPI_Group
 
typedef int RawType_MPI_Datatype
 
typedef int RawType_MPI_Op
 
typedef int RawType_MPI_Status
 

Functions

template<class V , class M >
VectorSet< V, M > * InstantiateIntersection (const VectorSet< V, M > &domain1, const VectorSet< V, M > &domain2)
 This method calculates the intersection of domain1 and domain2. More...
 
template<class T >
void ComputeSubGaussian2dKde (const ScalarSequence< T > &scalarSeq1, const ScalarSequence< T > &scalarSeq2, unsigned int initialPos, double scaleValue1, double scaleValue2, const std::vector< T > &evaluationPositions1, const std::vector< T > &evaluationPositions2, std::vector< double > &densityValues)
 
template<class T >
void ComputeUnifiedGaussian2dKde (bool useOnlyInter0Comm, const ScalarSequence< T > &scalarSeq1, const ScalarSequence< T > &scalarSeq2, unsigned int initialPos, double unifiedScaleValue1, double unifiedScaleValue2, const std::vector< T > &unifiedEvaluationPositions1, const std::vector< T > &unifiedEvaluationPositions2, std::vector< double > &unifiedDensityValues)
 
template<class T >
void ComputeCovCorrBetweenScalarSequences (const ScalarSequence< T > &subPSeq, const ScalarSequence< T > &subQSeq, unsigned int subNumSamples, T &covValue, T &corrValue)
 
template<class P_V , class P_M , class Q_V , class Q_M >
void ComputeCovCorrMatricesBetweenVectorSequences (const BaseVectorSequence< P_V, P_M > &subPSeq, const BaseVectorSequence< Q_V, Q_M > &subQSeq, unsigned int subNumSamples, P_M &pqCovMatrix, P_M &pqCorrMatrix)
 
int MyWorldfullRank ()
 Returns the rank of the calling process in the communicator. More...
 
void queso_terminate_handler ()
 Function for unhandled exceptions in Queso. More...
 
void QUESO_version_print (std::ostream &os)
 
int QUESO_get_numeric_version ()
 
std::ostream & operator<< (std::ostream &os, const BaseEnvironment &obj)
 
std::ostream & operator<< (std::ostream &os, const EnvironmentOptions &obj)
 Print values of the options chosen. More...
 
std::ostream & operator<< (std::ostream &os, const GslBlockMatrix &obj)
 
GslMatrix operator* (double a, const GslMatrix &mat)
 
GslVector operator* (const GslMatrix &mat, const GslVector &vec)
 
GslMatrix operator* (const GslMatrix &m1, const GslMatrix &m2)
 
GslMatrix operator+ (const GslMatrix &m1, const GslMatrix &m2)
 
GslMatrix operator- (const GslMatrix &m1, const GslMatrix &m2)
 
GslMatrix matrixProduct (const GslVector &v1, const GslVector &v2)
 
GslMatrix leftDiagScaling (const GslVector &vec, const GslMatrix &mat)
 
GslMatrix rightDiagScaling (const GslMatrix &mat, const GslVector &vec)
 
std::ostream & operator<< (std::ostream &os, const GslMatrix &obj)
 
GslVector operator/ (double a, const GslVector &x)
 
GslVector operator/ (const GslVector &x, const GslVector &y)
 
GslVector operator* (double a, const GslVector &x)
 
GslVector operator* (const GslVector &x, const GslVector &y)
 
double scalarProduct (const GslVector &x, const GslVector &y)
 
GslVector operator+ (const GslVector &x, const GslVector &y)
 
GslVector operator- (const GslVector &x, const GslVector &y)
 
bool operator== (const GslVector &lhs, const GslVector &rhs)
 
std::ostream & operator<< (std::ostream &os, const GslVector &obj)
 
 STANDARD_TYPE (char, MPI_CHAR)
 
 STANDARD_TYPE (int, MPI_INT)
 
 STANDARD_TYPE (unsigned int, MPI_UNSIGNED)
 
 STANDARD_TYPE (double, MPI_DOUBLE)
 
template<>
void BoostInputOptionsParser::getOption< std::vector< double, std::allocator< double > > > (std::string &name, std::vector< double, std::allocator< double > > &value)
 
std::ostream & operator<< (std::ostream &os, const BoostInputOptionsParser &parser)
 
template void BoostInputOptionsParser::registerOption< std::string > (std::string, std::string, std::string)
 
template void BoostInputOptionsParser::getOption< std::string > (std::string &, std::string &)
 
template void BoostInputOptionsParser::getOption< std::vector< unsigned int, std::allocator< unsigned int > > > (std::string &, std::vector< unsigned int, std::allocator< unsigned int > > &)
 
std::ostream & operator<< (std::ostream &os, const EnvOptionsValues &obj)
 
double c_evaluate (const gsl_vector *x, void *context)
 
void c_evaluate_derivative (const gsl_vector *x, void *context, gsl_vector *derivative)
 
void c_evaluate_with_derivative (const gsl_vector *x, void *context, double *f, gsl_vector *derivative)
 
std::ostream & operator<< (std::ostream &os, const InfiniteDimensionalMCMCSamplerOptions &obj)
 
std::ostream & operator<< (std::ostream &os, const ExperimentModelOptions &obj)
 
std::ostream & operator<< (std::ostream &os, const GpmsaComputerModelOptions &obj)
 
std::ostream & operator<< (std::ostream &os, const SimulationModelOptions &obj)
 
std::ostream & operator<< (std::ostream &os, const GPMSAOptions &obj)
 
template<class T >
double SubF1F2Gaussian2dKdeIntegral (const ScalarSequence< T > &scalarSeq1, const ScalarSequence< T > &scalarSeq2, unsigned int initialPos, double scaleValue1, double scaleValue2, const Base1D1DFunction &func1, const Base1D1DFunction &func2, unsigned int quadratureOrder)
 Calculates the integral of a 2D Gaussian KDE. More...
 
template<class V , class M >
void CovCond (double condNumber, const V &direction, M &covMatrix, M &precMatrix)
 
void MiscReadDoublesFromString (const std::string &inputString, std::vector< double > &outputDoubles)
 
void MiscReadWordsFromString (const std::string &inputString, std::vector< std::string > &outputWords)
 
int MiscReadStringAndDoubleFromFile (std::ifstream &ifs, std::string &termString, double *termValue)
 
int MiscReadCharsAndDoubleFromFile (std::ifstream &ifs, std::string &termString, double *termValue, bool &endOfLineAchieved)
 
double MiscGammar (double a, double b, const RngBase *rngObject)
 
double MiscGetEllapsedSeconds (struct timeval *timeval0)
 
double MiscHammingWindow (unsigned int N, unsigned int j)
 
double MiscGaussianDensity (double x, double mu, double sigma)
 
unsigned int MiscUintDebugMessage (unsigned int value, const char *message)
 
int MiscIntDebugMessage (int value, const char *message)
 
double MiscDoubleDebugMessage (double value, const char *message)
 
int CheckFilePath (const char *path)
 
int GRVY_CheckDir (const char *dirname)
 
template<class T >
bool MiscCheckForSameValueInAllNodes (T &inputValue, double acceptableTreshold, const MpiComm &comm, const char *whereString)
 
template<class V >
void MiscComputePositionsBetweenMinMax (V minValues, V maxValues, std::vector< V * > &positions)
 
template<class V1 , class V2 >
void MiscCheckTheParallelEnvironment (const V1 &vec1, const V2 &vec2)
 
template<class V , class M >
std::ostream & operator<< (std::ostream &os, const ArrayOfOneDTables< V, M > &obj)
 
template<class V , class M >
std::ostream & operator<< (std::ostream &os, const AsciiTable< V, M > &obj)
 
template<class V , class M >
void ComputeConditionalGaussianVectorRV (const V &muVec1, const V &muVec2, const M &sigmaMat11, const M &sigmaMat12, const M &sigmaMat21, const M &sigmaMat22, const V &sampleVec2, V &muVec1_cond_on_2, M &sigmaMat11_cond_on_2)
 
std::ostream & operator<< (std::ostream &os, const MetropolisHastingsSGOptions &obj)
 
std::ostream & operator<< (std::ostream &os, const MonteCarloSGOptions &obj)
 Prints the object obj, overloading an operator. More...
 
template<class T >
double horizontalDistance (const BaseScalarCdf< T > &cdf1, const BaseScalarCdf< T > &cdf2, double epsilon)
 It calculated the maximum horizontal distance between two CDFs. More...
 
std::ostream & operator<< (std::ostream &os, const StatisticalForwardProblemOptions &obj)
 Prints the object obj, overloading an operator. More...
 
std::ostream & operator<< (std::ostream &os, const StatisticalInverseProblemOptions &obj)
 Prints the object obj, overloading an operator. More...
 
template<class V , class M >
void horizontalDistances (const BaseVectorCdf< V, M > &cdf1, const BaseVectorCdf< V, M > &cdf2, const V &epsilonVec, V &distances)
 It calculated the maximum horizontal distances between two vector CDFs. More...
 
template<class P_V , class P_M , class Q_V , class Q_M >
void ComputeCovCorrMatricesBetweenVectorRvs (const BaseVectorRV< P_V, P_M > &paramRv, const BaseVectorRV< Q_V, Q_M > &qoiRv, unsigned int localNumSamples, P_M &pqCovMatrix, P_M &pqCorrMatrix)
 
std::ostream & operator<< (std::ostream &os, const MhOptionsValues &obj)
 
template<class P_V , class P_M >
std::ostream & operator<< (std::ostream &os, const MLSampling< P_V, P_M > &obj)
 
std::ostream & operator<< (std::ostream &os, const MLSamplingLevelOptions &obj)
 
std::ostream & operator<< (std::ostream &os, const MLSamplingOptions &obj)
 
std::ostream & operator<< (std::ostream &os, const McOptionsValues &obj)
 
std::ostream & operator<< (std::ostream &os, const SfpOptionsValues &obj)
 
std::ostream & operator<< (std::ostream &os, const SipOptionsValues &obj)
 

Variables

const int UQ_UNAVAILABLE_RANK = -1
 
const int UQ_OK_RC = 0
 
const int UQ_INCOMPLETE_IMPLEMENTATION_RC = -1
 
const int UQ_INVALID_PARAMETER_SPEC_RC = -2
 
const int UQ_INVALID_OBSERVABLE_SPEC_RC = -3
 
const int UQ_INVALID_QOI_SPEC_RC = -4
 
const int UQ_INVALID_INTERNAL_RESULT_RC = -5
 
const int UQ_INVALID_INTERNAL_STATE_RC = -6
 
const int UQ_FAILED_TO_OPEN_FILE_RC = -7
 
const int UQ_MATRIX_IS_NOT_POS_DEFINITE_RC = -8
 
const int UQ_FAILED_READING_FILE_RC = -9
 
const int UQ_INVALID_SPACE_COMPONENT_ID_RC = -10
 
const int UQ_MATRIX_SVD_FAILED_RC = -11
 
std::terminate_handler old_terminate_handler
 

Typedef Documentation

Definition at line 57 of file MpiComm.h.

Definition at line 59 of file MpiComm.h.

Definition at line 58 of file MpiComm.h.

typedef int QUESO::RawType_MPI_Op

Definition at line 61 of file MpiComm.h.

Definition at line 62 of file MpiComm.h.

Function Documentation

template void QUESO::BoostInputOptionsParser::getOption< std::string > ( std::string &  ,
std::string &   
)
template<>
void QUESO::BoostInputOptionsParser::getOption< std::vector< double, std::allocator< double > > > ( std::string &  name,
std::vector< double, std::allocator< double > > &  value 
)

Definition at line 129 of file BoostInputOptionsParser.C.

References MiscReadDoublesFromString().

130 {
131  if (m_scannedInputFile) {
132  // Need to reset value?
133 
134  // Get the option as a string
135  // DM: Why do it this way? Doesn't boost support vectors as input options?
136  std::string optionValue;
137  this->getOption<std::string>(name, optionValue);
138  MiscReadDoublesFromString(optionValue, value);
139  }
140 }
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
Definition: Miscellaneous.C:40
template void QUESO::BoostInputOptionsParser::getOption< std::vector< unsigned int, std::allocator< unsigned int > > > ( std::string &  ,
std::vector< unsigned int, std::allocator< unsigned int > > &   
)
template void QUESO::BoostInputOptionsParser::registerOption< std::string > ( std::string  ,
std::string  ,
std::string   
)
double QUESO::c_evaluate ( const gsl_vector *  x,
void context 
)

Definition at line 43 of file GslOptimizer.C.

References QUESO::GslOptimizer::objectiveFunction().

Referenced by c_evaluate_with_derivative(), QUESO::GslOptimizer::minimize_no_gradient(), and QUESO::GslOptimizer::minimize_with_gradient().

43  {
44 
45  GslOptimizer * optimizer = static_cast<GslOptimizer * >(context);
46 
47  GslVector state(
48  optimizer->objectiveFunction().domainSet().vectorSpace().zeroVector());
49 
50  // DM: Doing this copy sucks, but whatever. It'll do for now.
51  for (unsigned int i = 0; i < state.sizeLocal(); i++) {
52  state[i] = gsl_vector_get(x, i);
53  }
54 
55  // Bail early if GSL tries to evaluate outside of the domain
56  if (!optimizer->objectiveFunction().domainSet().contains(state)) {
57  return GSL_NAN;
58  }
59 
60  // Should cache derivative here so we don't a) segfault in the user's code
61  // and b) so we don't recompute stuff
62  double result = -optimizer->objectiveFunction().lnValue(state, NULL, NULL,
63  NULL, NULL);
64 
65  return result;
66  }
void QUESO::c_evaluate_derivative ( const gsl_vector *  x,
void context,
gsl_vector *  derivative 
)

Definition at line 69 of file GslOptimizer.C.

References QUESO::BaseOptimizer::getFiniteDifferenceStepSize(), and QUESO::GslOptimizer::objectiveFunction().

Referenced by c_evaluate_with_derivative(), and QUESO::GslOptimizer::minimize_with_gradient().

70  {
71  GslOptimizer * optimizer = static_cast<GslOptimizer * >(context);
72 
73  GslVector state(
74  optimizer->objectiveFunction().domainSet().vectorSpace().zeroVector());
75  GslVector deriv(
76  optimizer->objectiveFunction().domainSet().vectorSpace().zeroVector());
77 
78  // DM: Doing this copy sucks, but whatever. It'll do for now.
79  for (unsigned int i = 0; i < state.sizeLocal(); i++) {
80  state[i] = gsl_vector_get(x, i);
81 
82  // We fill with GSL_NAN and use it as a flag to check later that the user
83  // actually fills the derivative vector with stuff
84  deriv[i] = GSL_NAN;
85  }
86 
87  if (!optimizer->objectiveFunction().domainSet().contains(state)) {
88  // Fill derivative with error codes if the point is outside of the
89  // domain
90  for (unsigned int i = 0; i < deriv.sizeLocal(); i++) {
91  gsl_vector_set(derivative, i, GSL_NAN);
92  }
93  }
94  else {
95  // We should cache the return value here so we don't recompute stuff
96  double fx = -optimizer->objectiveFunction().lnValue(state, NULL, &deriv,
97  NULL, NULL);
98 
99  // Decide whether or not we need to do a finite difference based on
100  // whether the user actually filled deriv with values that are not
101  // GSL_NAN
102  //
103  // We're currently doing this check every time this function gets called.
104  // We could probably pull this logic out of here and put it somewhere
105  // where it only happens once
106  bool userComputedDerivative = true;
107  for (unsigned int i = 0; i < deriv.sizeLocal(); i++) {
108  // If the user missed out a derivative in any direction, fall back to
109  // a finite difference
110  if (gsl_isnan(deriv[i])) {
111  userComputedDerivative = false;
112  break;
113  }
114  }
115 
116  if (userComputedDerivative) {
117  for (unsigned int i = 0; i < deriv.sizeLocal(); i++) {
118  gsl_vector_set(derivative, i, -deriv[i]); // We need the minus sign
119  }
120  }
121  else {
122  // Finite difference step-size
123  double h = optimizer->getFiniteDifferenceStepSize();
124 
125  // User did not provide a derivative, so do a finite difference
126  for (unsigned int i = 0; i < deriv.sizeLocal(); i++) {
127  double tempState = state[i];
128  state[i] += h;
129 
130  // User didn't provide a derivative, so we don't bother passing in
131  // the derivative vector again
132  double fxph = -optimizer->objectiveFunction().lnValue(state, NULL,
133  NULL, NULL, NULL);
134 
135  // Reset the state back to what it was before
136  state[i] = tempState;
137 
138  // Make sure we didn't do anything dumb and tell gsl if we did
139  if (!gsl_isnan(fx) && !gsl_isnan(fxph)) {
140  gsl_vector_set(derivative, i, (fxph - fx) / h);
141  }
142  else {
143  gsl_vector_set(derivative, i, GSL_NAN);
144  }
145  }
146  }
147  }
148  }
void QUESO::c_evaluate_with_derivative ( const gsl_vector *  x,
void context,
double *  f,
gsl_vector *  derivative 
)

Definition at line 151 of file GslOptimizer.C.

References c_evaluate(), and c_evaluate_derivative().

Referenced by QUESO::GslOptimizer::minimize_with_gradient().

152  {
153  // We don't need to call both of these
154  *f = c_evaluate(x, context);
155  c_evaluate_derivative(x, context, derivative);
156  }
void c_evaluate_derivative(const gsl_vector *x, void *context, gsl_vector *derivative)
Definition: GslOptimizer.C:69
double c_evaluate(const gsl_vector *x, void *context)
Definition: GslOptimizer.C:43
int QUESO::CheckFilePath ( const char *  pathname)

int CheckFilePath(const char *path) {

// verify parent directories in path exist (and create if not).

ifdef HAVE_GRVY return(grvy_check_file_path(path)); else

return 0; endif }

Definition at line 362 of file Miscellaneous.C.

References GRVY_CheckDir().

Referenced by QUESO::FullEnvironment::FullEnvironment(), QUESO::BaseEnvironment::openInputFile(), QUESO::BaseEnvironment::openOutputFile(), QUESO::BaseEnvironment::openUnifiedInputFile(), and QUESO::BaseEnvironment::openUnifiedOutputFile().

363  {
364 
365  // verify parent directories in path exist (and create if not).
366 
367 #ifdef HAVE_GRVY
368  return(grvy_check_file_path(pathname));
369 #else
370 
371  const int MAX_DEPTH = 50;
372 
373  char *pathlocal;
374  char *parents;
375  char *dirstring;
376  char *token;
377  int depth = 0;
378 
379  // Save a copy of pathname and look for the parent directories.
380 
381  pathlocal = strdup(pathname);
382  dirstring = strdup(pathname);
383  parents = dirname(pathlocal);
384 
385  if(strcmp(parents,".") == 0)
386  {
387  free(pathlocal);
388  free(dirstring);
389  return 0;
390  }
391 
392  // Deal with the possibility of an absolute path being provided
393 
394  bool abs_path = false;
395 
396  std::string leading_char("");
397  std::string path_to_check;
398 
399  if(strncmp(parents,"/",1) == 0)
400  {
401  leading_char = "/";
402  abs_path = true;
403  }
404 
405  // Verify existence of top-level directory
406 
407  if( (token = strtok(parents,"/")) != NULL )
408  {
409  path_to_check += leading_char + token;
410 
411  if ( GRVY_CheckDir(path_to_check.c_str()) )
412  {
413  free(pathlocal);
414  free(dirstring);
415  return -1;
416  }
417 
418  // Now, search for any remaining parent directories.
419 
420  if(abs_path)
421  sprintf(dirstring,"/%s",token);
422  else
423  sprintf(dirstring,"%s",token);
424 
425  while ( (token = strtok(0,"/")) && (depth < MAX_DEPTH) )
426  {
427  dirstring = strcat(dirstring,"/");
428 
429  if(GRVY_CheckDir(strcat(dirstring,token)))
430  {
431  free(pathlocal);
432  free(dirstring);
433  return -1;
434  }
435  depth++;
436  };
437 
438  if(depth >= MAX_DEPTH )
439  {
440  std::cerr << __func__ << ": error - Max directory depth exceeded, limit = " << MAX_DEPTH << std::endl;
441  free(pathlocal);
442  free(dirstring);
443  return -1;
444  }
445  }
446 
447  // Clean Up
448  free(pathlocal);
449  free(dirstring);
450 
451  return 0;
452 #endif
453  }
int GRVY_CheckDir(const char *dirname)
template<class V , class M >
void QUESO::ComputeConditionalGaussianVectorRV ( const V &  muVec1,
const V &  muVec2,
const M &  sigmaMat11,
const M &  sigmaMat12,
const M &  sigmaMat21,
const M &  sigmaMat22,
const V &  sampleVec2,
V &  muVec1_cond_on_2,
M &  sigmaMat11_cond_on_2 
)

Definition at line 207 of file GaussianVectorRV.C.

References queso_require_equal_to_msg, queso_require_less_msg, queso_require_msg, and QUESO::BaseEnvironment::subDisplayFile().

Referenced by QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::predictVUsAtGridPoint(), and QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::predictWsAtGridPoint().

217 {
218  const BaseEnvironment& env = muVec1.env();
219  unsigned int dim1 = muVec1.sizeLocal();
220  unsigned int dim2 = muVec2.sizeLocal();
221 
222  queso_require_msg(!((sigmaMat11.numRowsLocal() != dim1) || (sigmaMat11.numCols() != dim1)), "invalid sigmaMat11");
223 
224  queso_require_msg(!((sigmaMat12.numRowsLocal() != dim1) || (sigmaMat12.numCols() != dim2)), "invalid sigmaMat12");
225 
226  queso_require_msg(!((sigmaMat21.numRowsLocal() != dim2) || (sigmaMat21.numCols() != dim1)), "invalid sigmaMat21");
227 
228  queso_require_msg(!((sigmaMat22.numRowsLocal() != dim2) || (sigmaMat22.numCols() != dim2)), "invalid sigmaMat22");
229 
230  // Check transpose operation
231  M mat_tt(sigmaMat12);
232  mat_tt.cwSet(0.);
233  mat_tt.fillWithTranspose(0,0,sigmaMat21,true,true);
234  double auxNorm = (mat_tt - sigmaMat12).normFrob();
235  if (auxNorm >= 1.e-12) {
236  if (env.subDisplayFile()) {
237  *env.subDisplayFile() << "In ComputeConditionalGaussianVectorRV()"
238  << ": WARNING, ||sigmaMat21^T - sigmaMat12||_2 = " << auxNorm
239  << std::endl;
240  }
241  }
242  queso_require_less_msg(auxNorm, 1.e-12, "sigmaMat12 and sigmaMat21 are not transpose of each other");
243 
244  queso_require_equal_to_msg(sampleVec2.sizeLocal(), dim2, "invalid sampleVec2");
245 
246  queso_require_equal_to_msg(muVec1_cond_on_2.sizeLocal(), dim1, "invalid muVec1_cond_on_2");
247 
248  queso_require_msg(!((sigmaMat11_cond_on_2.numRowsLocal() != dim1) || (sigmaMat11_cond_on_2.numCols() != dim1)), "invalid sigmaMat11_cond_on_2");
249 
250  muVec1_cond_on_2 = muVec1 + sigmaMat12 * sigmaMat22.invertMultiply(sampleVec2 - muVec2);
251  sigmaMat11_cond_on_2 = sigmaMat11 - sigmaMat12 * sigmaMat22.invertMultiply(sigmaMat21);
252 
253  return;
254 }
#define queso_require_less_msg(expr1, expr2, msg)
Definition: asserts.h:87
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
template<class T >
void QUESO::ComputeCovCorrBetweenScalarSequences ( const ScalarSequence< T > &  subPSeq,
const ScalarSequence< T > &  subQSeq,
unsigned int  subNumSamples,
T &  covValue,
T &  corrValue 
)

Definition at line 4083 of file ScalarSequence.C.

References QUESO::ScalarSequence< T >::env(), QUESO::BaseEnvironment::inter0Comm(), QUESO::BaseEnvironment::inter0Rank(), k, queso_require_msg, RawValue_MPI_SUM, QUESO::ScalarSequence< T >::subSequenceSize(), QUESO::ScalarSequence< T >::unifiedMeanExtra(), and QUESO::ScalarSequence< T >::unifiedSampleVarianceExtra().

Referenced by ComputeSubGaussian2dKde().

4089 {
4090  // Check input data consistency
4091  const BaseEnvironment& env = subPSeq.env();
4092 
4093  queso_require_msg(!((subNumSamples > subPSeq.subSequenceSize()) || (subNumSamples > subQSeq.subSequenceSize())), "subNumSamples is too large");
4094 
4095  // For both P and Q vector sequences: fill them
4096  T tmpP = 0.;
4097  T tmpQ = 0.;
4098 
4099  // For both P and Q vector sequences: compute the unified mean
4100  T unifiedMeanP = subPSeq.unifiedMeanExtra(true,0,subNumSamples);
4101  T unifiedMeanQ = subQSeq.unifiedMeanExtra(true,0,subNumSamples);
4102 
4103  // Compute "sub" covariance matrix
4104  covValue = 0.;
4105  for (unsigned k = 0; k < subNumSamples; ++k) {
4106  // For both P and Q vector sequences: get the difference (wrt the unified mean) in them
4107  tmpP = subPSeq[k] - unifiedMeanP;
4108  tmpQ = subQSeq[k] - unifiedMeanQ;
4109  covValue += tmpP*tmpQ;
4110  }
4111 
4112  // For both P and Q vector sequences: compute the unified variance
4113  T unifiedSampleVarianceP = subPSeq.unifiedSampleVarianceExtra(true,
4114  0,
4115  subNumSamples,
4116  unifiedMeanP);
4117 
4118  T unifiedSampleVarianceQ = subQSeq.unifiedSampleVarianceExtra(true,
4119  0,
4120  subNumSamples,
4121  unifiedMeanQ);
4122 
4123  // Compute unified covariance
4124  if (env.inter0Rank() >= 0) {
4125  unsigned int unifiedNumSamples = 0;
4126  env.inter0Comm().template Allreduce<unsigned int>(&subNumSamples, &unifiedNumSamples, (int) 1, RawValue_MPI_SUM,
4127  "ComputeCovCorrBetweenScalarSequences()",
4128  "failed MPI.Allreduce() for subNumSamples");
4129 
4130  double aux = 0.;
4131  env.inter0Comm().template Allreduce<double>(&covValue, &aux, (int) 1, RawValue_MPI_SUM,
4132  "ComputeCovCorrBetweenScalarSequences()",
4133  "failed MPI.Allreduce() for a matrix position");
4134  covValue = aux/((double) (unifiedNumSamples-1)); // Yes, '-1' in order to compensate for the 'N-1' denominator factor in the calculations of sample variances above (whose square roots will be used below)
4135 
4136  corrValue = covValue/std::sqrt(unifiedSampleVarianceP)/std::sqrt(unifiedSampleVarianceQ);
4137 
4138  if ((corrValue < -1.) || (corrValue > 1.)) { // prudencio 2010-07-23
4139  std::cerr << "In ComputeCovCorrBetweenScalarSequences()"
4140  << ": computed correlation is out of range, corrValue = " << corrValue
4141  << std::endl;
4142  }
4143 
4144  // env.worldRank(),
4145  // "ComputeCovCorrBetweenScalarSequences()",
4146  // "computed correlation is out of range");
4147  }
4148  else {
4149  // Node not in the 'inter0' communicator: do nothing extra
4150  }
4151 
4152  return;
4153 }
#define RawValue_MPI_SUM
Definition: MpiComm.h:71
int k
Definition: ann_sample.cpp:53
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
template<class P_V , class P_M , class Q_V , class Q_M >
void QUESO::ComputeCovCorrMatricesBetweenVectorRvs ( const BaseVectorRV< P_V, P_M > &  paramRv,
const BaseVectorRV< Q_V, Q_M > &  qoiRv,
unsigned int  localNumSamples,
P_M &  pqCovMatrix,
P_M &  pqCorrMatrix 
)

Definition at line 201 of file VectorRV.C.

References ComputeCovCorrMatricesBetweenVectorSequences(), QUESO::BaseVectorRV< V, M >::imageSet(), k, QUESO::VectorSpace< V, M >::numOfProcsForStorage(), queso_require_msg, QUESO::BaseVectorRealizer< V, M >::realization(), QUESO::BaseVectorRV< V, M >::realizer(), QUESO::VectorSet< V, M >::vectorSpace(), and QUESO::VectorSpace< V, M >::zeroVector().

207 {
208  // Check input data consistency
209  bool useOnlyInter0Comm = (paramRv.imageSet().vectorSpace().numOfProcsForStorage() == 1) &&
210  (qoiRv.imageSet().vectorSpace().numOfProcsForStorage() == 1);
211 
212  queso_require_msg(useOnlyInter0Comm, "parallel vectors not supported yet");
213 
214  unsigned int numRows = paramRv.imageSet().vectorSpace().dim();
215  unsigned int numCols = qoiRv.imageSet().vectorSpace().dim();
216 
217  queso_require_msg(!((numRows != pqCovMatrix.numRows()) || (numCols != pqCovMatrix.numCols())), "inconsistent dimensions for covariance matrix");
218 
219  queso_require_msg(!((numRows != pqCorrMatrix.numRows()) || (numCols != pqCorrMatrix.numCols())), "inconsistent dimensions for correlation matrix");
220 
221  queso_require_msg(!((localNumSamples > paramRv.realizer().period()) || (localNumSamples > qoiRv.realizer().period())), "localNumSamples is too large");
222 
223  // For both P and Q vector sequences: fill them
224  P_V tmpP(paramRv.imageSet().vectorSpace().zeroVector());
225  Q_V tmpQ(qoiRv.imageSet().vectorSpace().zeroVector());
226 
227  SequenceOfVectors<P_V,P_M> localWorkingPSeq(paramRv.imageSet().vectorSpace(),
228  localNumSamples,
229  "covTmpP");
230  SequenceOfVectors<Q_V,Q_M> localWorkingQSeq(qoiRv.imageSet().vectorSpace(),
231  localNumSamples,
232  "covTmpQ");
233  for (unsigned int k = 0; k < localNumSamples; ++k) {
234  paramRv.realizer().realization(tmpP);
235  localWorkingPSeq.setPositionValues(k,tmpP);
236 
237  qoiRv.realizer().realization(tmpQ);
238  localWorkingQSeq.setPositionValues(k,tmpQ);
239  }
240 
242  localWorkingQSeq,
243  localNumSamples,
244  pqCovMatrix,
245  pqCorrMatrix);
246 
247  return;
248 }
const BaseVectorRealizer< V, M > & realizer() const
Finds a realization (sample) of the PDF of this vector RV; access to private attribute m_realizer...
Definition: VectorRV.C:98
void ComputeCovCorrMatricesBetweenVectorSequences(const BaseVectorSequence< P_V, P_M > &subPSeq, const BaseVectorSequence< Q_V, Q_M > &subQSeq, unsigned int subNumSamples, P_M &pqCovMatrix, P_M &pqCorrMatrix)
int k
Definition: ann_sample.cpp:53
virtual const VectorSpace< V, M > & vectorSpace() const =0
Vector space to which this set belongs to. See template specialization.
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
virtual void realization(V &nextValues) const =0
Performs a realization (sample) from a probability density function. See template specialization...
const V & zeroVector() const
Returns a vector filled with zeros.
Definition: VectorSpace.C:189
unsigned int numOfProcsForStorage() const
Returns total number of processes.
Definition: VectorSpace.C:164
const VectorSet< V, M > & imageSet() const
Image set of the vector RV; access to private attribute m_imageSet.
Definition: VectorRV.C:82
template<class P_V , class P_M , class Q_V , class Q_M >
void QUESO::ComputeCovCorrMatricesBetweenVectorSequences ( const BaseVectorSequence< P_V, P_M > &  subPSeq,
const BaseVectorSequence< Q_V, Q_M > &  subQSeq,
unsigned int  subNumSamples,
P_M &  pqCovMatrix,
P_M &  pqCorrMatrix 
)

Definition at line 2774 of file VectorSequence.C.

References QUESO::MpiComm::Barrier(), QUESO::VectorSpace< V, M >::dimGlobal(), QUESO::VectorSpace< V, M >::dimLocal(), QUESO::BaseVectorSequence< V, M >::getPositionValues(), QUESO::BaseEnvironment::inter0Comm(), QUESO::BaseEnvironment::inter0Rank(), k, QUESO::VectorSpace< V, M >::numOfProcsForStorage(), queso_require_greater_equal_msg, queso_require_greater_msg, queso_require_less_equal_msg, queso_require_msg, RawValue_MPI_SUM, QUESO::BaseVectorSequence< V, M >::subSequenceSize(), QUESO::BaseVectorSequence< V, M >::unifiedMeanExtra(), QUESO::BaseVectorSequence< V, M >::unifiedSampleVarianceExtra(), QUESO::BaseVectorSequence< V, M >::vectorSpace(), QUESO::BaseEnvironment::worldRank(), and QUESO::VectorSpace< V, M >::zeroVector().

Referenced by ComputeCovCorrMatricesBetweenVectorRvs(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::predictVUsAtGridPoint(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::predictWsAtGridPoint(), and QUESO::StatisticalForwardProblem< P_V, P_M, Q_V, Q_M >::solveWithMonteCarlo().

2780 {
2781  queso_require_greater_equal_msg(subNumSamples, 2,
2782  "must provide at least 2 samples to compute correlation matrices");
2783 
2784  // Check input data consistency
2785  const BaseEnvironment& env = subPSeq.vectorSpace().zeroVector().env();
2786 
2787  bool useOnlyInter0Comm = (subPSeq.vectorSpace().numOfProcsForStorage() == 1) &&
2788  (subQSeq.vectorSpace().numOfProcsForStorage() == 1);
2789 
2790  queso_require_msg(useOnlyInter0Comm, "parallel vectors not supported yet");
2791 
2792  unsigned int numRowsLocal = subPSeq.vectorSpace().dimLocal();
2793  unsigned int numCols = subQSeq.vectorSpace().dimGlobal();
2794 
2795  queso_require_msg(!((numRowsLocal != pqCovMatrix.numRowsLocal()) || (numCols != pqCovMatrix.numCols())), "inconsistent dimensions for covariance matrix");
2796 
2797  queso_require_msg(!((numRowsLocal != pqCorrMatrix.numRowsLocal()) || (numCols != pqCorrMatrix.numCols())), "inconsistent dimensions for correlation matrix");
2798 
2799  queso_require_msg(!((subNumSamples > subPSeq.subSequenceSize()) || (subNumSamples > subQSeq.subSequenceSize())), "subNumSamples is too large");
2800 
2801  // For both P and Q vector sequences: fill them
2802  P_V tmpP(subPSeq.vectorSpace().zeroVector());
2803  Q_V tmpQ(subQSeq.vectorSpace().zeroVector());
2804 
2805  // For both P and Q vector sequences: compute the unified mean
2806  P_V unifiedMeanP(subPSeq.vectorSpace().zeroVector());
2807  subPSeq.unifiedMeanExtra(0,subNumSamples,unifiedMeanP);
2808 
2809  Q_V unifiedMeanQ(subQSeq.vectorSpace().zeroVector());
2810  subQSeq.unifiedMeanExtra(0,subNumSamples,unifiedMeanQ);
2811 
2812  // Compute "sub" covariance matrix
2813  for (unsigned i = 0; i < numRowsLocal; ++i) {
2814  for (unsigned j = 0; j < numCols; ++j) {
2815  pqCovMatrix(i,j) = 0.;
2816  }
2817  }
2818  for (unsigned k = 0; k < subNumSamples; ++k) {
2819  // For both P and Q vector sequences: get the difference (wrt the unified mean) in them
2820  subPSeq.getPositionValues(k,tmpP);
2821  tmpP -= unifiedMeanP;
2822 
2823  subQSeq.getPositionValues(k,tmpQ);
2824  tmpQ -= unifiedMeanQ;
2825 
2826  for (unsigned i = 0; i < numRowsLocal; ++i) {
2827  for (unsigned j = 0; j < numCols; ++j) {
2828  pqCovMatrix(i,j) += tmpP[i]*tmpQ[j];
2829  }
2830  }
2831  }
2832 
2833  // For both P and Q vector sequences: compute the unified variance
2834  P_V unifiedSampleVarianceP(subPSeq.vectorSpace().zeroVector());
2835  subPSeq.unifiedSampleVarianceExtra(0,
2836  subNumSamples,
2837  unifiedMeanP,
2838  unifiedSampleVarianceP);
2839 
2840  Q_V unifiedSampleVarianceQ(subQSeq.vectorSpace().zeroVector());
2841  subQSeq.unifiedSampleVarianceExtra(0,
2842  subNumSamples,
2843  unifiedMeanQ,
2844  unifiedSampleVarianceQ);
2845 
2846  // Check the variance is positive in every component
2847  double minSampleVarianceP;
2848  double minSampleVarianceQ;
2849  minSampleVarianceP = unifiedSampleVarianceP.getMinValue();
2850  minSampleVarianceQ = unifiedSampleVarianceQ.getMinValue();
2851  queso_require_greater_msg(minSampleVarianceP, 0, "sample variance is not positive");
2852  queso_require_greater_msg(minSampleVarianceQ, 0, "sample variance is not positive");
2853 
2854  // Compute unified covariance matrix
2855  if (useOnlyInter0Comm) {
2856  if (env.inter0Rank() >= 0) {
2857  unsigned int unifiedNumSamples = 0;
2858  env.inter0Comm().template Allreduce<unsigned int>(&subNumSamples, &unifiedNumSamples, (int) 1, RawValue_MPI_SUM,
2859  "ComputeCovCorrMatricesBetweenVectorSequences()",
2860  "failed MPI.Allreduce() for subNumSamples");
2861 
2862  for (unsigned i = 0; i < numRowsLocal; ++i) {
2863  for (unsigned j = 0; j < numCols; ++j) {
2864  double aux = 0.;
2865  env.inter0Comm().template Allreduce<double>(&pqCovMatrix(i,j), &aux, (int) 1, RawValue_MPI_SUM,
2866  "ComputeCovCorrMatricesBetweenVectorSequences()",
2867  "failed MPI.Allreduce() for a matrix position");
2868  pqCovMatrix(i,j) = aux/((double) (unifiedNumSamples-1)); // Yes, '-1' in order to compensate for the 'N-1' denominator factor in the calculations of sample variances above (whose square roots will be used below)
2869  }
2870  }
2871 
2872  for (unsigned i = 0; i < numRowsLocal; ++i) {
2873  for (unsigned j = 0; j < numCols; ++j) {
2874  pqCorrMatrix(i,j) = pqCovMatrix(i,j)/std::sqrt(unifiedSampleVarianceP[i])/std::sqrt(unifiedSampleVarianceQ[j]);
2875  if (((pqCorrMatrix(i,j) + 1.) < -1.e-8) ||
2876  ((pqCorrMatrix(i,j) - 1.) > 1.e-8)) {
2877  if (env.inter0Rank() == 0) {
2878  std::cerr << "In ComputeCovCorrMatricesBetweenVectorSequences()"
2879  << ": worldRank = " << env.worldRank()
2880  << ", i = " << i
2881  << ", j = " << j
2882  << ", pqCorrMatrix(i,j)+1 = " << pqCorrMatrix(i,j)+1.
2883  << ", pqCorrMatrix(i,j)-1 = " << pqCorrMatrix(i,j)-1.
2884  << std::endl;
2885  }
2886  env.inter0Comm().Barrier();
2887  }
2889  (pqCorrMatrix(i,j), -1. - 1.e-8,
2890  "computed correlation is out of range");
2892  (pqCorrMatrix(i,j), 1. + 1.e-8,
2893  "computed correlation is out of range");
2894  }
2895  }
2896  }
2897  else {
2898  // Node not in the 'inter0' communicator: do nothing extra
2899  }
2900  }
2901  else {
2902  queso_require_msg(useOnlyInter0Comm, "parallel vectors not supported yet (2)");
2903  }
2904 
2905  return;
2906 }
#define RawValue_MPI_SUM
Definition: MpiComm.h:71
int k
Definition: ann_sample.cpp:53
unsigned int dimGlobal() const
Definition: VectorSpace.C:176
#define queso_require_less_equal_msg(expr1, expr2, msg)
Definition: asserts.h:89
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
virtual void unifiedMeanExtra(unsigned int initialPos, unsigned int numPos, V &unifiedMeanVec) const =0
Finds the mean value of the unified sequence of numPos positions starting at position initialPos...
virtual void unifiedSampleVarianceExtra(unsigned int initialPos, unsigned int numPos, const V &unifiedMeanVec, V &unifiedSamVec) const =0
Finds the sample variance of the unified sequence, considering numPos positions starting at position ...
#define queso_require_greater_equal_msg(expr1, expr2, msg)
Definition: asserts.h:90
const VectorSpace< V, M > & vectorSpace() const
Vector space; access to protected attribute VectorSpace&lt;V,M&gt;&amp; m_vectorSpace.
const V & zeroVector() const
Returns a vector filled with zeros.
Definition: VectorSpace.C:189
virtual void getPositionValues(unsigned int posId, V &vec) const =0
Gets the values of the sequence at position posId and stores them at vec. See template specialization...
unsigned int numOfProcsForStorage() const
Returns total number of processes.
Definition: VectorSpace.C:164
virtual unsigned int subSequenceSize() const =0
Size of the sub-sequence of vectors. See template specialization.
unsigned int dimLocal() const
Definition: VectorSpace.C:170
#define queso_require_greater_msg(expr1, expr2, msg)
Definition: asserts.h:88
template<class T >
void QUESO::ComputeSubGaussian2dKde ( const ScalarSequence< T > &  scalarSeq1,
const ScalarSequence< T > &  scalarSeq2,
unsigned int  initialPos,
double  scaleValue1,
double  scaleValue2,
const std::vector< T > &  evaluationPositions1,
const std::vector< T > &  evaluationPositions2,
std::vector< double > &  densityValues 
)

Definition at line 3974 of file ScalarSequence.C.

References ComputeCovCorrBetweenScalarSequences(), k, queso_require_equal_to_msg, queso_require_msg, and QUESO::ScalarSequence< T >::subSequenceSize().

Referenced by ComputeUnifiedGaussian2dKde().

3982 {
3983  queso_require_equal_to_msg(initialPos, 0, "not implemented yet for initialPos != 0");
3984 
3985  double covValue = 0.;
3986  double corrValue = 0.;
3988  scalarSeq2,
3989  scalarSeq1.subSequenceSize(),
3990  covValue,
3991  corrValue);
3992 
3993  bool bRC = ((initialPos < scalarSeq1.subSequenceSize()) &&
3994  (scalarSeq1.subSequenceSize() == scalarSeq2.subSequenceSize()) &&
3995  (0 < evaluationPositions1.size() ) &&
3996  (evaluationPositions1.size() == evaluationPositions2.size() ) &&
3997  (evaluationPositions1.size() == densityValues.size() ));
3998  queso_require_msg(bRC, "invalid input data");
3999 
4000  unsigned int dataSize = scalarSeq1.subSequenceSize() - initialPos;
4001  unsigned int numEvals = evaluationPositions1.size();
4002 
4003  double scale1Inv = 1./scaleValue1;
4004  double scale2Inv = 1./scaleValue2;
4005  //corrValue = 0.;
4006  double r = 1. - corrValue*corrValue;
4007  if (r <= 0.) { // prudencio 2010-07-23
4008  std::cerr << "In ComputeSubGaussian2dKde()"
4009  << ": WARNING, r = " << r
4010  << std::endl;
4011  }
4012 
4013  // scalarSeq1.env().worldRank(),
4014  // "ComputeSubGaussian2dKde()",
4015  // "negative r");
4016  for (unsigned int j = 0; j < numEvals; ++j) {
4017  double x1 = evaluationPositions1[j];
4018  double x2 = evaluationPositions2[j];
4019  double value = 0.;
4020  for (unsigned int k = 0; k < dataSize; ++k) {
4021  double d1k = scale1Inv*(x1 - scalarSeq1[initialPos+k]);
4022  double d2k = scale2Inv*(x2 - scalarSeq2[initialPos+k]);
4023  value += exp(-.5*( d1k*d1k + 2*corrValue*d1k*d2k + d2k*d2k )/r);
4024  }
4025  densityValues[j] = scale1Inv * scale2Inv * (value/(double) dataSize) / 2. / M_PI / sqrt(r);
4026  }
4027 
4028  return;
4029 }
int k
Definition: ann_sample.cpp:53
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
void ComputeCovCorrBetweenScalarSequences(const ScalarSequence< T > &subPSeq, const ScalarSequence< T > &subQSeq, unsigned int subNumSamples, T &covValue, T &corrValue)
template<class T >
void QUESO::ComputeUnifiedGaussian2dKde ( bool  useOnlyInter0Comm,
const ScalarSequence< T > &  scalarSeq1,
const ScalarSequence< T > &  scalarSeq2,
unsigned int  initialPos,
double  unifiedScaleValue1,
double  unifiedScaleValue2,
const std::vector< T > &  unifiedEvaluationPositions1,
const std::vector< T > &  unifiedEvaluationPositions2,
std::vector< double > &  unifiedDensityValues 
)

Definition at line 4033 of file ScalarSequence.C.

References ComputeSubGaussian2dKde(), QUESO::ScalarSequence< T >::env(), QUESO::BaseEnvironment::inter0Rank(), QUESO::BaseEnvironment::numSubEnvironments(), and queso_error_msg.

4042 {
4043  if (scalarSeq1.env().numSubEnvironments() == 1) {
4044  return ComputeSubGaussian2dKde(scalarSeq1,
4045  scalarSeq2,
4046  initialPos,
4047  unifiedScaleValue1,
4048  unifiedScaleValue2,
4049  unifiedEvaluationPositions1,
4050  unifiedEvaluationPositions2,
4051  unifiedDensityValues);
4052  }
4053 
4054  // As of 14/Nov/2009, this routine needs to be checked if it requires sub sequences to have equal size. Good.
4055 
4056  if (useOnlyInter0Comm) {
4057  if (scalarSeq1.env().inter0Rank() >= 0) {
4058  queso_error_msg("inter0 case not supported yet");
4059  }
4060  else {
4061  // Node not in the 'inter0' communicator
4062  ComputeSubGaussian2dKde(scalarSeq1,
4063  scalarSeq2,
4064  initialPos,
4065  unifiedScaleValue1,
4066  unifiedScaleValue2,
4067  unifiedEvaluationPositions1,
4068  unifiedEvaluationPositions2,
4069  unifiedDensityValues);
4070  }
4071  }
4072  else {
4073  queso_error_msg("parallel vectors not supported yet");
4074  }
4075 
4076  //scalarSeq1.env().fullComm().Barrier();
4077 
4078  return;
4079 }
#define queso_error_msg(msg)
Definition: asserts.h:47
void ComputeSubGaussian2dKde(const ScalarSequence< T > &scalarSeq1, const ScalarSequence< T > &scalarSeq2, unsigned int initialPos, double scaleValue1, double scaleValue2, const std::vector< T > &evaluationPositions1, const std::vector< T > &evaluationPositions2, std::vector< double > &densityValues)
template<class V , class M >
void QUESO::CovCond ( double  condNumber,
const V &  direction,
M &  covMatrix,
M &  precMatrix 
)

Definition at line 30 of file CovCond.C.

References leftDiagScaling(), and matrixProduct().

32 {
33  //std::cout << "Entering CovCond()"
34  // << std::endl;
35 
36  V v1(direction);
37  //std::cout << "In CovCond(), v1 contents are:"
38  // << std::endl
39  // << v1
40  // << std::endl;
41 
42  V v2(direction,condNumber,1.0); // MATLAB linspace
43  v2.cwInvert();
44  v2.sort();
45  //std::cout << "In CovCond(), v2 contents are:"
46  // << std::endl
47  // << v2
48  // << std::endl;
49 
50  double v1Norm2 = v1.norm2();
51  if (v1[0] >=0) v1[0] += v1Norm2;
52  else v1[0] -= v1Norm2;
53  double v1Norm2Sq = v1.norm2Sq();
54 
55  M Z(direction,1.0);
56  Z -= (2./v1Norm2Sq) * matrixProduct(v1,v1);
57  //std::cout << "In CovCond(), Z contents are:"
58  // << std::endl
59  // << Z
60  // << std::endl;
61 
62  M Zt(Z.transpose());
63  covMatrix = Z * leftDiagScaling(v2, Zt);
64  precMatrix = Z * leftDiagScaling(1./v2,Zt);
65 
66  //std::cout << "Leaving CovCond()"
67  // << std::endl;
68 }
GslMatrix matrixProduct(const GslVector &v1, const GslVector &v2)
Definition: GslMatrix.C:2001
GslMatrix leftDiagScaling(const GslVector &vec, const GslMatrix &mat)
Definition: GslMatrix.C:2017
int QUESO::GRVY_CheckDir ( const char *  dirname)

Definition at line 456 of file Miscellaneous.C.

Referenced by CheckFilePath().

457 {
458  struct stat st;
459 
460  if(stat(dirname,&st) != 0)
461  {
462  if( mkdir(dirname,0700) != 0 )
463  {
464  std::cerr << __func__ << ": error - unable to create directory " << dirname << std::endl;
465  return -1;
466  }
467  }
468  else if (!S_ISDIR(st.st_mode))
469  {
470  std::cerr << __func__ << ": error - entry exists, but is not a directory " << dirname << std::endl;
471  return -1;
472  }
473 
474  return 0;
475 }
template<class T >
double QUESO::horizontalDistance ( const BaseScalarCdf< T > &  cdf1,
const BaseScalarCdf< T > &  cdf2,
double  epsilon 
)

It calculated the maximum horizontal distance between two CDFs.

Definition at line 96 of file ScalarCdf.C.

References QUESO::BaseEnvironment::displayVerbosity(), QUESO::BaseScalarCdf< T >::env(), QUESO::BaseScalarCdf< T >::inverse(), QUESO::BaseScalarCdf< T >::prefix(), QUESO::BaseEnvironment::subDisplayFile(), and QUESO::BaseScalarCdf< T >::value().

Referenced by horizontalDistances().

99 {
100  double maxDistance = 0.;
101  double xForMaxDistance = 0.;
102 
103  double x1 = cdf1.inverse(epsilon*.5);
104  double x2 = cdf1.inverse(1.-epsilon*.5);
105  if (cdf1.env().subDisplayFile()) {
106  *cdf1.env().subDisplayFile() << "In horizontalDistance()"
107  << ", cdf1.prefix() = " << cdf1.prefix()
108  << ", cdf2.prefix() = " << cdf2.prefix()
109  << ", epsilon = " << epsilon
110  << ": x1 = " << x1
111  << ", x2 = " << x2
112  << std::endl;
113  }
114 
115  //if (cdf1.env().subDisplayFile()) {
116  // *cdf1.env().subDisplayFile() << "In horizontalDistance: x1 = " << x1
117  // << ", x2 = " << x2
118  // << std::endl;
119  //}
120 
121  double numEvaluationPoints = 1001.;
122  for (double i = 0.; i < numEvaluationPoints; ++i) {
123  double ratio = i/(numEvaluationPoints-1.); // IMPORTANT: Yes, '-1.'
124  double x = (1.-ratio)*x1 + ratio*x2;
125  double y = cdf2.inverse(cdf1.value(x));
126  double d = fabs(x-y);
127  if ((cdf1.env().subDisplayFile()) && (cdf1.env().displayVerbosity() >= 3)) {
128  *cdf1.env().subDisplayFile() << "In horizontalDistance"
129  << ": i = " << i
130  << ", x = " << x
131  << ", cdf1.value(x) = " << cdf1.value(x)
132  << ", y = " << y
133  << ", d = " << d
134  << ", currentMaxDistance = " << maxDistance
135  << std::endl;
136  }
137  if (maxDistance < d) {
138  maxDistance = d;
139  xForMaxDistance = x;
140  if ((cdf1.env().subDisplayFile()) && (cdf1.env().displayVerbosity() >= 3)) {
141  *cdf1.env().subDisplayFile() << "In horizontalDistance"
142  << ": i = " << i
143  << ", NOW maxDistance = " << maxDistance
144  << ", xForMaxDistance = " << xForMaxDistance
145  << std::endl;
146  }
147  }
148  }
149 
150  if (cdf1.env().subDisplayFile()) {
151  *cdf1.env().subDisplayFile() << "In horizontalDistance()"
152  << ", cdf1.prefix() = " << cdf1.prefix()
153  << ", cdf2.prefix() = " << cdf2.prefix()
154  << ", epsilon = " << epsilon
155  << ": maxDistance = " << maxDistance
156  << ", xForMaxDistance = " << xForMaxDistance
157  << std::endl;
158  }
159 
160  return maxDistance;
161 }
double epsilon
Definition: ann_test.cpp:484
template<class V , class M >
void QUESO::horizontalDistances ( const BaseVectorCdf< V, M > &  cdf1,
const BaseVectorCdf< V, M > &  cdf2,
const V &  epsilonVec,
V &  distances 
)

It calculated the maximum horizontal distances between two vector CDFs.

Definition at line 84 of file VectorCdf.C.

References QUESO::BaseVectorCdf< V, M >::cdf(), horizontalDistance(), and QUESO::BaseVectorCdf< V, M >::pdfSupport().

88 {
89  for (unsigned int i = 0; i < cdf1.pdfSupport().vectorSpace().dimLocal(); ++i) {
90  distances[i] = horizontalDistance(cdf1.cdf(i),
91  cdf2.cdf(i),
92  epsilonVec[i]);
93  }
94 
95  return;
96 }
double horizontalDistance(const BaseScalarCdf< T > &cdf1, const BaseScalarCdf< T > &cdf2, double epsilon)
It calculated the maximum horizontal distance between two CDFs.
Definition: ScalarCdf.C:96
template<class V , class M >
VectorSet< V, M > * QUESO::InstantiateIntersection ( const VectorSet< V, M > &  domain1,
const VectorSet< V, M > &  domain2 
)

This method calculates the intersection of domain1 and domain2.

It is used, for instance, to calculate the domain of the Posterior PDF, which is the intersection of the domain of the Prior PDF and of the likelihood function.

Definition at line 37 of file InstantiateIntersection.C.

References QUESO::VectorSpace< V, M >::dimGlobal(), QUESO::VectorSpace< V, M >::env(), QUESO::BoxSubset< V, M >::maxValues(), QUESO::BoxSubset< V, M >::minValues(), QUESO::VectorSet< V, M >::prefix(), queso_error_msg, QUESO::VectorSubset< V, M >::vectorSpace(), and QUESO::VectorSet< V, M >::vectorSpace().

Referenced by QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::calibrateWithBayesMetropolisHastings(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::calibrateWithBayesMLSampling(), QUESO::StatisticalInverseProblem< P_V, P_M >::solveWithBayesMetropolisHastings(), and QUESO::StatisticalInverseProblem< P_V, P_M >::solveWithBayesMLSampling().

38 {
39  VectorSet<V,M>* result = NULL;
40 
41  unsigned int dim1 = domain1.vectorSpace().dimGlobal();
42  unsigned int dim2 = domain2.vectorSpace().dimGlobal();
43 
44  if (result == NULL) {
45  const VectorSpace<V,M>* tmp1 = dynamic_cast<const VectorSpace<V,M>* >(&domain1);
46  const VectorSpace<V,M>* tmp2 = dynamic_cast<const VectorSpace<V,M>* >(&domain2);
47 
48  if ((tmp1 != NULL) && (tmp2 != NULL)) {
49  if (dim1 < dim2) {
50  result = new VectorSpace<V,M>(tmp1->env(),
51  tmp1->prefix().c_str(),
52  tmp1->dimGlobal(),
53  NULL);//tmp1->componentsNames());
54  }
55  else if (dim1 == dim2) {
56  result = new VectorSpace<V,M>(tmp1->env(),
57  tmp1->prefix().c_str(),
58  tmp1->dimGlobal(),
59  NULL);//tmp1->componentsNames());
60  }
61  else {
62  result = new VectorSpace<V,M>(tmp2->env(),
63  tmp2->prefix().c_str(),
64  tmp2->dimGlobal(),
65  NULL);//tmp2->componentsNames());
66  }
67  }
68  }
69 
70  if (result == NULL) {
71  const VectorSubset<V,M>* tmp1 = dynamic_cast<const VectorSubset<V,M>* >(&domain1);
72  const VectorSubset<V,M>* tmp2 = dynamic_cast<const VectorSubset<V,M>* >(&domain2);
73 
74  if ((tmp1 != NULL) && (tmp2 != NULL)) {
75  if (dim1 == dim2) {
76  const BoxSubset<V,M>* box1 = dynamic_cast<const BoxSubset<V,M>* >(&domain1);
77  const BoxSubset<V,M>* box2 = dynamic_cast<const BoxSubset<V,M>* >(&domain2);
78 
79  if ((box1 != NULL) && (box2 != NULL)) {
80  V minV(box1->minValues());
81  V maxV(box1->maxValues());
82  for (unsigned int i = 0; i < dim1; ++i) {
83  minV[i] = std::max(box1->minValues()[i],
84  box2->minValues()[i]);
85  }
86  for (unsigned int i = 0; i < dim1; ++i) {
87  maxV[i] = std::min(box1->maxValues()[i],
88  box2->maxValues()[i]);
89  }
90  result = new BoxSubset<V,M>(box1->prefix().c_str(),
91  box1->vectorSpace(),
92  minV,
93  maxV);
94  }
95  else {
96  result = new IntersectionSubset<V,M>(tmp1->prefix().c_str(),
97  tmp1->vectorSpace(),
98  0., // FIX ME
99  domain1,
100  domain2);
101  }
102  }
103  else {
104  queso_error_msg("situation 001");
105  }
106  }
107  }
108 
109  if (result == NULL) {
110  const VectorSubset<V,M>* tmp1 = dynamic_cast<const VectorSubset<V,M>* >(&domain1);
111  const VectorSpace <V,M>* tmp2 = dynamic_cast<const VectorSpace <V,M>* >(&domain2);
112 
113  if ((tmp1 != NULL) && (tmp2 != NULL)) {
114  if (dim1 == dim2) {
115  const BoxSubset<V,M>* box1 = dynamic_cast<const BoxSubset<V,M>* >(&domain1);
116  if (box1 != NULL) {
117  result = new BoxSubset<V,M>(box1->prefix().c_str(),
118  box1->vectorSpace(),
119  box1->minValues(),
120  box1->maxValues());
121  }
122  else {
123  queso_error_msg("situation 002");
124  }
125  }
126  else {
127  queso_error_msg("situation 003");
128  }
129  }
130  }
131 
132  if (result == NULL) {
133  const VectorSpace <V,M>* tmp1 = dynamic_cast<const VectorSpace <V,M>* >(&domain1);
134  const VectorSubset<V,M>* tmp2 = dynamic_cast<const VectorSubset<V,M>* >(&domain2);
135 
136  if ((tmp1 != NULL) && (tmp2 != NULL)) {
137  if (dim1 == dim2) {
138  const BoxSubset<V,M>* box2 = dynamic_cast<const BoxSubset<V,M>* >(&domain2);
139  if (box2 != NULL) {
140  result = new BoxSubset<V,M>(box2->prefix().c_str(),
141  box2->vectorSpace(),
142  box2->minValues(),
143  box2->maxValues());
144  }
145  else {
146  queso_error_msg("situation 004");
147  }
148  }
149  else {
150  queso_error_msg("situation 005");
151  }
152  }
153  }
154 
155  if (result == NULL) {
156  queso_error_msg("situation 006");
157  }
158 
159  return result;
160 }
#define queso_error_msg(msg)
Definition: asserts.h:47
GslMatrix QUESO::leftDiagScaling ( const GslVector &  vec,
const GslMatrix &  mat 
)

Definition at line 2017 of file GslMatrix.C.

References QUESO::GslMatrix::numCols(), QUESO::GslMatrix::numRowsLocal(), queso_require_equal_to_msg, and QUESO::GslVector::sizeLocal().

Referenced by CovCond().

2018 {
2019  unsigned int vSize = vec.sizeLocal();
2020  unsigned int mRows = mat.numRowsLocal();
2021  unsigned int mCols = mat.numCols();
2022 
2023  queso_require_equal_to_msg(vSize, mRows, "size of vector is different from the number of rows in matrix");
2024 
2025  queso_require_equal_to_msg(mCols, mRows, "routine currently works for square matrices only");
2026 
2027  GslMatrix answer(mat);
2028  for (unsigned int i = 0; i < mRows; ++i) {
2029  double vecValue = vec[i];
2030  for (unsigned int j = 0; j < mCols; ++j) {
2031  answer(i,j) *= vecValue;
2032  }
2033  }
2034 
2035  return answer;
2036 }
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
GslMatrix QUESO::matrixProduct ( const GslVector &  v1,
const GslVector &  v2 
)

Definition at line 2001 of file GslMatrix.C.

References QUESO::Vector::env(), QUESO::Vector::map(), and QUESO::GslVector::sizeLocal().

Referenced by CovCond(), QUESO::SequenceOfVectors< V, M >::estimateConvBrooksGelman(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step04_inter0(), and QUESO::MetropolisHastingsSG< P_V, P_M >::updateAdaptedCovMatrix().

2002 {
2003  unsigned int nRows = v1.sizeLocal();
2004  unsigned int nCols = v2.sizeLocal();
2005  GslMatrix answer(v1.env(),v1.map(),nCols);
2006 
2007  for (unsigned int i = 0; i < nRows; ++i) {
2008  double value1 = v1[i];
2009  for (unsigned int j = 0; j < nCols; ++j) {
2010  answer(i,j) = value1*v2[j];
2011  }
2012  }
2013 
2014  return answer;
2015 }
template<class T >
bool QUESO::MiscCheckForSameValueInAllNodes ( T &  inputValue,
double  acceptableTreshold,
const MpiComm &  comm,
const char *  whereString 
)

Definition at line 479 of file Miscellaneous.C.

References QUESO::MpiComm::Allreduce(), QUESO::MpiComm::Barrier(), QUESO::MpiComm::Bcast(), QUESO::MpiComm::MyPID(), QUESO::MpiComm::NumProc(), queso_require_less_equal_msg, RawValue_MPI_DOUBLE, and RawValue_MPI_SUM.

Referenced by QUESO::MLSampling< P_V, P_M >::generateSequence_Step03_inter0(), and QUESO::MLSampling< P_V, P_M >::generateSequence_Step09_all().

483 {
484  // Filter out those nodes that should not participate
485  if (comm.MyPID() < 0) return true;
486 
487  double localValue = (double) inputValue;
488  double sumValue = 0.;
489  comm.Allreduce<double>(&localValue, &sumValue, (int) 1, RawValue_MPI_SUM,
490  whereString,
491  "failed MPI on 'sumValue' inside MiscCheckForSameValueInAllNodes()");
492 
493  double totalNumNodes = (double) comm.NumProc();
494  double testValue = fabs(1. - localValue/(sumValue/totalNumNodes));
495  unsigned int boolSum = 0;
496 #if 1
497  unsigned int boolResult = 0;
498  if (testValue > acceptableTreshold) boolResult = 1;
499  comm.Allreduce<unsigned int>(&boolResult, &boolSum, (int) 1, RawValue_MPI_SUM,
500  whereString,
501  "failed MPI on 'boolSum' inside MiscCheckForSameValueInAllNodes()");
502 
503  if (boolSum > 0) {
504  comm.Barrier();
505  for (int i = 0; i < comm.NumProc(); ++i) {
506  if (i == comm.MyPID()) {
507  std::cerr << "WARNING, "
508  << whereString
509  << ", inside MiscCheckForSameValueInAllNodes()"
510  << ", rank (in this communicator) = " << i
511  << ": boolSum = " << boolSum
512  << ", localValue = " << localValue
513  << ", sumValue = " << sumValue
514  << ", totalNumNodes = " << totalNumNodes
515  << ", avgValue = " << (sumValue/totalNumNodes)
516  << ", relativeTest = " << testValue
517  << std::endl;
518  }
519  comm.Barrier();
520  }
521  comm.Barrier();
522 
523  comm.Bcast((void *) &localValue, (int) 1, RawValue_MPI_DOUBLE, 0,
524  whereString,
525  "failed MPI on 'boolSum' inside MiscCheckForSameValueInAllNodes()");
526  inputValue = localValue; // IMPORTANT
527  }
528 #else
529  queso_require_less_equal_msg(testValue, acceptableTreshold, "not all nodes have the same value inside MiscCheckForSameValueInAllNodes()");
530 #endif
531 
532  return (boolSum == 0);
533 }
#define RawValue_MPI_SUM
Definition: MpiComm.h:71
#define queso_require_less_equal_msg(expr1, expr2, msg)
Definition: asserts.h:89
#define RawValue_MPI_DOUBLE
Definition: MpiComm.h:67
template<class V1 , class V2 >
void QUESO::MiscCheckTheParallelEnvironment ( const V1 &  vec1,
const V2 &  vec2 
)

Definition at line 564 of file Miscellaneous.C.

References QUESO::BaseEnvironment::fullComm(), QUESO::MpiComm::NumProc(), QUESO::BaseEnvironment::numSubEnvironments(), queso_error_msg, queso_require_equal_to_msg, QUESO::BaseEnvironment::subComm(), and QUESO::BaseEnvironment::subRank().

565 {
566  const BaseEnvironment& env = vec1.env();
567 
568  if (env.numSubEnvironments() == (unsigned int) env.fullComm().NumProc()) {
569  queso_require_equal_to_msg(env.subRank(), 0, "there should exist only one processor per sub environment");
570  queso_require_equal_to_msg(vec1.numOfProcsForStorage(), 1,
571  "only 1 processor (per sub environment) should be necessary for the storage of a parameter vector");
572  queso_require_equal_to_msg(vec2.numOfProcsForStorage(), 1,
573  "only 1 processor (per sub environment) should be necessary for the storage of a parameter vector");
574  }
575  else if (env.numSubEnvironments() < (unsigned int) env.fullComm().NumProc()) {
576  queso_require_equal_to_msg(env.fullComm().NumProc()%env.numSubEnvironments(), 0, "total number of processors should be a multiple of the number of sub environments");
577  unsigned int numProcsPerSubEnvironment = env.fullComm().NumProc()/env.numSubEnvironments();
578  queso_require_equal_to_msg(env.subComm().NumProc(), (int) numProcsPerSubEnvironment, "inconsistent number of processors per sub environment");
579  if ((vec1.numOfProcsForStorage() == 1) &&
580  (vec2.numOfProcsForStorage() == 1)) {
581  // Ok
582  }
583  else if ((vec1.numOfProcsForStorage() == numProcsPerSubEnvironment) &&
584  (vec2.numOfProcsForStorage() == numProcsPerSubEnvironment)) {
585  queso_error_msg("parallel vectors are not supported yet");
586  }
587  else {
588  queso_error_msg("number of processors required for a vector storage should be equal to either 1 or to the number of processors in the sub environment");
589  }
590  }
591  else {
592  queso_error_msg("number of processors per sub environment is less than 1!");
593  }
594 
595  return;
596 }
#define queso_error_msg(msg)
Definition: asserts.h:47
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
template<class V >
void QUESO::MiscComputePositionsBetweenMinMax ( minValues,
maxValues,
std::vector< V * > &  positions 
)

Definition at line 537 of file Miscellaneous.C.

540 {
541  double factor = 0.5;
542  switch (positions.size()) {
543  case 0:
544  // Do nothing
545  break;
546 
547  case 1:
548  positions[0] = new V((1. - factor) * minValues + factor * maxValues);
549  break;
550 
551  default:
552  for (unsigned int i = 0; i < positions.size(); ++i) {
553  factor = ((double) i)/(((double) positions.size()) - 1.);
554  positions[i] = new V((1. - factor) * minValues + factor * maxValues);
555  }
556  break;
557  }
558 
559  return;
560 }
double QUESO::MiscDoubleDebugMessage ( double  value,
const char *  message 
)

Definition at line 334 of file Miscellaneous.C.

337 {
338  if (message) {
339  std::cout << "Passing in MiscDoubleDebugMessage(), value = " << value << ", message = " << message << std::endl;
340  }
341  return value;
342 }
double QUESO::MiscGammar ( double  a,
double  b,
const RngBase *  rngObject 
)

Definition at line 248 of file Miscellaneous.C.

References QUESO::RngBase::gaussianSample(), and QUESO::RngBase::uniformSample().

252 {
253  double result = 0.;
254  if (a < 1.) {
255  result = MiscGammar(1.+a,b,rngObject)*std::pow( rngObject->uniformSample(),1./a );
256  }
257  else {
258  double d = a-1./3.;
259  double c = 1./std::sqrt(9.*d);
260  double x = 0.;
261  double w = 0.;
262  while (1) {
263  while (1) {
264  x = rngObject->gaussianSample(1.);
265  w = 1.+c*x;
266  if (w > 0.) break;
267  }
268  w = std::pow(w,3.);
269  double u = rngObject->uniformSample();
270  double compValue = 1.-0.0331*std::pow(x,4.);
271  if (u < compValue) break;
272  compValue = 0.5*std::pow(x,2.)+d*(1.-w+log(w));
273  if (log(u) < compValue) break;
274  }
275  result = b*d*w;
276  }
277 
278  return result;
279 }
double MiscGammar(double a, double b, const RngBase *rngObject)
double QUESO::MiscGaussianDensity ( double  x,
double  mu,
double  sigma 
)

Definition at line 306 of file Miscellaneous.C.

Referenced by QUESO::ArrayOfSequences< V, M >::gaussianKDE(), QUESO::ScalarSequence< T >::subGaussian1dKde(), and QUESO::ScalarSequence< T >::unifiedGaussian1dKde().

307 {
308  double sigma2 = sigma*sigma;
309  double diff = x-mu;
310 
311  return (1./std::sqrt(2*M_PI*sigma2))*std::exp(-.5*diff*diff/sigma2);
312 }
double QUESO::MiscGetEllapsedSeconds ( struct timeval *  timeval0)

Definition at line 282 of file Miscellaneous.C.

Referenced by QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::actualGenerateSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::adapt(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::calibrateWithBayesMetropolisHastings(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::calibrateWithBayesMLSampling(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::calibrateWithLanlMcmc(), QUESO::MLSampling< P_V, P_M >::generateBalLinkedChains_all(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain(), QUESO::MLSampling< P_V, P_M >::generateSequence(), QUESO::MLSampling< P_V, P_M >::generateSequence_Level0_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step01_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step02_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step03_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step04_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step05_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step06_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step07_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step08_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step09_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step10_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step11_inter0(), QUESO::MLSampling< P_V, P_M >::generateUnbLinkedChains_all(), QUESO::MLSampling< P_V, P_M >::justBalance_proc0(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::likelihoodRoutine(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::predictVUsAtGridPoint(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::predictWsAtGridPoint(), QUESO::SequenceOfVectors< V, M >::unifiedReadContents(), QUESO::ScalarSequence< T >::unifiedReadContents(), QUESO::SequenceOfVectors< V, M >::unifiedWriteContents(), and QUESO::ScalarSequence< T >::unifiedWriteContents().

283 {
284  double result = 0.;
285 
286  struct timeval timevalNow;
287  /*int iRC;*/
288  /*iRC = */gettimeofday(&timevalNow, NULL);
289 
290  result = (double) (timevalNow.tv_sec - timeval0->tv_sec );
291  result *= 1.e+6;
292  result += (double) (timevalNow.tv_usec - timeval0->tv_usec);
293  result *= 1.e-6;
294 
295  return result;
296 }
double QUESO::MiscHammingWindow ( unsigned int  N,
unsigned int  j 
)

Definition at line 298 of file Miscellaneous.C.

299 {
300  double angle = 2.*M_PI*((double) j)/((double) N);
301  double result = 0.53836 - 0.46164*cos(angle);
302 
303  return result;
304 }
int QUESO::MiscIntDebugMessage ( int  value,
const char *  message 
)

Definition at line 324 of file Miscellaneous.C.

327 {
328  if (message) {
329  std::cout << "Passing in MiscIntDebugMessage(), value = " << value << ", message = " << message << std::endl;
330  }
331  return value;
332 }
int QUESO::MiscReadCharsAndDoubleFromFile ( std::ifstream &  ifs,
std::string &  termString,
double *  termValue,
bool &  endOfLineAchieved 
)

Definition at line 191 of file Miscellaneous.C.

References UQ_FAILED_READING_FILE_RC, and UQ_OK_RC.

Referenced by QUESO::AsciiTable< V, M >::readColumnsFromFile().

196 {
197  int iRC = UQ_OK_RC;
198  endOfLineAchieved = false;
199 
200  char c = ' ';
201  while (c == ' ') {
202  ifs.get(c);
203  if ((ifs.rdstate() & std::ifstream::failbit)) {
205  break;
206  }
207  };
208 
209  char term[512];
210  unsigned int pos = 0;
211 
212  if (!iRC) {
213  while ((pos < 512) && (c != '\n') && (c != '\0') && (c != ' ')) {
214  term[pos++] = c;
215  if ((ifs.rdstate() & std::ifstream::failbit)) {
217  break;
218  }
219  ifs.get(c);
220  };
221  }
222 
223  if (!iRC) {
224  if (c == '\n') endOfLineAchieved = true;
225  term[pos] = '\0';
226  termString = term;
227  //std::cout << "Read chars = " << termString << std::endl;
228  if (termValue) {
229  if (termString == std::string("inf")) {
230  *termValue = INFINITY;
231  }
232  else if (termString == std::string("-inf")) {
233  *termValue = -INFINITY;
234  }
235  else if (termString == std::string("nan")) {
236  *termValue = nan("");
237  }
238  else {
239  *termValue = strtod(termString.c_str(),NULL);
240  }
241  }
242  }
243 
244  return iRC;
245 }
const int UQ_OK_RC
Definition: Defines.h:89
const int UQ_FAILED_READING_FILE_RC
Definition: Defines.h:98
void QUESO::MiscReadDoublesFromString ( const std::string &  inputString,
std::vector< double > &  outputDoubles 
)

Definition at line 40 of file Miscellaneous.C.

References queso_require_not_equal_to_msg.

Referenced by BoostInputOptionsParser::getOption< std::vector< double, std::allocator< double > > >(), QUESO::ExperimentModelOptions::getMyOptionValues(), QUESO::SimulationModelOptions::getMyOptionValues(), QUESO::GpmsaComputerModelOptions::getMyOptionValues(), QUESO::StatisticalForwardProblemOptions::getMyOptionValues(), QUESO::StatisticalInverseProblemOptions::getMyOptionValues(), QUESO::MonteCarloSGOptions::getMyOptionValues(), QUESO::EnvironmentOptions::getMyOptionValues(), QUESO::MetropolisHastingsSGOptions::getMyOptionValues(), and QUESO::BoostInputOptionsParser::getOption().

43 {
44  //std::cout << "In MiscReadDoublesFromString()"
45  // << ": inputString = " << inputString
46  // << std::endl;
47  outputDoubles.clear();
48  bool aDoubleIsBeingRead = false;
49  std::string::size_type positionOfFirstChar = 0;
50  std::string::size_type numberOfChars = 0;
51  for (std::string::size_type i = 0; i < inputString.size(); ++i) {
52  queso_require_not_equal_to_msg(inputString[i], '\0', "character '\0' should not be found!");
53  if (inputString[i] == ' ') {
54  if (aDoubleIsBeingRead == true) {
55  // We just finished reading the current string/double. Convert string to double now.
56  char tmpVar[numberOfChars+1];
57  for (std::string::size_type j = 0; j < numberOfChars; ++j) {
58  tmpVar[j] = inputString[positionOfFirstChar+j];
59  }
60  tmpVar[numberOfChars] = '\0';
61  outputDoubles.push_back(strtod(tmpVar,NULL));
62 
63  // Continue loop
64  aDoubleIsBeingRead = false;
65  positionOfFirstChar = 0;
66  numberOfChars = 0;
67  }
68  }
69  else {
70  if (aDoubleIsBeingRead == false) {
71  aDoubleIsBeingRead = true;
72  positionOfFirstChar = i;
73  }
74  numberOfChars++;
75  }
76  } // for
77  if (aDoubleIsBeingRead == true) {
78  // We just finished reading the current string/double. Convert string to double now.
79  char tmpVar[numberOfChars+1];
80  for (std::string::size_type j = 0; j < numberOfChars; ++j) {
81  tmpVar[j] = inputString[positionOfFirstChar+j];
82  }
83  tmpVar[numberOfChars] = '\0';
84  outputDoubles.push_back(strtod(tmpVar,NULL));
85  }
86  std::vector<double>(outputDoubles).swap(outputDoubles);
87 
88  return;
89 }
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:86
int QUESO::MiscReadStringAndDoubleFromFile ( std::ifstream &  ifs,
std::string &  termString,
double *  termValue 
)

Definition at line 160 of file Miscellaneous.C.

References UQ_FAILED_READING_FILE_RC, and UQ_OK_RC.

Referenced by QUESO::AsciiTable< V, M >::readColumnsFromFile().

164 {
165  int iRC = UQ_OK_RC;
166 
167  ifs >> termString;
168  if ((ifs.rdstate() & std::ifstream::failbit)) {
170  }
171  else if (termValue) {
172  if (termString == std::string("inf")) {
173  *termValue = INFINITY;
174  }
175  else if (termString == std::string("-inf")) {
176  *termValue = -INFINITY;
177  }
178  else if (termString == std::string("nan")) {
179  *termValue = nan("");
180  }
181  else {
182  *termValue = strtod(termString.c_str(),NULL);
183  }
184  }
185  //if (!iRC) std::cout << "Read termString = " << termString << std::endl;
186 
187  return iRC;
188 }
const int UQ_OK_RC
Definition: Defines.h:89
const int UQ_FAILED_READING_FILE_RC
Definition: Defines.h:98
void QUESO::MiscReadWordsFromString ( const std::string &  inputString,
std::vector< std::string > &  outputWords 
)

Definition at line 92 of file Miscellaneous.C.

References queso_require_not_equal_to_msg.

95 {
96  //std::cout << "In MiscReadWordsFromString()"
97  // << ": inputString = " << inputString
98  // << std::endl;
99  outputWords.clear();
100  bool aWordIsBeingRead = false;
101  std::string::size_type positionOfFirstChar = 0;
102  std::string::size_type numberOfChars = 0;
103  for (std::string::size_type i = 0; i < inputString.size(); ++i) {
104  queso_require_not_equal_to_msg(inputString[i], '\0', "character '\0' should not be found!");
105  if (inputString[i] == ' ') {
106  if (aWordIsBeingRead == true) {
107  // We just finished reading the current string/word.
108  char tmpVar[numberOfChars+1];
109  for (std::string::size_type j = 0; j < numberOfChars; ++j) {
110  tmpVar[j] = inputString[positionOfFirstChar+j];
111  }
112  tmpVar[numberOfChars] = '\0';
113  outputWords.push_back(tmpVar);
114 
115  // Continue loop
116  aWordIsBeingRead = false;
117  positionOfFirstChar = 0;
118  numberOfChars = 0;
119  }
120  }
121  else {
122  if (aWordIsBeingRead == false) {
123  aWordIsBeingRead = true;
124  positionOfFirstChar = i;
125  }
126  numberOfChars++;
127  }
128  } // for
129  if (aWordIsBeingRead == true) {
130  // We just finished reading the current string/word.
131  char tmpVar[numberOfChars+1];
132  for (std::string::size_type j = 0; j < numberOfChars; ++j) {
133  tmpVar[j] = inputString[positionOfFirstChar+j];
134  }
135  tmpVar[numberOfChars] = '\0';
136  outputWords.push_back(tmpVar);
137  }
138  std::vector<std::string>(outputWords).swap(outputWords);
139 
140  return;
141 }
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:86
unsigned int QUESO::MiscUintDebugMessage ( unsigned int  value,
const char *  message 
)

Definition at line 314 of file Miscellaneous.C.

317 {
318  if (message) {
319  std::cout << "Passing in MiscUintDebugMessage(), value = " << value << ", message = " << message << std::endl;
320  }
321  return value;
322 }
int QUESO::MyWorldfullRank ( )

Returns the rank of the calling process in the communicator.

Definition at line 33 of file Defines.C.

33  {
34  int result = 0;
35 #ifdef QUESO_HAS_MPI
36  int iRC;
37  iRC = MPI_Comm_rank(MPI_COMM_WORLD,&result);
38  if (iRC) {}; // just to remove compiler warning
39 #endif
40  return result;
41 }
GslVector QUESO::operator* ( double  a,
const GslVector &  x 
)

Definition at line 1120 of file GslVector.C.

1121 {
1122  GslVector answer(x);
1123  answer *= a;
1124 
1125  return answer;
1126 }
GslVector QUESO::operator* ( const GslVector &  x,
const GslVector &  y 
)

Definition at line 1128 of file GslVector.C.

1129 {
1130  GslVector answer(x);
1131  answer *= y;
1132 
1133  return answer;
1134 }
GslMatrix QUESO::operator* ( double  a,
const GslMatrix &  mat 
)

Definition at line 1947 of file GslMatrix.C.

1948 {
1949  GslMatrix answer(mat);
1950  answer *= a;
1951  return answer;
1952 }
GslVector QUESO::operator* ( const GslMatrix &  mat,
const GslVector &  vec 
)

Definition at line 1954 of file GslMatrix.C.

References QUESO::GslMatrix::multiply().

1955 {
1956  return mat.multiply(vec);
1957 }
GslMatrix QUESO::operator* ( const GslMatrix &  m1,
const GslMatrix &  m2 
)

Definition at line 1959 of file GslMatrix.C.

References QUESO::Matrix::env(), k, QUESO::Matrix::map(), QUESO::GslMatrix::numCols(), QUESO::GslMatrix::numRowsLocal(), and queso_require_equal_to_msg.

1960 {
1961  unsigned int m1Rows = m1.numRowsLocal();
1962  unsigned int m1Cols = m1.numCols();
1963  unsigned int m2Rows = m2.numRowsLocal();
1964  unsigned int m2Cols = m2.numCols();
1965 
1966  queso_require_equal_to_msg(m1Cols, m2Rows, "different sizes m1Cols and m2Rows");
1967 
1968  GslMatrix mat(m1.env(),m1.map(),m2Cols);
1969 
1970  //std::cout << "In GslMatrix(mat * mat): m1Cols = " << m1Cols << std::endl;
1971 
1972  unsigned int commonSize = m1Cols;
1973  for (unsigned int row1 = 0; row1 < m1Rows; ++row1) {
1974  for (unsigned int col2 = 0; col2 < m2Cols; ++col2) {
1975  double result = 0.;
1976  for (unsigned int k = 0; k < commonSize; ++k) {
1977  result += m1(row1,k)*m2(k,col2);
1978  }
1979  mat(row1,col2) = result;
1980  }
1981  //std::cout << "In GslMatrix(mat * mat): ended row " << row1 << std::endl;
1982  }
1983 
1984  return mat;
1985 }
int k
Definition: ann_sample.cpp:53
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
GslVector QUESO::operator+ ( const GslVector &  x,
const GslVector &  y 
)

Definition at line 1150 of file GslVector.C.

1151 {
1152  GslVector answer(x);
1153  answer += y;
1154 
1155  return answer;
1156 }
GslMatrix QUESO::operator+ ( const GslMatrix &  m1,
const GslMatrix &  m2 
)

Definition at line 1987 of file GslMatrix.C.

1988 {
1989  GslMatrix answer(m1);
1990  answer += m2;
1991  return answer;
1992 }
GslVector QUESO::operator- ( const GslVector &  x,
const GslVector &  y 
)

Definition at line 1158 of file GslVector.C.

1159 {
1160  GslVector answer(x);
1161  answer -= y;
1162 
1163  return answer;
1164 }
GslMatrix QUESO::operator- ( const GslMatrix &  m1,
const GslMatrix &  m2 
)

Definition at line 1994 of file GslMatrix.C.

1995 {
1996  GslMatrix answer(m1);
1997  answer -= m2;
1998  return answer;
1999 }
GslVector QUESO::operator/ ( double  a,
const GslVector &  x 
)

Definition at line 1103 of file GslVector.C.

References QUESO::GslVector::cwInvert().

1104 {
1105  GslVector answer(x);
1106  answer.cwInvert();
1107  answer *= a;
1108 
1109  return answer;
1110 }
GslVector QUESO::operator/ ( const GslVector &  x,
const GslVector &  y 
)

Definition at line 1112 of file GslVector.C.

1113 {
1114  GslVector answer(x);
1115  answer /= y;
1116 
1117  return answer;
1118 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const InfiniteDimensionalMCMCSamplerOptions &  obj 
)

Definition at line 97 of file InfiniteDimensionalMCMCSamplerOptions.C.

References QUESO::InfiniteDimensionalMCMCSamplerOptions::m_parser, and QUESO::InfiniteDimensionalMCMCSamplerOptions::print().

99 {
100  os << (*(obj.m_parser)) << std::endl;
101  obj.print(os);
102  return os;
103 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const GslBlockMatrix &  obj 
)

Definition at line 156 of file GslBlockMatrix.C.

References QUESO::GslBlockMatrix::print().

157 {
158  obj.print(os);
159 
160  return os;
161 }
template<class V , class M >
std::ostream& QUESO::operator<< ( std::ostream &  os,
const ArrayOfOneDTables< V, M > &  obj 
)

Definition at line 112 of file ArrayOfOneDTables.C.

References QUESO::ArrayOfOneDTables< V, M >::print().

113 {
114  obj.print(os);
115  return os;
116 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const ExperimentModelOptions &  obj 
)

Definition at line 373 of file ExperimentModelOptions.C.

References QUESO::ExperimentModelOptions::print(), and queso_deprecated.

374 {
376 
377  obj.print(os);
378 
379  return os;
380 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream& QUESO::operator<< ( std::ostream &  os,
const GPMSAOptions &  obj 
)

Definition at line 138 of file GPMSAOptions.C.

References QUESO::GPMSAOptions::m_parser, and QUESO::GPMSAOptions::print().

139 {
140  os << (*(obj.m_parser)) << std::endl;
141  obj.print(os);
142  return os;
143 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const BoostInputOptionsParser &  parser 
)

Definition at line 143 of file BoostInputOptionsParser.C.

References QUESO::BoostInputOptionsParser::m_optionsDescription.

144 {
145  os << *(parser.m_optionsDescription);
146  return os;
147 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const SipOptionsValues &  obj 
)

Definition at line 145 of file StatisticalInverseProblemOptions.C.

References QUESO::SipOptionsValues::m_computeSolution, QUESO::SipOptionsValues::m_dataOutputAllowedSet, QUESO::SipOptionsValues::m_dataOutputFileName, QUESO::SipOptionsValues::m_option_computeSolution, QUESO::SipOptionsValues::m_option_dataOutputAllowedSet, and QUESO::SipOptionsValues::m_option_dataOutputFileName.

146 {
147  os << "\n" << obj.m_option_computeSolution << " = " << obj.m_computeSolution
148  << "\n" << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName;
149  os << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
150  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
151  os << *setIt << " ";
152  }
153 #ifdef UQ_SIP_READS_SOLVER_OPTION
154  << "\n" << obj.m_option_solver << " = " << obj.m_solverString
155 #endif
156  os << std::endl;
157  return os;
158 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const SimulationModelOptions &  obj 
)

Definition at line 507 of file SimulationModelOptions.C.

References QUESO::SimulationModelOptions::print(), and queso_deprecated.

508 {
510 
511  obj.print(os);
512 
513  return os;
514 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream& QUESO::operator<< ( std::ostream &  os,
const MLSamplingOptions &  obj 
)

Definition at line 145 of file MLSamplingOptions.C.

References QUESO::MLSamplingOptions::m_parser, and QUESO::MLSamplingOptions::print().

146 {
147  os << (*(obj.m_parser)) << std::endl;
148 
149  obj.print(os);
150  return os;
151 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const SfpOptionsValues &  obj 
)

Definition at line 150 of file StatisticalForwardProblemOptions.C.

References QUESO::SfpOptionsValues::m_computeCorrelations, QUESO::SfpOptionsValues::m_computeCovariances, QUESO::SfpOptionsValues::m_computeSolution, QUESO::SfpOptionsValues::m_dataOutputAllowedSet, QUESO::SfpOptionsValues::m_dataOutputFileName, QUESO::SfpOptionsValues::m_option_computeCorrelations, QUESO::SfpOptionsValues::m_option_computeCovariances, QUESO::SfpOptionsValues::m_option_computeSolution, QUESO::SfpOptionsValues::m_option_dataOutputAllowedSet, QUESO::SfpOptionsValues::m_option_dataOutputFileName, and QUESO::SfpOptionsValues::m_parser.

151 {
152  os << (*(obj.m_parser)) << std::endl;
153 
154  os << obj.m_option_computeSolution << " = " << obj.m_computeSolution
155  << "\n" << obj.m_option_computeCovariances << " = " << obj.m_computeCovariances
156  << "\n" << obj.m_option_computeCorrelations << " = " << obj.m_computeCorrelations
157  << "\n" << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName;
158  os << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
159  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
160  os << *setIt << " ";
161  }
162 #ifdef UQ_SFP_READS_SOLVER_OPTION
163  << "\n" << obj.m_option_solver << " = " << obj.m_solverString
164 #endif
165  os << std::endl;
166  return os;
167 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const GpmsaComputerModelOptions &  obj 
)

Definition at line 661 of file GpmsaComputerModelOptions.C.

References QUESO::GpmsaComputerModelOptions::print(), and queso_deprecated.

662 {
664 
665  obj.print(os);
666 
667  return os;
668 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream & QUESO::operator<< ( std::ostream &  os,
const StatisticalForwardProblemOptions &  obj 
)

Prints the object obj, overloading an operator.

Definition at line 355 of file StatisticalForwardProblemOptions.C.

References QUESO::StatisticalForwardProblemOptions::print(), and queso_deprecated.

356 {
358 
359  obj.print(os);
360 
361  return os;
362 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream & QUESO::operator<< ( std::ostream &  os,
const StatisticalInverseProblemOptions &  obj 
)

Prints the object obj, overloading an operator.

Definition at line 339 of file StatisticalInverseProblemOptions.C.

References QUESO::StatisticalInverseProblemOptions::print(), and queso_deprecated.

340 {
342  obj.print(os);
343 
344  return os;
345 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream& QUESO::operator<< ( std::ostream &  os,
const EnvOptionsValues &  obj 
)

Definition at line 201 of file EnvironmentOptions.C.

References QUESO::EnvOptionsValues::m_checkingLevel, QUESO::EnvOptionsValues::m_displayVerbosity, QUESO::EnvOptionsValues::m_identifyingString, QUESO::EnvOptionsValues::m_numSubEnvironments, QUESO::EnvOptionsValues::m_option_checkingLevel, QUESO::EnvOptionsValues::m_option_displayVerbosity, QUESO::EnvOptionsValues::m_option_identifyingString, QUESO::EnvOptionsValues::m_option_numSubEnvironments, QUESO::EnvOptionsValues::m_option_platformName, QUESO::EnvOptionsValues::m_option_rngType, QUESO::EnvOptionsValues::m_option_seed, QUESO::EnvOptionsValues::m_option_subDisplayAllowAll, QUESO::EnvOptionsValues::m_option_subDisplayAllowedSet, QUESO::EnvOptionsValues::m_option_subDisplayFileName, QUESO::EnvOptionsValues::m_option_syncVerbosity, QUESO::EnvOptionsValues::m_parser, QUESO::EnvOptionsValues::m_platformName, QUESO::EnvOptionsValues::m_rngType, QUESO::EnvOptionsValues::m_seed, QUESO::EnvOptionsValues::m_subDisplayAllowAll, QUESO::EnvOptionsValues::m_subDisplayAllowedSet, QUESO::EnvOptionsValues::m_subDisplayFileName, and QUESO::EnvOptionsValues::m_syncVerbosity.

202 {
203  // Print the parser
204  os << (*(obj.m_parser)) << std::endl;
205 
206  // Print the option names and current values
207  os << obj.m_option_numSubEnvironments << " = " << obj.m_numSubEnvironments
208  << "\n" << obj.m_option_subDisplayFileName << " = " << obj.m_subDisplayFileName
209  << "\n" << obj.m_option_subDisplayAllowAll << " = " << obj.m_subDisplayAllowAll
210  //<< "\n" << obj.m_option_subDisplayAllowInter0 << " = " << obj.m_subDisplayAllowInter0
211  << "\n" << obj.m_option_subDisplayAllowedSet << " = ";
212  for (std::set<unsigned int>::iterator setIt = obj.m_subDisplayAllowedSet.begin(); setIt != obj.m_subDisplayAllowedSet.end(); ++setIt) {
213  os << *setIt << " ";
214  }
215  os << "\n" << obj.m_option_displayVerbosity << " = " << obj.m_displayVerbosity
216  << "\n" << obj.m_option_syncVerbosity << " = " << obj.m_syncVerbosity
217  << "\n" << obj.m_option_checkingLevel << " = " << obj.m_checkingLevel
218  << "\n" << obj.m_option_rngType << " = " << obj.m_rngType
219  << "\n" << obj.m_option_seed << " = " << obj.m_seed
220  << "\n" << obj.m_option_platformName << " = " << obj.m_platformName
221  << "\n" << obj.m_option_identifyingString << " = " << obj.m_identifyingString
222  //<< "\n" << obj.m_option_numDebugParams << " = " << obj.m_numDebugParams
223  << std::endl;
224  return os;
225 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const GslVector &  obj 
)

Definition at line 1096 of file GslVector.C.

References QUESO::GslVector::print().

1097 {
1098  obj.print(os);
1099 
1100  return os;
1101 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const MonteCarloSGOptions &  obj 
)

Prints the object obj, overloading an operator.

Definition at line 635 of file MonteCarloSGOptions.C.

References QUESO::MonteCarloSGOptions::print(), and queso_deprecated.

636 {
638 
639  obj.print(os);
640 
641  return os;
642 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream& QUESO::operator<< ( std::ostream &  os,
const McOptionsValues &  obj 
)

Definition at line 268 of file MonteCarloSGOptions.C.

References QUESO::McOptionsValues::m_dataOutputAllowedSet, QUESO::McOptionsValues::m_dataOutputFileName, QUESO::McOptionsValues::m_option_dataOutputAllowedSet, QUESO::McOptionsValues::m_option_dataOutputFileName, QUESO::McOptionsValues::m_option_pseq_dataOutputAllowedSet, QUESO::McOptionsValues::m_option_pseq_dataOutputFileName, QUESO::McOptionsValues::m_option_pseq_dataOutputFileType, QUESO::McOptionsValues::m_option_pseq_dataOutputPeriod, QUESO::McOptionsValues::m_option_qseq_dataInputFileName, QUESO::McOptionsValues::m_option_qseq_dataInputFileType, QUESO::McOptionsValues::m_option_qseq_dataOutputAllowedSet, QUESO::McOptionsValues::m_option_qseq_dataOutputFileName, QUESO::McOptionsValues::m_option_qseq_dataOutputFileType, QUESO::McOptionsValues::m_option_qseq_dataOutputPeriod, QUESO::McOptionsValues::m_option_qseq_displayPeriod, QUESO::McOptionsValues::m_option_qseq_measureRunTimes, QUESO::McOptionsValues::m_option_qseq_size, QUESO::McOptionsValues::m_parser, QUESO::McOptionsValues::m_pseqDataOutputAllowedSet, QUESO::McOptionsValues::m_pseqDataOutputFileName, QUESO::McOptionsValues::m_pseqDataOutputFileType, QUESO::McOptionsValues::m_pseqDataOutputPeriod, QUESO::McOptionsValues::m_qseqDataInputFileName, QUESO::McOptionsValues::m_qseqDataInputFileType, QUESO::McOptionsValues::m_qseqDataOutputAllowedSet, QUESO::McOptionsValues::m_qseqDataOutputFileName, QUESO::McOptionsValues::m_qseqDataOutputFileType, QUESO::McOptionsValues::m_qseqDataOutputPeriod, QUESO::McOptionsValues::m_qseqDisplayPeriod, QUESO::McOptionsValues::m_qseqMeasureRunTimes, and QUESO::McOptionsValues::m_qseqSize.

269 {
270  os << (*(obj.m_parser)) << std::endl;
271 
272  os << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName
273  << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
274  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
275  os << *setIt << " ";
276  }
277  os << "\n" << obj.m_option_pseq_dataOutputPeriod << " = " << obj.m_pseqDataOutputPeriod
278  << "\n" << obj.m_option_pseq_dataOutputFileName << " = " << obj.m_pseqDataOutputFileName
279  << "\n" << obj.m_option_pseq_dataOutputFileType << " = " << obj.m_pseqDataOutputFileType
280  << "\n" << obj.m_option_pseq_dataOutputAllowedSet << " = ";
281  for (std::set<unsigned int>::iterator setIt = obj.m_pseqDataOutputAllowedSet.begin(); setIt != obj.m_pseqDataOutputAllowedSet.end(); ++setIt) {
282  os << *setIt << " ";
283  }
284  os
285 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
286  << "\n" << obj.m_option_pseq_computeStats << " = " << obj.m_pseqComputeStats
287 #endif
288  << "\n" << obj.m_option_qseq_dataInputFileName << " = " << obj.m_qseqDataInputFileName
289  << "\n" << obj.m_option_qseq_dataInputFileType << " = " << obj.m_qseqDataInputFileType
290  << "\n" << obj.m_option_qseq_size << " = " << obj.m_qseqSize
291  << "\n" << obj.m_option_qseq_displayPeriod << " = " << obj.m_qseqDisplayPeriod
292  << "\n" << obj.m_option_qseq_measureRunTimes << " = " << obj.m_qseqMeasureRunTimes
293  << "\n" << obj.m_option_qseq_dataOutputPeriod << " = " << obj.m_qseqDataOutputPeriod
294  << "\n" << obj.m_option_qseq_dataOutputFileName << " = " << obj.m_qseqDataOutputFileName
295  << "\n" << obj.m_option_qseq_dataOutputFileType << " = " << obj.m_qseqDataOutputFileType
296  << "\n" << obj.m_option_qseq_dataOutputAllowedSet << " = ";
297  for (std::set<unsigned int>::iterator setIt = obj.m_qseqDataOutputAllowedSet.begin(); setIt != obj.m_qseqDataOutputAllowedSet.end(); ++setIt) {
298  os << *setIt << " ";
299  }
300 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
301  os << "\n" << obj.m_option_qseq_computeStats << " = " << obj.m_qseqComputeStats;
302 #endif
303 
304  return os;
305 }
template<class V , class M >
std::ostream& QUESO::operator<< ( std::ostream &  os,
const AsciiTable< V, M > &  obj 
)

Definition at line 301 of file AsciiTable.C.

302 {
303  obj.print(os);
304 
305  return os;
306 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const EnvironmentOptions &  obj 
)

Print values of the options chosen.

Definition at line 487 of file EnvironmentOptions.C.

References QUESO::EnvironmentOptions::print(), and queso_deprecated.

488 {
490 
491  obj.print(os);
492 
493  return os;
494 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream& QUESO::operator<< ( std::ostream &  os,
const BaseEnvironment &  obj 
)
std::ostream & QUESO::operator<< ( std::ostream &  os,
const GslMatrix &  obj 
)

Definition at line 1940 of file GslMatrix.C.

References QUESO::GslMatrix::print().

1941 {
1942  obj.print(os);
1943 
1944  return os;
1945 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const MhOptionsValues &  obj 
)

Definition at line 552 of file MetropolisHastingsSGOptions.C.

References QUESO::MhOptionsValues::m_amAdaptedMatricesDataOutputAllowAll, QUESO::MhOptionsValues::m_amAdaptedMatricesDataOutputAllowedSet, QUESO::MhOptionsValues::m_amAdaptedMatricesDataOutputFileName, QUESO::MhOptionsValues::m_amAdaptedMatricesDataOutputFileType, QUESO::MhOptionsValues::m_amAdaptedMatricesDataOutputPeriod, QUESO::MhOptionsValues::m_amAdaptInterval, QUESO::MhOptionsValues::m_amEpsilon, QUESO::MhOptionsValues::m_amEta, QUESO::MhOptionsValues::m_amInitialNonAdaptInterval, QUESO::MhOptionsValues::m_amKeepInitialMatrix, QUESO::MhOptionsValues::m_BrooksGelmanLag, QUESO::MhOptionsValues::m_dataOutputAllowAll, QUESO::MhOptionsValues::m_dataOutputAllowedSet, QUESO::MhOptionsValues::m_dataOutputFileName, QUESO::MhOptionsValues::m_displayCandidates, QUESO::MhOptionsValues::m_doLogitTransform, QUESO::MhOptionsValues::m_drDuringAmNonAdaptiveInt, QUESO::MhOptionsValues::m_drMaxNumExtraStages, QUESO::MhOptionsValues::m_drScalesForExtraStages, QUESO::MhOptionsValues::m_enableBrooksGelmanConvMonitor, QUESO::MhOptionsValues::m_filteredChainDataOutputAllowAll, QUESO::MhOptionsValues::m_filteredChainDataOutputAllowedSet, QUESO::MhOptionsValues::m_filteredChainDataOutputFileName, QUESO::MhOptionsValues::m_filteredChainDataOutputFileType, QUESO::MhOptionsValues::m_filteredChainDiscardedPortion, QUESO::MhOptionsValues::m_filteredChainGenerate, QUESO::MhOptionsValues::m_filteredChainLag, QUESO::MhOptionsValues::m_initialPositionDataInputFileName, QUESO::MhOptionsValues::m_initialPositionDataInputFileType, QUESO::MhOptionsValues::m_initialProposalCovMatrixDataInputFileName, QUESO::MhOptionsValues::m_initialProposalCovMatrixDataInputFileType, QUESO::MhOptionsValues::m_option_am_adaptedMatrices_dataOutputAllowAll, QUESO::MhOptionsValues::m_option_am_adaptedMatrices_dataOutputAllowedSet, QUESO::MhOptionsValues::m_option_am_adaptedMatrices_dataOutputFileName, QUESO::MhOptionsValues::m_option_am_adaptedMatrices_dataOutputFileType, QUESO::MhOptionsValues::m_option_am_adaptedMatrices_dataOutputPeriod, QUESO::MhOptionsValues::m_option_am_adaptInterval, QUESO::MhOptionsValues::m_option_am_epsilon, QUESO::MhOptionsValues::m_option_am_eta, QUESO::MhOptionsValues::m_option_am_initialNonAdaptInterval, QUESO::MhOptionsValues::m_option_am_keepInitialMatrix, QUESO::MhOptionsValues::m_option_BrooksGelmanLag, QUESO::MhOptionsValues::m_option_dataOutputAllowAll, QUESO::MhOptionsValues::m_option_dataOutputAllowedSet, QUESO::MhOptionsValues::m_option_dataOutputFileName, QUESO::MhOptionsValues::m_option_displayCandidates, QUESO::MhOptionsValues::m_option_doLogitTransform, QUESO::MhOptionsValues::m_option_dr_duringAmNonAdaptiveInt, QUESO::MhOptionsValues::m_option_dr_listOfScalesForExtraStages, QUESO::MhOptionsValues::m_option_dr_maxNumExtraStages, QUESO::MhOptionsValues::m_option_enableBrooksGelmanConvMonitor, QUESO::MhOptionsValues::m_option_filteredChain_dataOutputAllowAll, QUESO::MhOptionsValues::m_option_filteredChain_dataOutputAllowedSet, QUESO::MhOptionsValues::m_option_filteredChain_dataOutputFileName, QUESO::MhOptionsValues::m_option_filteredChain_dataOutputFileType, QUESO::MhOptionsValues::m_option_filteredChain_discardedPortion, QUESO::MhOptionsValues::m_option_filteredChain_generate, QUESO::MhOptionsValues::m_option_filteredChain_lag, QUESO::MhOptionsValues::m_option_initialPosition_dataInputFileName, QUESO::MhOptionsValues::m_option_initialPosition_dataInputFileType, QUESO::MhOptionsValues::m_option_initialProposalCovMatrix_dataInputFileName, QUESO::MhOptionsValues::m_option_initialProposalCovMatrix_dataInputFileType, QUESO::MhOptionsValues::m_option_listOfDisabledParameters, QUESO::MhOptionsValues::m_option_outputLogLikelihood, QUESO::MhOptionsValues::m_option_outputLogTarget, QUESO::MhOptionsValues::m_option_putOutOfBoundsInChain, QUESO::MhOptionsValues::m_option_rawChain_dataInputFileName, QUESO::MhOptionsValues::m_option_rawChain_dataInputFileType, QUESO::MhOptionsValues::m_option_rawChain_dataOutputAllowAll, QUESO::MhOptionsValues::m_option_rawChain_dataOutputAllowedSet, QUESO::MhOptionsValues::m_option_rawChain_dataOutputFileName, QUESO::MhOptionsValues::m_option_rawChain_dataOutputFileType, QUESO::MhOptionsValues::m_option_rawChain_dataOutputPeriod, QUESO::MhOptionsValues::m_option_rawChain_displayPeriod, QUESO::MhOptionsValues::m_option_rawChain_generateExtra, QUESO::MhOptionsValues::m_option_rawChain_measureRunTimes, QUESO::MhOptionsValues::m_option_rawChain_size, QUESO::MhOptionsValues::m_option_tk_useLocalHessian, QUESO::MhOptionsValues::m_option_tk_useNewtonComponent, QUESO::MhOptionsValues::m_option_totallyMute, QUESO::MhOptionsValues::m_outputLogLikelihood, QUESO::MhOptionsValues::m_outputLogTarget, QUESO::MhOptionsValues::m_parameterDisabledSet, QUESO::MhOptionsValues::m_parser, QUESO::MhOptionsValues::m_putOutOfBoundsInChain, QUESO::MhOptionsValues::m_rawChainDataInputFileName, QUESO::MhOptionsValues::m_rawChainDataInputFileType, QUESO::MhOptionsValues::m_rawChainDataOutputAllowAll, QUESO::MhOptionsValues::m_rawChainDataOutputAllowedSet, QUESO::MhOptionsValues::m_rawChainDataOutputFileName, QUESO::MhOptionsValues::m_rawChainDataOutputFileType, QUESO::MhOptionsValues::m_rawChainDataOutputPeriod, QUESO::MhOptionsValues::m_rawChainDisplayPeriod, QUESO::MhOptionsValues::m_rawChainGenerateExtra, QUESO::MhOptionsValues::m_rawChainMeasureRunTimes, QUESO::MhOptionsValues::m_rawChainSize, QUESO::MhOptionsValues::m_tkUseLocalHessian, QUESO::MhOptionsValues::m_tkUseNewtonComponent, and QUESO::MhOptionsValues::m_totallyMute.

553 {
554  os << (*(obj.m_parser)) << std::endl;
555 
556  os << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName
557  << "\n" << obj.m_option_dataOutputAllowAll << " = " << obj.m_dataOutputAllowAll
558  << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
559  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
560  os << *setIt << " ";
561  }
562  os << "\n" << obj.m_option_totallyMute << " = " << obj.m_totallyMute
563  << "\n" << obj.m_option_initialPosition_dataInputFileName << " = " << obj.m_initialPositionDataInputFileName
564  << "\n" << obj.m_option_initialPosition_dataInputFileType << " = " << obj.m_initialPositionDataInputFileType
565  << "\n" << obj.m_option_initialProposalCovMatrix_dataInputFileName << " = " << obj.m_initialProposalCovMatrixDataInputFileName
566  << "\n" << obj.m_option_initialProposalCovMatrix_dataInputFileType << " = " << obj.m_initialProposalCovMatrixDataInputFileType
567  << "\n" << obj.m_option_listOfDisabledParameters << " = ";
568  for (std::set<unsigned int>::iterator setIt = obj.m_parameterDisabledSet.begin(); setIt != obj.m_parameterDisabledSet.end(); ++setIt) {
569  os << *setIt << " ";
570  }
571  os << "\n" << obj.m_option_rawChain_dataInputFileName << " = " << obj.m_rawChainDataInputFileName
572  << "\n" << obj.m_option_rawChain_dataInputFileType << " = " << obj.m_rawChainDataInputFileType
573  << "\n" << obj.m_option_rawChain_size << " = " << obj.m_rawChainSize
574  << "\n" << obj.m_option_rawChain_generateExtra << " = " << obj.m_rawChainGenerateExtra
575  << "\n" << obj.m_option_rawChain_displayPeriod << " = " << obj.m_rawChainDisplayPeriod
576  << "\n" << obj.m_option_rawChain_measureRunTimes << " = " << obj.m_rawChainMeasureRunTimes
577  << "\n" << obj.m_option_rawChain_dataOutputPeriod << " = " << obj.m_rawChainDataOutputPeriod
578  << "\n" << obj.m_option_rawChain_dataOutputFileName << " = " << obj.m_rawChainDataOutputFileName
579  << "\n" << obj.m_option_rawChain_dataOutputFileType << " = " << obj.m_rawChainDataOutputFileType
580  << "\n" << obj.m_option_rawChain_dataOutputAllowAll << " = " << obj.m_rawChainDataOutputAllowAll
581  << "\n" << obj.m_option_rawChain_dataOutputAllowedSet << " = ";
582  for (std::set<unsigned int>::iterator setIt = obj.m_rawChainDataOutputAllowedSet.begin(); setIt != obj.m_rawChainDataOutputAllowedSet.end(); ++setIt) {
583  os << *setIt << " ";
584  }
585  os
586 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
587  << "\n" << obj.m_option_rawChain_computeStats << " = " << obj.m_rawChainComputeStats
588 #endif
589  << "\n" << obj.m_option_filteredChain_generate << " = " << obj.m_filteredChainGenerate
590  << "\n" << obj.m_option_filteredChain_discardedPortion << " = " << obj.m_filteredChainDiscardedPortion
591  << "\n" << obj.m_option_filteredChain_lag << " = " << obj.m_filteredChainLag
592  << "\n" << obj.m_option_filteredChain_dataOutputFileName << " = " << obj.m_filteredChainDataOutputFileName
593  << "\n" << obj.m_option_filteredChain_dataOutputFileType << " = " << obj.m_filteredChainDataOutputFileType
594  << "\n" << obj.m_option_filteredChain_dataOutputAllowAll << " = " << obj.m_filteredChainDataOutputAllowAll
595  << "\n" << obj.m_option_filteredChain_dataOutputAllowedSet << " = ";
596  for (std::set<unsigned int>::iterator setIt = obj.m_filteredChainDataOutputAllowedSet.begin(); setIt != obj.m_filteredChainDataOutputAllowedSet.end(); ++setIt) {
597  os << *setIt << " ";
598  }
599  os
600 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
601  << "\n" << obj.m_option_filteredChain_computeStats << " = " << obj.m_filteredChainComputeStats
602 #endif
603  << "\n" << obj.m_option_displayCandidates << " = " << obj.m_displayCandidates
604  << "\n" << obj.m_option_putOutOfBoundsInChain << " = " << obj.m_putOutOfBoundsInChain
605  << "\n" << obj.m_option_tk_useLocalHessian << " = " << obj.m_tkUseLocalHessian
606  << "\n" << obj.m_option_tk_useNewtonComponent << " = " << obj.m_tkUseNewtonComponent
607  << "\n" << obj.m_option_dr_maxNumExtraStages << " = " << obj.m_drMaxNumExtraStages
608  << "\n" << obj.m_option_dr_listOfScalesForExtraStages << " = ";
609  for (unsigned int i = 0; i < obj.m_drScalesForExtraStages.size(); ++i) {
610  os << obj.m_drScalesForExtraStages[i] << " ";
611  }
612  os << "\n" << obj.m_option_dr_duringAmNonAdaptiveInt << " = " << obj.m_drDuringAmNonAdaptiveInt
613  << "\n" << obj.m_option_am_keepInitialMatrix << " = " << obj.m_amKeepInitialMatrix
614  << "\n" << obj.m_option_am_initialNonAdaptInterval << " = " << obj.m_amInitialNonAdaptInterval
615  << "\n" << obj.m_option_am_adaptInterval << " = " << obj.m_amAdaptInterval
616  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputPeriod << " = " << obj.m_amAdaptedMatricesDataOutputPeriod
617  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputFileName << " = " << obj.m_amAdaptedMatricesDataOutputFileName
618  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputFileType << " = " << obj.m_amAdaptedMatricesDataOutputFileType
619  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputAllowAll << " = " << obj.m_amAdaptedMatricesDataOutputAllowAll
620  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputAllowedSet << " = ";
621  for (std::set<unsigned int>::iterator setIt = obj.m_amAdaptedMatricesDataOutputAllowedSet.begin(); setIt != obj.m_amAdaptedMatricesDataOutputAllowedSet.end(); ++setIt) {
622  os << *setIt << " ";
623  }
624  os << "\n" << obj.m_option_am_eta << " = " << obj.m_amEta
625  << "\n" << obj.m_option_am_epsilon << " = " << obj.m_amEpsilon
626  << "\n" << obj.m_option_enableBrooksGelmanConvMonitor << " = " << obj.m_enableBrooksGelmanConvMonitor
627  << "\n" << obj.m_option_BrooksGelmanLag << " = " << obj.m_BrooksGelmanLag
628  << "\n" << obj.m_option_outputLogLikelihood << " = " << obj.m_outputLogLikelihood
629  << "\n" << obj.m_option_outputLogTarget << " = " << obj.m_outputLogTarget
630  << "\n" << obj.m_option_doLogitTransform << " = " << obj.m_doLogitTransform
631  << std::endl;
632 
633  return os;
634 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const MLSamplingLevelOptions &  obj 
)

Definition at line 683 of file MLSamplingLevelOptions.C.

References QUESO::MLSamplingLevelOptions::m_parser, and QUESO::MLSamplingLevelOptions::print().

684 {
685  os << (*(obj.m_parser)) << std::endl;
686  obj.print(os);
687  return os;
688 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const MetropolisHastingsSGOptions &  obj 
)

Definition at line 1482 of file MetropolisHastingsSGOptions.C.

References QUESO::MetropolisHastingsSGOptions::print(), and queso_deprecated.

1483 {
1484  queso_deprecated();
1485 
1486  obj.print(os);
1487 
1488  return os;
1489 }
#define queso_deprecated()
Definition: Defines.h:134
template<class P_V , class P_M >
std::ostream& QUESO::operator<< ( std::ostream &  os,
const MLSampling< P_V, P_M > &  obj 
)

Definition at line 4817 of file MLSampling.C.

4818 {
4819  obj.print(os);
4820 
4821  return os;
4822 }
bool QUESO::operator== ( const GslVector &  lhs,
const GslVector &  rhs 
)

Definition at line 1167 of file GslVector.C.

References queso_require_equal_to_msg, and QUESO::GslVector::sizeLocal().

1168 {
1169  bool answer = true;
1170 
1171  unsigned int size1 = lhs.sizeLocal();
1172  unsigned int size2 = rhs.sizeLocal();
1173  queso_require_equal_to_msg(size1, size2, "different sizes of lhs and rhs");
1174 
1175  for (unsigned int i = 0; i < size1; ++i) {
1176  if (lhs[i] != rhs[i]) {
1177  answer = false;
1178  break;
1179  }
1180  }
1181 
1182  return answer;
1183 }
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
int QUESO::QUESO_get_numeric_version ( )

Definition at line 79 of file Environment.C.

Referenced by QUESO_version_print().

80  {
81  // Note: return format follows the versioning convention xx.yy.z where
82  //
83  // xx = major version number
84  // yy = minor version number
85  // zz = micro version number
86  //
87  // For example:
88  // v. 0.23 -> 002300 = 2300
89  // v. 0.23.1 -> 002301 = 2301
90  // v. 10.23.2 -> 102302
91 
92  int major_version = 0;
93  int minor_version = 0;
94  int micro_version = 0;
95 
96 #ifdef QUESO_MAJOR_VERSION
97  major_version = QUESO_MAJOR_VERSION;
98 #endif
99 
100 #ifdef QUESO_MINOR_VERSION
101  minor_version = QUESO_MINOR_VERSION;
102 #endif
103 
104 #ifdef QUESO_MICRO_VERSION
105  micro_version = QUESO_MICRO_VERSION;
106 #endif
107 
108  return(major_version*10000 + minor_version*100 + micro_version);
109  }
void QUESO::queso_terminate_handler ( )

Function for unhandled exceptions in Queso.

queso_terminate_handler This function deals with unhandled exceptions encountered in Queso. It provides a call to MPI_abort using the global communicator.

Definition at line 1625 of file Environment.C.

References old_terminate_handler.

Referenced by QUESO::FullEnvironment::FullEnvironment().

1626 {
1627 #ifdef QUESO_HAS_MPI
1628  int mpi_initialized;
1629  MPI_Initialized (&mpi_initialized);
1630 
1631  if (mpi_initialized)
1632  {
1633  //MPI_Abort(m_fullComm->Comm(), 1);
1634  MPI_Abort(MPI_COMM_WORLD, 1);
1635  }
1636  else
1637  {
1638  // The system terminate_handler may do useful things like printing
1639  // uncaught exception information, or the user may have created
1640  // their own terminate handler that we want to call.
1642  }
1643 #else
1645 #endif
1646  exit(1);
1647 }
std::terminate_handler old_terminate_handler
Definition: Environment.C:130
void QUESO::QUESO_version_print ( std::ostream &  os)

Definition at line 49 of file Environment.C.

References QUESO_get_numeric_version().

Referenced by QUESO::FullEnvironment::FullEnvironment(), and main().

50  {
51  {
52  os << "------------------------------------------------------------------------------------------" ;
53  os << "--------------------" << std::endl;
54  os << "QUESO Library: Version = " << QUESO_LIB_VERSION;
55  os << " (" << QUESO_get_numeric_version() << ")" << std::endl << std::endl;
56 
57  os << QUESO_LIB_RELEASE << std::endl << std::endl;
58 
59  os << "Build Date = " << QUESO_BUILD_DATE << std::endl;
60  os << "Build Host = " << QUESO_BUILD_HOST << std::endl;
61  os << "Build User = " << QUESO_BUILD_USER << std::endl;
62  os << "Build Arch = " << QUESO_BUILD_ARCH << std::endl;
63  os << "Build Rev = " << QUESO_BUILD_VERSION << std::endl << std::endl;
64 
65  os << "C++ Config = " << QUESO_CXX << " " << QUESO_CXXFLAGS << std::endl;
66  os << std::endl;
67  os << "Trilinos DIR = " << QUESO_TRILINOS_DIR << std::endl;
68  os << "GSL Libs = " << QUESO_GSL_DIR << std::endl;
69  os << "GRVY DIR = " << QUESO_GRVY_DIR << std::endl;
70  os << "GLPK DIR = " << QUESO_GLPK_DIR << std::endl;
71  os << "HDF5 DIR = " << QUESO_HDF5_DIR << std::endl;
72  os << "------------------------------------------------------------------------------------------" ;
73  os << "--------------------" << std::endl;
74  }
75 
76  return;
77  }
int QUESO_get_numeric_version()
Definition: Environment.C:79
GslMatrix QUESO::rightDiagScaling ( const GslMatrix &  mat,
const GslVector &  vec 
)

Definition at line 2038 of file GslMatrix.C.

References QUESO::GslMatrix::numCols(), QUESO::GslMatrix::numRowsLocal(), queso_require_equal_to_msg, and QUESO::GslVector::sizeLocal().

2039 {
2040  unsigned int vSize = vec.sizeLocal();
2041  unsigned int mRows = mat.numRowsLocal();
2042  unsigned int mCols = mat.numCols();
2043 
2044  queso_require_equal_to_msg(vSize, mCols, "size of vector is different from the number of cols in matrix");
2045 
2046  queso_require_equal_to_msg(mCols, mRows, "routine currently works for square matrices only");
2047 
2048  GslMatrix answer(mat);
2049  for (unsigned int j = 0; j < mCols; ++j) {
2050  double vecValue = vec[j];
2051  for (unsigned int i = 0; i < mRows; ++i) {
2052  answer(i,j) *= vecValue;
2053  }
2054  }
2055 
2056  return answer;
2057 }
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
double QUESO::scalarProduct ( const GslVector &  x,
const GslVector &  y 
)

Definition at line 1136 of file GslVector.C.

References queso_require_equal_to_msg, and QUESO::GslVector::sizeLocal().

Referenced by QUESO::GcmJointInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointInfo(), QUESO::GcmJointTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointTildeInfo(), QUESO::GcmSimulationInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationInfo(), QUESO::GcmSimulationTildeInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationTildeInfo(), QUESO::GcmZTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmZTildeInfo(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::likelihoodRoutine(), and QUESO::GslVector::norm2Sq().

1137 {
1138  unsigned int size1 = x.sizeLocal();
1139  unsigned int size2 = y.sizeLocal();
1140  queso_require_equal_to_msg(size1, size2, "different sizes of x and y");
1141 
1142  double result = 0.;
1143  for (unsigned int i = 0; i < size1; ++i) {
1144  result += x[i]*y[i];
1145  }
1146 
1147  return result;
1148 }
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
QUESO::STANDARD_TYPE ( char  ,
MPI_CHAR   
)
QUESO::STANDARD_TYPE ( int  ,
MPI_INT   
)
QUESO::STANDARD_TYPE ( unsigned  int,
MPI_UNSIGNED   
)
QUESO::STANDARD_TYPE ( double  ,
MPI_DOUBLE   
)
template<class T >
double QUESO::SubF1F2Gaussian2dKdeIntegral ( const ScalarSequence< T > &  scalarSeq1,
const ScalarSequence< T > &  scalarSeq2,
unsigned int  initialPos,
double  scaleValue1,
double  scaleValue2,
const Base1D1DFunction &  func1,
const Base1D1DFunction &  func2,
unsigned int  quadratureOrder 
)

Calculates the integral of a 2D Gaussian KDE.

This function performs numerical integration (via Hermite-Gauss quadrature, see GaussianHermite1DQuadrature), of a bi-variate Gaussian KDE (refer to ScalarSequence::subGaussian1dKde(), ArrayOfSequences::gaussianKDE(), or SequenceOfVectors::subGaussian1dKde().

Definition at line 875 of file 1D1DFunction.C.

References k, queso_require_equal_to_msg, QUESO::ScalarSequence< T >::subSequenceSize(), and QUESO::Base1D1DFunction::value().

883 {
884  double resultValue = 0.;
885 
886  queso_require_equal_to_msg(initialPos, 0, "not implemented yet for initialPos != 0");
887  queso_require_equal_to_msg(scalarSeq1.subSequenceSize(), scalarSeq2.subSequenceSize(), "different sizes");
888 
889  GaussianHermite1DQuadrature quadObj(0.,1.,quadratureOrder);
890  const std::vector<double>& quadPositions = quadObj.positions();
891  const std::vector<double>& quadWeights = quadObj.weights ();
892  queso_require_equal_to_msg(quadPositions.size(), quadWeights.size(), "quadObj has invalid state");
893 
894  unsigned int numQuadraturePositions = quadPositions.size();
895  unsigned int dataSize = scalarSeq1.subSequenceSize();
896  for (unsigned int k = 0; k < dataSize; ++k) {
897  double value1 = 0.;
898  double value2 = 0.;
899  double x1k = scalarSeq1[k];
900  double x2k = scalarSeq2[k];
901  for (unsigned int j = 0; j < numQuadraturePositions; ++j) {
902  value1 += func1.value(scaleValue1*quadPositions[j]+x1k)*quadWeights[j];
903  value2 += func2.value(scaleValue2*quadPositions[j]+x2k)*quadWeights[j];
904  }
905  resultValue += value1*value2;
906  }
907  resultValue *= 1./(2.*M_PI)/((double) dataSize);
908 
909  return resultValue;
910 }
int k
Definition: ann_sample.cpp:53
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85

Variable Documentation

std::terminate_handler QUESO::old_terminate_handler
const int QUESO::UQ_FAILED_READING_FILE_RC = -9

Definition at line 98 of file Defines.h.

Referenced by MiscReadCharsAndDoubleFromFile(), and MiscReadStringAndDoubleFromFile().

const int QUESO::UQ_FAILED_TO_OPEN_FILE_RC = -7

Definition at line 96 of file Defines.h.

const int QUESO::UQ_INCOMPLETE_IMPLEMENTATION_RC = -1

Definition at line 90 of file Defines.h.

Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::adapt().

const int QUESO::UQ_INVALID_INTERNAL_RESULT_RC = -5

Definition at line 94 of file Defines.h.

const int QUESO::UQ_INVALID_INTERNAL_STATE_RC = -6

Definition at line 95 of file Defines.h.

const int QUESO::UQ_INVALID_OBSERVABLE_SPEC_RC = -3

Definition at line 92 of file Defines.h.

const int QUESO::UQ_INVALID_PARAMETER_SPEC_RC = -2

Definition at line 91 of file Defines.h.

const int QUESO::UQ_INVALID_QOI_SPEC_RC = -4

Definition at line 93 of file Defines.h.

const int QUESO::UQ_INVALID_SPACE_COMPONENT_ID_RC = -10

Definition at line 99 of file Defines.h.

const int QUESO::UQ_MATRIX_IS_NOT_POS_DEFINITE_RC = -8
const int QUESO::UQ_MATRIX_SVD_FAILED_RC = -11

Definition at line 100 of file Defines.h.

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

const int QUESO::UQ_OK_RC = 0

Definition at line 89 of file Defines.h.

Referenced by QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::actualGenerateSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::adapt(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain(), QUESO::MLSampling< P_V, P_M >::generateSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence(), QUESO::MLSampling< P_V, P_M >::generateSequence_Level0_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step01_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step02_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step03_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step04_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step05_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step06_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step07_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step08_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step09_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step10_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step11_inter0(), QUESO::MLSampling< P_V, P_M >::justBalance_proc0(), MiscReadCharsAndDoubleFromFile(), MiscReadStringAndDoubleFromFile(), QUESO::SequenceOfVectors< V, M >::unifiedReadContents(), QUESO::ScalarSequence< T >::unifiedReadContents(), QUESO::SequenceOfVectors< V, M >::unifiedWriteContents(), QUESO::ScalarSequence< T >::unifiedWriteContents(), and QUESO::MetropolisHastingsSG< P_V, P_M >::writeInfo().

const int QUESO::UQ_UNAVAILABLE_RANK = -1

Definition at line 87 of file Defines.h.


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