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
16a181b1
Commit
16a181b1
authored
7 years ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
Add teh matrix-matrix wrapper in spm
parent
e61b2afc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
spm.c
+95
-0
95 additions, 0 deletions
spm.c
spm.h
+4
-0
4 additions, 0 deletions
spm.h
with
99 additions
and
0 deletions
spm.c
+
95
−
0
View file @
16a181b1
...
...
@@ -1035,6 +1035,101 @@ spmMatVec( pastix_trans_t trans,
return
rc
;
}
/**
*******************************************************************************
*
* @brief Compute a matrix-matrix product.
*
* y = alpha * op(A) * B + beta * C
*
* where op(A) is one of:
*
* op( A ) = A or op( A ) = A' or op( A ) = conjg( A' )
*
* alpha and beta are scalars, and x and y are vectors.
*
*******************************************************************************
*
* @param[in] trans
* Specifies whether the matrix spm is transposed, not transposed or conjugate transposed:
* - PastixTrans
* - PastixNoTrans
* - PastixConjTrans
*
* @param[in] n
* The number of columns of the matrices B and C.
*
* @param[in] alpha
* alpha specifies the scalar alpha.
*
* @param[in] A
* The square sparse matrix A
*
* @param[in] B
* The matrix B of size ldb-by-n
*
* @param[in] ldb
* The leading dimension of the matrix B. ldb >= A->n
*
* @param[in] beta
* beta specifies the scalar beta.
*
* @param[inout] C
* The matrix C of size ldc-by-n
*
* @param[in] ldc
* The leading dimension of the matrix C. ldc >= A->n
*
*******************************************************************************
*
* @retval PASTIX_SUCCESS if the y vector has been computed successfully,
* @retval PASTIX_ERR_BADPARAMETER otherwise.
*
*******************************************************************************/
int
spmMatMat
(
pastix_trans_t
trans
,
pastix_int_t
n
,
const
void
*
alpha
,
const
pastix_spm_t
*
A
,
const
void
*
B
,
pastix_int_t
ldb
,
const
void
*
beta
,
void
*
C
,
pastix_int_t
ldc
)
{
pastix_spm_t
*
espm
=
(
pastix_spm_t
*
)
A
;
int
rc
=
PASTIX_SUCCESS
;
if
(
A
->
fmttype
!=
PastixCSC
)
{
return
PASTIX_ERR_BADPARAMETER
;
}
if
(
A
->
dof
!=
1
)
{
espm
=
spmExpand
(
A
);
}
switch
(
A
->
flttype
)
{
case
PastixFloat
:
rc
=
s_spmCSCMat
(
trans
,
alpha
,
espm
,
B
,
beta
,
C
);
break
;
case
PastixComplex32
:
rc
=
c_spmCSCMat
(
trans
,
alpha
,
espm
,
B
,
beta
,
C
);
break
;
case
PastixComplex64
:
rc
=
z_spmCSCMat
(
trans
,
alpha
,
espm
,
B
,
beta
,
C
);
break
;
case
PastixDouble
:
default:
rc
=
d_spmCSCMat
(
trans
,
alpha
,
espm
,
B
,
beta
,
C
);
break
;
}
if
(
A
!=
espm
)
{
spmExit
(
espm
);
free
(
espm
);
}
return
rc
;
}
/**
*******************************************************************************
*
...
...
This diff is collapsed.
Click to expand it.
spm.h
+
4
−
0
View file @
16a181b1
...
...
@@ -92,6 +92,10 @@ void spmGenFakeValues( pastix_spm_t *spm );
*/
double
spmNorm
(
pastix_normtype_t
ntype
,
const
pastix_spm_t
*
spm
);
int
spmMatVec
(
pastix_trans_t
trans
,
const
void
*
alpha
,
const
pastix_spm_t
*
spm
,
const
void
*
x
,
const
void
*
beta
,
void
*
y
);
int
spmMatMat
(
pastix_trans_t
trans
,
pastix_int_t
n
,
const
void
*
alpha
,
const
pastix_spm_t
*
A
,
const
void
*
B
,
pastix_int_t
ldb
,
const
void
*
beta
,
void
*
C
,
pastix_int_t
ldc
);
void
spmScalMatrix
(
double
alpha
,
pastix_spm_t
*
spm
);
void
spmScalVector
(
double
alpha
,
pastix_spm_t
*
spm
,
void
*
x
);
void
spmScalRHS
(
pastix_coeftype_t
flt
,
double
alpha
,
pastix_int_t
m
,
pastix_int_t
n
,
void
*
A
,
pastix_int_t
lda
);
...
...
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