Commit baeffe2d authored by Ludovic Hussonnois's avatar Ludovic Hussonnois

STYLE: Change include order add ignore some warning for shark.

parent 4f8f6e36
......@@ -18,14 +18,16 @@
#ifndef otbSharkUtils_h
#define otbSharkUtils_h
#include "otb_shark.h"
#ifdef OTB_USE_SHARK
#include "itkMacro.h"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
#include <shark/Data/Dataset.h>
#include "otb_shark.h"
#include "shark/Data/Dataset.h"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
......@@ -120,6 +122,7 @@ template <class T> void ListSampleToSharkVector(const T * listSample, std::vecto
}
}
#endif //OTB_USE_SHARK
#endif
......@@ -18,8 +18,6 @@
#ifndef otbSharkRandomForestsMachineLearningModel_h
#define otbSharkRandomForestsMachineLearningModel_h
#include "otb_shark.h"
#include "itkLightObject.h"
#include "otbMachineLearningModel.h"
......@@ -33,6 +31,7 @@
#pragma GCC diagnostic ignored "-Wcast-align"
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#endif
#include "otb_shark.h"
#include "shark/Algorithms/Trainers/RFTrainer.h"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
......
......@@ -17,6 +17,7 @@ otb_module(OTBUnsupervised
OTBImageBase
OTBLearningBase
OTBSupervised
OTBShark
DESCRIPTION
"${DOCUMENTATION}"
......
......@@ -51,15 +51,15 @@ void generateSamples(unsigned int num_classes, unsigned int num_samples,
LocalInputListSampleType * samples,
LocalTargetListSampleType * labels)
{
std::default_random_engine generator;
std::default_random_engine randomEngine;
std::uniform_int_distribution<int> label_distribution(1,num_classes);
std::uniform_int_distribution<int> feat_distribution(0,256);
for(size_t scount=0; scount<num_samples; ++scount)
{
LabeledPixelType label = label_distribution(generator);
LabeledPixelType label = label_distribution(randomEngine);
LocalInputSampleType sample(num_features);
for(unsigned int i=0; i<num_features; ++i)
sample[i]= feat_distribution(generator);
sample[i]= feat_distribution(randomEngine);
samples->SetMeasurementVectorSize(num_features);
samples->PushBack(sample);
labels->PushBack(label);
......
/*=========================================================================
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 <iostream>
#include <otbConfigure.h>
......
/*=========================================================================
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 "otbTestMain.h"
void RegisterTests()
{
......
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