Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81654741
test_data_selector.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Sep 7, 06:21
Size
1 KB
Mime Type
text/x-c++
Expires
Mon, Sep 9, 06:21 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20476961
Attached To
rSPECMICP SpecMiCP / ReactMiCP
test_data_selector.hpp
View Options
/*-------------------------------------------------------
- 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
Log In to Comment