dmlfw (Daniyal Machine Learning Framework)
example_dmlfw_vec_string.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];
char *val = NULL;
if (dmlfw_error()) {
dmlfw_get_error_string(err, sizeof(err));
dmlfw_get_debug_string(dbg, sizeof(dbg));
printf("Error creating row vector: %s\nDebug info: %s\n", err, dbg);
return EXIT_FAILURE;
}
dmlfw_row_vec_string_set(row_vec, 0, "Hello");
dmlfw_row_vec_string_set(row_vec, 1, "World");
dmlfw_row_vec_string_set(row_vec, 2, "!");
dmlfw_row_vec_string_get(row_vec, 1, &val);
if (!dmlfw_error() && val) {
printf("Element at index 1: %s\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 vector types and utilities for double and string data.
void dmlfw_row_vec_string_get(dmlfw_row_vec_string *vector, index_t index, char **string)
Retrieves a string element from a row vector by index.
void dmlfw_row_vec_string_destroy(dmlfw_row_vec_string *vector)
Destroys a row vector of strings and frees its memory.
dmlfw_row_vec_string * dmlfw_row_vec_string_create_new(dimension_t columns)
Creates a new row vector of strings of specified length.
void dmlfw_row_vec_string_set(dmlfw_row_vec_string *vector, index_t index, char *string)
Sets a string element in the row vector.
struct __dmlfw_row_vec_string dmlfw_row_vec_string
Opaque structure representing a row vector of strings.
Definition dmlfw_vec_string.h:82