dmlfw (Daniyal Machine Learning Framework)
example_dmlfw_error.c

Example usage:

#include <stdio.h>
#include <stdlib.h>
#include <dmlfw_matrix.h>
#include <dmlfw_error.h>
int main(void) {
char err[512];
char debug[512];
dmlfw_mat_double *matrix = NULL;
// Example framework call
if(dmlfw_error()) {
dmlfw_get_error_string(err, sizeof(err));
dmlfw_get_debug_string(debug, sizeof(debug));
printf("Error: %s, Debugging: %s\n", err, debug);
// Handle error and clean up
return EXIT_FAILURE;
}
// Do some work with matrix...
// Cleanup
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.
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_create_new(dimension_t rows, dimension_t columns)
Creates a new matrix with specified rows and columns.
void dmlfw_mat_double_destroy(dmlfw_mat_double *matrix)
Destroys a matrix and frees all associated memory.
Core matrix types and utilities for double and string data.

Note: For dmlfw_get_error_string() and dmlfw_get_debug_string(), pass a character buffer of sufficient size (typically >=512 bytes) to safely hold the returned string.

This enables robust and consistent error tracking across the framework.