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
b89aec1c
Commit
b89aec1c
authored
7 years ago
by
PICHON Gregoire
Browse files
Options
Downloads
Patches
Plain Diff
add example with compression and remove useless scaling without compression
parent
63f5c9ad
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
+44
-1
44 additions, 1 deletion
spm.c
spm.h
+2
-1
2 additions, 1 deletion
spm.h
with
46 additions
and
2 deletions
spm.c
+
44
−
1
View file @
b89aec1c
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
#include
"s_spm.h"
#include
"s_spm.h"
#include
"p_spm.h"
#include
"p_spm.h"
#include
<cblas.h>
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
static
int
(
*
conversionTable
[
3
][
3
][
6
])(
pastix_spm_t
*
)
=
{
static
int
(
*
conversionTable
[
3
][
3
][
6
])(
pastix_spm_t
*
)
=
{
...
@@ -1179,7 +1181,7 @@ spmCheckAxb( int nrhs,
...
@@ -1179,7 +1181,7 @@ spmCheckAxb( int nrhs,
*
*
*******************************************************************************/
*******************************************************************************/
void
void
spmScal
(
const
pastix_complex64_t
alpha
,
pastix_spm_t
*
spm
)
spmScal
Matrix
(
const
pastix_complex64_t
alpha
,
pastix_spm_t
*
spm
)
{
{
switch
(
spm
->
flttype
)
switch
(
spm
->
flttype
)
{
{
...
@@ -1200,6 +1202,47 @@ spmScal(const pastix_complex64_t alpha, pastix_spm_t* spm)
...
@@ -1200,6 +1202,47 @@ spmScal(const pastix_complex64_t alpha, pastix_spm_t* spm)
}
}
}
}
/**
*******************************************************************************
*
* @brief Scale a vector according to the spm type.
*
* x = alpha * x
*
*******************************************************************************
*
* @param[in] alpha
* The scaling parameter.
*
* @param[in] spm
* The spm structure to know the type of the vector.
*
* @param[inout] x
* The vector to scal.
*
*******************************************************************************/
void
spmScalVector
(
const
double
alpha
,
pastix_spm_t
*
spm
,
void
*
x
)
{
switch
(
spm
->
flttype
)
{
case
PastixPattern
:
break
;
case
PastixFloat
:
cblas_sscal
(
spm
->
n
,
alpha
,
x
,
1
);
break
;
case
PastixComplex32
:
cblas_csscal
(
spm
->
n
,
alpha
,
x
,
1
);
break
;
case
PastixComplex64
:
cblas_zdscal
(
spm
->
n
,
alpha
,
x
,
1
);
break
;
case
PastixDouble
:
default:
cblas_dscal
(
spm
->
n
,
alpha
,
x
,
1
);
}
}
/**
/**
* @}
* @}
*/
*/
This diff is collapsed.
Click to expand it.
spm.h
+
2
−
1
View file @
b89aec1c
...
@@ -90,7 +90,8 @@ void spmUpdateComputedFields( pastix_spm_t *spm );
...
@@ -90,7 +90,8 @@ void spmUpdateComputedFields( pastix_spm_t *spm );
*/
*/
double
spmNorm
(
pastix_normtype_t
ntype
,
const
pastix_spm_t
*
spm
);
double
spmNorm
(
pastix_normtype_t
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
(
const
pastix_complex64_t
alpha
,
pastix_spm_t
*
spm
);
void
spmScalMatrix
(
const
pastix_complex64_t
alpha
,
pastix_spm_t
*
spm
);
void
spmScalVector
(
const
double
alpha
,
pastix_spm_t
*
spm
,
void
*
x
);
/**
/**
* @}
* @}
...
...
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