queso-0.56.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  BayesianJointPdf
 A class for handling Bayesian joint PDFs. 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  AlgorithmFactory
 
class  AlgorithmFactoryImp
 
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  Factory
 
class  FactoryImp
 
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  OptimizerOptions
 This class provides options for a Optimizer. More...
 
class  RngBase
 Class for random number generation (base class for either GSL or Boost RNG). More...
 
class  RngBoost
 
class  RngGsl
 
class  TKFactoryLogitRandomWalk
 
class  TKFactoryMALA
 
class  TKFactoryRandomWalk
 
class  TKFactoryStochasticNewton
 
class  TransitionKernelFactory
 
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  BaseTKGroup
 This base class allows the representation of a transition kernel. More...
 
class  Algorithm
 
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...
 
class  BayseianJointPdf
 
class  MetropolisAdjustedLangevinTK
 This class allows the representation of the MALA transition kernel with a scaled covariance matrix for the purposes of delayed rejection. 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  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)
 
 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<>
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 OptimizerOptions &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)
 
template<typename T >
bool queso_isnan (T arg)
 
template<typename T >
bool queso_isfinite (T arg)
 
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)
 
template<class V , class M >
std::ostream & operator<< (std::ostream &os, const BaseJointPdf< V, M > &obj)
 
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
 
AlgorithmFactoryImp< Algorithm
< GslVector, GslMatrix > > 
random_walk_alg ("random_walk")
 
AlgorithmFactoryImp< Algorithm
< GslVector, GslMatrix > > 
logit_random_walk_alg ("logit_random_walk")
 
std::terminate_handler old_terminate_handler
 
TKFactoryLogitRandomWalk
< TransformedScaledCovMatrixTKGroup
< GslVector, GslMatrix > > 
tk_factory_logit_random_walk ("logit_random_walk")
 
TKFactoryMALA
< MetropolisAdjustedLangevinTK
< GslVector, GslMatrix > > 
tk_factory_mala ("mala")
 
TKFactoryRandomWalk
< ScaledCovMatrixTKGroup
< GslVector, GslMatrix > > 
tk_factory_random_walk ("random_walk")
 
TKFactoryStochasticNewton
< HessianCovMatricesTKGroup
< GslVector, GslMatrix > > 
tk_factory_stochastic_newton ("stochastic_newton")
 

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 139 of file BoostInputOptionsParser.C.

References MiscReadDoublesFromString(), and queso_deprecated.

140 {
142  if (m_scannedInputFile) {
143  // Need to reset value?
144 
145  // Get the option as a string
146  // DM: Why do it this way? Doesn't boost support vectors as input options?
147  std::string optionValue;
148  this->getOption<std::string>(name, optionValue);
149  MiscReadDoublesFromString(optionValue, value);
150  }
151 }
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
Definition: Miscellaneous.C:40
#define queso_deprecated()
Definition: Defines.h:134
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::construct(), 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_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:73
#define queso_require_less_msg(expr1, expr2, msg)
Definition: asserts.h:75
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
template<class T >
void QUESO::ComputeCovCorrBetweenScalarSequences ( const ScalarSequence< T > &  subPSeq,
const ScalarSequence< T > &  subQSeq,
unsigned int  subNumSamples,
T &  covValue,
T &  corrValue 
)

Definition at line 4072 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().

4078 {
4079  // Check input data consistency
4080  const BaseEnvironment& env = subPSeq.env();
4081 
4082  queso_require_msg(!((subNumSamples > subPSeq.subSequenceSize()) || (subNumSamples > subQSeq.subSequenceSize())), "subNumSamples is too large");
4083 
4084  // For both P and Q vector sequences: fill them
4085  T tmpP = 0.;
4086  T tmpQ = 0.;
4087 
4088  // For both P and Q vector sequences: compute the unified mean
4089  T unifiedMeanP = subPSeq.unifiedMeanExtra(true,0,subNumSamples);
4090  T unifiedMeanQ = subQSeq.unifiedMeanExtra(true,0,subNumSamples);
4091 
4092  // Compute "sub" covariance matrix
4093  covValue = 0.;
4094  for (unsigned k = 0; k < subNumSamples; ++k) {
4095  // For both P and Q vector sequences: get the difference (wrt the unified mean) in them
4096  tmpP = subPSeq[k] - unifiedMeanP;
4097  tmpQ = subQSeq[k] - unifiedMeanQ;
4098  covValue += tmpP*tmpQ;
4099  }
4100 
4101  // For both P and Q vector sequences: compute the unified variance
4102  T unifiedSampleVarianceP = subPSeq.unifiedSampleVarianceExtra(true,
4103  0,
4104  subNumSamples,
4105  unifiedMeanP);
4106 
4107  T unifiedSampleVarianceQ = subQSeq.unifiedSampleVarianceExtra(true,
4108  0,
4109  subNumSamples,
4110  unifiedMeanQ);
4111 
4112  // Compute unified covariance
4113  if (env.inter0Rank() >= 0) {
4114  unsigned int unifiedNumSamples = 0;
4115  env.inter0Comm().template Allreduce<unsigned int>(&subNumSamples, &unifiedNumSamples, (int) 1, RawValue_MPI_SUM,
4116  "ComputeCovCorrBetweenScalarSequences()",
4117  "failed MPI.Allreduce() for subNumSamples");
4118 
4119  double aux = 0.;
4120  env.inter0Comm().template Allreduce<double>(&covValue, &aux, (int) 1, RawValue_MPI_SUM,
4121  "ComputeCovCorrBetweenScalarSequences()",
4122  "failed MPI.Allreduce() for a matrix position");
4123  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)
4124 
4125  corrValue = covValue/std::sqrt(unifiedSampleVarianceP)/std::sqrt(unifiedSampleVarianceQ);
4126 
4127  if ((corrValue < -1.) || (corrValue > 1.)) { // prudencio 2010-07-23
4128  std::cerr << "In ComputeCovCorrBetweenScalarSequences()"
4129  << ": computed correlation is out of range, corrValue = " << corrValue
4130  << std::endl;
4131  }
4132 
4133  // env.worldRank(),
4134  // "ComputeCovCorrBetweenScalarSequences()",
4135  // "computed correlation is out of range");
4136  }
4137  else {
4138  // Node not in the 'inter0' communicator: do nothing extra
4139  }
4140 
4141  return;
4142 }
#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 V & zeroVector() const
Returns a vector filled with zeros.
Definition: VectorSpace.C:189
int k
Definition: ann_sample.cpp:53
virtual void realization(V &nextValues) const =0
Performs a realization (sample) from a probability density function. See template specialization...
const VectorSet< V, M > & imageSet() const
Image set of the vector RV; access to private attribute m_imageSet.
Definition: VectorRV.C:82
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
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)
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
virtual const VectorSpace< V, M > & vectorSpace() const =0
Vector space to which this set belongs to. See template specialization.
unsigned int numOfProcsForStorage() const
Returns total number of processes.
Definition: VectorSpace.C:164
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.0, "sample variance is not positive");
2852  queso_require_greater_msg(minSampleVarianceQ, 0.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 }
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 ...
virtual unsigned int subSequenceSize() const =0
Size of the sub-sequence of vectors. See template specialization.
#define RawValue_MPI_SUM
Definition: MpiComm.h:71
#define queso_require_greater_equal_msg(expr1, expr2, msg)
Definition: asserts.h:78
const V & zeroVector() const
Returns a vector filled with zeros.
Definition: VectorSpace.C:189
int k
Definition: ann_sample.cpp:53
#define queso_require_greater_msg(expr1, expr2, msg)
Definition: asserts.h:76
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 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...
#define queso_require_less_equal_msg(expr1, expr2, msg)
Definition: asserts.h:77
unsigned int dimGlobal() const
Definition: VectorSpace.C:176
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
const VectorSpace< V, M > & vectorSpace() const
Vector space; access to protected attribute VectorSpace&lt;V,M&gt;&amp; m_vectorSpace.
unsigned int numOfProcsForStorage() const
Returns total number of processes.
Definition: VectorSpace.C:164
unsigned int dimLocal() const
Definition: VectorSpace.C:170
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 3963 of file ScalarSequence.C.

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

Referenced by ComputeUnifiedGaussian2dKde().

3971 {
3972  queso_require_equal_to_msg(initialPos, 0, "not implemented yet for initialPos != 0");
3973 
3974  double covValue = 0.;
3975  double corrValue = 0.;
3977  scalarSeq2,
3978  scalarSeq1.subSequenceSize(),
3979  covValue,
3980  corrValue);
3981 
3982  bool bRC = ((initialPos < scalarSeq1.subSequenceSize()) &&
3983  (scalarSeq1.subSequenceSize() == scalarSeq2.subSequenceSize()) &&
3984  (0 < evaluationPositions1.size() ) &&
3985  (evaluationPositions1.size() == evaluationPositions2.size() ) &&
3986  (evaluationPositions1.size() == densityValues.size() ));
3987  queso_require_msg(bRC, "invalid input data");
3988 
3989  unsigned int dataSize = scalarSeq1.subSequenceSize() - initialPos;
3990  unsigned int numEvals = evaluationPositions1.size();
3991 
3992  double scale1Inv = 1./scaleValue1;
3993  double scale2Inv = 1./scaleValue2;
3994  //corrValue = 0.;
3995  double r = 1. - corrValue*corrValue;
3996  if (r <= 0.) { // prudencio 2010-07-23
3997  std::cerr << "In ComputeSubGaussian2dKde()"
3998  << ": WARNING, r = " << r
3999  << std::endl;
4000  }
4001 
4002  // scalarSeq1.env().worldRank(),
4003  // "ComputeSubGaussian2dKde()",
4004  // "negative r");
4005  for (unsigned int j = 0; j < numEvals; ++j) {
4006  double x1 = evaluationPositions1[j];
4007  double x2 = evaluationPositions2[j];
4008  double value = 0.;
4009  for (unsigned int k = 0; k < dataSize; ++k) {
4010  double d1k = scale1Inv*(x1 - scalarSeq1[initialPos+k]);
4011  double d2k = scale2Inv*(x2 - scalarSeq2[initialPos+k]);
4012  value += exp(-.5*( d1k*d1k + 2*corrValue*d1k*d2k + d2k*d2k )/r);
4013  }
4014  densityValues[j] = scale1Inv * scale2Inv * (value/(double) dataSize) / 2. / M_PI / sqrt(r);
4015  }
4016 
4017  return;
4018 }
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:73
int k
Definition: ann_sample.cpp:53
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
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 4022 of file ScalarSequence.C.

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

4031 {
4032  if (scalarSeq1.env().numSubEnvironments() == 1) {
4033  return ComputeSubGaussian2dKde(scalarSeq1,
4034  scalarSeq2,
4035  initialPos,
4036  unifiedScaleValue1,
4037  unifiedScaleValue2,
4038  unifiedEvaluationPositions1,
4039  unifiedEvaluationPositions2,
4040  unifiedDensityValues);
4041  }
4042 
4043  // As of 14/Nov/2009, this routine needs to be checked if it requires sub sequences to have equal size. Good.
4044 
4045  if (useOnlyInter0Comm) {
4046  if (scalarSeq1.env().inter0Rank() >= 0) {
4047  queso_error_msg("inter0 case not supported yet");
4048  }
4049  else {
4050  // Node not in the 'inter0' communicator
4051  ComputeSubGaussian2dKde(scalarSeq1,
4052  scalarSeq2,
4053  initialPos,
4054  unifiedScaleValue1,
4055  unifiedScaleValue2,
4056  unifiedEvaluationPositions1,
4057  unifiedEvaluationPositions2,
4058  unifiedDensityValues);
4059  }
4060  }
4061  else {
4062  queso_error_msg("parallel vectors not supported yet");
4063  }
4064 
4065  //scalarSeq1.env().fullComm().Barrier();
4066 
4067  return;
4068 }
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)
#define queso_error_msg(msg)
Definition: asserts.h:47
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 leftDiagScaling(const GslVector &vec, const GslMatrix &mat)
Definition: GslMatrix.C:2052
GslMatrix matrixProduct(const GslVector &v1, const GslVector &v2)
Definition: GslMatrix.C:2036
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 2052 of file GslMatrix.C.

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

Referenced by CovCond().

2053 {
2054  unsigned int vSize = vec.sizeLocal();
2055  unsigned int mRows = mat.numRowsLocal();
2056  unsigned int mCols = mat.numCols();
2057 
2058  queso_require_equal_to_msg(vSize, mRows, "size of vector is different from the number of rows in matrix");
2059 
2060  queso_require_equal_to_msg(mCols, mRows, "routine currently works for square matrices only");
2061 
2062  GslMatrix answer(mat);
2063  for (unsigned int i = 0; i < mRows; ++i) {
2064  double vecValue = vec[i];
2065  for (unsigned int j = 0; j < mCols; ++j) {
2066  answer(i,j) *= vecValue;
2067  }
2068  }
2069 
2070  return answer;
2071 }
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:73
GslMatrix QUESO::matrixProduct ( const GslVector &  v1,
const GslVector &  v2 
)

Definition at line 2036 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().

2037 {
2038  unsigned int nRows = v1.sizeLocal();
2039  unsigned int nCols = v2.sizeLocal();
2040  GslMatrix answer(v1.env(),v1.map(),nCols);
2041 
2042  for (unsigned int i = 0; i < nRows; ++i) {
2043  double value1 = v1[i];
2044  for (unsigned int j = 0; j < nCols; ++j) {
2045  answer(i,j) = value1*v2[j];
2046  }
2047  }
2048 
2049  return answer;
2050 }
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 RawValue_MPI_DOUBLE
Definition: MpiComm.h:67
#define queso_require_less_equal_msg(expr1, expr2, msg)
Definition: asserts.h:77
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_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:73
#define queso_error_msg(msg)
Definition: asserts.h:47
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::MetropolisHastingsSG< P_V, P_M >::delayedRejection(), 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:74
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:74
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 1982 of file GslMatrix.C.

1983 {
1984  GslMatrix answer(mat);
1985  answer *= a;
1986  return answer;
1987 }
GslVector QUESO::operator* ( const GslMatrix &  mat,
const GslVector &  vec 
)

Definition at line 1989 of file GslMatrix.C.

References QUESO::GslMatrix::multiply().

1990 {
1991  return mat.multiply(vec);
1992 }
GslMatrix QUESO::operator* ( const GslMatrix &  m1,
const GslMatrix &  m2 
)

Definition at line 1994 of file GslMatrix.C.

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

1995 {
1996  unsigned int m1Rows = m1.numRowsLocal();
1997  unsigned int m1Cols = m1.numCols();
1998  unsigned int m2Rows = m2.numRowsLocal();
1999  unsigned int m2Cols = m2.numCols();
2000 
2001  queso_require_equal_to_msg(m1Cols, m2Rows, "different sizes m1Cols and m2Rows");
2002 
2003  GslMatrix mat(m1.env(),m1.map(),m2Cols);
2004 
2005  //std::cout << "In GslMatrix(mat * mat): m1Cols = " << m1Cols << std::endl;
2006 
2007  unsigned int commonSize = m1Cols;
2008  for (unsigned int row1 = 0; row1 < m1Rows; ++row1) {
2009  for (unsigned int col2 = 0; col2 < m2Cols; ++col2) {
2010  double result = 0.;
2011  for (unsigned int k = 0; k < commonSize; ++k) {
2012  result += m1(row1,k)*m2(k,col2);
2013  }
2014  mat(row1,col2) = result;
2015  }
2016  //std::cout << "In GslMatrix(mat * mat): ended row " << row1 << std::endl;
2017  }
2018 
2019  return mat;
2020 }
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:73
int k
Definition: ann_sample.cpp:53
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 2022 of file GslMatrix.C.

2023 {
2024  GslMatrix answer(m1);
2025  answer += m2;
2026  return answer;
2027 }
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 2029 of file GslMatrix.C.

2030 {
2031  GslMatrix answer(m1);
2032  answer -= m2;
2033  return answer;
2034 }
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 105 of file InfiniteDimensionalMCMCSamplerOptions.C.

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

107 {
108 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
109  os << (*(obj.m_parser)) << std::endl;
110 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
111  obj.print(os);
112  return os;
113 }
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 }
template<class V , class M >
std::ostream& QUESO::operator<< ( std::ostream &  os,
const BaseJointPdf< V, M > &  obj 
)

Definition at line 121 of file JointPdf.h.

122 {
123  obj.print(os);
124  return os;
125 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const ExperimentModelOptions &  obj 
)

Definition at line 410 of file ExperimentModelOptions.C.

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

411 {
413 
414  obj.print(os);
415 
416  return os;
417 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream& QUESO::operator<< ( std::ostream &  os,
const BoostInputOptionsParser &  parser 
)

Definition at line 154 of file BoostInputOptionsParser.C.

References QUESO::BoostInputOptionsParser::m_optionsDescription, and queso_deprecated.

155 {
157  os << *(parser.m_optionsDescription);
158  return os;
159 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream & QUESO::operator<< ( std::ostream &  os,
const SimulationModelOptions &  obj 
)

Definition at line 551 of file SimulationModelOptions.C.

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

552 {
554 
555  obj.print(os);
556 
557  return os;
558 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream& QUESO::operator<< ( std::ostream &  os,
const OptimizerOptions &  obj 
)

Definition at line 166 of file OptimizerOptions.C.

References QUESO::OptimizerOptions::m_fdfstepSize, QUESO::OptimizerOptions::m_finiteDifferenceStepSize, QUESO::OptimizerOptions::m_fstepSize, QUESO::OptimizerOptions::m_lineTolerance, QUESO::OptimizerOptions::m_maxIterations, QUESO::OptimizerOptions::m_option_fdfstepSize, QUESO::OptimizerOptions::m_option_finiteDifferenceStepSize, QUESO::OptimizerOptions::m_option_fstepSize, QUESO::OptimizerOptions::m_option_lineTolerance, QUESO::OptimizerOptions::m_option_maxIterations, QUESO::OptimizerOptions::m_option_solverType, QUESO::OptimizerOptions::m_option_tolerance, QUESO::OptimizerOptions::m_solverType, and QUESO::OptimizerOptions::m_tolerance.

167 {
168  os << "\n" << obj.m_option_maxIterations << " = " << obj.m_maxIterations
169  << "\n" << obj.m_option_tolerance << " = " << obj.m_tolerance;
170  os << "\n" << obj.m_option_finiteDifferenceStepSize << " = "
171  << obj.m_finiteDifferenceStepSize;
172  os << "\n" << obj.m_option_solverType << " = " << obj.m_solverType;
173  os << "\n" << obj.m_option_fstepSize << " = " << obj.m_fstepSize;
174  os << "\n" << obj.m_option_fdfstepSize << " = " << obj.m_fdfstepSize;
175  os << "\n" << obj.m_option_lineTolerance << " = " << obj.m_lineTolerance;
176  os << std::endl;
177  return os;
178 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const GPMSAOptions &  obj 
)

Definition at line 170 of file GPMSAOptions.C.

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

171 {
172 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
173  os << (*(obj.m_parser)) << std::endl;
174 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
175  obj.print(os);
176  return os;
177 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const SipOptionsValues &  obj 
)

Definition at line 172 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.

173 {
174  os << "\n" << obj.m_option_computeSolution << " = " << obj.m_computeSolution
175  << "\n" << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName;
176  os << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
177  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
178  os << *setIt << " ";
179  }
180 #ifdef UQ_SIP_READS_SOLVER_OPTION
181  << "\n" << obj.m_option_solver << " = " << obj.m_solverString
182 #endif
183  os << std::endl;
184  return os;
185 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const MLSamplingOptions &  obj 
)

Definition at line 172 of file MLSamplingOptions.C.

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

173 {
174 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
175  os << (*(obj.m_parser)) << std::endl;
176 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
177 
178  obj.print(os);
179  return os;
180 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const SfpOptionsValues &  obj 
)

Definition at line 177 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.

178 {
179 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
180  os << (*(obj.m_parser)) << std::endl;
181 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
182 
183  os << obj.m_option_computeSolution << " = " << obj.m_computeSolution
184  << "\n" << obj.m_option_computeCovariances << " = " << obj.m_computeCovariances
185  << "\n" << obj.m_option_computeCorrelations << " = " << obj.m_computeCorrelations
186  << "\n" << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName;
187  os << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
188  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
189  os << *setIt << " ";
190  }
191 #ifdef UQ_SFP_READS_SOLVER_OPTION
192  << "\n" << obj.m_option_solver << " = " << obj.m_solverString
193 #endif
194  os << std::endl;
195  return os;
196 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const GpmsaComputerModelOptions &  obj 
)

Definition at line 721 of file GpmsaComputerModelOptions.C.

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

722 {
724 
725  obj.print(os);
726 
727  return os;
728 }
#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 397 of file StatisticalForwardProblemOptions.C.

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

398 {
400 
401  obj.print(os);
402 
403  return os;
404 }
#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 379 of file StatisticalInverseProblemOptions.C.

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

380 {
382  obj.print(os);
383 
384  return os;
385 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream& QUESO::operator<< ( std::ostream &  os,
const EnvOptionsValues &  obj 
)

Definition at line 236 of file EnvironmentOptions.C.

References QUESO::BaseEnvironment::input(), QUESO::EnvOptionsValues::m_checkingLevel, QUESO::EnvOptionsValues::m_displayVerbosity, QUESO::EnvOptionsValues::m_env, 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, QUESO::EnvOptionsValues::m_syncVerbosity, and GetPot::print().

237 {
238  // Print the parser
239 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
240  os << (*(obj.m_parser)) << std::endl;
241 #else
242  obj.m_env->input().print(os);
243 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
244 
245  // Print the option names and current values
246  os << obj.m_option_numSubEnvironments << " = " << obj.m_numSubEnvironments
247  << "\n" << obj.m_option_subDisplayFileName << " = " << obj.m_subDisplayFileName
248  << "\n" << obj.m_option_subDisplayAllowAll << " = " << obj.m_subDisplayAllowAll
249  //<< "\n" << obj.m_option_subDisplayAllowInter0 << " = " << obj.m_subDisplayAllowInter0
250  << "\n" << obj.m_option_subDisplayAllowedSet << " = ";
251  for (std::set<unsigned int>::iterator setIt = obj.m_subDisplayAllowedSet.begin(); setIt != obj.m_subDisplayAllowedSet.end(); ++setIt) {
252  os << *setIt << " ";
253  }
254  os << "\n" << obj.m_option_displayVerbosity << " = " << obj.m_displayVerbosity
255  << "\n" << obj.m_option_syncVerbosity << " = " << obj.m_syncVerbosity
256  << "\n" << obj.m_option_checkingLevel << " = " << obj.m_checkingLevel
257  << "\n" << obj.m_option_rngType << " = " << obj.m_rngType
258  << "\n" << obj.m_option_seed << " = " << obj.m_seed
259  << "\n" << obj.m_option_platformName << " = " << obj.m_platformName
260  << "\n" << obj.m_option_identifyingString << " = " << obj.m_identifyingString
261  //<< "\n" << obj.m_option_numDebugParams << " = " << obj.m_numDebugParams
262  << std::endl;
263  return os;
264 }
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 706 of file MonteCarloSGOptions.C.

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

707 {
709 
710  obj.print(os);
711 
712  return os;
713 }
#define queso_deprecated()
Definition: Defines.h:134
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 McOptionsValues &  obj 
)

Definition at line 326 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.

327 {
328 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
329  os << (*(obj.m_parser)) << std::endl;
330 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
331 
332  os << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName
333  << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
334  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
335  os << *setIt << " ";
336  }
337  os << "\n" << obj.m_option_pseq_dataOutputPeriod << " = " << obj.m_pseqDataOutputPeriod
338  << "\n" << obj.m_option_pseq_dataOutputFileName << " = " << obj.m_pseqDataOutputFileName
339  << "\n" << obj.m_option_pseq_dataOutputFileType << " = " << obj.m_pseqDataOutputFileType
340  << "\n" << obj.m_option_pseq_dataOutputAllowedSet << " = ";
341  for (std::set<unsigned int>::iterator setIt = obj.m_pseqDataOutputAllowedSet.begin(); setIt != obj.m_pseqDataOutputAllowedSet.end(); ++setIt) {
342  os << *setIt << " ";
343  }
344  os
345 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
346  << "\n" << obj.m_option_pseq_computeStats << " = " << obj.m_pseqComputeStats
347 #endif
348  << "\n" << obj.m_option_qseq_dataInputFileName << " = " << obj.m_qseqDataInputFileName
349  << "\n" << obj.m_option_qseq_dataInputFileType << " = " << obj.m_qseqDataInputFileType
350  << "\n" << obj.m_option_qseq_size << " = " << obj.m_qseqSize
351  << "\n" << obj.m_option_qseq_displayPeriod << " = " << obj.m_qseqDisplayPeriod
352  << "\n" << obj.m_option_qseq_measureRunTimes << " = " << obj.m_qseqMeasureRunTimes
353  << "\n" << obj.m_option_qseq_dataOutputPeriod << " = " << obj.m_qseqDataOutputPeriod
354  << "\n" << obj.m_option_qseq_dataOutputFileName << " = " << obj.m_qseqDataOutputFileName
355  << "\n" << obj.m_option_qseq_dataOutputFileType << " = " << obj.m_qseqDataOutputFileType
356  << "\n" << obj.m_option_qseq_dataOutputAllowedSet << " = ";
357  for (std::set<unsigned int>::iterator setIt = obj.m_qseqDataOutputAllowedSet.begin(); setIt != obj.m_qseqDataOutputAllowedSet.end(); ++setIt) {
358  os << *setIt << " ";
359  }
360 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
361  os << "\n" << obj.m_option_qseq_computeStats << " = " << obj.m_qseqComputeStats;
362 #endif
363 
364  return os;
365 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const EnvironmentOptions &  obj 
)

Print values of the options chosen.

Definition at line 538 of file EnvironmentOptions.C.

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

539 {
541 
542  obj.print(os);
543 
544  return os;
545 }
#define queso_deprecated()
Definition: Defines.h:134
std::ostream & QUESO::operator<< ( std::ostream &  os,
const GslMatrix &  obj 
)

Definition at line 1975 of file GslMatrix.C.

References QUESO::GslMatrix::print().

1976 {
1977  obj.print(os);
1978 
1979  return os;
1980 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const BaseEnvironment &  obj 
)
std::ostream& QUESO::operator<< ( std::ostream &  os,
const MhOptionsValues &  obj 
)

Definition at line 732 of file MetropolisHastingsSGOptions.C.

References QUESO::MhOptionsValues::m_algorithm, 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_algorithm, 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, 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_tk, QUESO::MhOptionsValues::m_tkUseLocalHessian, QUESO::MhOptionsValues::m_tkUseNewtonComponent, and QUESO::MhOptionsValues::m_totallyMute.

733 {
734 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
735  os << (*(obj.m_parser)) << std::endl;
736 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
737 
738  os << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName
739  << "\n" << obj.m_option_dataOutputAllowAll << " = " << obj.m_dataOutputAllowAll
740  << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
741  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
742  os << *setIt << " ";
743  }
744  os << "\n" << obj.m_option_totallyMute << " = " << obj.m_totallyMute
745  << "\n" << obj.m_option_initialPosition_dataInputFileName << " = " << obj.m_initialPositionDataInputFileName
746  << "\n" << obj.m_option_initialPosition_dataInputFileType << " = " << obj.m_initialPositionDataInputFileType
747  << "\n" << obj.m_option_initialProposalCovMatrix_dataInputFileName << " = " << obj.m_initialProposalCovMatrixDataInputFileName
748  << "\n" << obj.m_option_initialProposalCovMatrix_dataInputFileType << " = " << obj.m_initialProposalCovMatrixDataInputFileType
749  << "\n" << obj.m_option_listOfDisabledParameters << " = ";
750  for (std::set<unsigned int>::iterator setIt = obj.m_parameterDisabledSet.begin(); setIt != obj.m_parameterDisabledSet.end(); ++setIt) {
751  os << *setIt << " ";
752  }
753  os << "\n" << obj.m_option_rawChain_dataInputFileName << " = " << obj.m_rawChainDataInputFileName
754  << "\n" << obj.m_option_rawChain_dataInputFileType << " = " << obj.m_rawChainDataInputFileType
755  << "\n" << obj.m_option_rawChain_size << " = " << obj.m_rawChainSize
756  << "\n" << obj.m_option_rawChain_generateExtra << " = " << obj.m_rawChainGenerateExtra
757  << "\n" << obj.m_option_rawChain_displayPeriod << " = " << obj.m_rawChainDisplayPeriod
758  << "\n" << obj.m_option_rawChain_measureRunTimes << " = " << obj.m_rawChainMeasureRunTimes
759  << "\n" << obj.m_option_rawChain_dataOutputPeriod << " = " << obj.m_rawChainDataOutputPeriod
760  << "\n" << obj.m_option_rawChain_dataOutputFileName << " = " << obj.m_rawChainDataOutputFileName
761  << "\n" << obj.m_option_rawChain_dataOutputFileType << " = " << obj.m_rawChainDataOutputFileType
762  << "\n" << obj.m_option_rawChain_dataOutputAllowAll << " = " << obj.m_rawChainDataOutputAllowAll
763  << "\n" << obj.m_option_rawChain_dataOutputAllowedSet << " = ";
764  for (std::set<unsigned int>::iterator setIt = obj.m_rawChainDataOutputAllowedSet.begin(); setIt != obj.m_rawChainDataOutputAllowedSet.end(); ++setIt) {
765  os << *setIt << " ";
766  }
767  os
768 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
769  << "\n" << obj.m_option_rawChain_computeStats << " = " << obj.m_rawChainComputeStats
770 #endif
771  << "\n" << obj.m_option_filteredChain_generate << " = " << obj.m_filteredChainGenerate
772  << "\n" << obj.m_option_filteredChain_discardedPortion << " = " << obj.m_filteredChainDiscardedPortion
773  << "\n" << obj.m_option_filteredChain_lag << " = " << obj.m_filteredChainLag
774  << "\n" << obj.m_option_filteredChain_dataOutputFileName << " = " << obj.m_filteredChainDataOutputFileName
775  << "\n" << obj.m_option_filteredChain_dataOutputFileType << " = " << obj.m_filteredChainDataOutputFileType
776  << "\n" << obj.m_option_filteredChain_dataOutputAllowAll << " = " << obj.m_filteredChainDataOutputAllowAll
777  << "\n" << obj.m_option_filteredChain_dataOutputAllowedSet << " = ";
778  for (std::set<unsigned int>::iterator setIt = obj.m_filteredChainDataOutputAllowedSet.begin(); setIt != obj.m_filteredChainDataOutputAllowedSet.end(); ++setIt) {
779  os << *setIt << " ";
780  }
781  os
782 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
783  << "\n" << obj.m_option_filteredChain_computeStats << " = " << obj.m_filteredChainComputeStats
784 #endif
785  << "\n" << obj.m_option_displayCandidates << " = " << obj.m_displayCandidates
786  << "\n" << obj.m_option_putOutOfBoundsInChain << " = " << obj.m_putOutOfBoundsInChain
787  << "\n" << obj.m_option_tk_useLocalHessian << " = " << obj.m_tkUseLocalHessian
788  << "\n" << obj.m_option_tk_useNewtonComponent << " = " << obj.m_tkUseNewtonComponent
789  << "\n" << obj.m_option_dr_maxNumExtraStages << " = " << obj.m_drMaxNumExtraStages
790  << "\n" << obj.m_option_dr_listOfScalesForExtraStages << " = ";
791  for (unsigned int i = 0; i < obj.m_drScalesForExtraStages.size(); ++i) {
792  os << obj.m_drScalesForExtraStages[i] << " ";
793  }
794  os << "\n" << obj.m_option_dr_duringAmNonAdaptiveInt << " = " << obj.m_drDuringAmNonAdaptiveInt
795  << "\n" << obj.m_option_am_keepInitialMatrix << " = " << obj.m_amKeepInitialMatrix
796  << "\n" << obj.m_option_am_initialNonAdaptInterval << " = " << obj.m_amInitialNonAdaptInterval
797  << "\n" << obj.m_option_am_adaptInterval << " = " << obj.m_amAdaptInterval
798  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputPeriod << " = " << obj.m_amAdaptedMatricesDataOutputPeriod
799  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputFileName << " = " << obj.m_amAdaptedMatricesDataOutputFileName
800  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputFileType << " = " << obj.m_amAdaptedMatricesDataOutputFileType
801  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputAllowAll << " = " << obj.m_amAdaptedMatricesDataOutputAllowAll
802  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputAllowedSet << " = ";
803  for (std::set<unsigned int>::iterator setIt = obj.m_amAdaptedMatricesDataOutputAllowedSet.begin(); setIt != obj.m_amAdaptedMatricesDataOutputAllowedSet.end(); ++setIt) {
804  os << *setIt << " ";
805  }
806  os << "\n" << obj.m_option_am_eta << " = " << obj.m_amEta
807  << "\n" << obj.m_option_am_epsilon << " = " << obj.m_amEpsilon
808  << "\n" << obj.m_option_enableBrooksGelmanConvMonitor << " = " << obj.m_enableBrooksGelmanConvMonitor
809  << "\n" << obj.m_option_BrooksGelmanLag << " = " << obj.m_BrooksGelmanLag
810  << "\n" << obj.m_option_outputLogLikelihood << " = " << obj.m_outputLogLikelihood
811  << "\n" << obj.m_option_outputLogTarget << " = " << obj.m_outputLogTarget
812  << "\n" << obj.m_option_doLogitTransform << " = " << obj.m_doLogitTransform
813  << "\n" << obj.m_option_algorithm << " = " << obj.m_algorithm
814  << "\n" << obj.m_option_tk << " = " << obj.m_tk
815  << std::endl;
816 
817  return os;
818 }
std::ostream& QUESO::operator<< ( std::ostream &  os,
const MLSamplingLevelOptions &  obj 
)

Definition at line 835 of file MLSamplingLevelOptions.C.

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

836 {
837 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
838  os << (*(obj.m_parser)) << std::endl;
839 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
840  obj.print(os);
841  return os;
842 }
std::ostream & QUESO::operator<< ( std::ostream &  os,
const MetropolisHastingsSGOptions &  obj 
)

Definition at line 1701 of file MetropolisHastingsSGOptions.C.

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

1702 {
1703  queso_deprecated();
1704 
1705  obj.print(os);
1706 
1707  return os;
1708 }
#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 4822 of file MLSampling.C.

4823 {
4824  obj.print(os);
4825 
4826  return os;
4827 }
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:73
int QUESO::QUESO_get_numeric_version ( )

Definition at line 84 of file Environment.C.

Referenced by QUESO_version_print().

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

Definition at line 51 of file math_macros.h.

Referenced by QUESO::InvLogitGaussianJointPdf< V, M >::lnValue(), QUESO::UniformVectorRealizer< V, M >::realization(), QUESO::InvLogitGaussianVectorRealizer< V, M >::realization(), QUESO::MetropolisHastingsSG< P_V, P_M >::transformInitialCovMatrixToGaussianSpace(), and QUESO::TransformedScaledCovMatrixTKGroup< V, M >::transformToGaussianSpace().

52  {
53 #ifdef QUESO_HAVE_CXX11_ISFINITE
54  return std::isfinite(arg);
55 #elif QUESO_HAVE_BOOST_MATH_SPECIAL_FUNCTIONS_HPP
56  return (boost::math::isfinite)(arg);
57 #else
58 # error "No valid definition for isfinite found!"
59 #endif
60  }
template<typename T >
bool QUESO::queso_isnan ( arg)
QUESO::QUESO_STANDARD_TYPE ( char  ,
MPI_CHAR   
)
QUESO::QUESO_STANDARD_TYPE ( int  ,
MPI_INT   
)
QUESO::QUESO_STANDARD_TYPE ( unsigned  int,
MPI_UNSIGNED   
)
QUESO::QUESO_STANDARD_TYPE ( double  ,
MPI_DOUBLE   
)
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 1722 of file Environment.C.

References old_terminate_handler.

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

1723 {
1724 #ifdef QUESO_HAS_MPI
1725  int mpi_initialized;
1726  MPI_Initialized (&mpi_initialized);
1727 
1728  if (mpi_initialized)
1729  {
1730  //MPI_Abort(m_fullComm->Comm(), 1);
1731  MPI_Abort(MPI_COMM_WORLD, 1);
1732  }
1733  else
1734  {
1735  // The system terminate_handler may do useful things like printing
1736  // uncaught exception information, or the user may have created
1737  // their own terminate handler that we want to call.
1739  }
1740 #else
1742 #endif
1743  exit(1);
1744 }
std::terminate_handler old_terminate_handler
Definition: Environment.C:135
void QUESO::QUESO_version_print ( std::ostream &  os)

Definition at line 54 of file Environment.C.

References QUESO_get_numeric_version().

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

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

Definition at line 2073 of file GslMatrix.C.

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

2074 {
2075  unsigned int vSize = vec.sizeLocal();
2076  unsigned int mRows = mat.numRowsLocal();
2077  unsigned int mCols = mat.numCols();
2078 
2079  queso_require_equal_to_msg(vSize, mCols, "size of vector is different from the number of cols in matrix");
2080 
2081  queso_require_equal_to_msg(mCols, mRows, "routine currently works for square matrices only");
2082 
2083  GslMatrix answer(mat);
2084  for (unsigned int j = 0; j < mCols; ++j) {
2085  double vecValue = vec[j];
2086  for (unsigned int i = 0; i < mRows; ++i) {
2087  answer(i,j) *= vecValue;
2088  }
2089  }
2090 
2091  return answer;
2092 }
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:73
double QUESO::scalarProduct ( const GslVector &  x,
const GslVector &  y 
)
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 }
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:73
int k
Definition: ann_sample.cpp:53

Variable Documentation

AlgorithmFactoryImp<Algorithm<GslVector, GslMatrix> > QUESO::logit_random_walk_alg("logit_random_walk")
std::terminate_handler QUESO::old_terminate_handler

Definition at line 135 of file Environment.C.

Referenced by QUESO::FullEnvironment::construct(), and queso_terminate_handler().

AlgorithmFactoryImp<Algorithm<GslVector, GslMatrix> > QUESO::random_walk_alg("random_walk")
TKFactoryLogitRandomWalk<TransformedScaledCovMatrixTKGroup<GslVector, GslMatrix> > QUESO::tk_factory_logit_random_walk("logit_random_walk")
TKFactoryMALA<MetropolisAdjustedLangevinTK<GslVector, GslMatrix> > QUESO::tk_factory_mala("mala")
TKFactoryRandomWalk<ScaledCovMatrixTKGroup<GslVector, GslMatrix> > QUESO::tk_factory_random_walk("random_walk")
TKFactoryStochasticNewton<HessianCovMatricesTKGroup<GslVector, GslMatrix> > QUESO::tk_factory_stochastic_newton("stochastic_newton")
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 >::delayedRejection(), 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 Tue Nov 29 2016 10:53:13 for queso-0.56.0 by  doxygen 1.8.5