SpM Handbook
1.3.0
Loading...
Searching...
No Matches
d_spm_scal.c
Go to the documentation of this file.
1
/**
2
* @file d_spm_scal.c
3
*
4
* SParse Matrix package scaling routine.
5
*
6
* @copyright 2016-2026 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
7
* Univ. Bordeaux. All rights reserved.
8
*
9
* @version 1.3.0
10
* @author Mathieu Faverge
11
* @author Pierre Ramet
12
* @author Matias Hastaran
13
* @author Tony Delarue
14
* @author Alycia Lisito
15
* @author Gregoire Pichon
16
* @date 2024-07-09
17
* @generated from /builds/fpruvost/spm/src/z_spm_scal.c, normal z -> d, Fri Oct 23 13:04:59 2026
18
*
19
**/
20
#include "common.h"
21
22
/**
23
*******************************************************************************
24
*
25
* @ingroup spm_dev_scal
26
*
27
* @brief Scal the spm: A = alpha * A
28
*
29
*******************************************************************************
30
*
31
* @param[in] alpha
32
* The scaling parameter.
33
*
34
* @param[inout] spm
35
* The spm which needs to be scaled.
36
*
37
*******************************************************************************/
38
void
39
d_spmScal
(
const
double
alpha,
40
spmatrix_t
*spm )
41
{
42
spm_int_t
nnzexp, i;
43
double
*values;
44
45
nnzexp = spm->
nnzexp
;
46
values = spm->
values
;
47
48
for
(i=0; i<nnzexp; i++){
49
values[i] *= alpha;
50
}
51
}
d_spmScal
void d_spmScal(const double alpha, spmatrix_t *spm)
Scal the spm: A = alpha * A.
Definition
d_spm_scal.c:39
spmatrix_s::values
void * values
Definition
spm.h:93
spmatrix_s::nnzexp
spm_int_t nnzexp
Definition
spm.h:81
spmatrix_t
struct spmatrix_s spmatrix_t
The sparse matrix data structure.
spm_int_t
int spm_int_t
The main integer datatype used in spm arrays.
Definition
datatypes.h:70
build
src
d_spm_scal.c
Generated by
1.15.0