SpM Handbook 1.2.4
Loading...
Searching...
No Matches
s_spm_scal.c
Go to the documentation of this file.
1/**
2 * @file s_spm_scal.c
3 *
4 * SParse Matrix package scaling routine.
5 *
6 * @copyright 2016-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
7 * Univ. Bordeaux. All rights reserved.
8 *
9 * @version 1.2.4
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-05-29
17 * @generated from /builds/2mk6rsew/0/fpruvost/spm/src/z_spm_scal.c, normal z -> s, Fri Nov 29 11:34:30 2024
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 *******************************************************************************/
38void
39s_spmScal( const float alpha,
40 spmatrix_t *spm )
41{
42 spm_int_t nnzexp, i;
43 float *values;
44
45 nnzexp = spm->nnzexp;
46 values = spm->values;
47
48 for (i=0; i<nnzexp; i++){
49 values[i] *= alpha;
50 }
51}
void s_spmScal(const float alpha, spmatrix_t *spm)
Scal the spm: A = alpha * A.
Definition s_spm_scal.c:39
void * values
Definition spm.h:92
spm_int_t nnzexp
Definition spm.h:80
int spm_int_t
The main integer datatype used in spm arrays.
Definition datatypes.h:70
The sparse matrix data structure.
Definition spm.h:64