Commit 0fe0c49a authored by Jussi Lindgren's avatar Jussi Lindgren

plugins/processing/classification:

 * Moved libSVM code to contrib/.
 + Added libSVM copyright notice
plugins/processing/signal-processing:
 * Added some error messages to situations where SimpleDSP init fails
parent e08e619e
# These files can be included by non-contrib projects.
Copyright (c) 2000-2013 Chih-Chung Chang and Chih-Jen Lin
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither name of copyright holders nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
......@@ -6,7 +6,9 @@ SET(PROJECT_VERSION_PATCH ${OV_GLOBAL_VERSION_PATCH})
SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
FILE(GLOB_RECURSE source_files src/*.cpp src/*.h src/*.inl)
ADD_LIBRARY(${PROJECT_NAME} SHARED ${source_files})
ADD_LIBRARY(${PROJECT_NAME} SHARED ${source_files}
"../../../contrib/packages/libSVM/svm.cpp"
"../../../contrib/packages/libSVM/svm.h")
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
......
......@@ -9,7 +9,7 @@
#include <xml/IReader.h>
#include <stack>
#include "libSVM/svm.h"
#include "../../../contrib/packages/libSVM/svm.h"
#define OVP_ClassId_Algorithm_ClassifierSVM OpenViBE::CIdentifier(0x50486EC2, 0x6F2417FC)
#define OVP_ClassId_Algorithm_ClassifierSVMDesc OpenViBE::CIdentifier(0x272B056E, 0x0C6502AC)
......
......@@ -28,13 +28,20 @@ boolean CSimpleDSP::initialize(void)
m_ppVariable=new float64*[l_rStaticBoxContext.getInputCount()];
if(!m_ppVariable)
{
this->getLogManager() << LogLevel_Error << "Unable to allocate an array of floats for " << l_rStaticBoxContext.getInputCount() << " inputs\n";
return false;
}
CString l_sEquation=FSettingValueAutoCast(*this->getBoxAlgorithmContext(), 0);
m_pEquationParser=new CEquationParser(*this, m_ppVariable, l_rStaticBoxContext.getInputCount());
if(!m_pEquationParser)
{
this->getLogManager() << LogLevel_Error << "Failed to create EquationParser\n";
return false;
}
if(!m_pEquationParser->compileEquation(l_sEquation.toASCIIString()))
{
this->getLogManager() << LogLevel_Error << "Failed to compile equation '" << l_sEquation << "'\n";
return false;
}
m_ui64EquationType=m_pEquationParser->getTreeCategory();
......@@ -44,6 +51,7 @@ boolean CSimpleDSP::initialize(void)
l_rStaticBoxContext.getOutputType(0, l_oStreamType);
if(!this->getTypeManager().isDerivedFromStream(l_oStreamType, OV_TypeId_StreamedMatrix))
{
this->getLogManager() << LogLevel_Error << "Output stream is not derived from OV_TypeId_StreamedMatrix\n";
return false;
}
if(l_oStreamType==OV_TypeId_StreamedMatrix)
......
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