Skip to content

Commit

Permalink
Merge branch 'dev' into options_handling_569
Browse files Browse the repository at this point in the history
  • Loading branch information
briadam authored Oct 12, 2017
2 parents dfce945 + 902e670 commit 0e85810
Show file tree
Hide file tree
Showing 83 changed files with 14,662 additions and 3,940 deletions.
3 changes: 0 additions & 3 deletions examples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,6 @@ dist_gpmsa_linverif_DATA += ${gpmsa_linverif_SOURCES}
dist_gpmsa_linverif_DATA += gp/linear_verif/gpmsa_scalar.txt
dist_gpmsa_linverif_DATA += gp/linear_verif/sim_scalar.dat
dist_gpmsa_linverif_DATA += gp/linear_verif/y_exp_scalar.txt
dist_gpmsa_linverif_DATA += gp/linear_verif/gpmsa_mv.txt
dist_gpmsa_linverif_DATA += gp/linear_verif/sim_mv.dat
dist_gpmsa_linverif_DATA += gp/linear_verif/y_exp_mv.txt

#######################################
# Canned Gaussian likelihood examples #
Expand Down
11 changes: 6 additions & 5 deletions examples/gp/linear_verif/gpmsa_linear_verif.C
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ void run_scalar(const QUESO::FullEnvironment& env)
configSpace,
paramSpace,
nEtaSpace,
experimentSpace,
numSimulations,
numExperiments);

Expand Down Expand Up @@ -216,13 +215,16 @@ void run_scalar(const QUESO::FullEnvironment& env)
simulationScenarios[i].reset(new QUESO::GslVector(configSpace.zeroVector())); // 'x_{i+1}^*' in paper
paramVecs [i].reset(new QUESO::GslVector(paramSpace.zeroVector())); // 't_{i+1}^*' in paper
outputVecs [i].reset(new QUESO::GslVector(nEtaSpace.zeroVector())); // 'eta_{i+1}' in paper
}

// Must set scaling before adding experiments due to construct order
// As of this implementation autoscale only affects params/scenarios
// Must set scaling before adding experiments due to construct order
for (unsigned int i = 0; i < numUncertainVars; i++)
gp_opts.set_autoscale_minmax_uncertain_parameter(i);
for (unsigned int i = 0; i < numConfigVars; i++)
gp_opts.set_autoscale_minmax_scenario_parameter(i);
for (unsigned int i = 0; i < numEta; i++)
gp_opts.set_autoscale_meanvar_output(i);
}


for (unsigned int i = 0; i < numExperiments; i++) {
experimentScenarios[i].reset(new QUESO::GslVector(configSpace.zeroVector())); // 'x_{i+1}' in paper
Expand Down Expand Up @@ -399,7 +401,6 @@ void run_multivariate(const QUESO::FullEnvironment& env)
configSpace,
paramSpace,
nEtaSpace,
experimentSpace,
numSimulations,
numExperiments);

Expand Down
1 change: 0 additions & 1 deletion examples/gp/pseudovector/gpmsa_pseudovector.C
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ int main(int argc, char ** argv) {
configSpace,
paramSpace,
nEtaSpace,
experimentSpace,
numSimulations,
numExperiments);

Expand Down
1 change: 0 additions & 1 deletion examples/gp/scalar/gpmsa_scalar.C
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ int main(int argc, char ** argv) {
configSpace,
paramSpace,
nEtaSpace,
experimentSpace,
numSimulations,
numExperiments);

Expand Down
1 change: 0 additions & 1 deletion examples/gp/vector/gpmsa_vector.C
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ int main(int argc, char ** argv) {
configSpace,
paramSpace,
nEtaSpace,
experimentSpace,
numSimulations,
numExperiments);

Expand Down
18 changes: 18 additions & 0 deletions inc/queso/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ BUILT_SOURCES += BoxSubset.h
BUILT_SOURCES += ConcatenationSubset.h
BUILT_SOURCES += ConstantScalarFunction.h
BUILT_SOURCES += ConstantVectorFunction.h
BUILT_SOURCES += DiscreteSubset.h
BUILT_SOURCES += GenericScalarFunction.h
BUILT_SOURCES += GenericVectorFunction.h
BUILT_SOURCES += InstantiateIntersection.h
Expand Down Expand Up @@ -40,6 +41,7 @@ BUILT_SOURCES += DistArray.h
BUILT_SOURCES += Environment.h
BUILT_SOURCES += EnvironmentOptions.h
BUILT_SOURCES += Factory.h
BUILT_SOURCES += FilePtr.h
BUILT_SOURCES += FunctionBase.h
BUILT_SOURCES += FunctionOperatorBuilder.h
BUILT_SOURCES += GslBlockMatrix.h
Expand Down Expand Up @@ -81,6 +83,9 @@ BUILT_SOURCES += exceptions.h
BUILT_SOURCES += queso.h
BUILT_SOURCES += GPMSA.h
BUILT_SOURCES += GPMSAOptions.h
BUILT_SOURCES += SimulationOutputMesh.h
BUILT_SOURCES += SimulationOutputPoint.h
BUILT_SOURCES += TensorProductMesh.h
BUILT_SOURCES += 1D1DFunction.h
BUILT_SOURCES += 1DQuadrature.h
BUILT_SOURCES += 2dArrayOfStuff.h
Expand Down Expand Up @@ -110,6 +115,7 @@ BUILT_SOURCES += ConcatenatedVectorRV.h
BUILT_SOURCES += ConcatenatedVectorRealizer.h
BUILT_SOURCES += ExponentialMatrixCovarianceFunction.h
BUILT_SOURCES += ExponentialScalarCovarianceFunction.h
BUILT_SOURCES += FiniteDistribution.h
BUILT_SOURCES += GammaJointPdf.h
BUILT_SOURCES += GammaVectorRV.h
BUILT_SOURCES += GammaVectorRealizer.h
Expand Down Expand Up @@ -212,6 +218,8 @@ ConstantScalarFunction.h: $(top_srcdir)/src/basic/inc/ConstantScalarFunction.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
ConstantVectorFunction.h: $(top_srcdir)/src/basic/inc/ConstantVectorFunction.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
DiscreteSubset.h: $(top_srcdir)/src/basic/inc/DiscreteSubset.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
GenericScalarFunction.h: $(top_srcdir)/src/basic/inc/GenericScalarFunction.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
GenericVectorFunction.h: $(top_srcdir)/src/basic/inc/GenericVectorFunction.h
Expand Down Expand Up @@ -270,6 +278,8 @@ EnvironmentOptions.h: $(top_srcdir)/src/core/inc/EnvironmentOptions.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
Factory.h: $(top_srcdir)/src/core/inc/Factory.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
FilePtr.h: $(top_srcdir)/src/core/inc/FilePtr.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
FunctionBase.h: $(top_srcdir)/src/core/inc/FunctionBase.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
FunctionOperatorBuilder.h: $(top_srcdir)/src/core/inc/FunctionOperatorBuilder.h
Expand Down Expand Up @@ -352,6 +362,12 @@ GPMSA.h: $(top_srcdir)/src/gp/inc/GPMSA.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
GPMSAOptions.h: $(top_srcdir)/src/gp/inc/GPMSAOptions.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
SimulationOutputMesh.h: $(top_srcdir)/src/gp/inc/SimulationOutputMesh.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
SimulationOutputPoint.h: $(top_srcdir)/src/gp/inc/SimulationOutputPoint.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
TensorProductMesh.h: $(top_srcdir)/src/gp/inc/TensorProductMesh.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
1D1DFunction.h: $(top_srcdir)/src/misc/inc/1D1DFunction.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
1DQuadrature.h: $(top_srcdir)/src/misc/inc/1DQuadrature.h
Expand Down Expand Up @@ -410,6 +426,8 @@ ExponentialMatrixCovarianceFunction.h: $(top_srcdir)/src/stats/inc/ExponentialMa
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
ExponentialScalarCovarianceFunction.h: $(top_srcdir)/src/stats/inc/ExponentialScalarCovarianceFunction.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
FiniteDistribution.h: $(top_srcdir)/src/stats/inc/FiniteDistribution.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
GammaJointPdf.h: $(top_srcdir)/src/stats/inc/GammaJointPdf.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
GammaVectorRV.h: $(top_srcdir)/src/stats/inc/GammaVectorRV.h
Expand Down
4 changes: 3 additions & 1 deletion inc/queso/rebuild_makefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# This file was shamelessly stolen from the libmesh source tree
# See https://github.com/libMesh/libmesh

headers=`find ../../src -name "*.h" -a -not -name all.h -a -not -name FiniteDistribution.h -a -not -name DiscreteSubset.h -a -not -name FilePtr.h -type f | grep -v 'ANN' | grep -v 'interface' | LC_COLLATE=POSIX sort`
# TODO: Restore concept of build-time vs. install time headers
##headers=`find ../../src -name "*.h" -a -not -name all.h -a -not -name FiniteDistribution.h -a -not -name DiscreteSubset.h -a -not -name FilePtr.h -type f | grep -v 'ANN' | grep -v 'interface' | LC_COLLATE=POSIX sort`
headers=`find ../../src -name "*.h" -a -not -name all.h -type f | grep -v 'ANN' | grep -v 'interface' | LC_COLLATE=POSIX sort`

cat <<EOF > Makefile.am
# Note - this file is automatically generated by $0
Expand Down
5 changes: 5 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ libqueso_la_SOURCES += surrogates/src/InterpolationSurrogateIOASCII.C
# Sources from gp/src
libqueso_la_SOURCES += gp/src/GPMSA.C
libqueso_la_SOURCES += gp/src/GPMSAOptions.C
libqueso_la_SOURCES += gp/src/SimulationOutputMesh.C
libqueso_la_SOURCES += gp/src/TensorProductMesh.C

# Headers to install from core/inc

Expand Down Expand Up @@ -504,6 +506,9 @@ libqueso_include_HEADERS += surrogates/inc/InterpolationSurrogateIOASCII.h
# Headers to install from gp/inc
libqueso_include_HEADERS += gp/inc/GPMSA.h
libqueso_include_HEADERS += gp/inc/GPMSAOptions.h
libqueso_include_HEADERS += gp/inc/SimulationOutputMesh.h
libqueso_include_HEADERS += gp/inc/SimulationOutputPoint.h
libqueso_include_HEADERS += gp/inc/TensorProductMesh.h

# Install the magic header
libqueso_include_HEADERS += contrib/inc/all.h
Expand Down
186 changes: 0 additions & 186 deletions src/basic/inc/SequenceStatisticalOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,192 +256,6 @@ class SsOptionsValues
void copy(const SsOptionsValues& src);
};

//------------------------------------------------------------------------------------------------

/*!\class SequenceStatisticalOptions
* \brief A templated class that stores statistical options (optionally read from an input file)
*
* A templated class that stores statistical options for a sequence of vectors, e.g.
* a Markov chain, a Monte Carlo input sequence, or a Monte Carlo output sequence.
*/


class SequenceStatisticalOptions
{
public:
//! @name Constructor/Destructor methods
//@{
//! Constructor: reads options from the input file.
/*! It assigns to the variables the identifying strings (prefixes) for a sequence of data
* (scalars; vectors) which had been read from an input file.*/
SequenceStatisticalOptions(const BaseEnvironment& env,
const std::string& prefix);

//! Constructor: with alternative option values.
/*! In this constructor, the input options are given by \c alternativeOptionsValues, thus, they
* are not read from an input file.*/
SequenceStatisticalOptions(const BaseEnvironment& env,
const std::string& prefix,
const SsOptionsValues& alternativeOptionsValues);
//! Destructor
~SequenceStatisticalOptions();
//@}

//! @name Statistical methods
//@{

//! Finds the initially discarded portion of the chain. Access to private attribute m_initialDiscardedPortions
const std::vector<double>& initialDiscardedPortions() const;

//! Compute autocorrelation via definition. Access to private attribute m_autoCorrComputeViaDef
bool autoCorrComputeViaDef() const;

//! Compute autocorrelation via FFT. Access to private attribute m_autoCorrComputeViaFft
bool autoCorrComputeViaFft() const;

//! Returns the second lag of the autocorrelation. Access to private attribute m_autoCorrSecondLag
unsigned int autoCorrSecondLag () const;

//! Returns the spacing of the autocorrelation. Access to private attribute m_autoCorrLagSpacing
unsigned int autoCorrLagSpacing () const;

//! Returns the number of lags of the autocorrelation. Access to private attribute m_autoCorrNumLags
unsigned int autoCorrNumLags () const;

//! Displays autocorrelation. Access to private attribute m_autoCorrDisplay
bool autoCorrDisplay () const;

//! Writes autocorrelation. Access to private attribute m_autoCorrWrite
bool autoCorrWrite () const;

//! Computes KDE. Access to private attribute m_kdeCompute
bool kdeCompute () const;

//! Returns number of evaluation positions for KDE. Access to private attribute m_kdeNumEvalPositions
unsigned int kdeNumEvalPositions() const;

//! Finds the covariance matrix. Access to private attribute m_covMatrixCompute
bool covMatrixCompute () const;

//! Finds the correlation matrix. Access to private attribute m_corrMatrixCompute
bool corrMatrixCompute() const;
//@}

//! @name I/O method
//@{
//! Prints the initial discarded portion of the chain; and, optionally, other attributes of the chain.
void print(std::ostream& os) const;
//@}

//! @name Public attribute
//@{
SsOptionsValues m_ov;
//@}

#ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS

unsigned int meanMonitorPeriod() const;

bool bmmRun () const;
const std::vector<unsigned int>& bmmLengths() const;
bool bmmDisplay() const;
bool bmmWrite () const;

bool fftCompute () const;
unsigned int fftParamId () const;
unsigned int fftSize () const;
bool fftTestInversion() const;
bool fftWrite () const;

bool psdCompute () const;
unsigned int psdNumBlocks () const;
double psdHopSizeRatio() const;
unsigned int psdParamId () const;
bool psdWrite () const;

bool psdAtZeroCompute () const;
const std::vector<unsigned int>& psdAtZeroNumBlocks () const;
double psdAtZeroHopSizeRatio() const;
bool psdAtZeroDisplay () const;
bool psdAtZeroWrite () const;

bool gewekeCompute() const;
double gewekeNaRatio() const;
double gewekeNbRatio() const;
bool gewekeDisplay() const;
bool gewekeWrite () const;

bool meanStaccCompute() const;

bool histCompute () const;
unsigned int histNumInternalBins() const;

bool cdfStaccCompute () const;
unsigned int cdfStaccNumEvalPositions() const;
#endif

private:
//! Defines the options for the chain
void defineMyOptions (boost::program_options::options_description& optionsDesc) const;

//! Reads the chain options
void getMyOptionValues(boost::program_options::options_description& optionsDesc);

std::string m_prefix;
const BaseEnvironment& m_env;
boost::program_options::options_description* m_optionsDesc;

std::string m_option_help;
std::string m_option_initialDiscardedPortions;

std::string m_option_autoCorr_computeViaDef;
std::string m_option_autoCorr_computeViaFft;
std::string m_option_autoCorr_secondLag;
std::string m_option_autoCorr_lagSpacing;
std::string m_option_autoCorr_numLags;
std::string m_option_autoCorr_display;
std::string m_option_autoCorr_write;
std::string m_option_kde_compute;
std::string m_option_kde_numEvalPositions;
std::string m_option_covMatrix_compute;
std::string m_option_corrMatrix_compute;

#ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
std::string m_option_mean_monitorPeriod;
std::string m_option_bmm_run;
std::string m_option_bmm_lengths;
std::string m_option_bmm_display;
std::string m_option_bmm_write;
std::string m_option_fft_compute;
std::string m_option_fft_paramId;
std::string m_option_fft_size;
std::string m_option_fft_testInversion;
std::string m_option_fft_write;
std::string m_option_psd_compute;
std::string m_option_psd_numBlocks;
std::string m_option_psd_hopSizeRatio;
std::string m_option_psd_paramId;
std::string m_option_psd_write;
std::string m_option_psdAtZero_compute;
std::string m_option_psdAtZero_numBlocks;
std::string m_option_psdAtZero_hopSizeRatio;
std::string m_option_psdAtZero_display;
std::string m_option_psdAtZero_write;
std::string m_option_geweke_compute;
std::string m_option_geweke_naRatio;
std::string m_option_geweke_nbRatio;
std::string m_option_geweke_display;
std::string m_option_geweke_write;
std::string m_option_meanStacc_compute;
std::string m_option_hist_compute;
std::string m_option_hist_numInternalBins;
std::string m_option_cdfStacc_compute;
std::string m_option_cdfStacc_numEvalPositions;
#endif

};

std::ostream& operator<<(std::ostream& os, const SequenceStatisticalOptions& obj);

#endif // ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS

Expand Down
Loading

0 comments on commit 0e85810

Please sign in to comment.