Пример #1
0
bool DataSample::operator<(const DataSample &rhs) const
{
    assert(this->getDimX() == rhs.getDimX());

    for (unsigned int i = 0; i < this->getDimX(); i++)
    {
        if (x.at(i) < rhs.getX().at(i))
            return true;
        else if (x.at(i) > rhs.getX().at(i))
            return false;
    }

    return false;
}
Пример #2
0
/*
 * Computes Euclidean distance ||x-y||
 */
double RBFSpline::dist(DataSample x, DataSample y) const
{
    return dist(x.getX(), y.getX());
}