Skip to content
Snippets Groups Projects
Commit 7ebff3e4 authored by Julien Malik's avatar Julien Malik
Browse files

ENH: remove otbGamma. already implemented in boost + big doubts on code origin

parent b1035bdf
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,6 @@
#include "otbMRFEnergy.h"
#include "otbMath.h"
#include "otbGamma.h"
#include <boost/math/special_functions/gamma.hpp>
namespace otb
......@@ -57,7 +56,6 @@ public:
itkNewMacro(Self);
itkTypeMacro(MRFEnergyFisherClassification, MRFEnergy);
Gamma g;
void SetNumberOfParameters(const unsigned int nParameters)
{
Superclass::SetNumberOfParameters(nParameters);
......
......@@ -1044,13 +1044,6 @@ ADD_TEST(coTvRAMDrivenTiledStreamingManager ${COMMON_TESTS13}
${TEMP}/coTvRAMDrivenTiledStreamingManager.txt
)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbCommonTests14 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Gamma function tests #
ADD_TEST(coTvGamma ${COMMON_TESTS14}
otbGammaTest
)
# ------- Fichiers sources CXX -----------------------------------
SET(BasicCommon_SRCS1
......@@ -1216,12 +1209,6 @@ otbPipelineMemoryPrintCalculatorTest.cxx
otbStreamingManager.cxx
)
SET(BasicCommon_SRCS14
otbCommonTests14.cxx
otbGammaTest.cxx
)
OTB_ADD_EXECUTABLE(otbCommonTests1 "${BasicCommon_SRCS1}" "OTBIO;OTBTesting")
OTB_ADD_EXECUTABLE(otbCommonTests2 "${BasicCommon_SRCS2}" "OTBIO;OTBTesting")
OTB_ADD_EXECUTABLE(otbCommonTests3 "${BasicCommon_SRCS3}" "OTBIO;OTBTesting")
......@@ -1243,6 +1230,5 @@ TARGET_LINK_LIBRARIES(otbCommonTests11 OTBIO OTBTesting itkvcl)
OTB_ADD_EXECUTABLE(otbCommonTests12 "${BasicCommon_SRCS12}" "OTBIO;OTBTesting")
OTB_ADD_EXECUTABLE(otbCommonTests13 "${BasicCommon_SRCS13}" "OTBIO;OTBTesting")
OTB_ADD_EXECUTABLE(otbCommonTests14 "${BasicCommon_SRCS14}" "OTBIO;OTBTesting")
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
// this file defines the otbCommonTest for the test driver
// and all it expects is that you have a function called RegisterTests
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "otbTestMain.h"
void RegisterTests()
{
REGISTER_TEST(otbGammaTest);
}
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "otbGamma.h"
#include "otbMacro.h"
#include <iostream>
int otbGammaTest(int argc, char * argv[])
{
typedef otb::Gamma GammaFunctionType;
//Instantiation
GammaFunctionType * gam = new GammaFunctionType();
const double epsilon = 0.0000000001;
int output = EXIT_SUCCESS;
if ( vcl_abs(gam->gamma(1) - 1) > epsilon ) output = EXIT_FAILURE;
if ( vcl_abs(gam->gamma(0.5) - 1.77245385091) > epsilon ) output = EXIT_FAILURE;
if ( vcl_abs(gam->gamma(4) - 6) > epsilon ) output = EXIT_FAILURE;
delete gam;
return output;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment