Skip to content
Snippets Groups Projects
Commit 120ca9ab authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

ENH: LibSVM silent unless OTB_SHOW_ALL_MSG_DEBUG is on

parent 16e6a638
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,9 @@ namespace Utils ...@@ -48,6 +48,9 @@ namespace Utils
return s.str(); return s.str();
} }
/** Function that prints nothing (usefull to disable libsvm logs)*/
void OTBCommon_EXPORT PrintNothing(const char *s);
} }
} // namespace otb } // namespace otb
......
...@@ -37,6 +37,10 @@ bool IsLonLatValid(double lon, double lat) ...@@ -37,6 +37,10 @@ bool IsLonLatValid(double lon, double lat)
return true; return true;
} }
void PrintNothing(const char * /* s */)
{
}
} }
} }
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "otbSVMCrossValidationCostFunction.h" #include "otbSVMCrossValidationCostFunction.h"
#include "otbExhaustiveExponentialOptimizer.h" #include "otbExhaustiveExponentialOptimizer.h"
#include "otbMacro.h" #include "otbMacro.h"
#include "otbUtils.h"
namespace otb namespace otb
{ {
...@@ -65,6 +66,9 @@ LibSVMMachineLearningModel<TInputValue,TOutputValue> ...@@ -65,6 +66,9 @@ LibSVMMachineLearningModel<TInputValue,TOutputValue>
this->m_Problem.l = 0; this->m_Problem.l = 0;
this->m_Problem.y = ITK_NULLPTR; this->m_Problem.y = ITK_NULLPTR;
this->m_Problem.x = ITK_NULLPTR; this->m_Problem.x = ITK_NULLPTR;
#ifndef OTB_SHOW_ALL_MSG_DEBUG
svm_set_print_string_function(&otb::Utils::PrintNothing);
#endif
} }
template <class TInputValue, class TOutputValue> template <class TInputValue, class TOutputValue>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment