dmlfw (Daniyal Machine Learning Framework)
example_dmlfw_vec_double.c

Typical usage example:

#include <stdio.h>
#include <stdlib.h>
#include <dmlfw_vector.h>
#include <dmlfw_error.h>
int main(void) {
char err[512], dbg[512];
double mean=0.0;
// Create a column vector with 3 rows (elements)
if (dmlfw_error()) {
dmlfw_get_error_string(err, sizeof(err));
dmlfw_get_debug_string(dbg, sizeof(dbg));
printf("Error creating column vector: %s\nDebug info: %s\n", err, dbg);
return EXIT_FAILURE;
}
dmlfw_column_vec_double_set(col_vec, 0, 1.0);
dmlfw_column_vec_double_set(col_vec, 1, 2.0);
dmlfw_column_vec_double_set(col_vec, 2, 3.0);
printf("Mean of column vector: %lf\n", mean);
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 vector types and utilities for double and string data.
void dmlfw_column_vec_double_destroy(dmlfw_column_vec_double *vector)
Destroys a column vector and frees its memory.
void dmlfw_column_vec_double_set(dmlfw_column_vec_double *vector, index_t index, double value)
Sets the value of an element in a column vector.
struct __dmlfw_column_vec_double dmlfw_column_vec_double
Opaque structure representing a column vector of doubles.
Definition dmlfw_vec_double.h:83
dmlfw_column_vec_double * dmlfw_column_vec_double_create_new(dimension_t rows)
Creates a new column vector of specified size.
double dmlfw_column_vec_double_get_mean(dmlfw_column_vec_double *vector)
Computes the mean of all elements in a column vector.