LADEL main
Sparse LDL factorization package with rank 1 and rowadd/rowdel updates
ladel_permutation.h
Go to the documentation of this file.
1/**
2 * @file ladel_permutation.h
3 * @author Ben Hermans
4 * @brief Routines to permute vectors and matrices.
5 */
6
7#ifndef LADEL_PERMUTATION_H
8#define LADEL_PERMUTATION_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include "ladel_types.h"
15
16/**
17 * Compute y, where @f$y[i] = x[p[i]]@f$.
18 *
19 * @param x Input vector
20 * @param p Permutation vector
21 * @param size Size of the vectors
22 * @param y Output vector
23 */
25 ladel_int *p,
26 ladel_int size,
27 ladel_double *y);
28
29/**
30 * Compute y, where @f$y[pinv[i]] = x[i]@f$.
31 *
32 * @param x Input vector
33 * @param pinv (Inverse) permutation vector
34 * @param size Size of the vectors
35 * @param y Output vector
36 */
38 ladel_int *pinv,
39 ladel_int size,
40 ladel_double *y);
41
42/**
43 * Invert a permutation vector, such that @f$pinv[p[i]] = i@f$.
44 *
45 * @param p Permutation vector
46 * @param pinv Output inverse permutation vector
47 * @param size Size of the vectors
48 */
50 ladel_int *pinv,
51 ladel_int size);
52
53/**
54 * Compute @f$Mpp = M(p,p)@f$.
55 *
56 * @param M Input matrix
57 * @param p Permutation vector
58 * @param Mpp Output permuted matrix
59 * @param work LADEL workspace
60 */
62 ladel_int *p,
64 ladel_work *work);
65
66/**
67 * Permute @a x(:,col) in place, such that on output @f$x(:,col) = x(p,col)@f$.
68 *
69 * @param x Input sparse vector
70 * @param col The column of x to permute
71 * @param p Permutation vector
72 * @param work LADEL workspace
73 */
75 ladel_int col,
76 ladel_int *p,
77 ladel_work *work);
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif /*LADEL_PERMUTATION_H*/
void ladel_permute_vector(ladel_double *x, ladel_int *p, ladel_int size, ladel_double *y)
Compute y, where .
void ladel_inverse_permute_vector(ladel_double *x, ladel_int *pinv, ladel_int size, ladel_double *y)
Compute y, where .
void ladel_permute_symmetric_matrix(ladel_sparse_matrix *M, ladel_int *p, ladel_sparse_matrix *Mpp, ladel_work *work)
Compute .
void ladel_invert_permutation_vector(ladel_int *p, ladel_int *pinv, ladel_int size)
Invert a permutation vector, such that .
void ladel_permute_sparse_vector(ladel_sparse_matrix *x, ladel_int col, ladel_int *p, ladel_work *work)
Permute x(:,col) in place, such that on output .
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