Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_data
Commits
36f88797
Commit
36f88797
authored
9 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Small fix in the CSVWriter
parent
d5d69140
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure.ac
+1
-0
1 addition, 0 deletions
configure.ac
csv_out_test.csv
+1
-1
1 addition, 1 deletion
csv_out_test.csv
src/CSVWriter/CSVWriter.hpp
+3
-6
3 additions, 6 deletions
src/CSVWriter/CSVWriter.hpp
src/CSVWriter/CSVWriter_unit_tests.hpp
+2
-2
2 additions, 2 deletions
src/CSVWriter/CSVWriter_unit_tests.hpp
with
7 additions
and
9 deletions
configure.ac
+
1
−
0
View file @
36f88797
...
...
@@ -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*)
...
...
This diff is collapsed.
Click to expand it.
csv_out_test.csv
+
1
−
1
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,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
...
...
This diff is collapsed.
Click to expand it.
src/CSVWriter/CSVWriter.hpp
+
3
−
6
View file @
36f88797
...
...
@@ -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_
r
type
>
(
std
::
string
(
Tobj
::
attributes
::
name
[
T
::
value
]),
str
);
csv_col_str
<
col_type
>
(
std
::
string
(
Tobj
::
attributes
::
name
[
T
::
value
]),
str
);
}
};
...
...
This diff is collapsed.
Click to expand it.
src/CSVWriter/CSVWriter_unit_tests.hpp
+
2
−
2
View file @
36f88797
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment