Matrix data storage.
More...
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
|
sa_matrix_int * | sa_create_matrix_int (int rows, int cols) |
| Allocates and initializes the data structure. More...
|
|
sa_matrix_flt * | sa_create_matrix_flt (int rows, int cols) |
|
void | sa_init_matrix_int (sa_matrix_int *m) |
| Zeros out the matrix. More...
|
|
void | sa_init_matrix_flt (sa_matrix_flt *m) |
|
void | sa_init_matrix_row_int (sa_matrix_int *m, int row) |
| Zeros out the specified matrix row. More...
|
|
void | sa_init_matrix_row_flt (sa_matrix_flt *m, int row) |
|
int | sa_add_matrix_int (sa_matrix_int *m, int row, int col, int v) |
| Adds the specified value to the matrix. More...
|
|
float | sa_add_matrix_flt (sa_matrix_flt *m, int row, int col, float v) |
|
int | sa_set_matrix_int (sa_matrix_int *m, int row, int col, int v) |
| Sets the time series row to the specified value. More...
|
|
float | sa_set_matrix_flt (sa_matrix_flt *m, int row, int col, float v) |
|
int | sa_get_matrix_int (sa_matrix_int *m, int row, int cols) |
| Gets the value of the time series row. More...
|
|
float | sa_get_matrix_flt (sa_matrix_flt *m, int row, int cols) |
|
void | sa_destroy_matrix_int (sa_matrix_int *m) |
| Free the associated memory. More...
|
|
void | sa_destroy_matrix_flt (sa_matrix_flt *m) |
|
char * | sa_serialize_matrix_int (sa_matrix_int *m, size_t *len) |
| Serialize the internal state to a buffer. More...
|
|
char * | sa_serialize_matrix_flt (sa_matrix_flt *m, size_t *len) |
|
int | sa_deserialize_matrix_int (sa_matrix_int *m, const char *buf, size_t len) |
| Restores the internal state from the serialized output. More...
|
|
int | sa_deserialize_matrix_flt (sa_matrix_flt *m, const char *buf, size_t len) |
|
Matrix data storage.
Definition in file matrix.h.
float sa_add_matrix_flt |
( |
sa_matrix_flt * |
m, |
|
|
int |
row, |
|
|
int |
col, |
|
|
float |
v |
|
) |
| |
int sa_add_matrix_int |
( |
sa_matrix_int * |
m, |
|
|
int |
row, |
|
|
int |
col, |
|
|
int |
v |
|
) |
| |
Adds the specified value to the matrix.
- Parameters
-
m | Pointer to matrix_int |
row | |
col | |
v | Value to add |
- Returns
- current value
Allocates and initializes the data structure.
- Parameters
-
- Returns
- Pointer to matrix_int
int sa_deserialize_matrix_flt |
( |
sa_matrix_flt * |
m, |
|
|
const char * |
buf, |
|
|
size_t |
len |
|
) |
| |
int sa_deserialize_matrix_int |
( |
sa_matrix_int * |
m, |
|
|
const char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Restores the internal state from the serialized output.
- Parameters
-
m | Pointer to matrix_int |
buf | Buffer containing the output of serialize_matrix_int |
len | Length of the buffer |
- Returns
- 0 = success 1 = invalid buffer length 2 = invalid rows 3 = invalid cols
Free the associated memory.
- Parameters
-
Gets the value of the time series row.
- Parameters
-
m | Pointer to matrix_int |
row | |
cols | |
- Returns
- current value
Zeros out the matrix.
- matrix_int is set to all zeros
- matrix_flt is ste to all NAN
- Parameters
-
Zeros out the specified matrix row.
- matrix_int is set to all zeros
- matrix_flt is ste to all NAN
- Parameters
-
m | Pointer to matrix_int |
row | |
char* sa_serialize_matrix_flt |
( |
sa_matrix_flt * |
m, |
|
|
size_t * |
len |
|
) |
| |
char* sa_serialize_matrix_int |
( |
sa_matrix_int * |
m, |
|
|
size_t * |
len |
|
) |
| |
Serialize the internal state to a buffer.
- Parameters
-
m | Pointer to matrix_int |
len | Length of the returned buffer |
- Returns
- char* Serialized representation MUST be freed by the caller
float sa_set_matrix_flt |
( |
sa_matrix_flt * |
m, |
|
|
int |
row, |
|
|
int |
col, |
|
|
float |
v |
|
) |
| |
int sa_set_matrix_int |
( |
sa_matrix_int * |
m, |
|
|
int |
row, |
|
|
int |
col, |
|
|
int |
v |
|
) |
| |
Sets the time series row to the specified value.
- Parameters
-
m | Pointer to matrix_int |
row | |
col | |
v | Value to set |
- Returns
- current value