LADEL main
Sparse LDL factorization package with rank 1 and rowadd/rowdel updates
ladel_copy.h
Go to the documentation of this file.
1/**
2 * @file ladel_copy.h
3 * @author Ben Hermans
4 * @brief Routines to copy matrices and vectors.
5 */
6
7#ifndef LADEL_COPY_H
8#define LADEL_COPY_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include "ladel_types.h"
15
16/**
17 * Copies a matrix into a newly allocated one.
18 *
19 * Note that even if there is superfluous space in M (i.e. M->nz indicates the number of nonzeros per column),
20 * the returned matrix will fit the required size exactly, and not make use of the nz array.
21 *
22 * @param M Matrix to be copied
23 * @return Copy of the matrix
24 */
26
27/**
28 * Copies a matrix (preallocated)
29 *
30 * @param M Matrix to be copied
31 * @param M_copy Resulting copy
32 */
34 ladel_sparse_matrix *M_copy);
35
36/**
37 * Copies an integer vector (preallocated)
38 *
39 * @param x Vector to be copied
40 * @param size Size of the vector
41 * @param y Resulting copy
42 */
44 ladel_int size,
45 ladel_int *y);
46
47/**
48 * Copies a double vector (preallocated)
49 *
50 * @param x Vector to be copied
51 * @param size Size of the vector
52 * @param y Resulting copy
53 */
55 ladel_int size,
56 ladel_double *y);
57
58#ifdef __cplusplus
59}
60#endif
61
62#endif /*LADEL_COPY_H*/
ladel_sparse_matrix * ladel_sparse_allocate_and_copy(ladel_sparse_matrix *M)
Copies a matrix into a newly allocated one.
Definition: ladel_copy.c:5
void ladel_sparse_copy(ladel_sparse_matrix *M, ladel_sparse_matrix *M_copy)
Copies a matrix (preallocated)
Definition: ladel_copy.c:12
void ladel_int_vector_copy(ladel_int *x, ladel_int size, ladel_int *y)
Copies an integer vector (preallocated)
Definition: ladel_copy.c:38
void ladel_double_vector_copy(ladel_double *x, ladel_int size, ladel_double *y)
Copies a double vector (preallocated)
Definition: ladel_copy.c:47
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