LADEL main
Sparse LDL factorization package with rank 1 and rowadd/rowdel updates
ladel_scale.h
Go to the documentation of this file.
1/**
2 * @file ladel_scale.h
3 * @author Ben Hermans
4 * @brief Routines to scale the columns and rows of a matrix, or the whole matrix itself.
5 * @details This also includes routines to compute the row-wise and column-wise infinity norms.
6 */
7
8#ifndef LADEL_SCALE_H
9#define LADEL_SCALE_H
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#include "ladel_types.h"
16
17/**
18 * Scales the columns of @a M with the scalars in @a S, that is @f$M(:,i) = S(i)*M(:,i)@f$.
19 *
20 * @param M Matrix
21 * @param S Array with scale factors for the columns
22 */
24 const ladel_double *S);
25
26/**
27 * Scales the rows of @a M with the scalars in @a S, that is @f$M(i,:) = S(i)*M(i,:)@f$.
28 *
29 * @param M Matrix
30 * @param S Array with scale factors for the rows
31 */
33 const ladel_double *S);
34
35/**
36 * Scales the elements of @a M with @a s, that is @f$M = sM@f$.
37 *
38 * @param M Matrix
39 * @param s Scaling factor
40 */
42 ladel_double s);
43
44/**
45 * Computes the column-wise infinity norms, that is @f$norms(i) = norm(M(:,i), inf)@f$.
46 *
47 * @param M Matrix
48 * @param norms Output vector of infinity norms
49 */
51 ladel_double *norms);
52
53/**
54 * Computes the row-wise infinity norms, that is @f$norms(i) = norm(M(i,:), inf)@f$.
55 *
56 * @param M Matrix
57 * @param norms Output vector of infinity norms
58 */
60 ladel_double *norms);
61
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif /*LADEL_SCALE_H*/
void ladel_scale_scalar(ladel_sparse_matrix *M, ladel_double s)
Scales the elements of M with s, that is .
Definition: ladel_scale.c:21
void ladel_infinity_norm_rows(ladel_sparse_matrix *M, ladel_double *norms)
Computes the row-wise infinity norms, that is .
Definition: ladel_scale.c:40
void ladel_infinity_norm_columns(ladel_sparse_matrix *M, ladel_double *norms)
Computes the column-wise infinity norms, that is .
Definition: ladel_scale.c:28
void ladel_scale_rows(ladel_sparse_matrix *M, const ladel_double *S)
Scales the rows of M with the scalars in S, that is .
Definition: ladel_scale.c:14
void ladel_scale_columns(ladel_sparse_matrix *M, const ladel_double *S)
Scales the columns of M with the scalars in S, that is .
Definition: ladel_scale.c:6
Structures and types used in LADEL routines.
double ladel_double
Type for floating point numbers (default: double)
Definition: ladel_types.h:20
Sparse matrix in compressed column storage.
Definition: ladel_types.h:35