dmlfw (Daniyal Machine Learning Framework)
example_dmlfw_list_double.c

Example usage:

#include <stdio.h>
#include <stdlib.h>
#include <dmlfw_list.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 forward list: %s\nDebug info: %s\n", err, dbg);
return EXIT_FAILURE;
}
printf("List size: %u\n", size);
if (dmlfw_error()) {
dmlfw_get_error_string(err, sizeof(err));
dmlfw_get_debug_string(dbg, sizeof(dbg));
printf("Failed to convert list to vector: %s\nDebug info: %s\n", err, dbg);
return EXIT_FAILURE;
}
double val = dmlfw_row_vec_double_get(vec, 0);
printf("First element in vector: %lf\n", val);
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.
Core list types and utilities for double precision data.
dmlfw_forward_list_double * dmlfw_forward_list_double_create_new(void)
Creates a new empty forward list of doubles.
void dmlfw_forward_list_double_clear(dmlfw_forward_list_double *forward_list)
Removes all elements from the list.
struct __dmlfw_forward_list_double dmlfw_forward_list_double
Opaque structure representing a forward list of double values.
Definition dmlfw_list_double.h:86
dimension_t dmlfw_forward_list_double_get_size(dmlfw_forward_list_double *forward_list)
Returns the number of elements in the list.
void dmlfw_forward_list_double_insert(dmlfw_forward_list_double *forward_list, double value)
Inserts a double value at the front of the list.
void dmlfw_forward_list_double_destroy(dmlfw_forward_list_double *forward_list)
Destroys the forward list and frees all memory.
dmlfw_row_vec_double * dmlfw_forward_list_double_get_row_vector(dmlfw_forward_list_double *forward_list)
Converts the forward list into a row vector of doubles.
uint32_t dimension_t
Represents the size or dimension of a data structure (uint32_t).
Definition dmlfw_types.h:26
void dmlfw_row_vec_double_destroy(dmlfw_row_vec_double *vector)
Destroys a row vector and frees its memory.
struct __dmlfw_row_vec_double dmlfw_row_vec_double
Opaque structure representing a row vector of doubles.
Definition dmlfw_vec_double.h:92
double dmlfw_row_vec_double_get(dmlfw_row_vec_double *vector, index_t index)
Retrieves the value of an element in a row vector.