diff --git a/CHANGES b/CHANGES index 44a8cd829..679d5202e 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,14 @@ QUESO: Quantification of Uncertainty for Estimation, Simulation, and Optimization. ----------------------------------------------------- +Version 0.56.1 (Dec 15, 2016) + * queso.h and config_queso.h had some duplicate #defines. These have been + consodlidated and queso.h has been deprecated. + * Fix for gcc 4.4, change < ...> to < ... > + * Fix for gcc 4.4, remove `typename' for non-dependent types + * Updating documentation for m_normalizationStyle + * Fix sample-based normalisation computation in LogNormalJointPdf + Version 0.56.0 (Nov 18, 2016) * Multivariate GPMSA implementation (experimental) * Multivariate GPMSA examples diff --git a/configure.ac b/configure.ac index af9088d6e..582eaa7a8 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.65) -AC_INIT([queso], [0.56.0], [queso-users@googlegroups.com]) +AC_INIT([queso], [0.56.1], [queso-users@googlegroups.com]) PACKAGE_DESCRIPTION="The parallel C++ statistical library QUESO: Quantification of uncertainty for estimation, simulation and optimization" AC_SUBST([PACKAGE_DESCRIPTION]) PACKAGE_URL="https://github.com/libqueso/queso" @@ -26,6 +26,12 @@ GENERIC_MAJOR_VERSION=$AX_MAJOR_VERSION GENERIC_MINOR_VERSION=$AX_MINOR_VERSION GENERIC_MICRO_VERSION=$AX_POINT_VERSION +# Defines needed by Environment.C (formerly in queso.h) +# The values are not quoted strings per queso.h history (Environment.C uses for arithmetic) +AC_DEFINE_UNQUOTED([MAJOR_VERSION], ${GENERIC_MAJOR_VERSION}, "Major version") +AC_DEFINE_UNQUOTED([MINOR_VERSION], ${GENERIC_MINOR_VERSION}, "Minor version") +AC_DEFINE_UNQUOTED([MICRO_VERSION], ${GENERIC_MICRO_VERSION}, "Micro version") + # Generating a libtool library GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION @@ -257,7 +263,6 @@ AC_CONFIG_FILES([ src/Makefile src/contrib/ANN/Makefile src/contrib/ANN/test/Makefile - src/core/inc/queso.h examples/Makefile test/Makefile test/t01_valid_cycle/Makefile diff --git a/examples/simpleStatisticalInverseProblem/src/Makefile.am b/examples/simpleStatisticalInverseProblem/src/Makefile.am index e641ac94f..6c2365992 100644 --- a/examples/simpleStatisticalInverseProblem/src/Makefile.am +++ b/examples/simpleStatisticalInverseProblem/src/Makefile.am @@ -2,7 +2,6 @@ AM_CPPFLAGS = AM_CPPFLAGS += -I$(top_builddir)/inc -AM_CPPFLAGS += -I$(top_builddir)/src/core/inc # For queso.h AM_CPPFLAGS += $(BOOST_CPPFLAGS) AM_CPPFLAGS += $(GSL_CFLAGS) AM_CPPFLAGS += $(GRVY_CFLAGS) @@ -30,6 +29,6 @@ exStatisticalInverseProblem_gsl_SOURCES += example_compute.C exStatisticalInverseProblem_gsl_SOURCES += example_likelihood.C exStatisticalInverseProblem_gsl_SOURCES += example_compute.h exStatisticalInverseProblem_gsl_SOURCES += example_likelihood.h - + # Required for AX_AM_MACROS @INC_AMINCLUDE@ diff --git a/examples/statisticalForwardProblem/src/Makefile.am b/examples/statisticalForwardProblem/src/Makefile.am index 527de1943..38b3f6c50 100644 --- a/examples/statisticalForwardProblem/src/Makefile.am +++ b/examples/statisticalForwardProblem/src/Makefile.am @@ -2,7 +2,6 @@ AM_CPPFLAGS = AM_CPPFLAGS += -I$(top_builddir)/inc -AM_CPPFLAGS += -I$(top_builddir)/src/core/inc # For queso.h AM_CPPFLAGS += $(BOOST_CPPFLAGS) AM_CPPFLAGS += $(GSL_CFLAGS) AM_CPPFLAGS += $(GRVY_CFLAGS) diff --git a/examples/statisticalInverseProblem/src/Makefile.am b/examples/statisticalInverseProblem/src/Makefile.am index 3f507810b..ac005c0f1 100644 --- a/examples/statisticalInverseProblem/src/Makefile.am +++ b/examples/statisticalInverseProblem/src/Makefile.am @@ -2,7 +2,6 @@ AM_CPPFLAGS = AM_CPPFLAGS += -I$(top_builddir)/inc -AM_CPPFLAGS += -I$(top_builddir)/src/core/inc # For queso.h AM_CPPFLAGS += $(BOOST_CPPFLAGS) AM_CPPFLAGS += $(GSL_CFLAGS) AM_CPPFLAGS += $(GRVY_CFLAGS) diff --git a/examples/validationPyramid/src/Makefile.am b/examples/validationPyramid/src/Makefile.am index 660094020..d79f8efea 100644 --- a/examples/validationPyramid/src/Makefile.am +++ b/examples/validationPyramid/src/Makefile.am @@ -8,7 +8,6 @@ AM_CPPFLAGS += -I$(top_srcdir)/examples/validationPyramid/src/physics_1 AM_CPPFLAGS += -I$(top_srcdir)/examples/validationPyramid/src/physics_2 AM_CPPFLAGS += -I$(top_srcdir)/examples/validationPyramid/src/physics_1_2 AM_CPPFLAGS += -I$(top_builddir)/inc -AM_CPPFLAGS += -I$(top_builddir)/src/core/inc # For queso.h AM_CPPFLAGS += $(BOOST_CPPFLAGS) AM_CPPFLAGS += $(GSL_CFLAGS) AM_CPPFLAGS += $(GRVY_CFLAGS) diff --git a/generate_queso_headers.sh b/generate_queso_headers.sh index c99ed6f06..e1dbccd41 100755 --- a/generate_queso_headers.sh +++ b/generate_queso_headers.sh @@ -2,7 +2,7 @@ set -e # Find all teh headers -headers=`find src -name "*.h" -a -not -name queso.h -a -not -name all.h -type f | grep -v 'ANN'` +headers=`find src -name "*.h" -a -not -name all.h -type f | grep -v 'ANN'` # Find the thing we want to conduct wizardry on quesoh=`find src -name "all.h"` diff --git a/inc/queso/Makefile.am b/inc/queso/Makefile.am index 9a9c677a6..06e3d0e7f 100644 --- a/inc/queso/Makefile.am +++ b/inc/queso/Makefile.am @@ -75,6 +75,7 @@ BUILT_SOURCES += TransitionKernelFactory.h BUILT_SOURCES += Vector.h BUILT_SOURCES += asserts.h BUILT_SOURCES += exceptions.h +BUILT_SOURCES += queso.h BUILT_SOURCES += ExperimentModel.h BUILT_SOURCES += ExperimentModelOptions.h BUILT_SOURCES += ExperimentStorage.h @@ -205,7 +206,6 @@ BUILT_SOURCES += LinearLagrangeInterpolationSurrogate.h BUILT_SOURCES += SurrogateBase.h BUILT_SOURCES += SurrogateBuilderBase.h BUILT_SOURCES += config_queso.h -BUILT_SOURCES += queso.h DISTCLEANFILES = $(BUILT_SOURCES) @@ -349,6 +349,8 @@ asserts.h: $(top_srcdir)/src/core/inc/asserts.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ exceptions.h: $(top_srcdir)/src/core/inc/exceptions.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ +queso.h: $(top_srcdir)/src/core/inc/queso.h + $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ ExperimentModel.h: $(top_srcdir)/src/gp/inc/ExperimentModel.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ ExperimentModelOptions.h: $(top_srcdir)/src/gp/inc/ExperimentModelOptions.h @@ -609,5 +611,3 @@ SurrogateBuilderBase.h: $(top_srcdir)/src/surrogates/inc/SurrogateBuilderBase.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ config_queso.h: $(top_builddir)/config_queso.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ -queso.h: $(top_builddir)/src/core/inc/queso.h - $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ diff --git a/inc/queso/rebuild_makefile.sh b/inc/queso/rebuild_makefile.sh index 27e774e15..9c09ee8f4 100755 --- a/inc/queso/rebuild_makefile.sh +++ b/inc/queso/rebuild_makefile.sh @@ -3,7 +3,7 @@ # This file was shamelessly stolen from the libmesh source tree # See https://github.com/libMesh/libmesh -headers=`find ../../src -name "*.h" -a -not -name queso.h -a -not -name all.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 < Makefile.am # Note - this file is automatically generated by $0 @@ -26,7 +26,6 @@ done # Manually handle the auto-generated headers cat <> Makefile.am BUILT_SOURCES += config_queso.h -BUILT_SOURCES += queso.h EOF cat <> Makefile.am @@ -56,6 +55,4 @@ done cat <> Makefile.am config_queso.h: \$(top_builddir)/config_queso.h \$(AM_V_GEN)rm -f \$@ && \$(LN_S) \$< \$@ -queso.h: \$(top_builddir)/src/core/inc/queso.h - \$(AM_V_GEN)rm -f \$@ && \$(LN_S) \$< \$@ EOF diff --git a/m4/common/config_environment.m4 b/m4/common/config_environment.m4 index e62d50f0c..6e41c3c01 100644 --- a/m4/common/config_environment.m4 +++ b/m4/common/config_environment.m4 @@ -56,10 +56,25 @@ AC_DEFINE_UNQUOTED([BUILD_VERSION], "${BUILD_VERSION}", [git revision]) AC_DEFINE_UNQUOTED([BUILD_DEVSTATUS],"${BUILD_DEVSTATUS}",[Dev/Release build]) AC_DEFINE( [BUILD_DATE], __DATE__ " " __TIME__, [Build date]) +# Defines needed by Environment.C (formerly in queso.h) +AC_DEFINE_UNQUOTED([CXX], "${CXX}", [C++ compiler]) +AC_DEFINE_UNQUOTED([CXXFLAGS], "${CXXFLAGS}", [C++ compiler flags]) +# The following must be unconditionally defined per Environment.C +# TODO: Should these go in the respective .m4? +AC_DEFINE_UNQUOTED([TRILINOS_DIR], "${TRILINOS_HOME}", [Trilinos home directory]) +AC_DEFINE_UNQUOTED([GSL_DIR], "${GSL_LIBS}", [GSL libraries]) +AC_DEFINE_UNQUOTED([GRVY_DIR], "${GRVY_PREFIX}", [GRVY directory]) +AC_DEFINE_UNQUOTED([GLPK_DIR], "${GLPK_PREFIX}", [GLPK directory]) +AC_DEFINE_UNQUOTED([HDF5_DIR], "${HDF5_PREFIX}", [HDF directory]) + AC_SUBST(BUILD_USER) AC_SUBST(BUILD_ARCH) AC_SUBST(BUILD_HOST) AC_SUBST(BUILD_DATE) AC_SUBST(BUILD_VERSION) +# Defines needed by Environment.C (formerly in queso.h) +AC_SUBST(CXX) +AC_SUBST(CXX_FLAGS) + ]) diff --git a/m4/common/queso_new.m4 b/m4/common/queso_new.m4 index 40874dcf1..989910aa4 100644 --- a/m4/common/queso_new.m4 +++ b/m4/common/queso_new.m4 @@ -82,7 +82,7 @@ HAVE_QUESO=0 AC_LANG_PUSH([C++]) - AC_CHECK_HEADER([queso/queso.h], [found_header=yes], [found_header=no]) + AC_CHECK_HEADER([queso/config_queso.h], [found_header=yes], [found_header=no]) #----------------------- # Minimum version check @@ -115,7 +115,7 @@ HAVE_QUESO=0 version_succeeded=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include + @%:@include ]], [[ #if QUESO_MAJOR_VERSION > $MAJOR_VER /* Sweet nibblets */ @@ -136,7 +136,7 @@ HAVE_QUESO=0 fi dnl end test if header if available -##### AC_COMPILE_IFELSE([#include "queso/queso.h"],[found_header=yes],[found_header=no]) +##### AC_COMPILE_IFELSE([#include "queso/config_queso.h"],[found_header=yes],[found_header=no]) ##### ##### ac_QUESO_BOOST_PROGRAM_OPTIONS_LDFLAGS_COMPILER='' ##### diff --git a/src/Makefile.am b/src/Makefile.am index d58dd95e1..50453c356 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,5 @@ AM_CPPFLAGS = $(QUESO_CPPFLAGS) AM_CPPFLAGS += -I$(top_builddir)/inc -AM_CPPFLAGS += -I$(top_builddir)/src/core/inc # For queso.h AM_CPPFLAGS += $(BOOST_CPPFLAGS) AM_CPPFLAGS += $(GSL_CFLAGS) AM_CPPFLAGS += $(ANN_CFLAGS) @@ -289,7 +288,7 @@ libqueso_la_SOURCES += gp/src/GPMSAOptions.C # Headers to install from core/inc libqueso_include_HEADERS = -libqueso_include_HEADERS += $(top_builddir)/src/core/inc/queso.h +libqueso_include_HEADERS += core/inc/queso.h libqueso_include_HEADERS += core/inc/Defines.h libqueso_include_HEADERS += core/inc/Environment.h libqueso_include_HEADERS += core/inc/EnvironmentOptions.h @@ -512,7 +511,6 @@ libqueso_include_HEADERS += contrib/getpot/getpot.h nodist_libqueso_include_HEADERS = nodist_libqueso_include_HEADERS += $(top_builddir)/config_queso.h -nodist_libqueso_include_HEADERS += $(top_builddir)/src/core/inc/queso.h # Standalone binaries diff --git a/src/core/inc/AlgorithmFactory.h b/src/core/inc/AlgorithmFactory.h index 60eaebf0f..eecbc518e 100644 --- a/src/core/inc/AlgorithmFactory.h +++ b/src/core/inc/AlgorithmFactory.h @@ -75,11 +75,11 @@ class AlgorithmFactory : public Factory > * Create a Base class. Force this to be implemented * later. */ - virtual typename SharedPtr >::Type create(); + virtual SharedPtr >::Type create(); }; inline -typename SharedPtr >::Type +SharedPtr >::Type AlgorithmFactory::create() { queso_require_msg(m_env, "ERROR: must call set_environment() before building alg!"); diff --git a/src/core/inc/FunctionBase.h b/src/core/inc/FunctionBase.h index 549bf6ea4..0180592fa 100644 --- a/src/core/inc/FunctionBase.h +++ b/src/core/inc/FunctionBase.h @@ -77,7 +77,7 @@ class FunctionBase { * identically zero (by copying \c this) everywhere and return a boost shared * pointer to it */ - virtual typename SharedPtr::Type zero_clone() const = 0; + virtual SharedPtr::Type zero_clone() const = 0; //! Save the current function to an Exodus file called \c filename. \c time is the time to attach to the function and is usually the iteration number virtual void save_function(const std::string & filename, double time) const = 0; diff --git a/src/core/inc/InfiniteDimensionalGaussian.h b/src/core/inc/InfiniteDimensionalGaussian.h index 9e2f54002..3b5d8bf5f 100644 --- a/src/core/inc/InfiniteDimensionalGaussian.h +++ b/src/core/inc/InfiniteDimensionalGaussian.h @@ -65,7 +65,7 @@ class InfiniteDimensionalGaussian : public InfiniteDimensionalMeasureBase { //@} //! Draw from the measure, and then return a shared pointer to the draw - virtual typename SharedPtr::Type draw(); + virtual SharedPtr::Type draw(); //! Return coefficient \c i of the KL expansion of the current draw. Must be called after draw() virtual double get_kl_coefficient(unsigned int i) const; diff --git a/src/core/inc/InfiniteDimensionalMCMCSampler.h b/src/core/inc/InfiniteDimensionalMCMCSampler.h index b215c36c6..14dc9a214 100644 --- a/src/core/inc/InfiniteDimensionalMCMCSampler.h +++ b/src/core/inc/InfiniteDimensionalMCMCSampler.h @@ -80,7 +80,7 @@ class InfiniteDimensionalMCMCSampler unsigned int iteration() const; //! Returns a pointer to new sampler, with all the moments reset. - typename SharedPtr::Type clone_and_reset() const; + SharedPtr::Type clone_and_reset() const; private: // Current iteration @@ -109,22 +109,22 @@ class InfiniteDimensionalMCMCSampler const BaseEnvironment& m_env; // Pointer to the current physical state - typename SharedPtr::Type current_physical_state; + SharedPtr::Type current_physical_state; // Pointer to the current proposed state - typename SharedPtr::Type proposed_physical_state; + SharedPtr::Type proposed_physical_state; // Pointer to the current physical mean - typename SharedPtr::Type current_physical_mean; + SharedPtr::Type current_physical_mean; // Pointer to the current physical variance - typename SharedPtr::Type current_physical_var; + SharedPtr::Type current_physical_var; // Stores the differences from the mean - typename SharedPtr::Type _delta; + SharedPtr::Type _delta; // Stores a running sum-of-squares (kinda) - typename SharedPtr::Type _M2; + SharedPtr::Type _M2; // A pointer to the random number generator to use. // Should probably use the one in the queso environment. diff --git a/src/core/inc/InfiniteDimensionalMeasureBase.h b/src/core/inc/InfiniteDimensionalMeasureBase.h index 5d2a862cd..730f8e597 100644 --- a/src/core/inc/InfiniteDimensionalMeasureBase.h +++ b/src/core/inc/InfiniteDimensionalMeasureBase.h @@ -52,7 +52,7 @@ class InfiniteDimensionalMeasureBase { //@} //! Draw from the measure, and then return a shared pointer to the draw - virtual typename SharedPtr::Type draw() = 0; + virtual SharedPtr::Type draw() = 0; //! Return coefficient \c i of the KL expansion of the current draw. Must be called after draw() virtual double get_kl_coefficient(unsigned int i) const = 0; diff --git a/src/core/inc/LibMeshFunction.h b/src/core/inc/LibMeshFunction.h index 9c9083ea2..91f733f04 100644 --- a/src/core/inc/LibMeshFunction.h +++ b/src/core/inc/LibMeshFunction.h @@ -98,15 +98,15 @@ class LibMeshFunction : public FunctionBase { * identically zero (by copying \c this) everywhere and return a boost shared * pointer to it */ - virtual typename SharedPtr::Type zero_clone() const; + virtual SharedPtr::Type zero_clone() const; //! Return the internal libmesh equation systems object - virtual typename SharedPtr::Type get_equation_systems() const; + virtual SharedPtr::Type get_equation_systems() const; private: const FunctionOperatorBuilder & builder; - typename SharedPtr::Type equation_systems; + SharedPtr::Type equation_systems; }; } // End namespace QUESO diff --git a/src/core/inc/LibMeshOperatorBase.h b/src/core/inc/LibMeshOperatorBase.h index 029082395..e03a34636 100644 --- a/src/core/inc/LibMeshOperatorBase.h +++ b/src/core/inc/LibMeshOperatorBase.h @@ -112,11 +112,11 @@ class LibMeshOperatorBase : public OperatorBase, * where the lambda are eigenvalues of the precision operator, \c this, and * the \phi(x) are eigenfunctions of the precision operator, \c this */ - virtual typename SharedPtr::Type + virtual SharedPtr::Type inverse_kl_transform(std::vector & xi, double alpha) const; protected: - typename SharedPtr::Type equation_systems; + SharedPtr::Type equation_systems; const FunctionOperatorBuilder & builder; diff --git a/src/core/inc/OperatorBase.h b/src/core/inc/OperatorBase.h index dfafceea8..615f95a31 100644 --- a/src/core/inc/OperatorBase.h +++ b/src/core/inc/OperatorBase.h @@ -74,7 +74,7 @@ class OperatorBase { * where the lambda are eigenvalues of the precision operator, \c this, and * the \phi(x) are eigenfunctions of the precision operator, \c this */ - virtual typename SharedPtr::Type + virtual SharedPtr::Type inverse_kl_transform(std::vector& xi, double alpha) const = 0; }; diff --git a/src/core/inc/TransitionKernelFactory.h b/src/core/inc/TransitionKernelFactory.h index cd99184cb..31e4ab5d2 100644 --- a/src/core/inc/TransitionKernelFactory.h +++ b/src/core/inc/TransitionKernelFactory.h @@ -118,11 +118,11 @@ class TransitionKernelFactory : public Factory * Create a Base class. Force this to be implemented * later. */ - virtual typename SharedPtr >::Type create(); + virtual SharedPtr >::Type create(); }; inline -typename SharedPtr >::Type TransitionKernelFactory::create() +SharedPtr >::Type TransitionKernelFactory::create() { queso_require_msg(m_vectorSpace, "ERROR: must call set_vectorspace() before building tk!"); queso_require_msg(m_dr_scales, "ERROR: must call set_dr_scales() before building tk!"); diff --git a/src/core/inc/queso.h.in b/src/core/inc/queso.h similarity index 61% rename from src/core/inc/queso.h.in rename to src/core/inc/queso.h index adc189578..24154a2fc 100644 --- a/src/core/inc/queso.h.in +++ b/src/core/inc/queso.h @@ -29,30 +29,23 @@ #ifndef QUESO_H_ #define QUESO_H_ -// Library version/build info - -#define QUESO_MAJOR_VERSION @GENERIC_MAJOR_VERSION@ -#define QUESO_MINOR_VERSION @GENERIC_MINOR_VERSION@ -#define QUESO_MICRO_VERSION @GENERIC_MICRO_VERSION@ +#warning Header queso.h is deprecated; use config_queso.h instead. -#define QUESO_BUILD_USER "@BUILD_USER@" -#define QUESO_BUILD_ARCH "@BUILD_ARCH@" -#define QUESO_BUILD_HOST "@BUILD_HOST@" -#define QUESO_BUILD_DATE "@BUILD_DATE@" -#define QUESO_BUILD_VERSION "@BUILD_VERSION@" +#include "config_queso.h" -#define QUESO_LIB_VERSION "@VERSION@" -#define QUESO_LIB_RELEASE "@BUILD_DEVSTATUS@" +// Library version/build info -#define QUESO_CXX "@CXX@" -#define QUESO_CXXFLAGS "@CXXFLAGS@" +// Deprecated backward-compatible duplicate definitions, now derived +// from config_queso.h -// External libraries +#ifndef QUESO_LIB_VERSION +#define QUESO_LIB_VERSION QUESO_VERSION +#warning QUESO_LIB_VERSION is deprecated; use QUESO_VERSION instead. +#endif -#define QUESO_TRILINOS_DIR "@TRILINOS_HOME@" -#define QUESO_GSL_DIR "@GSL_LIBS@" -#define QUESO_GRVY_DIR "@GRVY_PREFIX@" -#define QUESO_GLPK_DIR "@GLPK_PREFIX@" -#define QUESO_HDF5_DIR "@HDF5_PREFIX@" +#ifndef QUESO_LIB_RELEASE +#define QUESO_LIB_RELEASE QUESO_BUILD_DEVSTATUS +#warning QUESO_LIB_RELEASE is deprecated; use QUESO_BUILD_DEVSTATUS instead. +#endif #endif diff --git a/src/core/src/Environment.C b/src/core/src/Environment.C index 500ed27f1..889dfdc5d 100644 --- a/src/core/src/Environment.C +++ b/src/core/src/Environment.C @@ -29,7 +29,7 @@ #define GETPOT_NAMESPACE QUESO #include -#include +#include #include #include #include @@ -56,10 +56,10 @@ namespace QUESO { { os << "------------------------------------------------------------------------------------------" ; os << "--------------------" << std::endl; - os << "QUESO Library: Version = " << QUESO_LIB_VERSION; + os << "QUESO Library: Version = " << QUESO_VERSION; os << " (" << QUESO_get_numeric_version() << ")" << std::endl << std::endl; - os << QUESO_LIB_RELEASE << std::endl << std::endl; + os << QUESO_BUILD_DEVSTATUS << std::endl << std::endl; os << "Build Date = " << QUESO_BUILD_DATE << std::endl; os << "Build Host = " << QUESO_BUILD_HOST << std::endl; diff --git a/src/core/src/InfiniteDimensionalGaussian.C b/src/core/src/InfiniteDimensionalGaussian.C index 1d09d434a..aa7ee7cf9 100644 --- a/src/core/src/InfiniteDimensionalGaussian.C +++ b/src/core/src/InfiniteDimensionalGaussian.C @@ -54,7 +54,7 @@ InfiniteDimensionalGaussian::~InfiniteDimensionalGaussian() { } -typename SharedPtr::Type InfiniteDimensionalGaussian::draw() +SharedPtr::Type InfiniteDimensionalGaussian::draw() { unsigned int i; @@ -64,7 +64,7 @@ typename SharedPtr::Type InfiniteDimensionalGaussian::draw() #warning We never use the mean? -typename SharedPtr::Type f(this->precision.inverse_kl_transform(this->coeffs, this->alpha)); +SharedPtr::Type f(this->precision.inverse_kl_transform(this->coeffs, this->alpha)); return f; } diff --git a/src/core/src/InfiniteDimensionalMCMCSampler.C b/src/core/src/InfiniteDimensionalMCMCSampler.C index 2fe41b49e..a924cdcd5 100644 --- a/src/core/src/InfiniteDimensionalMCMCSampler.C +++ b/src/core/src/InfiniteDimensionalMCMCSampler.C @@ -151,7 +151,7 @@ void InfiniteDimensionalMCMCSampler::_propose() const double rwmh_step_sq = (this->m_ov->m_rwmh_step * this->m_ov->m_rwmh_step); const double coeff = std::sqrt(1.0 - rwmh_step_sq); - typename SharedPtr::Type p(prior.draw()); + SharedPtr::Type p(prior.draw()); this->proposed_physical_state->zero(); this->proposed_physical_state->add(coeff, *(this->current_physical_state)); @@ -201,7 +201,7 @@ void InfiniteDimensionalMCMCSampler::_update_moments() this->current_physical_mean->add(1.0 / this->iteration(), *(this->_delta)); // Update running sum-of-squares - typename SharedPtr::Type temp_ptr(this->_delta->zero_clone()); + SharedPtr::Type temp_ptr(this->_delta->zero_clone()); // LibMeshFunction & temp = static_cast(*temp_ptr); temp_ptr->pointwise_mult(*(this->_delta), *(this->current_physical_state)); @@ -336,10 +336,10 @@ void InfiniteDimensionalMCMCSampler::_write_state() this->current_physical_var->save_function(var_name, this->iteration()); } -typename SharedPtr::Type InfiniteDimensionalMCMCSampler::clone_and_reset() const +SharedPtr::Type InfiniteDimensionalMCMCSampler::clone_and_reset() const { // Set up a clone - typename SharedPtr::Type clone(new InfiniteDimensionalMCMCSampler(this->m_env, this->prior, this->llhd, this->m_ov)); + SharedPtr::Type clone(new InfiniteDimensionalMCMCSampler(this->m_env, this->prior, this->llhd, this->m_ov)); // Copy the state. clone->current_physical_state = this->current_physical_state; diff --git a/src/core/src/LibMeshFunction.C b/src/core/src/LibMeshFunction.C index 26b6060e1..a0db022e3 100644 --- a/src/core/src/LibMeshFunction.C +++ b/src/core/src/LibMeshFunction.C @@ -135,14 +135,14 @@ double LibMeshFunction::L2_norm() const { return norm; } -typename SharedPtr::Type LibMeshFunction::zero_clone() const +SharedPtr::Type LibMeshFunction::zero_clone() const { LibMeshFunction * clone = new LibMeshFunction(this->builder, this->equation_systems->get_mesh()); clone->equation_systems->get_system( "Function").solution->zero(); - typename SharedPtr::Type ptr(clone); + SharedPtr::Type ptr(clone); return ptr; } diff --git a/src/core/src/LibMeshNegativeLaplacianOperator.C b/src/core/src/LibMeshNegativeLaplacianOperator.C index a06450e51..d0257a773 100644 --- a/src/core/src/LibMeshNegativeLaplacianOperator.C +++ b/src/core/src/LibMeshNegativeLaplacianOperator.C @@ -57,7 +57,7 @@ LibMeshNegativeLaplacianOperator::LibMeshNegativeLaplacianOperator( const FunctionOperatorBuilder & builder, libMesh::MeshBase & m) : LibMeshOperatorBase(builder, m) { - typename SharedPtr::Type es(this->equation_systems); + SharedPtr::Type es(this->equation_systems); // Give the system a pointer to the matrix assembly // function defined below. @@ -142,7 +142,7 @@ void LibMeshNegativeLaplacianOperator::assemble() { #ifdef LIBMESH_HAVE_SLEPC - typename SharedPtr::Type es(this->equation_systems); + SharedPtr::Type es(this->equation_systems); // Get a constant reference to the mesh object. const libMesh::MeshBase& mesh = es->get_mesh(); diff --git a/src/core/src/LibMeshOperatorBase.C b/src/core/src/LibMeshOperatorBase.C index 0bf027f7e..c295550d3 100644 --- a/src/core/src/LibMeshOperatorBase.C +++ b/src/core/src/LibMeshOperatorBase.C @@ -104,7 +104,7 @@ void LibMeshOperatorBase::save_converged_evec(const std::string & filename, unsigned int i) const { if (i < this->nconv) { - typename SharedPtr::Type es(this->equation_systems); + SharedPtr::Type es(this->equation_systems); es->get_system("Eigensystem").get_eigenpair(i); libMesh::ExodusII_IO(es->get_mesh()).write_equation_systems(filename, *es); } @@ -123,7 +123,7 @@ double LibMeshOperatorBase::get_eigenvalue(unsigned int i) const { if (i < this->nconv) { std::pair eval; - typename SharedPtr::Type es(this->equation_systems); + SharedPtr::Type es(this->equation_systems); eval = es->get_system("Eigensystem").get_eigenpair(i); return eval.first; } @@ -142,12 +142,12 @@ libMesh::EquationSystems & LibMeshOperatorBase::get_equation_systems() const return *this->equation_systems; } -typename SharedPtr::Type +SharedPtr::Type LibMeshOperatorBase::inverse_kl_transform(std::vector & xi, double alpha) const { unsigned int i; - typename SharedPtr::Type es(this->equation_systems); + SharedPtr::Type es(this->equation_systems); LibMeshFunction *kl = new LibMeshFunction(this->builder, es->get_mesh()); // Make sure all procs in libmesh mpi communicator all have the same xi. No, @@ -155,7 +155,7 @@ LibMeshOperatorBase::inverse_kl_transform(std::vector & xi, // communicator. this->equation_systems->comm().broadcast(xi); - typename SharedPtr::Type kl_eq_sys(kl->get_equation_systems()); + SharedPtr::Type kl_eq_sys(kl->get_equation_systems()); std::pair eval; for (i = 0; i < this->get_num_converged(); i++) { @@ -165,7 +165,7 @@ LibMeshOperatorBase::inverse_kl_transform(std::vector & xi, *es->get_system("Eigensystem").solution); } - typename SharedPtr::Type ap(kl); + SharedPtr::Type ap(kl); return ap; } diff --git a/src/stats/inc/JointPdf.h b/src/stats/inc/JointPdf.h index 485ff0fb0..58ce45599 100644 --- a/src/stats/inc/JointPdf.h +++ b/src/stats/inc/JointPdf.h @@ -84,7 +84,16 @@ class BaseJointPdf : public BaseScalarFunction { */ virtual void distributionVariance (M & covMatrix) const; - //! Sets a value to be used in the normalization style (stored in the protected attribute m_normalizationStyle.) + //! Sets a value to be used in the normalization style. Default value is + //! zero. + /*! + * The value is stored in m_normalizationStyle. + * + * If the normalization style is zero, one should compute analytical + * normalization constants in lnValue and actualValue. It doesn't appear + * to be used in many of of the computeLogOfNormalizationFactor methods in + * derived classes. + */ virtual void setNormalizationStyle (unsigned int value) const; //! Sets a logarithmic value to be used in the normalization factor (stored in the protected attribute m_normalizationStyle.) @@ -110,6 +119,8 @@ class BaseJointPdf : public BaseScalarFunction { using BaseScalarFunction::m_prefix; using BaseScalarFunction::m_domainSet; + //! Flag to decide which style of normalisation to use. The constructor sets + //! this to zero in the initialisation list. mutable unsigned int m_normalizationStyle; mutable double m_logOfNormalizationFactor; diff --git a/src/stats/inc/MetropolisHastingsSG.h b/src/stats/inc/MetropolisHastingsSG.h index 12c3778d5..b46bb6a2b 100644 --- a/src/stats/inc/MetropolisHastingsSG.h +++ b/src/stats/inc/MetropolisHastingsSG.h @@ -305,7 +305,7 @@ class MetropolisHastingsSG const ScalarFunctionSynchronizer * m_targetPdfSynchronizer; typename SharedPtr >::Type m_tk; - typename SharedPtr>::Type m_algorithm; + typename SharedPtr >::Type m_algorithm; unsigned int m_positionIdForDebugging; unsigned int m_stageIdForDebugging; std::vector m_idsOfUniquePositions; diff --git a/src/stats/src/LogNormalJointPdf.C b/src/stats/src/LogNormalJointPdf.C index 367c0b616..6f676d294 100644 --- a/src/stats/src/LogNormalJointPdf.C +++ b/src/stats/src/LogNormalJointPdf.C @@ -186,9 +186,10 @@ LogNormalJointPdf::lnValue( returnValue = ((diffVec*diffVec)/this->lawVarVector()).sumOfComponents(); returnValue *= -0.5; - if (m_normalizationStyle == 0) { - for (unsigned int i = 0; i < domainVector.sizeLocal(); ++i) { - returnValue -= std::log(domainVector[i] * std::sqrt(2. * M_PI * this->lawVarVector()[i])); // Contribution of 1/(x\sqrt{2\pi\sigma^2}) + for (unsigned int i = 0; i < domainVector.sizeLocal(); ++i) { + returnValue -= std::log(domainVector[i]); + if (m_normalizationStyle == 0) { + returnValue -= std::log(std::sqrt(2. * M_PI * this->lawVarVector()[i])); // Contribution of 1/(x\sqrt{2\pi\sigma^2}) } } }