[aGrUM] renaming old GibbsKL

parent 1c831360
......@@ -24,8 +24,8 @@
* @author Pierre-Henri WUILLEMIN
*/
#include <agrum/BN/algorithms/divergence/GibbsKL.h>
#include <agrum/BN/algorithms/divergence/GibbsKLold.h>
#include <cmath>
template class gum::GibbsKL<float>;
template class gum::GibbsKL<double>;
template class gum::GibbsKLold<float>;
template class gum::GibbsKLold<double>;
......@@ -71,7 +71,7 @@ namespace gum {
* @endcode
*/
template <typename GUM_SCALAR>
class GibbsKL : public KL<GUM_SCALAR>,
class GibbsKLold : public KL<GUM_SCALAR>,
public ApproximationScheme,
public samplers::GibbsSampler<GUM_SCALAR> {
public:
......@@ -82,14 +82,14 @@ namespace gum {
* or
* compatible node sets.
*/
GibbsKL( const IBayesNet<GUM_SCALAR>& P, const IBayesNet<GUM_SCALAR>& Q );
GibbsKLold( const IBayesNet<GUM_SCALAR>& P, const IBayesNet<GUM_SCALAR>& Q );
/** copy constructor
*/
GibbsKL( const KL<GUM_SCALAR>& kl );
GibbsKLold( const KL<GUM_SCALAR>& kl );
/** destructor */
~GibbsKL();
~GibbsKLold();
using samplers::GibbsSampler<GUM_SCALAR>::particle;
using samplers::GibbsSampler<GUM_SCALAR>::initParticle;
......@@ -112,12 +112,12 @@ namespace gum {
};
extern template class GibbsKL<float>;
extern template class GibbsKL<double>;
extern template class GibbsKLold<float>;
extern template class GibbsKLold<double>;
} // namespace gum
#include <agrum/BN/algorithms/divergence/GibbsKL_tpl.h>
#include <agrum/BN/algorithms/divergence/GibbsKLold_tpl.h>
#endif // GUM_GIBBS_KL_H
......@@ -29,7 +29,7 @@
#include <agrum/BN/IBayesNet.h>
#include <agrum/core/hashTable.h>
#include <agrum/BN/algorithms/divergence/GibbsKL.h>
#include <agrum/BN/algorithms/divergence/GibbsKLold.h>
#include <agrum/BN/samplers/GibbsSampler.h>
#include <agrum/core/approximations/approximationScheme.h>
......@@ -43,12 +43,12 @@
namespace gum {
template <typename GUM_SCALAR>
GibbsKL<GUM_SCALAR>::GibbsKL( const IBayesNet<GUM_SCALAR>& P,
GibbsKLold<GUM_SCALAR>::GibbsKLold( const IBayesNet<GUM_SCALAR>& P,
const IBayesNet<GUM_SCALAR>& Q )
: KL<GUM_SCALAR>( P, Q )
, ApproximationScheme()
, samplers::GibbsSampler<GUM_SCALAR>( P ) {
GUM_CONSTRUCTOR( GibbsKL );
GUM_CONSTRUCTOR( GibbsKLold );
setEpsilon( KL_DEFAULT_EPSILON );
setMinEpsilonRate( KL_DEFAULT_MIN_EPSILON_RATE );
......@@ -59,11 +59,11 @@ namespace gum {
}
template <typename GUM_SCALAR>
GibbsKL<GUM_SCALAR>::GibbsKL( const KL<GUM_SCALAR>& kl )
GibbsKLold<GUM_SCALAR>::GibbsKLold( const KL<GUM_SCALAR>& kl )
: KL<GUM_SCALAR>( kl )
, ApproximationScheme()
, samplers::GibbsSampler<GUM_SCALAR>( kl.p() ) {
GUM_CONSTRUCTOR( GibbsKL );
GUM_CONSTRUCTOR( GibbsKLold );
setEpsilon( KL_DEFAULT_EPSILON );
setMinEpsilonRate( KL_DEFAULT_MIN_EPSILON_RATE );
......@@ -74,12 +74,12 @@ namespace gum {
}
template <typename GUM_SCALAR>
GibbsKL<GUM_SCALAR>::~GibbsKL() {
GUM_DESTRUCTOR( GibbsKL );
GibbsKLold<GUM_SCALAR>::~GibbsKLold() {
GUM_DESTRUCTOR( GibbsKLold );
}
template <typename GUM_SCALAR>
void GibbsKL<GUM_SCALAR>::_computeKL() {
void GibbsKLold<GUM_SCALAR>::_computeKL() {
gum::Instantiation Iq;
_q.completeInstantiation( Iq );
......
......@@ -28,7 +28,7 @@
#include <agrum/BN/BayesNet.h>
#include <agrum/BN/io/BIF/BIFReader.h>
#include <agrum/BN/algorithms/divergence/GibbsKL.h>
#include <agrum/BN/algorithms/divergence/GibbsKLold.h>
#include <agrum/BN/algorithms/divergence/bruteForceKL.h>
#include <agrum/BN/algorithms/divergence/gibbsKL2.h>
......@@ -135,7 +135,7 @@ namespace gum_tests {
}
{
gum::GibbsKL<float> gkl( kl );
gum::GibbsKLold<float> gkl( kl );
gkl.setMaxIter( 40 );
TS_GUM_ASSERT_THROWS_NOTHING( vkl = gkl.klPQ() );
TS_ASSERT_DIFFERS( vkl, (float)0.0 );
......@@ -192,7 +192,7 @@ namespace gum_tests {
// iterations for better robustness : KL may fail from time to time
for ( int ii = 0; ii < TESTKL_MAX_ITER_GIBBS_KL; ii++ ) {
gum::GibbsKL<float> kl( netP, netQ );
gum::GibbsKLold<float> kl( netP, netQ );
kl.setVerbosity( true );
// very rough approximation in order to not penalize TestSuite
kl.setEpsilon( 1e-5 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment