mirror of
https://github.com/Doctorado-ML/FImdlp.git
synced 2025-08-17 08:25:51 +00:00
25 lines
519 B
C++
25 lines
519 B
C++
#include "FImdlp.h"
|
|
namespace FImdlp
|
|
{
|
|
FImdlp::FImdlp()
|
|
{
|
|
}
|
|
FImdlp::~FImdlp()
|
|
{
|
|
}
|
|
std::vector<float> FImdlp::cutPoints(std::vector<int> &X, std::vector<int> &y)
|
|
{
|
|
std::vector<float> cutPts;
|
|
int i, ant = X.at(0);
|
|
int n = X.size();
|
|
for (i = 1; i < n; i++)
|
|
{
|
|
if (X.at(i) != ant)
|
|
{
|
|
cutPts.push_back(float(X.at(i) + ant) / 2);
|
|
ant = X.at(i);
|
|
}
|
|
}
|
|
return cutPts;
|
|
}
|
|
} |