Commit d5dcb157 authored by OTB Bot's avatar OTB Bot

STYLE

parent 6fc0dcb5
......@@ -26,7 +26,7 @@
#include "otbMath.h"
namespace otb
namespace otb
{
/** \class Gamma
* \brief Gamma function
......@@ -36,8 +36,8 @@ class Gamma {
public:
double gamma(double x)
{
int i,k,m;
double ga,gr,r,z;
int i, k, m;
double ga, gr, r, z;
static double g[] = {
1.0,
......@@ -70,7 +70,7 @@ public:
if (x == (int)x) {
if (x > 0.0) {
ga = 1.0; // use factorial
for (i=2;i<x;i++) {
for (i=2; i<x; i++) {
ga *= i;
}
}
......@@ -82,7 +82,7 @@ public:
z = vcl_abs(x);
m = (int)z;
r = 1.0;
for (k=1;k<=m;k++) {
for (k=1; k<=m; k++) {
r *= (z-k);
}
z -= m;
......@@ -90,7 +90,7 @@ public:
else
z = x;
gr = g[24];
for (k=23;k>=0;k--) {
for (k=23; k>=0; k--) {
gr = gr*z+g[k];
}
ga = 1.0/(gr*z);
......
......@@ -73,8 +73,8 @@ double GetSingleValue(const InputImagePixelType & value1, const LabelledImagePi
double m = this->m_Parameters[3*static_cast<double>(value2)+2];
double result = -vcl_log((g.gamma(l+m)/(g.gamma(l)*g.gamma(m))) * (2/(mu)) * (vcl_sqrt(l/m)) *
((pow((vcl_sqrt(l/m)*(val1/mu)),((2*l)-1))) /
(pow(1+(vcl_sqrt(l/m)*(val1/mu)*vcl_sqrt(l/m)*(val1/mu)),(l+m)))));
((pow((vcl_sqrt(l/m)*(val1/mu)), ((2*l)-1))) /
(pow(1+(vcl_sqrt(l/m)*(val1/mu)*vcl_sqrt(l/m)*(val1/mu)), (l+m)))));
return static_cast<double>( result );
}
......
......@@ -75,7 +75,7 @@
namespace otb
{
int TestHelper::RegressionTestAllImages(const StringList& baselineFilenamesImage,
int TestHelper::RegressionTestAllImages(const StringList& baselineFilenamesImage,
const StringList& testFilenamesImage)
{
int result = 0;
......@@ -114,7 +114,7 @@ int TestHelper::RegressionTestAllImages(const StringList& baselineFilenamesImage
= this->RegressionTestImage(cpt, testFilenameImage.c_str(),
(baseline->first).c_str(),
m_ToleranceDiffValue);
}
}
cpt++;
result += multiResult;
}
......
......@@ -121,7 +121,7 @@ int main(int argc, char* argv[] )
// Software Guide : BeginCodeSnippet
typedef otb::MarkovRandomFieldFilter
<InputImageType,LabelledImageType> MarkovRandomFieldFilterType;
<InputImageType, LabelledImageType> MarkovRandomFieldFilterType;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
......@@ -188,7 +188,7 @@ int main(int argc, char* argv[] )
// Software Guide : BeginLatex
//
// Parameter for the MRFEnergyFisherClassification class are created. The shape parameters M,L
// Parameter for the MRFEnergyFisherClassification class are created. The shape parameters M, L
// and the weighting parameter mu are computed in a supervised step
//
// Software Guide : EndLatex
......@@ -276,7 +276,7 @@ int main(int argc, char* argv[] )
typedef otb::Image<RGBPixelType, 2> RGBImageType;
typedef itk::Functor::ScalarToRGBPixelFunctor<unsigned long> ColorMapFunctorType;
typedef itk::UnaryFunctorImageFilter< LabelledImageType,RGBImageType,ColorMapFunctorType> ColorMapFilterType;
typedef itk::UnaryFunctorImageFilter< LabelledImageType, RGBImageType, ColorMapFunctorType> ColorMapFilterType;
ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();
colormapper->SetInput( rescaleFilter->GetOutput() );
......
......@@ -29,7 +29,7 @@ int otbGammaTest(int argc, char * argv[])
GammaFunctionType * gam = new GammaFunctionType();
const double epsilon = 0.0000000001;
if ( vcl_abs(gam->gamma(1) - 1) > epsilon ) return EXIT_FAILURE;
if ( vcl_abs(gam->gamma(1) - 1) > epsilon ) return EXIT_FAILURE;
if ( vcl_abs(gam->gamma(0.5) - 1.77245385091) > epsilon ) return EXIT_FAILURE;
if ( vcl_abs(gam->gamma(4) - 6) > epsilon ) return EXIT_FAILURE;
......
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