Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sonets
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alois SCHLOEGL
sonets
Commits
2528910d
Commit
2528910d
authored
Apr 29, 2016
by
Alois SCHLOEGL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sparse output format for MatrixMarket coordinate binary added
parent
c595e316
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
makefile
makefile
+9
-0
run_secorder.cpp
run_secorder.cpp
+16
-1
No files found.
makefile
View file @
2528910d
...
...
@@ -4,6 +4,15 @@ LIBS = -lgsl -lgslcblas -lgomp
CFLAGS
=
-Wall
${C_OPTIMIZE_SWITCH}
-fopenmp
## Define sparse output format
# SPARSE_MM clear text ascii format
# SPARSE_COO coordinate format, binary
# SPARSE_CSR compressed row storage, most space efficient, default
#CFLAGS += -DSPARSE_MM
#CFLAGS += -DSPARSE_COO
#CFLAGS += -DSPARSE_CSR
run_secorder
:
run_secorder.o secorder_rec_1p.o calc_sqrtcov_rec_1p.o calc_rhos.o calc_stats_1p.o
${CC}
run_secorder.o secorder_rec_1p.o calc_sqrtcov_rec_1p.o calc_rhos.o calc_stats_1p.o
-o
$@
${LIBS}
...
...
run_secorder.cpp
View file @
2528910d
...
...
@@ -141,7 +141,7 @@ int main(int argc, char *argv[]) {
cerr
<<
"Couldn't open outfile file "
<<
FN
<<
"
\n
"
;
exit
(
-
1
);
}
#if
0 //
defined(SPARSE_COO)
#if defined(SPARSE_COO)
fwrite
(
"SPARSE
\x00\x00
"
,
8
,
1
,
fhnd
);
size_t
nr
,
nc
;
nr
=
nc
=
N_nodes
;
...
...
@@ -158,6 +158,21 @@ int main(int argc, char *argv[]) {
}
}
}
#elif defined(SPARSE_MM) // MatrixMarket format
fprintf
(
fhnd
,
"%%MatrixMarket matrix coordinate binary general
\n
"
);
fprintf
(
fhnd
,
"%%
\n
%% see also http://math.nist.gov/MatrixMarket/formats.html#MMformat
\n
%%
\n
"
);
size_t
nr
,
nc
;
nr
=
nc
=
N_nodes
;
fprintf
(
fhnd
,
"%lu
\t
%lu
\t
%lu
\n
"
,
nr
,
nc
,
nnz
);
for
(
int
i
=
0
;
i
<
N_nodes
;
i
++
)
{
for
(
int
j
=
0
;
j
<
N_nodes
;
j
++
)
{
int
t
=
gsl_matrix_float_get
(
W
,
i
,
j
)
>
1.0
;
gsl_matrix_float_set
(
W
,
i
,
j
,(
float
)
t
);
if
(
t
)
{
fprintf
(
fhnd
,
"%lu
\t
%lu
\n
"
,
i
,
j
);
}
}
}
#elif 1 //defined(SPARSE_CSR)
fwrite
(
"SPARSE
\x00\x02
"
,
8
,
1
,
fhnd
);
size_t
nr
,
nc
;
...
...
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