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
f99a03fc
Commit
f99a03fc
authored
8 years ago
by
PICHON Gregoire
Browse files
Options
Downloads
Patches
Plain Diff
add alpha parameter for spmScal function
parent
6a169e28
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
+9
-6
9 additions, 6 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_scal.c
+6
-5
6 additions, 5 deletions
z_spm_scal.c
with
17 additions
and
13 deletions
spm.c
+
9
−
6
View file @
f99a03fc
...
@@ -1085,32 +1085,35 @@ spmCheckAxb( int nrhs,
...
@@ -1085,32 +1085,35 @@ spmCheckAxb( int nrhs,
*
*
* @ingroup pastix_spm
* @ingroup pastix_spm
*
*
* @brief Scal
a matrix with ||A||_2
* @brief Scal
the spm: A = alpha * A
*
*
*******************************************************************************
*******************************************************************************
*
*
* @param[in] alpha
* The scaling parameter.
*
* @param[in,out] spm
* @param[in,out] spm
* The sparse matrix to scal.
* The sparse matrix to scal.
*
*
*******************************************************************************/
*******************************************************************************/
void
void
spmScal
(
pastix_spm_t
*
spm
)
spmScal
(
const
pastix_complex64_t
alpha
,
pastix_spm_t
*
spm
)
{
{
switch
(
spm
->
flttype
)
switch
(
spm
->
flttype
)
{
{
case
PastixPattern
:
case
PastixPattern
:
break
;
break
;
case
PastixFloat
:
case
PastixFloat
:
s_spmScal
(
spm
);
s_spmScal
(
alpha
,
spm
);
break
;
break
;
case
PastixComplex32
:
case
PastixComplex32
:
c_spmScal
(
spm
);
c_spmScal
(
alpha
,
spm
);
break
;
break
;
case
PastixComplex64
:
case
PastixComplex64
:
z_spmScal
(
spm
);
z_spmScal
(
alpha
,
spm
);
break
;
break
;
case
PastixDouble
:
case
PastixDouble
:
default:
default:
d_spmScal
(
spm
);
d_spmScal
(
alpha
,
spm
);
}
}
}
}
This diff is collapsed.
Click to expand it.
spm.h
+
1
−
1
View file @
f99a03fc
...
@@ -150,7 +150,7 @@ void * spm2Dense( const pastix_spm_t *spm );
...
@@ -150,7 +150,7 @@ void * spm2Dense( const pastix_spm_t *spm );
pastix_int_t
spmFindBase
(
const
pastix_spm_t
*
spm
);
pastix_int_t
spmFindBase
(
const
pastix_spm_t
*
spm
);
double
spmNorm
(
int
ntype
,
const
pastix_spm_t
*
spm
);
double
spmNorm
(
int
ntype
,
const
pastix_spm_t
*
spm
);
int
spmMatVec
(
const
pastix_trans_t
trans
,
const
void
*
alpha
,
const
pastix_spm_t
*
spm
,
const
void
*
x
,
const
void
*
beta
,
void
*
y
);
int
spmMatVec
(
const
pastix_trans_t
trans
,
const
void
*
alpha
,
const
pastix_spm_t
*
spm
,
const
void
*
x
,
const
void
*
beta
,
void
*
y
);
void
spmScal
(
pastix_spm_t
*
spm
);
void
spmScal
(
const
pastix_complex64_t
alpha
,
pastix_spm_t
*
spm
);
int
spmSort
(
pastix_spm_t
*
spm
);
int
spmSort
(
pastix_spm_t
*
spm
);
pastix_int_t
spmMergeDuplicate
(
pastix_spm_t
*
spm
);
pastix_int_t
spmMergeDuplicate
(
pastix_spm_t
*
spm
);
...
...
This diff is collapsed.
Click to expand it.
z_spm.h
+
1
−
1
View file @
f99a03fc
...
@@ -66,7 +66,7 @@ void z_spmPrint( FILE *f, const pastix_spm_t *spm );
...
@@ -66,7 +66,7 @@ void z_spmPrint( FILE *f, const pastix_spm_t *spm );
pastix_spm_t
*
z_spmExpand
(
const
pastix_spm_t
*
spm
);
pastix_spm_t
*
z_spmExpand
(
const
pastix_spm_t
*
spm
);
void
z_spmDofExtend
(
pastix_spm_t
*
spm
);
void
z_spmDofExtend
(
pastix_spm_t
*
spm
);
void
z_spmScal
(
pastix_spm_t
*
spm
);
void
z_spmScal
(
const
pastix_complex64_t
alpha
,
pastix_spm_t
*
spm
);
#endif
/* _z_spm_H_ */
#endif
/* _z_spm_H_ */
This diff is collapsed.
Click to expand it.
z_spm_scal.c
+
6
−
5
View file @
f99a03fc
...
@@ -24,26 +24,27 @@
...
@@ -24,26 +24,27 @@
*
*
* @ingroup pastix_spm_internal
* @ingroup pastix_spm_internal
*
*
* z_spmScal - Scal the
matrix with ||A||_2
* z_spmScal - Scal the
spm: A = alpha * A
*
*
*******************************************************************************
*******************************************************************************
*
*
* @param[in] alpha
* The scaling parameter.
*
* @param[in,out] spm
* @param[in,out] spm
* The spm which needs to be scaled.
* The spm which needs to be scaled.
*
*
*******************************************************************************/
*******************************************************************************/
void
void
z_spmScal
(
pastix_spm_t
*
spm
)
z_spmScal
(
const
pastix_complex64_t
alpha
,
pastix_spm_t
*
spm
)
{
{
double
norm
;
pastix_int_t
nnz
,
i
;
pastix_int_t
nnz
,
i
;
pastix_complex64_t
*
values
;
pastix_complex64_t
*
values
;
nnz
=
spm
->
nnz
;
nnz
=
spm
->
nnz
;
values
=
spm
->
values
;
values
=
spm
->
values
;
norm
=
z_spmNorm
(
PastixFrobeniusNorm
,
spm
);
for
(
i
=
0
;
i
<
nnz
;
i
++
){
for
(
i
=
0
;
i
<
nnz
;
i
++
){
values
[
i
]
/
=
norm
;
values
[
i
]
*
=
alpha
;
}
}
}
}
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