-
Notifications
You must be signed in to change notification settings - Fork 0
/
nms_processor-base.cpp
28 lines (21 loc) · 1.11 KB
/
nms_processor-base.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "nms_processor-base.h"
NMSProcessorBase::NMSProcessorBase( const size_t parametersNumber, const size_t samplesNumber )
: OptimizerSystem( parametersNumber ), MAX_SAMPLES_COUNT( samplesNumber ) { std::cout << "Parameters number: " << parametersNumber << std::endl; }
NMSProcessorBase::~NMSProcessorBase() { }
bool NMSProcessorBase::StoreSamples( SimTK::Vector& dynInputSample, SimTK::Vector& emgInputSample, SimTK::Vector& outputSample )
{
if( inputSamplesList.size() >= MAX_SAMPLES_COUNT ) return false;
SimTK::Vector inputSample( dynInputSample.size() + emgInputSample.size() );
for( size_t valueIndex = 0; valueIndex < dynInputSample.size(); valueIndex++ )
inputSample[ valueIndex ] = dynInputSample[ valueIndex ];
for( size_t valueIndex = 0; valueIndex < dynInputSample.size(); valueIndex++ )
inputSample[ dynInputSample.size() + valueIndex ] = emgInputSample[ valueIndex ];
inputSamplesList.push_back( inputSample );
outputSamplesList.push_back( outputSample );
return true;
}
void NMSProcessorBase::ResetSamplesStorage()
{
inputSamplesList.clear();
outputSamplesList.clear();
}