Page MenuHomec4science

test_data_selector.hpp
No OneTemporary

File Metadata

Created
Wed, Nov 13, 09:16

test_data_selector.hpp

/*-------------------------------------------------------
- Module : test/database
- File : test_data_selector.hpp
- Author : Fabien Georget
Copyright (c) 2014, Fabien Georget, Princeton University
---------------------------------------------------------*/
#include <cxxtest/TestSuite.h>
#include "database/database.hpp"
#include "database/selector.hpp"
class DatabaseSelectorTestSuite : public CxxTest::TestSuite
{
public:
void test_doit()
{
specmicp::database::Database database("data/cemdata_specmicp.js");
database.make_canonical();
std::shared_ptr<specmicp::database::DataContainer> data = database.get_database();
specmicp::database::DatabaseSelector selector(data);
selector.remove_component(std::vector<int>({2}));
std::cout << "## Basis : " << std::endl;
for (int i=0; i<data->nb_component; ++i)
{
std::cout << data->labels_basis[i] << std::endl;
}
std::cout << "## Aqueous : " << std::endl;
for (int j=0; j<data->nb_aqueous; ++j)
{
std::cout << data->labels_aqueous[j] << " : "
<< data->nu_aqueous.row(j) << " : "
<< data->logk_aqueous(j) << std::endl;
}
std::cout << "## Minerals : " << std::endl;
for (int m=0; m<data->nb_mineral; ++m)
{
std::cout << data->labels_minerals[m] << " : "
<< data->nu_mineral.row(m) << " : "
<< data->logk_mineral(m) << std::endl;
}
}
};

Event Timeline