dmlfw (Daniyal Machine Learning Framework)
example_mat_string.c

Example usage:

#include <stdio.h>
#include <stdlib.h>
#include <dmlfw_matrix.h>
#include <dmlfw_error.h>
int main(void) {
char err[512], dbg[512];
if (dmlfw_error()) {
dmlfw_get_error_string(err, sizeof(err));
dmlfw_get_debug_string(dbg, sizeof(dbg));
printf("Failed to create matrix: %s\nDebug info: %s\n", err, dbg);
return EXIT_FAILURE;
}
dmlfw_mat_string_set(mat, 0, 0, "Hello");
char *str = NULL;
dmlfw_mat_string_get(mat, 0, 0, &str);
if (!dmlfw_error() && str != NULL) {
printf("Value at (0,0): %s\n", str);
free(str);
} else {
dmlfw_get_error_string(err, sizeof(err));
dmlfw_get_debug_string(dbg, sizeof(dbg));
printf("Failed to get string: %s\nDebug info: %s\n", err, dbg);
}
return EXIT_SUCCESS;
}
int main()
Main function to execute batch gradient descent linear regression example.
Definition batch_gd.c:316
Centralized error handling interface for the framework.
void dmlfw_get_error_string(char *error_string, uint32_t size)
Copies the last error message into the provided character buffer.
uint8_t dmlfw_error(void)
Checks if the last framework call resulted in an error.
void dmlfw_get_debug_string(char *debug_string, uint32_t size)
Copies detailed debug information about the last error into the provided character buffer.
void dmlfw_mat_string_get(dmlfw_mat_string *matrix, index_t row, index_t column, char **string)
Retrieves the string at specified row and column.
void dmlfw_mat_string_destroy(dmlfw_mat_string *matrix)
Destroys a string matrix and frees all allocated memory.
void dmlfw_mat_string_set(dmlfw_mat_string *matrix, index_t row, index_t column, char *string)
Sets the string at specified row and column.
struct __dmlfw_mat_string dmlfw_mat_string
Opaque structure representing a string matrix.
Definition dmlfw_mat_string.h:77
dmlfw_mat_string * dmlfw_mat_string_create_new(dimension_t rows, dimension_t columns)
Creates a new string matrix with specified rows and columns.
Core matrix types and utilities for double and string data.