Commit ceffcf0e authored by Jussi Lindgren's avatar Jussi Lindgren
Browse files

Merge branch 'master' of...

Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/openvibe/openvibe into wip-jlindgre-motor-imagery-improvements
parents 8c4f1db7 108add27
......@@ -220,6 +220,7 @@ namespace oscpkt {
int sent = 0;
do {
int res;
errno = 0;
if (isBound()) {
res = sendto(handle, (const char*)ptr, (int)sz, 0, &addr.addr(), (int)addr.actualLen());
} else {
......
......@@ -114,6 +114,7 @@ bool CModTemporalFilterBoxAlgorithm::updateSettings()
if(m_sFilterOrder!=l_oFilterOrder)
{
errno = 0;
int64 l_i64Integer64Parameter = strtol(l_oFilterOrder, &l_pEndPtr, 10);
if(l_i64Integer64Parameter <= 0 || (errno !=0 && l_i64Integer64Parameter == 0) || *l_pEndPtr != '\0' || errno == ERANGE)
{
......@@ -132,6 +133,8 @@ bool CModTemporalFilterBoxAlgorithm::updateSettings()
if(m_sLowBand!=l_oLowPassBandEdge)
{
TParameterHandler<float64> ip_f64HighCutFrequency(m_pComputeModTemporalFilterCoefficients->getInputParameter(OVP_Algorithm_ComputeTemporalFilterCoefficients_InputParameterId_HighCutFrequency));
errno = 0;
float64 l_f64Float64Parameter = strtod(l_oLowPassBandEdge, &l_pEndPtr);
if(l_f64Float64Parameter < 0 || (errno !=0 && l_f64Float64Parameter == 0) || *l_pEndPtr != '\0' || errno == ERANGE)
{
......@@ -156,6 +159,7 @@ bool CModTemporalFilterBoxAlgorithm::updateSettings()
if(m_sHighBand!=l_oHighPassBandEdge)
{
TParameterHandler<float64> ip_f64LowCutFrequency(m_pComputeModTemporalFilterCoefficients->getInputParameter(OVP_Algorithm_ComputeTemporalFilterCoefficients_InputParameterId_LowCutFrequency));
errno = 0;
float64 l_f64Float64Parameter = strtod(l_oHighPassBandEdge, &l_pEndPtr);
if(l_f64Float64Parameter < 0 || (errno !=0 && l_f64Float64Parameter == 0) || *l_pEndPtr != '\0' || errno == ERANGE)
{
......@@ -179,6 +183,7 @@ bool CModTemporalFilterBoxAlgorithm::updateSettings()
if(m_sPassBandRiple!=l_oPassBandRipple)
{
errno = 0;
float64 l_f64Float64Parameter = strtod(l_oPassBandRipple, &l_pEndPtr);;
if((errno !=0 && l_f64Float64Parameter == 0) || *l_pEndPtr != '\0' || errno == ERANGE)
{
......
......@@ -66,7 +66,7 @@ boolean CTemporalFilterBoxAlgorithm::initialize(void)
TParameterHandler<uint64> ip_ui64KindFilter(m_pComputeTemporalFilterCoefficients->getInputParameter(OVP_Algorithm_ComputeTemporalFilterCoefficients_InputParameterId_FilterType));
ip_ui64KindFilter=l_ui64UInteger64Parameter;
errno = 0;
l_i64Integer64Parameter = strtol(l_oFilterOrder, &l_pEndPtr, 10);
if(l_i64Integer64Parameter <= 0 || (errno !=0 && l_i64Integer64Parameter == 0) || *l_pEndPtr != '\0' || errno == ERANGE)
{
......@@ -76,7 +76,7 @@ boolean CTemporalFilterBoxAlgorithm::initialize(void)
TParameterHandler<uint64> ip_ui64FilterOrder(m_pComputeTemporalFilterCoefficients->getInputParameter(OVP_Algorithm_ComputeTemporalFilterCoefficients_InputParameterId_FilterOrder));
ip_ui64FilterOrder=l_i64Integer64Parameter;
errno = 0;
l_f64Float64Parameter = strtod(l_oLowPassBandEdge, &l_pEndPtr);
if(l_f64Float64Parameter < 0 || (errno !=0 && l_f64Float64Parameter == 0) || *l_pEndPtr != '\0' || errno == ERANGE)
{
......@@ -86,7 +86,7 @@ boolean CTemporalFilterBoxAlgorithm::initialize(void)
TParameterHandler<float64> ip_f64LowCutFrequency(m_pComputeTemporalFilterCoefficients->getInputParameter(OVP_Algorithm_ComputeTemporalFilterCoefficients_InputParameterId_LowCutFrequency));
ip_f64LowCutFrequency=l_f64Float64Parameter;
errno = 0;
l_f64Float64Parameter = strtod(l_oHighPassBandEdge, &l_pEndPtr);
if(l_f64Float64Parameter < 0 || (errno !=0 && l_f64Float64Parameter == 0) || *l_pEndPtr != '\0' || errno == ERANGE)
{
......@@ -102,8 +102,7 @@ boolean CTemporalFilterBoxAlgorithm::initialize(void)
TParameterHandler<float64> ip_f64HighCutFrequency(m_pComputeTemporalFilterCoefficients->getInputParameter(OVP_Algorithm_ComputeTemporalFilterCoefficients_InputParameterId_HighCutFrequency));
ip_f64HighCutFrequency=l_f64Float64Parameter;
errno = 0;
l_f64Float64Parameter = strtod(l_oPassBandRipple, &l_pEndPtr);;
if((errno !=0 && l_f64Float64Parameter == 0) || *l_pEndPtr != '\0' || errno == ERANGE)
{
......
......@@ -518,6 +518,7 @@ boolean COgreObject::loadWorldMatrix()
//stop at first whitespace char or when vector end is found
if(std::isspace(*l_oIt, l_oLocale) == true || *l_oIt == ']')
{
errno = 0;
float64 l_f64Value = atof(l_sCurString.c_str());
#if defined TARGET_OS_Windows
if(errno == ERANGE)
......@@ -558,6 +559,7 @@ boolean COgreObject::loadWorldMatrix()
//stop at first whitespace char or when vector end is found
if(std::isspace(*l_oIt, l_oLocale) == true || *l_oIt == ']')
{
errno = 0;
float64 l_f64Value = atof(l_sCurString.c_str());
#if defined TARGET_OS_Windows
if(errno == ERANGE)
......@@ -598,6 +600,7 @@ boolean COgreObject::loadWorldMatrix()
//stop at first whitespace char or when vector end is found
if(std::isspace(*l_oIt, l_oLocale) == true || *l_oIt == ']')
{
errno = 0;
float64 l_f64Value = atof(l_sCurString.c_str());
#if defined TARGET_OS_Windows
if(errno == ERANGE)
......
......@@ -81,6 +81,7 @@ namespace Socket
l_oServerAddress.sin_family=AF_INET;
l_oServerAddress.sin_port=htons((unsigned short)ui32ServerPort);
l_oServerAddress.sin_addr=*((struct in_addr*)l_pServerHostEntry->h_addr);
errno = 0;
if(::connect(m_i32Socket, (struct sockaddr*)&l_oServerAddress, sizeof(struct sockaddr_in))<0)
{
boolean l_bInProgress=false;
......
......@@ -148,7 +148,7 @@ boolean CAlgorithmClassifierOneVsAll::classify(const IFeatureVector& rFeatureVec
{
l_oClassificationVector.push_back(CClassifierOutput(static_cast<float64>(op_f64ClassificationStateClass), static_cast<IMatrix*>(op_pClassificationValues)));
}
this->getLogManager() << LogLevel_Debug << l_iClassifierCounter << " " << (float64)op_f64ClassificationStateClass << " " << (*op_pProbabilityValues)[0] << " " << (*op_pProbabilityValues)[1] << "\n";
this->getLogManager() << LogLevel_Debug << static_cast<int64>(l_iClassifierCounter) << " " << (float64)op_f64ClassificationStateClass << " " << (*op_pProbabilityValues)[0] << " " << (*op_pProbabilityValues)[1] << "\n";
}
//Now, we determine the best classification
......
......@@ -377,7 +377,7 @@ boolean CAlgorithmClassifierSVM::classify(const IFeatureVector& rFeatureVector,
for(int i=0;i<m_pModel->nr_class;i++)
{
this->getLogManager() << LogLevel_Trace << "index:"<<i<<" label:"<< m_pModel->label[i]<<" probability:"<<l_pProbEstimates[i]<<"\n";
rProbabilityValue[i]=l_pProbEstimates[i];
rProbabilityValue[ (m_pModel->label[i])-1 ]=l_pProbEstimates[i];
}
}
else
......
#include "ovpCAlgorithmOVMatrixFileReader.h"
#include <system/ovCMemory.h>
#include <sstream>
#include <locale>
#if defined TARGET_OS_Windows
#include <cerrno>
#endif
#include <cstring>
#include <cstdlib>
using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBE::Plugins;
......
#include "ovpCAlgorithmOVMatrixFileWriter.h"
#include <system/ovCMemory.h>
#include <sstream>
#if defined TARGET_OS_Windows
#include <cerrno>
#endif
using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBE::Plugins;
......
......@@ -15,7 +15,6 @@
#include <stack>
#include <cstdio>
#include <cerrno>
namespace OpenViBEPlugins
{
......
......@@ -6,7 +6,7 @@
#include <cmath>
#include <cstdlib>
#include <cfloat>
#include <cerrno>
// for save/load
#include <fstream>
......@@ -507,6 +507,7 @@ boolean OpenViBEToolkit::Tools::Matrix::fromString(OpenViBE::IMatrix& rMatrix, c
}
//retrieve value
errno = 0;
const float64 l_f64Value = atof(l_sCurString.c_str());
#if defined TARGET_OS_Windows
if(errno == ERANGE)
......
Supports Markdown
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