LADEL main
Sparse LDL factorization package with rank 1 and rowadd/rowdel updates
ladel_add.h
Go to the documentation of this file.
1/**
2 * @file ladel_add.h
3 * @author Ben Hermans
4 * @brief Routines to add matrices.
5 * @details The add_matrices and add_matrices_pattern routines compute the scaled addition
6 * of the matrices provided or of the patterns of the matrices respectively.
7 */
8
9#ifndef LADEL_ADD_H
10#define LADEL_ADD_H
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#include "ladel_types.h"
17
18/**
19 * Returns a sparse matrix @f$C = \alpha A + \beta B@f$.
20 *
21 * @param alpha Scaling for the first matrix
22 * @param A The first matrix
23 * @param beta Scaling for the second matrix
24 * @param B The second matrix
25 * @param work LADEL workspace
26 * @return @f$C = \alpha A + \beta B@f$
27 */
29 const ladel_sparse_matrix *A,
30 ladel_double beta,
31 const ladel_sparse_matrix *B,
32 ladel_work *work);
33
34/**
35 * Returns a pattern matrix whose pattern includes the patterns of @a A and @a B.
36 *
37 * @param A The first matrix
38 * @param B The second matrix
39 * @param work LADEL workspace
40 * @return A sparse matrix whose pattern contains that of @a A and @a B
41 */
43 const ladel_sparse_matrix *B,
44 ladel_work *work);
45
46/**
47 * Returns a sparse matrix @f$C = \alpha A + \beta B@f$ if @a values==TRUE, or a pattern matrix
48 * that includes the patterns of @a A and @a B if @a values==FALSE.
49 *
50 * @param alpha Scaling for the first matrix
51 * @param A The first matrix
52 * @param beta Scaling for the second matrix
53 * @param B The second matrix
54 * @param values Flag to choose between values and just pattern
55 * @param work LADEL workspace
56 * @return @f$C = \alpha A + \beta B@f$ or the sum of the patterns
57 */
59 const ladel_sparse_matrix *A,
60 ladel_double beta,
61 const ladel_sparse_matrix *B,
62 ladel_int values,
63 ladel_work *work);
64
65#ifdef __cplusplus
66}
67#endif
68
69#endif /* LADEL_ADD_H */
ladel_sparse_matrix * ladel_add_matrices_advanced(ladel_double alpha, const ladel_sparse_matrix *A, ladel_double beta, const ladel_sparse_matrix *B, ladel_int values, ladel_work *work)
Returns a sparse matrix if values==TRUE, or a pattern matrix that includes the patterns of A and B i...
Definition: ladel_add.c:16
ladel_sparse_matrix * ladel_add_matrices_pattern(const ladel_sparse_matrix *A, const ladel_sparse_matrix *B, ladel_work *work)
Returns a pattern matrix whose pattern includes the patterns of A and B.
Definition: ladel_add.c:11
ladel_sparse_matrix * ladel_add_matrices(ladel_double alpha, const ladel_sparse_matrix *A, ladel_double beta, const ladel_sparse_matrix *B, ladel_work *work)
Returns a sparse matrix .
Definition: ladel_add.c:6
Structures and types used in LADEL routines.
int64_t ladel_int
Type for integer numbers (default: int64_t)
Definition: ladel_types.h:24
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
Workspace required for various routines in LADEL.
Definition: ladel_types.h:109