Skip to content
Alberto Morcillo Sanz edited this page Mar 29, 2024 · 4 revisions

Welcome to the tensor wiki!

Tensor algebra library in a single header file in C11 for graphics programming, machine and deep learning and physics.

  • Vectors, matrices and higher rank tensors.

  • Linear algebra and tensor algebra operations.

  • Pure C code, easy to integrate in C++ or other languajes using bindings.

  • Only one header file.

Still under development

Create tensors

Create vector

In order to create a vector of n elements call create_vector(n) which returns Vector*

Vector* u = create_vector(3);

set_value(u, 1.0, 0);
set_value(u, 2.0, 1);
set_value(u, 3.0, 2);

destroy_tensor(u);

Create matrix

Create rank 3 tensor

Create rank n tensor

Destroy tensor

Operations

Set value

Get value

Get length

Transpose of a tensor

Tensor-scalar addition

Tensor-scalar multiplication

Tensor-Tensor addition

Matrix multiplication

Hadamard product

Tensor product

Dot product

Dyadic product

Cross product

Transform vector

Matrix determinant

Inverse of a matrix

Debugging

Print vector

Print matrix

Print rank 3 tensor

Print rank 4 tensor

Print rank n tensor