C3E: Complex Compute Core Engine v1.0
An engine for handling complex computational tasks
Loading...
Searching...
No Matches
commons.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 Nathanne Isip
3 *
4 * Redistribution and use in source and binary forms,
5 * with or without modification, are permitted provided
6 * that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the
9 * above copyright notice, this list of conditions
10 * and the following disclaimer.
11 *
12 * 2. Redistributions in binary form must reproduce the
13 * above copyright notice, this list of conditions
14 * and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 */
17
27#ifndef C3E_COMMONS_H
28#define C3E_COMMONS_H
29
30#include <stdbool.h>
31#include <stdint.h>
32#include <stdlib.h>
33
34#ifndef PI
39#define PI 3.14159265358979323846
40#endif
41
42#ifndef C3E_32BIT_NUMBER
50typedef double c3e_number;
51#else
52typedef float c3e_number;
53#endif
54
62typedef struct {
63 uint32_t size;
66
74typedef struct {
75 uint32_t rows;
76 uint32_t cols;
79
90
103
118
119#endif /* C3E_COMMONS_H */
double c3e_number
A type representing a numerical value in C3E. Defaults to double precision.
Definition commons.h:50
A structure representing a tuple of two matrices.
Definition commons.h:86
c3e_matrix * b
Pointer to the second matrix in the tuple.
Definition commons.h:88
c3e_matrix * a
Pointer to the first matrix in the tuple.
Definition commons.h:87
Represents a mathematical matrix.
Definition commons.h:74
c3e_number * data
Pointer to the data array containing matrix elements.
Definition commons.h:77
uint32_t cols
The number of columns in the matrix.
Definition commons.h:76
uint32_t rows
The number of rows in the matrix.
Definition commons.h:75
Represents the Singular Value Decomposition (SVD) of a matrix.
Definition commons.h:98
c3e_matrix * left
Matrix containing the left singular vectors.
Definition commons.h:99
c3e_vector * singular
Vector containing the singular values.
Definition commons.h:101
c3e_matrix * right
Matrix containing the right singular vectors.
Definition commons.h:100
Represents a tensor, a multi-dimensional array of numerical values.
Definition commons.h:111
uint32_t dimensions
The number of dimensions in the tensor.
Definition commons.h:112
size_t dimension_size
The size of each dimension.
Definition commons.h:113
c3e_matrix ** matrices
Pointer to an array of matrices representing the tensor data.
Definition commons.h:115
c3e_vector * data
Pointer to a vector containing the tensor data.
Definition commons.h:116
Represents a mathematical vector.
Definition commons.h:62
c3e_number * data
Pointer to the data array containing vector elements.
Definition commons.h:64
uint32_t size
The number of elements in the vector.
Definition commons.h:63