dmlfw (Daniyal Machine Learning Framework)
|
Core mathematical vector and matrix functions. More...
Go to the source code of this file.
Functions | |
dmlfw_column_vec_double * | dmlfw_column_vec_double_log (dmlfw_column_vec_double *vector, dmlfw_column_vec_double *new_vector) |
Applies natural logarithm element-wise to column vector. | |
dmlfw_column_vec_double * | dmlfw_column_vec_double_sigmoid (dmlfw_column_vec_double *vector, dmlfw_column_vec_double *new_vector) |
Applies sigmoid function element-wise to column vector. | |
double | dmlfw_column_vec_double_sum (dmlfw_column_vec_double *vector) |
Computes sum of all values in column vector. | |
dmlfw_mat_double * | dmlfw_mat_double_sigmoid (dmlfw_mat_double *matrix, dmlfw_mat_double *new_matrix) |
Applies sigmoid function element-wise to a matrix. | |
Core mathematical vector and matrix functions.
This module provides functions for common mathematical transformations (sigmoid, log) and reductions (sum) on double precision vectors and matrices, supporting ML and numeric data workflows.
All functions use a centralized error API. After calls, check dmlfw_error()
and access full details via dmlfw_get_error_string()
and dmlfw_get_debug_string()
.
Functions that allocate new containers (vectors/matrices) transfer ownership to caller. Returned vectors/matrices must be destroyed with the appropriate API function.
dmlfw_column_vec_double * dmlfw_column_vec_double_log | ( | dmlfw_column_vec_double * | vector, |
dmlfw_column_vec_double * | new_vector | ||
) |
Applies natural logarithm element-wise to column vector.
If new_vector is NULL, allocates a new container; otherwise, fills provided container. Input and output sizes must match if container is reused.
vector | [in] Source column vector (non-NULL). |
new_vector | [in,out] Optional result vector. If NULL, allocated. |
Usage example:
dmlfw_column_vec_double * dmlfw_column_vec_double_sigmoid | ( | dmlfw_column_vec_double * | vector, |
dmlfw_column_vec_double * | new_vector | ||
) |
Applies sigmoid function element-wise to column vector.
If new_vector is NULL, allocates a result container; otherwise, fills provided container. Input and output sizes must match if container is reused.
vector | [in] Source column vector (non-NULL). |
new_vector | [in,out] Optional result vector to fill. If NULL, allocated. |
Usage example:
double dmlfw_column_vec_double_sum | ( | dmlfw_column_vec_double * | vector | ) |
Computes sum of all values in column vector.
vector | [in] Source vector. |
Usage example:
dmlfw_mat_double * dmlfw_mat_double_sigmoid | ( | dmlfw_mat_double * | matrix, |
dmlfw_mat_double * | new_matrix | ||
) |
Applies sigmoid function element-wise to a matrix.
If new_matrix is NULL, allocates a new matrix; otherwise, fills provided container. Dimensions must match if container is reused.
matrix | [in] Source matrix (non-NULL). |
new_matrix | [in,out] Optional result matrix. If NULL, allocated. |
Usage example: