Skip to content
Snippets Groups Projects
Commit 36f88797 authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Small fix in the CSVWriter

parent d5d69140
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@ m4_ifdef([AX_BOOST_BASE],,[m4_include([m4/ax_boost_base.m4])])
m4_ifdef([AX_BOOST_IOSTREAMS],,[m4_include([m4/ax_boost_iostreams.m4])])
m4_ifdef([AX_BOOST_PROGRAM_OPTIONS],,[m4_include([m4/ax_boost_program_options.m4])])
m4_ifdef([AX_BOOST_UNIT_TEST_FRAMEWORK],,[m4_include([m4/ax_boost_unit_test_framework.m4])])
m4_ifdef([AX_LIB_HDF5],,[m4_include([m4/ax_lib_hdf5.m4])])
case $host_os in
*cygwin*)
......
x[0],x[1],x[2],column_0,column_1,column_2,column_3,column_4_[0],column_4_[1],column_4_[2],column_5_[0][0],column_5_[0][1],column_5_[0][2],column_5_[1][0],column_5_[1][1],column_5_[1][2],column_5_[2][0],column_5_[2][1],column_5_[2][2]
x[0],x[1],x[2],x,y,z,s,v_[0],v_[1],v_[2],t_[0][0],t_[0][1],t_[0][2],t_[1][0],t_[1][1],t_[1][2],t_[2][0],t_[2][1],t_[2][2]
1,2,3,1,2,3,4,1,2,7,10,13,8,19,23,5,4,3,11
1,2,3,1,2,3,4,2,3,8,11,14,9,20,24,6,5,4,12
1,2,3,1,2,3,4,3,4,9,12,15,10,21,25,7,6,5,13
......
......@@ -86,15 +86,12 @@ struct csv_col
//! It call the functor for each member
template<typename T>
void operator()(T& t)
inline void operator()(T& t)
{
// This is the type of the csv column
typedef decltype(std::declval<Tobj>.template get<T::value>()) col_type;
// Remove the reference from the column type
typedef typename boost::remove_reference<col_type>::type col_rtype;
typedef typename boost::mpl::at<typename Tobj::type,boost::mpl::int_<T::value>>::type col_type;
csv_col_str<col_rtype>(std::string(Tobj::attributes::name[T::value]),str);
csv_col_str<col_type>(std::string(Tobj::attributes::name[T::value]),str);
}
};
......
......@@ -10,7 +10,7 @@ BOOST_AUTO_TEST_SUITE( csv_writer_test )
BOOST_AUTO_TEST_CASE( csv_writer_particles )
{
// Allocate a property vector
auto v_prp = allocate_openfpm(16);
auto v_prp = allocate_openfpm_prp(16);
// Vector of position
openfpm::vector<Point<3,float>> v_pos;
......@@ -23,7 +23,7 @@ BOOST_AUTO_TEST_CASE( csv_writer_particles )
}
// CSVWriter test
CSVWriter<openfpm::vector<Point<3,float>>, openfpm::vector<Point_test<float>> > csv_writer;
CSVWriter<openfpm::vector<Point<3,float>>, openfpm::vector<Point_test_prp<float>> > csv_writer;
// Write the CSV
csv_writer.write("csv_out.csv",v_pos,v_prp);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment