Common data structures and type definitions for the C3E library.
double c3e_number
A type representing a numerical value in C3E. Defaults to double precision.
Definition commons.h:50
Represents a mathematical matrix.
Definition commons.h:74
Represents a tensor, a multi-dimensional array of numerical values.
Definition commons.h:111
Represents a mathematical vector.
Definition commons.h:62
c3e_tensor * c3e_tensor_normalize(c3e_tensor *tensor)
Normalizes the elements of a tensor.
c3e_tensor * c3e_tensor_add(c3e_tensor *left, c3e_tensor *right)
Adds two tensors element-wise.
c3e_tensor * c3e_tensor_random(size_t dsize, uint32_t dims, int rows, int cols, int seed)
Creates a tensor with random values within a range.
c3e_tensor * c3e_tensor_random_bound(size_t dsize, uint32_t dims, int rows, int cols, int seed, c3e_number min, c3e_number max)
Creates a tensor with random values within a specified range.
void c3e_tensor_free(c3e_tensor *tensor)
Frees the resources associated with a tensor.
c3e_tensor * c3e_tensor_fill(size_t dsize, uint32_t dims, int rows, int cols, c3e_number value)
Creates a tensor filled with a specific value.
bool c3e_tensor_all_close(c3e_tensor *tensor, c3e_tensor *subject)
Checks if two tensors are element-wise close within a tolerance.
c3e_tensor * c3e_tensor_init(size_t dsize, uint32_t dims, c3e_matrix **matrices, c3e_vector *data)
Initializes a tensor with given data and dimensions.
c3e_tensor * c3e_tensor_sub(c3e_tensor *left, c3e_tensor *right)
Subtracts one tensor from another element-wise.
c3e_tensor * c3e_tensor_exp(c3e_tensor *tensor)
Applies the exponential function to each element of a tensor.
c3e_tensor * c3e_tensor_mul(c3e_tensor *left, c3e_tensor *right)
Multiplies two tensors element-wise.
c3e_tensor * c3e_tensor_copy(c3e_tensor *tensor)
Creates a copy of a tensor.
c3e_tensor * c3e_tensor_scale(c3e_tensor *tensor, int x)
Scales the elements of a tensor by a scalar value.
bool c3e_tensor_equals(c3e_tensor *tensor, c3e_tensor *subject)
Checks if two tensors are equal.
c3e_tensor * c3e_tensor_div(c3e_tensor *left, c3e_tensor *right)
Divides one tensor by another element-wise.
c3e_tensor * c3e_tensor_zeros(size_t dsize, uint32_t dims, int rows, int cols)
Creates a tensor filled with zeros.
c3e_tensor * c3e_tensor_ones(size_t dsize, uint32_t dims, int rows, int cols)
Creates a tensor filled with ones.