Skip to content

Commit

Permalink
Merge branch 'hotfix-0.56.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcdougall committed Feb 2, 2017
2 parents e10fa41 + 2b67878 commit 14aefed
Show file tree
Hide file tree
Showing 15 changed files with 136 additions and 97 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ QUESO: Quantification of Uncertainty for Estimation,
Simulation, and Optimization.
-----------------------------------------------------

Version 0.56.2 (Feb 2, 2017)
* Fixed missing factory symbols when linking statically

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.
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.65)
AC_INIT([queso], [0.56.1], [queso-users@googlegroups.com])
AC_INIT([queso], [0.56.2], [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"
Expand Down
6 changes: 6 additions & 0 deletions inc/queso/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ BUILT_SOURCES += VectorSpace.h
BUILT_SOURCES += VectorSubset.h
BUILT_SOURCES += getpot.h
BUILT_SOURCES += AlgorithmFactory.h
BUILT_SOURCES += AlgorithmFactoryInitializer.h
BUILT_SOURCES += BaseInputOptionsParser.h
BUILT_SOURCES += BasicPdfsBase.h
BUILT_SOURCES += BasicPdfsBoost.h
Expand Down Expand Up @@ -65,6 +66,7 @@ BUILT_SOURCES += RngBoost.h
BUILT_SOURCES += RngGsl.h
BUILT_SOURCES += ScopedPtr.h
BUILT_SOURCES += SharedPtr.h
BUILT_SOURCES += TKFactoryInitializer.h
BUILT_SOURCES += TKFactoryLogitRandomWalk.h
BUILT_SOURCES += TKFactoryMALA.h
BUILT_SOURCES += TKFactoryRandomWalk.h
Expand Down Expand Up @@ -257,6 +259,8 @@ getpot.h: $(top_srcdir)/src/contrib/getpot/getpot.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
AlgorithmFactory.h: $(top_srcdir)/src/core/inc/AlgorithmFactory.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
AlgorithmFactoryInitializer.h: $(top_srcdir)/src/core/inc/AlgorithmFactoryInitializer.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
BaseInputOptionsParser.h: $(top_srcdir)/src/core/inc/BaseInputOptionsParser.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
BasicPdfsBase.h: $(top_srcdir)/src/core/inc/BasicPdfsBase.h
Expand Down Expand Up @@ -329,6 +333,8 @@ ScopedPtr.h: $(top_srcdir)/src/core/inc/ScopedPtr.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
SharedPtr.h: $(top_srcdir)/src/core/inc/SharedPtr.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
TKFactoryInitializer.h: $(top_srcdir)/src/core/inc/TKFactoryInitializer.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
TKFactoryLogitRandomWalk.h: $(top_srcdir)/src/core/inc/TKFactoryLogitRandomWalk.h
$(AM_V_GEN)rm -f $@ && $(LN_S) $< $@
TKFactoryMALA.h: $(top_srcdir)/src/core/inc/TKFactoryMALA.h
Expand Down
8 changes: 4 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,9 @@ libqueso_la_SOURCES += core/src/OptimizerOptions.C
libqueso_la_SOURCES += core/src/BaseInputOptionsParser.C
libqueso_la_SOURCES += core/src/BoostInputOptionsParser.C
libqueso_la_SOURCES += core/src/TransitionKernelFactory.C
libqueso_la_SOURCES += core/src/TKFactoryStochasticNewton.C
libqueso_la_SOURCES += core/src/TKFactoryRandomWalk.C
libqueso_la_SOURCES += core/src/TKFactoryLogitRandomWalk.C
libqueso_la_SOURCES += core/src/AlgorithmFactory.C
libqueso_la_SOURCES += core/src/TKFactoryMALA.C
libqueso_la_SOURCES += core/src/TKFactoryInitializer.C
libqueso_la_SOURCES += core/src/AlgorithmFactoryInitializer.C


# Sources that need libmesh
Expand Down Expand Up @@ -322,6 +320,8 @@ libqueso_include_HEADERS += core/inc/TKFactoryRandomWalk.h
libqueso_include_HEADERS += core/inc/TKFactoryLogitRandomWalk.h
libqueso_include_HEADERS += core/inc/AlgorithmFactory.h
libqueso_include_HEADERS += core/inc/TKFactoryMALA.h
libqueso_include_HEADERS += core/inc/TKFactoryInitializer.h
libqueso_include_HEADERS += core/inc/AlgorithmFactoryInitializer.h

# Headers that need libmesh
libqueso_include_HEADERS += core/inc/FunctionBase.h
Expand Down
8 changes: 7 additions & 1 deletion src/core/inc/AlgorithmFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ class AlgorithmFactoryImp : public AlgorithmFactory
virtual ~AlgorithmFactoryImp() {}

private:
virtual SharedPtr<Algorithm<GslVector, GslMatrix> >::Type build_algorithm();
virtual SharedPtr<Algorithm<GslVector, GslMatrix> >::Type build_algorithm()
{
SharedPtr<Algorithm<GslVector, GslMatrix> >::Type new_alg;
new_alg.reset(new DerivedAlgorithm(*(this->m_env), *(this->m_tk)));
return new_alg;
}

};

} // namespace QUESO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,19 @@
//
//-----------------------------------------------------------------------el-

#include <queso/TKFactoryRandomWalk.h>
#include <queso/ScaledCovMatrixTKGroup.h>
#ifndef QUESO_ALGORITHM_FACTORY_INITIALIZER_H
#define QUESO_ALGORITHM_FACTORY_INITIALIZER_H

namespace QUESO
{

template <class DerivedTK>
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type
TKFactoryRandomWalk<DerivedTK>::build_tk()
class AlgorithmFactoryInitializer
{
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type new_tk;
public:
AlgorithmFactoryInitializer();
virtual ~AlgorithmFactoryInitializer();
};

new_tk.reset(new DerivedTK(this->m_options->m_prefix.c_str(),
*(this->m_vectorSpace),
*(this->m_dr_scales),
*(this->m_initial_cov_matrix)));
} // namespace QUESO

return new_tk;
}

// Instantiate all the transition kernel factories
TKFactoryRandomWalk<ScaledCovMatrixTKGroup<GslVector, GslMatrix> > tk_factory_random_walk("random_walk");

} // namespace QUESO
#endif // QUESO_ALGORITHM_FACTORY_INITIALIZER_H
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,19 @@
//
//-----------------------------------------------------------------------el-

#include <queso/TKFactoryMALA.h>
#include <queso/MetropolisAdjustedLangevinTK.h>
#include <queso/BayesianJointPdf.h>
#ifndef QUESO_TK_FACTORY_INITIALIZER_H
#define QUESO_TK_FACTORY_INITIALIZER_H

namespace QUESO
{

template <class DerivedTK>
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type
TKFactoryMALA<DerivedTK>::build_tk()
class TKFactoryInitializer
{
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type new_tk;

// Assume the problem is Bayesian
const BayesianJointPdf<GslVector, GslMatrix> * target_bayesian_pdf =
dynamic_cast<const BayesianJointPdf<GslVector, GslMatrix> *>(
this->m_target_pdf);

new_tk.reset(new DerivedTK(this->m_options->m_prefix.c_str(),
*target_bayesian_pdf,
*(this->m_dr_scales),
*(this->m_initial_cov_matrix)));

return new_tk;
}

// Instantiate all the transition kernel factories
TKFactoryMALA<MetropolisAdjustedLangevinTK<GslVector, GslMatrix> > tk_factory_mala("mala");
public:
TKFactoryInitializer();
virtual ~TKFactoryInitializer();
};

} // namespace QUESO

#endif // QUESO_TK_FACTORY_INITIALIZER_H
18 changes: 17 additions & 1 deletion src/core/inc/TKFactoryLogitRandomWalk.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,23 @@ class TKFactoryLogitRandomWalk : public TransitionKernelFactory
virtual ~TKFactoryLogitRandomWalk() {}

protected:
virtual SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type build_tk();
virtual SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type build_tk()
{
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type new_tk;

// Cast the domain to a box. Might this cast fail?
const BoxSubset<GslVector, GslMatrix> & boxSubset =
dynamic_cast<const BoxSubset<GslVector, GslMatrix> & >(
this->m_target_pdf->domainSet());

new_tk.reset(new DerivedTK(this->m_options->m_prefix.c_str(),
boxSubset,
*(this->m_dr_scales),
*(this->m_initial_cov_matrix)));

return new_tk;
}

};

} // namespace QUESO
Expand Down
19 changes: 18 additions & 1 deletion src/core/inc/TKFactoryMALA.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <queso/TransitionKernelFactory.h>
#include <queso/TKGroup.h>
#include <queso/BayesianJointPdf.h>

namespace QUESO
{
Expand All @@ -52,7 +53,23 @@ class TKFactoryMALA : public TransitionKernelFactory
virtual ~TKFactoryMALA() {}

protected:
virtual SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type build_tk();
virtual SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type build_tk()
{
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type new_tk;

// Assume the problem is Bayesian
const BayesianJointPdf<GslVector, GslMatrix> * target_bayesian_pdf =
dynamic_cast<const BayesianJointPdf<GslVector, GslMatrix> *>(
this->m_target_pdf);

new_tk.reset(new DerivedTK(this->m_options->m_prefix.c_str(),
*target_bayesian_pdf,
*(this->m_dr_scales),
*(this->m_initial_cov_matrix)));

return new_tk;
}

};

} // namespace QUESO
Expand Down
13 changes: 12 additions & 1 deletion src/core/inc/TKFactoryRandomWalk.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,18 @@ class TKFactoryRandomWalk : public TransitionKernelFactory
virtual ~TKFactoryRandomWalk() {}

protected:
virtual SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type build_tk();
virtual SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type build_tk()
{
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type new_tk;

new_tk.reset(new DerivedTK(this->m_options->m_prefix.c_str(),
*(this->m_vectorSpace),
*(this->m_dr_scales),
*(this->m_initial_cov_matrix)));

return new_tk;
}

};

} // namespace QUESO
Expand Down
13 changes: 12 additions & 1 deletion src/core/inc/TKFactoryStochasticNewton.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,18 @@ class TKFactoryStochasticNewton : public TransitionKernelFactory
virtual ~TKFactoryStochasticNewton() {}

protected:
virtual SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type build_tk();
virtual SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type build_tk()
{
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type new_tk;

new_tk.reset(new DerivedTK(this->m_options->m_prefix.c_str(),
*(this->m_vectorSpace),
*(this->m_dr_scales),
*(this->m_pdf_synchronizer)));

return new_tk;
}

};

} // namespace QUESO
Expand Down
14 changes: 0 additions & 14 deletions src/core/src/AlgorithmFactory.C
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,7 @@ Factory<Algorithm<GslVector, GslMatrix> >::factory_map()
return _factory_map;
}

// AlgorithmFactoryImp implementation
template <class DerivedAlgorithm>
SharedPtr<Algorithm<GslVector, GslMatrix> >::Type
AlgorithmFactoryImp<DerivedAlgorithm>::build_algorithm()
{
SharedPtr<Algorithm<GslVector, GslMatrix> >::Type new_alg;
new_alg.reset(new DerivedAlgorithm(*(this->m_env), *(this->m_tk)));
return new_alg;
}

const BaseEnvironment * AlgorithmFactory::m_env = NULL;
const BaseTKGroup<GslVector, GslMatrix> * AlgorithmFactory::m_tk = NULL;

// Register with the factory
AlgorithmFactoryImp<Algorithm<GslVector, GslMatrix> > random_walk_alg("random_walk");
AlgorithmFactoryImp<Algorithm<GslVector, GslMatrix> > logit_random_walk_alg("logit_random_walk");

} // namespace QUESO
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,23 @@
//
//-----------------------------------------------------------------------el-

#include <queso/TKFactoryStochasticNewton.h>
#include <queso/HessianCovMatricesTKGroup.h>
#include <queso/AlgorithmFactory.h>
#include <queso/AlgorithmFactoryInitializer.h>

namespace QUESO
{

template <class DerivedTK>
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type
TKFactoryStochasticNewton<DerivedTK>::build_tk()
AlgorithmFactoryInitializer::AlgorithmFactoryInitializer()
{
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type new_tk;
// Instantiate all the algorithm factories
static AlgorithmFactoryImp<Algorithm<GslVector, GslMatrix> > random_walk_alg("random_walk");
static AlgorithmFactoryImp<Algorithm<GslVector, GslMatrix> > logit_random_walk_alg("logit_random_walk");

new_tk.reset(new DerivedTK(this->m_options->m_prefix.c_str(),
*(this->m_vectorSpace),
*(this->m_dr_scales),
*(this->m_pdf_synchronizer)));

return new_tk;
}

// Instantiate all the transition kernel factories
TKFactoryStochasticNewton<HessianCovMatricesTKGroup<GslVector, GslMatrix> > tk_factory_stochastic_newton("stochastic_newton");
AlgorithmFactoryInitializer::~AlgorithmFactoryInitializer()
{
// Do nothing
}

} // namespace QUESO
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,32 @@
//
//-----------------------------------------------------------------------el-

#include <queso/TKFactoryInitializer.h>

#include <queso/TKFactoryRandomWalk.h>
#include <queso/TKFactoryMALA.h>
#include <queso/TKFactoryLogitRandomWalk.h>
#include <queso/TKFactoryStochasticNewton.h>
#include <queso/ScaledCovMatrixTKGroup.h>
#include <queso/TransformedScaledCovMatrixTKGroup.h>
#include <queso/MetropolisAdjustedLangevinTK.h>
#include <queso/HessianCovMatricesTKGroup.h>

namespace QUESO
{

template <class DerivedTK>
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type
TKFactoryLogitRandomWalk<DerivedTK>::build_tk()
TKFactoryInitializer::TKFactoryInitializer()
{
SharedPtr<BaseTKGroup<GslVector, GslMatrix> >::Type new_tk;

// Cast the domain to a box. Might this cast fail?
const BoxSubset<GslVector, GslMatrix> & boxSubset =
dynamic_cast<const BoxSubset<GslVector, GslMatrix> & >(
this->m_target_pdf->domainSet());

new_tk.reset(new DerivedTK(this->m_options->m_prefix.c_str(),
boxSubset,
*(this->m_dr_scales),
*(this->m_initial_cov_matrix)));

return new_tk;
// Instantiate all the transition kernel factories
static TKFactoryRandomWalk<ScaledCovMatrixTKGroup<GslVector, GslMatrix> > tk_factory_random_walk("random_walk");
static TKFactoryLogitRandomWalk<TransformedScaledCovMatrixTKGroup<GslVector, GslMatrix> > tk_factory_logit_random_walk("logit_random_walk");
static TKFactoryStochasticNewton<HessianCovMatricesTKGroup<GslVector, GslMatrix> > tk_factory_stochastic_newton("stochastic_newton");
static TKFactoryMALA<MetropolisAdjustedLangevinTK<GslVector, GslMatrix> > tk_factory_mala("mala");
}

// Instantiate all the transition kernel factories
TKFactoryLogitRandomWalk<TransformedScaledCovMatrixTKGroup<GslVector, GslMatrix> > tk_factory_logit_random_walk("logit_random_walk");
TKFactoryInitializer::~TKFactoryInitializer()
{
// Do nothing
}

} // namespace QUESO
} // namespace QUESO
Loading

0 comments on commit 14aefed

Please sign in to comment.