dmlfw (Daniyal Machine Learning Framework)
dmlfw_mat_double.h
Go to the documentation of this file.
1#ifndef DMLFW_MAT_DOUBLE_H
2#define DMLFW_MAT_DOUBLE_H
63#include <dmlfw_types.h>
64
65struct __dmlfw_mat_double;
66
73typedef struct __dmlfw_mat_double dmlfw_mat_double;
74
75
101
102
116
117
147 dmlfw_mat_double *matrix,
148 dmlfw_row_vec_string **header);
149
150
177 const char *csv_file_name,
178 dmlfw_row_vec_string *header);
179
180
206
207
231void dmlfw_mat_double_set(dmlfw_mat_double *matrix, index_t row, index_t column, double value);
232
233
250 dimension_t *rows,
251 dimension_t *columns);
252
253
280 dmlfw_mat_double *source,
281 index_t target_row_index,
282 index_t target_column_index,
283 index_t source_from_row_index,
284 index_t source_from_column_index,
285 index_t source_to_row_index,
286 index_t source_to_column_index);
287
317 index_t from_row_index,
318 index_t from_column_index,
319 index_t to_row_index,
320 index_t to_column_index,
321 double value);
322
323
352 index_t column_index,
354
355
383 uint8_t how_many_times_to_shuffle,
384 dmlfw_mat_double *shuffled_matrix);
385
386
387
414 dmlfw_mat_double *transposed_matrix);
415
416
444 index_t start_row_index,
445 index_t start_column_index,
446 index_t end_row_index,
447 index_t end_column_index);
448
449
481 index_t start_row_index,
482 index_t start_column_index,
483 index_t end_row_index,
484 index_t end_column_index);
485
486
518 index_t start_row_index,
519 index_t start_column_index,
520 index_t end_row_index,
521 index_t end_column_index);
522
523
555 index_t start_row_index,
556 index_t start_column_index,
557 index_t end_row_index,
558 index_t end_column_index);
559
560
593void dmlfw_mat_double_get_training_testing_data(const char *csv_file_name,
594 dmlfw_mat_double **training_data_matrix,
595 dmlfw_mat_double **testing_data_matrix,
596 uint8_t testing_data_percentage);
597
598
624 dimension_t new_rows_count,
625 dimension_t new_columns_count);
626
627
651void dmlfw_mat_double_right_shift(dmlfw_mat_double *matrix, dimension_t how_many_places_to_shift);
652
676void dmlfw_mat_double_left_shift(dmlfw_mat_double *matrix, dimension_t how_many_places_to_shift);
677
702
728
755
783 double min, double max,
784 dmlfw_mat_double *new_matrix);
785
810 index_t from_row_index,
811 index_t from_column_index,
812 index_t to_row_index,
813 index_t to_column_index);
814
837 index_t at_index,
838 dimension_t number_of_columns);
839
868 dmlfw_mat_double *matrix,
869 uint64_t from_row,
870 uint64_t how_many_rows,
871 long *pos);
872
873
874
876#endif /* DMLFW_MAT_DOUBLE_H */
double dmlfw_mat_double_get_minimum(dmlfw_mat_double *matrix, index_t start_row_index, index_t start_column_index, index_t end_row_index, index_t end_column_index)
Finds the minimum value in a specified submatrix region.
void dmlfw_mat_double_get_dimensions(dmlfw_mat_double *matrix, dimension_t *rows, dimension_t *columns)
Retrieves the matrix dimensions.
void dmlfw_mat_double_get_training_testing_data(const char *csv_file_name, dmlfw_mat_double **training_data_matrix, dmlfw_mat_double **testing_data_matrix, uint8_t testing_data_percentage)
Splits data from a CSV file into training and testing matrices.
struct __dmlfw_mat_double dmlfw_mat_double
Opaque structure representing a double precision matrix.
Definition dmlfw_mat_double.h:73
dmlfw_mat_double * dmlfw_mat_double_get_block_from_csv(const char *csv_file_name, dmlfw_mat_double *matrix, uint64_t from_row, uint64_t how_many_rows, long *pos)
Loads a block of rows from a CSV file into a matrix.
void dmlfw_mat_double_reshape(dmlfw_mat_double **matrix_to_reshape, dimension_t new_rows_count, dimension_t new_columns_count)
Reshapes a matrix to new row and column counts.
void dmlfw_mat_double_copy(dmlfw_mat_double *target, dmlfw_mat_double *source, index_t target_row_index, index_t target_column_index, index_t source_from_row_index, index_t source_from_column_index, index_t source_to_row_index, index_t source_to_column_index)
Copies a submatrix from source to target at specified offsets.
void dmlfw_mat_double_fill(dmlfw_mat_double *matrix, index_t from_row_index, index_t from_column_index, index_t to_row_index, index_t to_column_index, double value)
Fills a subregion of the matrix with the specified value.
void dmlfw_mat_double_to_csv(dmlfw_mat_double *matrix, const char *csv_file_name, dmlfw_row_vec_string *header)
Saves a matrix and its header to a CSV file.
void dmlfw_mat_double_set(dmlfw_mat_double *matrix, index_t row, index_t column, double value)
Sets value at a specific matrix position.
dmlfw_mat_double * dmlfw_mat_double_create_new_random_filled(dimension_t rows, dimension_t columns, double min, double max, dmlfw_mat_double *new_matrix)
Creates a matrix filled with random values within [min, max].
void dmlfw_mat_double_left_shift(dmlfw_mat_double *matrix, dimension_t how_many_places_to_shift)
Left shifts matrix elements by specified number of places.
dmlfw_mat_double * dmlfw_mat_double_create_new(dimension_t rows, dimension_t columns)
Creates a new matrix with specified rows and columns.
dmlfw_mat_double * dmlfw_mat_double_inverse(dmlfw_mat_double *matrix_to_inverse, dmlfw_mat_double *new_matrix)
Computes the inverse of a square matrix using Gaussian elimination.
double dmlfw_mat_double_get_mean(dmlfw_mat_double *matrix, index_t start_row_index, index_t start_column_index, index_t end_row_index, index_t end_column_index)
Computes the mean of elements in a specified submatrix region.
double dmlfw_mat_double_get(dmlfw_mat_double *matrix, index_t row, index_t column)
Returns value at a specific matrix position.
dmlfw_mat_double * dmlfw_mat_double_create_identity_matrix(dimension_t rows)
Creates an identity matrix of specified size.
void dmlfw_mat_double_right_shift(dmlfw_mat_double *matrix, dimension_t how_many_places_to_shift)
Right shifts matrix elements by specified number of places.
dmlfw_mat_double * dmlfw_mat_double_clone(dmlfw_mat_double *matrix_to_clone, dmlfw_mat_double *new_matrix)
Clones a matrix into a new or existing matrix container.
dmlfw_mat_double * dmlfw_mat_double_shuffle(dmlfw_mat_double *matrix, uint8_t how_many_times_to_shuffle, dmlfw_mat_double *shuffled_matrix)
Returns a shuffled version of the matrix, shuffling rows specified times.
void dmlfw_mat_double_destroy(dmlfw_mat_double *matrix)
Destroys a matrix and frees all associated memory.
double dmlfw_mat_double_get_maximum(dmlfw_mat_double *matrix, index_t start_row_index, index_t start_column_index, index_t end_row_index, index_t end_column_index)
Finds the maximum value in a specified submatrix region.
void dmlfw_mat_double_truncate(dmlfw_mat_double **matrix, index_t from_row_index, index_t from_column_index, index_t to_row_index, index_t to_column_index)
Truncates the specified matrix to a subregion.
dmlfw_column_vec_double * dmlfw_mat_double_create_column_vec(dmlfw_mat_double *matrix, index_t column_index, dmlfw_column_vec_double *vector)
Creates or fills a column vector from the specified column of the matrix.
dmlfw_mat_double * dmlfw_mat_double_transpose(dmlfw_mat_double *matrix, dmlfw_mat_double *transposed_matrix)
Transposes a matrix.
double dmlfw_mat_double_get_standard_deviation(dmlfw_mat_double *matrix, index_t start_row_index, index_t start_column_index, index_t end_row_index, index_t end_column_index)
Calculates the standard deviation of elements in a specified submatrix region.
void dmlfw_mat_double_insert_columns(dmlfw_mat_double **matrix, index_t at_index, dimension_t number_of_columns)
Inserts columns into a matrix at a specified index.
dmlfw_mat_double * dmlfw_mat_double_from_csv(const char *csv_file_name, dmlfw_mat_double *matrix, dmlfw_row_vec_string **header)
Loads a matrix and header from a CSV file.
Fundamental scalar typedefs used across the framework.
uint32_t index_t
Represents an index within a data structure (uint32_t).
Definition dmlfw_types.h:32
uint32_t dimension_t
Represents the size or dimension of a data structure (uint32_t).
Definition dmlfw_types.h:26
struct __dmlfw_column_vec_double dmlfw_column_vec_double
Opaque structure representing a column vector of doubles.
Definition dmlfw_vec_double.h:83
struct __dmlfw_row_vec_string dmlfw_row_vec_string
Opaque structure representing a row vector of strings.
Definition dmlfw_vec_string.h:82