This module's API reference is not yet ready.
Kone: Linear Algebra
This module provides an API for linear algebra. It includes API for manipulation with vectors and matrices as well as API for different algorithms like computation of matrix's determinant.
This module is based on Kone's own multidimensional collections and Kone's algebraic contexts.
Applying the dependencies
- Gradle Kotlin DSL
- Gradle Groovy DSL
- Maven
dependencies {
implementation("dev.lounres:kone.linearAlgebra:0.0.0-experiment")
}
dependencies {
implementation 'dev.lounres:kone.linearAlgebra:0.0.0-experiment'
}
<dependency>
<groupId>dev.lounres</groupId>
<artifactId>kone.linearAlgebra</artifactId>
<version>0.0.0-experiment</version>
</dependency>
Vectors and matrices API
Linear algebra operates on vectors of vector spaces and linear operators from vector spaces to vector spaces.
But in the case of specified bases, vectors and matrices can be represented as rectangular tables called "matrices".
(Vectors are represented as tables with either column number one or row number one.)
So there are classes
Matrix
,
RowVector
and ColumnVector
that represent matrices, row vectors (one column tables), and column vectors (one row tables).
Also, all of them have settable variants:
SettableMatrix
,
SettableRowVector
and SettableColumnVector
.
The classes are intended to be value classes. But for now inheritance between value classes is prohibited.
Algebraic operations API
Now, the main reason this module exists is our wish to perform algebraic operations on matrices and vectors.
That's why we have interface
VectorKategory
that represents the context for the operations.
See its API reference for details about its operations.
Well, those operations work only in case of compatible shapes. Hence, they throw exceptions otherwise. So this context is called "vector category" instead of "vector space".
Algorithms API
The main idea of the API is to provide different algorithms like square matrix determinant computation as universal blocks. But it is just an idea and is not even tried to be prototyped.