Various guide edits

This commit is contained in:
Kiana Sheibani 2024-06-08 15:28:57 -04:00
parent 8903575d8b
commit bd1eee1366
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
4 changed files with 9 additions and 10 deletions

View file

@ -1,10 +1,13 @@
# NumIdr Guide # NumIdr Guide
Welcome to NumIdr's guide! Welcome to NumIdr's guide! This guide will serve as a basic introduction to the core ideas of NumIdr, as well as a reference for common functions and utilities that you might otherwise miss.
If you're familiar with the Python library [NumPy](https://numpy.org/) or anything based on it, then a lot of the early content will be familiar, as NumIdr is based on the same array type. If you're familiar with the Python library [NumPy](https://numpy.org/) or anything based on it, then a lot of the early content will be familiar, as NumIdr is based on the same array type.
### Tutorial > [!NOTE]
> This guide assumes a basic understanding of linear algebra, and it will not explain any linear algebra concepts necessary for understanding NumIdr's structure.
### Primary Features
1. [Fundamental Data Types](DataTypes.md) 1. [Fundamental Data Types](DataTypes.md)
2. [Basic Operations on Arrays](Operations.md) 2. [Basic Operations on Arrays](Operations.md)

View file

@ -126,7 +126,7 @@ The `TransType` parameter dictates what kind of transform it is. More informatio
### Permutations ### Permutations
The type `Permutation n` represents a permutation of `n` elements. Permutations are mostly used internally for various algorithms, but they are also an input in various operations, such as those that permute the axes of an array. The type `Permutation n` represents a permutation of `n` elements. Permutations are mostly used internally for various algorithms, but they are also an input in some operations, such as permuting the rows or columns of a matrix.
Permutations can be composed using `(*.)`, and a permutation can be converted into a matrix using `permuteM`. Permutations can be composed using `(*.)`, and a permutation can be converted into a matrix using `permuteM`.

View file

@ -76,7 +76,7 @@ There are also direct constructors for transforms, which are often more convenie
Like most objects in NumIdr, transforms multiply with the generalized multiplication operator `(*.)`, and `identity` and `inverse` can also be used with transforms. Like most objects in NumIdr, transforms multiply with the generalized multiplication operator `(*.)`, and `identity` and `inverse` can also be used with transforms.
> [!IMPORTANT] > [!NOTE]
> There is no `tryInverse` function for transforms. This is because all transforms are required to be invertible, so there isn't any need for it; you can safely use `inverse` in all circumstances. > There is no `tryInverse` function for transforms. This is because all transforms are required to be invertible, so there isn't any need for it; you can safely use `inverse` in all circumstances.
Transforms of any types can be multiplied. When two transforms of different types are multiplied, the resulting transform type is determined by taking the most specific type that both original types can be cast to. For example, an `Orthonormal` transform multiplied by a `Translation` returns an `Isometry`. Transforms of any types can be multiplied. When two transforms of different types are multiplied, the resulting transform type is determined by taking the most specific type that both original types can be cast to. For example, an `Orthonormal` transform multiplied by a `Translation` returns an `Isometry`.

View file

@ -4,18 +4,14 @@ As linear algebra is one of the main concerns of NumIdr, most of its provided fu
## The Generalized Multiplication Operator ## The Generalized Multiplication Operator
A linear algebra library wouldn't be very useful without matrix multiplication! Since `(*)` is already used for element-wise multiplication, NumIdr defines a new interface `Mult`: A linear algebra library wouldn't be very useful without matrix multiplication! Since `(*)` is already used for element-wise multiplication, NumIdr defines a new interface `Mult` that can accept and return values of different types:
```idris ```idris
interface Mult a b c where interface Mult a b c where
(*.) : a -> b -> c (*.) : a -> b -> c
-- Synonym for homogeneous cases:
Mult' : Type -> Type
Mult' a = Mult a a a
``` ```
The generalized multiplication operator `(*.)` covers matrix multiplication, scalar-vector multiplication, and any other operation that's vaguely multiplication-like. The generalized multiplication operator `(*.)` covers matrix multiplication, scalar-vector multiplication, and any other linear algebra operation that's vaguely multiplication-like.
## Vectors ## Vectors