Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
spm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
solverstack
spm
Commits
eb6383b5
Commit
eb6383b5
authored
7 years ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
Add FILE by default if NULL given to ease the fortran wrapper
parent
bbdb6d6a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
spm.c
+4
-3
4 additions, 3 deletions
spm.c
spm_io.c
+23
-2
23 additions, 2 deletions
spm_io.c
with
27 additions
and
5 deletions
spm.c
+
4
−
3
View file @
eb6383b5
...
...
@@ -999,12 +999,13 @@ spmPrintInfo( const pastix_spm_t* spm, FILE *stream )
* @param[in] spm
* The sparse matrix to print.
*
* @param[in]
f
* File to print the spm matrix.
* @param[in]
stream
* File to print the spm matrix.
stdout, if stream == NULL.
*
*******************************************************************************/
void
spmPrint
(
const
pastix_spm_t
*
spm
,
FILE
*
stream
)
spmPrint
(
const
pastix_spm_t
*
spm
,
FILE
*
stream
)
{
if
(
stream
==
NULL
)
{
stream
=
stdout
;
...
...
This diff is collapsed.
Click to expand it.
spm_io.c
+
23
−
2
View file @
eb6383b5
...
...
@@ -451,7 +451,8 @@ readArrayOfFloat( FILE *stream,
* On exit, the spm filled with the information read in the file.
*
* @param[in] infile
* The opened file in which the spm is stored.
* The opened file in which the spm is stored. If infile == NULL,
* matrix.spm is opened.
*
*******************************************************************************
*
...
...
@@ -466,6 +467,12 @@ spmLoad( pastix_spm_t *spm,
pastix_int_t
colsize
=
0
,
rowsize
=
0
;
char
line
[
256
],
*
test
;
int
rc
=
PASTIX_SUCCESS
;
int
local_stream
=
0
;
if
(
infile
==
NULL
)
{
PASTIX_FOPEN
(
infile
,
"matrix.spm"
,
"r"
);
local_stream
=
1
;
}
/*
* Skip comments
...
...
@@ -599,6 +606,10 @@ spmLoad( pastix_spm_t *spm,
break
;
}
if
(
local_stream
)
{
fclose
(
infile
);
}
return
rc
;
}
...
...
@@ -781,7 +792,8 @@ writeArrayOfFloat( FILE *outfile,
* The sparse matrix to write into the file.
*
* @param[in] outfile
* The opened file in which to store the spm.
* The opened file in which to store the spm. If outfile == NULL, data
* is saved into matrix.spm file.
*
********************************************************************************
*
...
...
@@ -793,6 +805,12 @@ spmSave( pastix_spm_t *spm,
FILE
*
outfile
)
{
pastix_int_t
i
,
colsize
,
rowsize
;
int
local_stream
=
0
;
if
(
outfile
==
NULL
)
{
PASTIX_FOPEN
(
outfile
,
"matrix.spm"
,
"w"
);
local_stream
=
1
;
}
/*
* Write header
...
...
@@ -886,5 +904,8 @@ spmSave( pastix_spm_t *spm,
break
;
}
if
(
local_stream
)
{
fclose
(
outfile
);
}
return
PASTIX_SUCCESS
;
}
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