///-------------------------------------------------------------------------------------------------
///
/// \file test_Classifier.hpp
/// \brief Tests for Classifier Functions.
/// \author Thibaut Monseigne (Inria).
/// \version 1.0.
/// \date 09/01/2019.
/// \copyright GNU Affero General Public License v3.0.
///
///-------------------------------------------------------------------------------------------------
#pragma once
#include "gtest/gtest.h"
#include "misc.hpp"
#include "init.hpp"
#include
//---------------------------------------------------------------------------------------------------
class Tests_Classifier : public testing::Test
{
protected:
std::vector> m_dataSet;
void SetUp() override
{
const std::vector tmp = InitFeaturization::TangentSpace::Reference();
m_dataSet = Geometry::Vector1DTo2D(tmp, { NB_TRIALS1, NB_TRIALS2 });
}
};
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
TEST_F(Tests_Classifier, LSQR)
{
const Eigen::MatrixXd ref = InitClassif::LSQR::Reference();
Eigen::MatrixXd calc;
Geometry::LSQR(m_dataSet, calc);
EXPECT_TRUE(isAlmostEqual(ref, calc)) << ErrorMsg("LSQR", ref, calc);
}
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
TEST_F(Tests_Classifier, FgDACompute)
{
const Eigen::MatrixXd ref = InitClassif::FgDACompute::Reference();
Eigen::MatrixXd calc;
Geometry::FgDACompute(m_dataSet, calc);
EXPECT_TRUE(isAlmostEqual(ref, calc)) << ErrorMsg("FgDA", ref, calc);
}
//---------------------------------------------------------------------------------------------------