Localized Orbital Scaling Correction (LOSC) C library
|
The C interface of matrix used in LOSC. More...
#include <stddef.h>
Go to the source code of this file.
Macros | |
#define | losc_matrix_free(ptr) _losc_matrix_free(&(ptr)) |
Free the losc_matrix. More... | |
Typedefs | |
typedef struct losc_matrix | losc_matirx |
losc_matrix More... | |
Functions | |
losc_matrix * | losc_matrix_create (size_t row, size_t col) |
Create a LOSC matrix object with data allocated. More... | |
losc_matrix * | losc_matrix_create_from_data (size_t row, size_t col, double *data) |
Create a LOSC matrix object with data owned externally. More... | |
double * | losc_matrix_data (losc_matrix *m) |
Return the pointer that points to the head of matrix data. More... | |
const double * | losc_matrix_data_const (const losc_matrix *m) |
Return the const pointer that points to the head of matrix data. More... | |
size_t | losc_matrix_rows (const losc_matrix *m) |
Return the number of rows. | |
size_t | losc_matrix_cols (const losc_matrix *m) |
Return the number of columns. | |
The C interface of matrix used in LOSC.
The struct losc_matrix is used to represent matrix object and shared between the C code and C++ LOSC library. The C users only need the interface as provided in this header file to use struct losc_matrix. The implementation of struct losc_matrix is hid.
#define losc_matrix_free | ( | ptr | ) | _losc_matrix_free(&(ptr)) |
Free the losc_matrix.
[in,out] | ptr | a pointer with type losc_matrix * . At exit, ptr is set to null. |
typedef struct losc_matrix losc_matirx |
losc_matrix
losc_matrix* losc_matrix_create | ( | size_t | row, |
size_t | col | ||
) |
Create a LOSC matrix object with data allocated.
[in] | row | number of rows. |
[in] | col | number of columns. |
losc_matrix* losc_matrix_create_from_data | ( | size_t | row, |
size_t | col, | ||
double * | data | ||
) |
Create a LOSC matrix object with data owned externally.
[in] | row | number of rows. |
[in] | col | number of columns. |
[in] | data | data points to an array which represents a matrix with dimension of [row, col] . The matrix is assumed to be stored in row-major. The size of the array is assumed to be at least row x col . |
double* losc_matrix_data | ( | losc_matrix * | m | ) |
Return the pointer that points to the head of matrix data.
[in] | m | a losc_matrix pointer. |
const double* losc_matrix_data_const | ( | const losc_matrix * | m | ) |
Return the const pointer that points to the head of matrix data.
[in] | m | a const losc_matrix pointer. |