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
8390695a
Commit
8390695a
authored
7 years ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
Add epsilon to the check function to test accordingly to the elvel of precision wanted
parent
67a282f2
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
spm.c
+8
-4
8 additions, 4 deletions
spm.c
spm.h
+1
-1
1 addition, 1 deletion
spm.h
z_spm.h
+1
-1
1 addition, 1 deletion
z_spm.h
z_spm_genrhs.c
+11
-5
11 additions, 5 deletions
z_spm_genrhs.c
with
21 additions
and
11 deletions
spm.c
+
8
−
4
View file @
8390695a
...
@@ -1205,6 +1205,10 @@ spmGenRHS( pastix_rhstype_t type, pastix_int_t nrhs,
...
@@ -1205,6 +1205,10 @@ spmGenRHS( pastix_rhstype_t type, pastix_int_t nrhs,
*
*
*******************************************************************************
*******************************************************************************
*
*
* @param[in] eps
* The epsilon threshold used for the refinement step. -1. to use the
* machine precision.
*
* @param[in] nrhs
* @param[in] nrhs
* Defines the number of right hand side that must be generated.
* Defines the number of right hand side that must be generated.
*
*
...
@@ -1243,14 +1247,14 @@ spmGenRHS( pastix_rhstype_t type, pastix_int_t nrhs,
...
@@ -1243,14 +1247,14 @@ spmGenRHS( pastix_rhstype_t type, pastix_int_t nrhs,
*
*
*******************************************************************************/
*******************************************************************************/
int
int
spmCheckAxb
(
pastix_int_t
nrhs
,
spmCheckAxb
(
double
eps
,
pastix_int_t
nrhs
,
const
pastix_spm_t
*
spm
,
const
pastix_spm_t
*
spm
,
void
*
x0
,
pastix_int_t
ldx0
,
void
*
x0
,
pastix_int_t
ldx0
,
void
*
b
,
pastix_int_t
ldb
,
void
*
b
,
pastix_int_t
ldb
,
const
void
*
x
,
pastix_int_t
ldx
)
const
void
*
x
,
pastix_int_t
ldx
)
{
{
static
int
(
*
ptrfunc
[
4
])(
int
,
const
pastix_spm_t
*
,
static
int
(
*
ptrfunc
[
4
])(
double
,
int
,
const
pastix_spm_t
*
,
void
*
,
int
,
void
*
,
int
,
const
void
*
,
int
)
=
void
*
,
int
,
void
*
,
int
,
const
void
*
,
int
)
=
{
{
s_spmCheckAxb
,
d_spmCheckAxb
,
c_spmCheckAxb
,
z_spmCheckAxb
s_spmCheckAxb
,
d_spmCheckAxb
,
c_spmCheckAxb
,
z_spmCheckAxb
};
};
...
@@ -1260,7 +1264,7 @@ spmCheckAxb( pastix_int_t nrhs,
...
@@ -1260,7 +1264,7 @@ spmCheckAxb( pastix_int_t nrhs,
return
PASTIX_ERR_BADPARAMETER
;
return
PASTIX_ERR_BADPARAMETER
;
}
}
else
{
else
{
return
ptrfunc
[
id
](
nrhs
,
spm
,
x0
,
ldx0
,
b
,
ldb
,
x
,
ldx
);
return
ptrfunc
[
id
](
eps
,
nrhs
,
spm
,
x0
,
ldx0
,
b
,
ldb
,
x
,
ldx
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
spm.h
+
1
−
1
View file @
8390695a
...
@@ -115,7 +115,7 @@ pastix_spm_t *spmCheckAndCorrect( pastix_spm_t *spm );
...
@@ -115,7 +115,7 @@ pastix_spm_t *spmCheckAndCorrect( pastix_spm_t *spm );
* @{
* @{
*/
*/
int
spmGenRHS
(
pastix_rhstype_t
type
,
pastix_int_t
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x
,
pastix_int_t
ldx
,
void
*
b
,
pastix_int_t
ldb
);
int
spmGenRHS
(
pastix_rhstype_t
type
,
pastix_int_t
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x
,
pastix_int_t
ldx
,
void
*
b
,
pastix_int_t
ldb
);
int
spmCheckAxb
(
pastix_int_t
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x0
,
pastix_int_t
ldx0
,
void
*
b
,
pastix_int_t
ldb
,
const
void
*
x
,
pastix_int_t
ldx
);
int
spmCheckAxb
(
double
eps
,
pastix_int_t
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x0
,
pastix_int_t
ldx0
,
void
*
b
,
pastix_int_t
ldb
,
const
void
*
x
,
pastix_int_t
ldx
);
/**
/**
* @}
* @}
...
...
This diff is collapsed.
Click to expand it.
z_spm.h
+
1
−
1
View file @
8390695a
...
@@ -56,7 +56,7 @@ pastix_int_t z_spmMergeDuplicate( pastix_spm_t *spm );
...
@@ -56,7 +56,7 @@ pastix_int_t z_spmMergeDuplicate( pastix_spm_t *spm );
pastix_int_t
z_spmSymmetrize
(
pastix_spm_t
*
spm
);
pastix_int_t
z_spmSymmetrize
(
pastix_spm_t
*
spm
);
int
z_spmGenRHS
(
pastix_rhstype_t
type
,
int
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x
,
int
ldx
,
void
*
b
,
int
ldb
);
int
z_spmGenRHS
(
pastix_rhstype_t
type
,
int
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x
,
int
ldx
,
void
*
b
,
int
ldb
);
int
z_spmCheckAxb
(
int
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x0
,
int
ldx0
,
void
*
b
,
int
ldb
,
const
void
*
x
,
int
ldx
);
int
z_spmCheckAxb
(
pastix_fixdbl_t
eps
,
int
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x0
,
int
ldx0
,
void
*
b
,
int
ldb
,
const
void
*
x
,
int
ldx
);
/**
/**
* Output routines
* Output routines
...
...
This diff is collapsed.
Click to expand it.
z_spm_genrhs.c
+
11
−
5
View file @
8390695a
...
@@ -321,6 +321,10 @@ z_spmGenRHS( pastix_rhstype_t type, int nrhs,
...
@@ -321,6 +321,10 @@ z_spmGenRHS( pastix_rhstype_t type, int nrhs,
*
*
*******************************************************************************
*******************************************************************************
*
*
* @param[in] eps
* The epsilon threshold used for the refinement step. -1. to use the
* machine precision.
*
* @param[in] nrhs
* @param[in] nrhs
* Defines the number of right hand side that must be generated.
* Defines the number of right hand side that must be generated.
*
*
...
@@ -358,7 +362,7 @@ z_spmGenRHS( pastix_rhstype_t type, int nrhs,
...
@@ -358,7 +362,7 @@ z_spmGenRHS( pastix_rhstype_t type, int nrhs,
*
*
*******************************************************************************/
*******************************************************************************/
int
int
z_spmCheckAxb
(
int
nrhs
,
z_spmCheckAxb
(
pastix_fixdbl_t
eps
,
int
nrhs
,
const
pastix_spm_t
*
spm
,
const
pastix_spm_t
*
spm
,
void
*
x0
,
int
ldx0
,
void
*
x0
,
int
ldx0
,
void
*
b
,
int
ldb
,
void
*
b
,
int
ldb
,
...
@@ -368,14 +372,16 @@ z_spmCheckAxb( int nrhs,
...
@@ -368,14 +372,16 @@ z_spmCheckAxb( int nrhs,
pastix_complex64_t
*
zx0
=
(
pastix_complex64_t
*
)
x0
;
pastix_complex64_t
*
zx0
=
(
pastix_complex64_t
*
)
x0
;
pastix_complex64_t
*
zb
=
(
pastix_complex64_t
*
)
b
;
pastix_complex64_t
*
zb
=
(
pastix_complex64_t
*
)
b
;
double
normA
,
normB
,
normX
,
normX0
,
normR
;
double
normA
,
normB
,
normX
,
normX0
,
normR
;
double
backward
,
forward
,
eps
;
double
backward
,
forward
;
int
failure
=
0
;
int
failure
=
0
;
int
i
;
int
i
;
assert
(
spm
->
nexp
==
spm
->
n
);
assert
(
spm
->
nexp
==
spm
->
n
);
assert
(
spm
->
dof
==
1
);
assert
(
spm
->
dof
==
1
);
eps
=
LAPACKE_dlamch
(
'e'
);
if
(
eps
==
-
1
.
)
{
eps
=
LAPACKE_dlamch
(
'e'
);
}
/**
/**
* Compute the starting norms
* Compute the starting norms
...
@@ -415,7 +421,7 @@ z_spmCheckAxb( int nrhs,
...
@@ -415,7 +421,7 @@ z_spmCheckAxb( int nrhs,
normR
=
(
nr
>
normR
)
?
nr
:
normR
;
normR
=
(
nr
>
normR
)
?
nr
:
normR
;
backward
=
(
back
>
backward
)
?
back
:
backward
;
backward
=
(
back
>
backward
)
?
back
:
backward
;
fail
=
isnan
(
nr
)
||
isinf
(
nr
)
||
isnan
(
back
)
||
isinf
(
back
)
||
(
back
>
1.e
3
);
fail
=
isnan
(
nr
)
||
isinf
(
nr
)
||
isnan
(
back
)
||
isinf
(
back
)
||
(
back
>
1.e
2
);
if
(
fail
)
{
if
(
fail
)
{
printf
(
" || b_%d - A x_%d ||_1 %e
\n
"
printf
(
" || b_%d - A x_%d ||_1 %e
\n
"
" || b_%d - A x_%d ||_1 / (||A||_1 * ||x_%d||_oo * eps) %e (%s)
\n
"
,
" || b_%d - A x_%d ||_1 / (||A||_1 * ||x_%d||_oo * eps) %e (%s)
\n
"
,
...
@@ -459,7 +465,7 @@ z_spmCheckAxb( int nrhs,
...
@@ -459,7 +465,7 @@ z_spmCheckAxb( int nrhs,
normR
=
(
nr
>
normR
)
?
nr
:
normR
;
normR
=
(
nr
>
normR
)
?
nr
:
normR
;
forward
=
(
forw
>
forward
)
?
forw
:
forward
;
forward
=
(
forw
>
forward
)
?
forw
:
forward
;
fail
=
isnan
(
nx
)
||
isinf
(
nx
)
||
isnan
(
forw
)
||
isinf
(
forw
)
||
(
forw
>
1.e
3
);
fail
=
isnan
(
nx
)
||
isinf
(
nx
)
||
isnan
(
forw
)
||
isinf
(
forw
)
||
(
forw
>
1.e
2
);
if
(
fail
)
{
if
(
fail
)
{
printf
(
" || x0_%d ||_oo %e
\n
"
printf
(
" || x0_%d ||_oo %e
\n
"
" || x0_%d - x_%d ||_oo / (||x0_%d||_oo * eps) %e (%s)
\n
"
,
" || x0_%d - x_%d ||_oo / (||x0_%d||_oo * eps) %e (%s)
\n
"
,
...
...
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