[aGrUM] renaming new GibbsKL

parent 0f9a50ed
#include <agrum/BN/algorithms/divergence/GibbsKL.h>
#include <cmath>
template class gum::GibbsKL<float>;
template class gum::GibbsKL<double>;
......@@ -74,7 +74,7 @@ namespace gum {
*/
template <typename GUM_SCALAR>
class GibbsKL2 : public KL<GUM_SCALAR>,
class GibbsKL : public KL<GUM_SCALAR>,
public ApproximationScheme,
public GibbsOperator<GUM_SCALAR> {
public:
......@@ -88,14 +88,14 @@ namespace gum {
*/
GibbsKL2( const IBayesNet<GUM_SCALAR>& P, const IBayesNet<GUM_SCALAR>& Q );
GibbsKL( const IBayesNet<GUM_SCALAR>& P, const IBayesNet<GUM_SCALAR>& Q );
/** copy constructor
*/
GibbsKL2( const KL<GUM_SCALAR>& kl );
GibbsKL( const KL<GUM_SCALAR>& kl );
/** destructor */
~GibbsKL2();
~GibbsKL();
protected:
......@@ -114,12 +114,12 @@ namespace gum {
};
extern template class GibbsKL2<float>;
extern template class GibbsKL2<double>;
extern template class GibbsKL<float>;
extern template class GibbsKL<double>;
} // namespace gum
#include <agrum/BN/algorithms/divergence/gibbsKL2_tpl.h>
#include <agrum/BN/algorithms/divergence/GibbsKL_tpl.h>
#endif
......@@ -26,7 +26,7 @@
#include <agrum/BN/IBayesNet.h>
#include <agrum/BN/algorithms/divergence/gibbsKL2.h>
#include <agrum/BN/algorithms/divergence/GibbsKL.h>
#include <agrum/BN/inference/tools/gibbsOperator.h>
#include <agrum/core/approximations/approximationScheme.h>
#include <agrum/core/hashTable.h>
......@@ -44,12 +44,12 @@ namespace gum {
template <typename GUM_SCALAR>
GibbsKL2<GUM_SCALAR>::GibbsKL2( const IBayesNet<GUM_SCALAR>& P,
GibbsKL<GUM_SCALAR>::GibbsKL( const IBayesNet<GUM_SCALAR>& P,
const IBayesNet<GUM_SCALAR>& Q )
: KL<GUM_SCALAR>( P, Q )
, ApproximationScheme()
, GibbsOperator<GUM_SCALAR>( P ) {
GUM_CONSTRUCTOR( GibbsKL2 );
GUM_CONSTRUCTOR( GibbsKL );
setEpsilon( GIBBSKL_DEFAULT_EPSILON );
setMinEpsilonRate( GIBBSKL_DEFAULT_MIN_EPSILON_RATE );
......@@ -61,11 +61,11 @@ namespace gum {
}
template <typename GUM_SCALAR>
GibbsKL2<GUM_SCALAR>::GibbsKL2( const KL<GUM_SCALAR>& kl )
GibbsKL<GUM_SCALAR>::GibbsKL( const KL<GUM_SCALAR>& kl )
: KL<GUM_SCALAR>( kl )
, ApproximationScheme()
, GibbsOperator<GUM_SCALAR>( kl.p() ) {
GUM_CONSTRUCTOR( GibbsKL2 );
GUM_CONSTRUCTOR( GibbsKL );
setEpsilon( GIBBSKL_DEFAULT_EPSILON );
setMinEpsilonRate( GIBBSKL_DEFAULT_MIN_EPSILON_RATE );
......@@ -77,12 +77,12 @@ namespace gum {
}
template <typename GUM_SCALAR>
GibbsKL2<GUM_SCALAR>::~GibbsKL2() {
GUM_DESTRUCTOR( GibbsKL2 );
GibbsKL<GUM_SCALAR>::~GibbsKL() {
GUM_DESTRUCTOR( GibbsKL );
}
template <typename GUM_SCALAR>
void GibbsKL2<GUM_SCALAR>::_computeKL() {
void GibbsKL<GUM_SCALAR>::_computeKL() {
gum::Instantiation Iq;
_q.completeInstantiation( Iq );
......
#include <agrum/BN/algorithms/divergence/gibbsKL2.h>
#include <cmath>
template class gum::GibbsKL2<float>;
template class gum::GibbsKL2<double>;
......@@ -30,7 +30,7 @@
#include <agrum/BN/algorithms/divergence/GibbsKLold.h>
#include <agrum/BN/algorithms/divergence/bruteForceKL.h>
#include <agrum/BN/algorithms/divergence/gibbsKL2.h>
#include <agrum/BN/algorithms/divergence/GibbsKL.h>
// The graph used for the tests:
// 1 2_ 1 -> 3
......@@ -143,7 +143,7 @@ namespace gum_tests {
}
{
gum::GibbsKL2<float> gkl( kl );
gum::GibbsKL<float> gkl( kl );
gkl.setMaxIter( 40 );
TS_GUM_ASSERT_THROWS_NOTHING( vkl = gkl.klPQ() );
TS_ASSERT_DIFFERS( vkl, (float)0.0 );
......@@ -215,7 +215,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::GibbsKL2<float> kl( netP, netQ );
gum::GibbsKL<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