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
7988298e
Commit
7988298e
authored
Dec 23, 2015
by
Pietro Incardona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and small changes
parent
c54eca6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
src/CSVWriter.hpp
src/CSVWriter.hpp
+6
-4
src/GraphMLWriter_unit_tests.hpp
src/GraphMLWriter_unit_tests.hpp
+4
-1
No files found.
src/CSVWriter.hpp
View file @
7988298e
...
...
@@ -181,9 +181,10 @@ class CSVWriter
*
* \param v_pos vector that contain the positional information
* \param v_prp vector that contain the property information
* \param offset from where to start
*
*/
std
::
string
get_csv_data
(
v_pos
&
vp
,
v_prp
&
vpr
)
std
::
string
get_csv_data
(
v_pos
&
vp
,
v_prp
&
vpr
,
size_t
offset
)
{
std
::
stringstream
str
;
...
...
@@ -195,7 +196,7 @@ class CSVWriter
}
// Write the data
for
(
size_t
i
=
0
;
i
<
vp
.
size
()
;
i
++
)
for
(
size_t
i
=
offset
;
i
<
vp
.
size
()
;
i
++
)
{
for
(
size_t
j
=
0
;
j
<
v_pos
::
value_type
::
dims
;
j
++
)
{
...
...
@@ -228,10 +229,11 @@ public:
* \param file path where to write
* \param v_pos positional vector
* \param v_prp properties vector
* \param offset from where to start to write
*
*/
bool
write
(
std
::
string
file
,
v_pos
&
v
,
v_prp
&
prp
)
bool
write
(
std
::
string
file
,
v_pos
&
v
,
v_prp
&
prp
,
size_t
offset
=
0
)
{
// Header for csv (colums name)
std
::
string
csv_header
;
...
...
@@ -242,7 +244,7 @@ public:
csv_header
=
get_csv_colums
();
// For each property in the vertex type produce a point data
point_data
=
get_csv_data
(
v
,
prp
);
point_data
=
get_csv_data
(
v
,
prp
,
offset
);
// write the file
std
::
ofstream
ofs
(
file
);
...
...
src/GraphMLWriter_unit_tests.hpp
View file @
7988298e
...
...
@@ -131,7 +131,10 @@ BOOST_AUTO_TEST_CASE( graphml_writer_use)
// Box
Box
<
3
,
float
>
box
({
0.0
,
0.0
,
0.0
},{
1.0
,
1.0
,
1.0
});
Graph_CSR
<
ne_cp
,
ne_cp
>
g_csr
=
g_factory
.
construct
<
5
,
float
,
2
,
ne_cp
::
x
,
ne_cp
::
y
,
ne_cp
::
z
>
(
sz
,
box
);
// Boundary conditions, non periodic
size_t
bc
[]
=
{
NON_PERIODIC
,
NON_PERIODIC
,
NON_PERIODIC
};
Graph_CSR
<
ne_cp
,
ne_cp
>
g_csr
=
g_factory
.
construct
<
5
,
float
,
2
,
ne_cp
::
x
,
ne_cp
::
y
,
ne_cp
::
z
>
(
sz
,
box
,
bc
);
// Create a graph ML
GraphMLWriter
<
Graph_CSR
<
ne_cp
,
ne_cp
>>
gw
(
g_csr
);
...
...
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