Angka
0.0.1
A C library focusing on data manipulation and visualization
|
the library for matrix data manipulation More...
Go to the source code of this file.
Data Structures | |
struct | s_matrix |
creating matrix data type in this library More... | |
Typedefs | |
typedef char * | p_matrixString_t |
matrix string typedef More... | |
typedef struct s_matrix | AgxMatrix |
creating matrix data type in this library More... | |
Functions | |
AgxMatrix * | agx_matrix_new (int row, int column) |
create an empty matrix with a certain row and column More... | |
void | agx_matrix_delete (AgxMatrix **mat) |
delete matrix More... | |
int | agx_matrix_change_elements_by_value (AgxMatrix *mat, double val) |
change all elements of matrix by a value More... | |
AgxMatrix * | agx_matrix_new_constant (int row, int column, double val) |
create a new matrix with a constant value More... | |
AgxMatrix * | agx_matrix_new_random (int row, int column, double min, double max) |
create a new matrix with some random values More... | |
AgxMatrix * | agx_matrix_new_from_array (double *ndarray_in, int dim1, int dim2) |
create a new matrix from C array More... | |
void | agx_matrix_to_array (AgxMatrix *mat, double **ndarray_out, int *dim1, int *dim2) |
passing the array reference to ndarray_out More... | |
int | agx_matrix_row_col_to_index (AgxMatrix *mat, int row, int col) |
change row and col values to index of array matrix More... | |
int | agx_matrix_set_item (AgxMatrix *mat, int row, int col, double val) |
set a value in a corresponding row and column More... | |
int | agx_matrix_get_item (AgxMatrix *mat, int row, int col, double *output) |
get the value from matrix based on row and column More... | |
p_matrixString_t | agx_matrix_to_string (AgxMatrix *mat, int islong) |
change a matrix to matrix string More... | |
int | agx_matrix_print (AgxMatrix *mat, int islong) |
print a matrix in the console with islong parameter More... | |
int | agx_matrix_print_partial (AgxMatrix *mat) |
print a matrix in a partial form (islong = 0) More... | |
int | agx_matrix_print_full (AgxMatrix *mat) |
print a matrix in a full form (islong = 1) More... | |
int | agx_matrix_add_by_value (AgxMatrix *mat, double val) |
adding all elements of matrix by a value More... | |
int | agx_matrix_substract_by_value (AgxMatrix *mat, double val) |
substracting all elements of matrix by a value More... | |
int | agx_matrix_multiply_by_value (AgxMatrix *mat, double val) |
multiplying all elements of matrix by a value More... | |
int | agx_matrix_divide_by_value (AgxMatrix *mat, double val) |
dividing all elements of matrix by a value More... | |
AgxMatrix * | agx_matrix_new_duplicate_size (AgxMatrix *mat) |
create a new matrix based on the row of col values on another matrix More... | |
int | agx_matrix_copy_elements (AgxMatrix *src, AgxMatrix *target) |
copy all elements of the vector to the target vector More... | |
int | agx_matrix_copy_shape (AgxMatrix *src, AgxMatrix *target) |
copy shape the vector to the target vector More... | |
int | agx_matrix_transpose (AgxMatrix *mat) |
transpose the matrix More... | |
AgxMatrix * | agx_matrix_new_copy (AgxMatrix *mat) |
copy the matrix More... | |
AgxMatrix * | agx_matrix_new_from_vector (AgxVector *vec) |
create a new matrix based on the vector More... | |
AgxMatrix * | agx_matrix_new_identity (int size) |
create a new identity matrix (m x m) More... | |
AgxMatrix * | agx_matrix_new_zero (int row, int col) |
create a new zero matrix More... | |
AgxMatrix * | agx_matrix_new_multiplication (AgxMatrix *mat1, AgxMatrix *mat2) |
matrix multiplication and stored in the new matrix More... | |
AgxVector * | agx_vector_new_from_matrix (AgxMatrix *mat) |
create a new vector from the matrix More... | |
AgxMatrix * | agx_matrix_new_extract_column (AgxMatrix *mat, int col) |
create a new matrix based on a certain column values More... | |
AgxMatrix * | agx_matrix_new_extract_row (AgxMatrix *mat, int row) |
create a new matrix based on a certain row values More... | |
AgxMatrix * | agx_matrix_new_extract_row_col (AgxMatrix *mat, int row1, int row2, int col1, int col2) |
create a new matrix based on a certain row and column range More... | |
double | agx_matrix_min (AgxMatrix *mat) |
look for a minimum value of the matrix More... | |
double | agx_matrix_max (AgxMatrix *mat) |
look for a maximum value of the matrix More... | |
the library for matrix data manipulation
creating matrix data type in this library
after this struct is created, we need to delete unused using agx_matrix_delete. Usually we call this struct using its typedef AgxMatrix
typedef char* p_matrixString_t |
matrix string typedef
it is used for indentifying that this typedef need to be delete in memory before quit a program. Deleting this type can use agx_data_delete in standard.h.
int agx_matrix_add_by_value | ( | AgxMatrix * | mat, |
double | val | ||
) |
adding all elements of matrix by a value
int agx_matrix_change_elements_by_value | ( | AgxMatrix * | mat, |
double | val | ||
) |
change all elements of matrix by a value
copy all elements of the vector to the target vector
copy shape the vector to the target vector
void agx_matrix_delete | ( | AgxMatrix ** | mat | ) |
delete matrix
int agx_matrix_divide_by_value | ( | AgxMatrix * | mat, |
double | val | ||
) |
dividing all elements of matrix by a value
int agx_matrix_get_item | ( | AgxMatrix * | mat, |
int | row, | ||
int | col, | ||
double * | output | ||
) |
get the value from matrix based on row and column
double agx_matrix_max | ( | AgxMatrix * | mat | ) |
look for a maximum value of the matrix
double agx_matrix_min | ( | AgxMatrix * | mat | ) |
look for a minimum value of the matrix
int agx_matrix_multiply_by_value | ( | AgxMatrix * | mat, |
double | val | ||
) |
multiplying all elements of matrix by a value
AgxMatrix* agx_matrix_new | ( | int | row, |
int | column | ||
) |
create an empty matrix with a certain row and column
AgxMatrix* agx_matrix_new_constant | ( | int | row, |
int | column, | ||
double | val | ||
) |
create a new matrix with a constant value
create a new matrix based on the row of col values on another matrix
create a new matrix based on a certain column values
create a new matrix based on a certain row values
AgxMatrix* agx_matrix_new_extract_row_col | ( | AgxMatrix * | mat, |
int | row1, | ||
int | row2, | ||
int | col1, | ||
int | col2 | ||
) |
create a new matrix based on a certain row and column range
AgxMatrix* agx_matrix_new_from_array | ( | double * | ndarray_in, |
int | dim1, | ||
int | dim2 | ||
) |
create a new matrix from C array
dim1 | equals to row number |
dim2 | equals to column number |
create a new matrix based on the vector
AgxMatrix* agx_matrix_new_identity | ( | int | size | ) |
create a new identity matrix (m x m)
matrix multiplication and stored in the new matrix
AgxMatrix* agx_matrix_new_random | ( | int | row, |
int | column, | ||
double | min, | ||
double | max | ||
) |
create a new matrix with some random values
AgxMatrix* agx_matrix_new_zero | ( | int | row, |
int | col | ||
) |
create a new zero matrix
int agx_matrix_print | ( | AgxMatrix * | mat, |
int | islong | ||
) |
print a matrix in the console with islong parameter
int agx_matrix_print_full | ( | AgxMatrix * | mat | ) |
print a matrix in a full form (islong = 1)
int agx_matrix_print_partial | ( | AgxMatrix * | mat | ) |
print a matrix in a partial form (islong = 0)
int agx_matrix_row_col_to_index | ( | AgxMatrix * | mat, |
int | row, | ||
int | col | ||
) |
change row and col values to index of array matrix
int agx_matrix_set_item | ( | AgxMatrix * | mat, |
int | row, | ||
int | col, | ||
double | val | ||
) |
set a value in a corresponding row and column
int agx_matrix_substract_by_value | ( | AgxMatrix * | mat, |
double | val | ||
) |
substracting all elements of matrix by a value
void agx_matrix_to_array | ( | AgxMatrix * | mat, |
double ** | ndarray_out, | ||
int * | dim1, | ||
int * | dim2 | ||
) |
passing the array reference to ndarray_out
p_matrixString_t agx_matrix_to_string | ( | AgxMatrix * | mat, |
int | islong | ||
) |
change a matrix to matrix string
int agx_matrix_transpose | ( | AgxMatrix * | mat | ) |
transpose the matrix