Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
openfpm_io
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openfpm
openfpm_io
Commits
36f88797
Commit
36f88797
authored
Mar 09, 2016
by
Pietro Incardona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fix in the CSVWriter
parent
d5d69140
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
9 deletions
+7
-9
configure.ac
configure.ac
+1
-0
csv_out_test.csv
csv_out_test.csv
+1
-1
src/CSVWriter/CSVWriter.hpp
src/CSVWriter/CSVWriter.hpp
+3
-6
src/CSVWriter/CSVWriter_unit_tests.hpp
src/CSVWriter/CSVWriter_unit_tests.hpp
+2
-2
No files found.
configure.ac
View file @
36f88797
...
@@ -16,6 +16,7 @@ m4_ifdef([AX_BOOST_BASE],,[m4_include([m4/ax_boost_base.m4])])
...
@@ -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_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_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_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
case $host_os in
*cygwin*)
*cygwin*)
...
...
csv_out_test.csv
View file @
36f88797
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,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,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
1,2,3,1,2,3,4,3,4,9,12,15,10,21,25,7,6,5,13
...
...
src/CSVWriter/CSVWriter.hpp
View file @
36f88797
...
@@ -86,15 +86,12 @@ struct csv_col
...
@@ -86,15 +86,12 @@ struct csv_col
//! It call the functor for each member
//! It call the functor for each member
template
<
typename
T
>
template
<
typename
T
>
void
operator
()(
T
&
t
)
inline
void
operator
()(
T
&
t
)
{
{
// This is the type of the csv column
// This is the type of the csv column
typedef
decltype
(
std
::
declval
<
Tobj
>
.
template
get
<
T
::
value
>())
col_type
;
typedef
typename
boost
::
mpl
::
at
<
typename
Tobj
::
type
,
boost
::
mpl
::
int_
<
T
::
value
>>::
type
col_type
;
// Remove the reference from the column type
typedef
typename
boost
::
remove_reference
<
col_type
>::
type
col_rtype
;
csv_col_str
<
col_
r
type
>
(
std
::
string
(
Tobj
::
attributes
::
name
[
T
::
value
]),
str
);
csv_col_str
<
col_type
>
(
std
::
string
(
Tobj
::
attributes
::
name
[
T
::
value
]),
str
);
}
}
};
};
...
...
src/CSVWriter/CSVWriter_unit_tests.hpp
View file @
36f88797
...
@@ -10,7 +10,7 @@ BOOST_AUTO_TEST_SUITE( csv_writer_test )
...
@@ -10,7 +10,7 @@ BOOST_AUTO_TEST_SUITE( csv_writer_test )
BOOST_AUTO_TEST_CASE
(
csv_writer_particles
)
BOOST_AUTO_TEST_CASE
(
csv_writer_particles
)
{
{
// Allocate a property vector
// Allocate a property vector
auto
v_prp
=
allocate_openfpm
(
16
);
auto
v_prp
=
allocate_openfpm
_prp
(
16
);
// Vector of position
// Vector of position
openfpm
::
vector
<
Point
<
3
,
float
>>
v_pos
;
openfpm
::
vector
<
Point
<
3
,
float
>>
v_pos
;
...
@@ -23,7 +23,7 @@ BOOST_AUTO_TEST_CASE( csv_writer_particles )
...
@@ -23,7 +23,7 @@ BOOST_AUTO_TEST_CASE( csv_writer_particles )
}
}
// CSVWriter test
// 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
// Write the CSV
csv_writer
.
write
(
"csv_out.csv"
,
v_pos
,
v_prp
);
csv_writer
.
write
(
"csv_out.csv"
,
v_pos
,
v_prp
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment