package prbnmcn-linalg
Install
Dune Dependency
Authors
Maintainers
Sources
md5=8b82c3fea93d99b25ba945e0fbda9dd4
sha512=38a673af59c5b775cee2586e826b2f346274fc1bfee0f883d47a911ec6300ce1ed5f205d38f0e06cf260766328dad527d067e182e7f0a90cd45c1f06b09befcf
doc/prbnmcn-linalg/Linalg/Mat/Rational/index.html
Module Mat.Rational
Source
Float
allows to manipulate Q.t
-valued matrices
type index := base_index * base_index
include Intf.Vec
with type 'a k := 'a k
and type 'a m := 'a m
and type 'a shape := 'a shape
with type ('a, 'b) morphism = ('a, 'b) Tensor.Int.Morphism.t
with type elt = Q.t
Type of shape morphisms.
Type of elements.
Creates an input vector from a dimension and a function.
Get an elemement of an input vector. Does not perform bound checking.
basis s i r
is the vector of shape s
everywhere equal to R.zero except at index i
where it is equal to r
. Raises Out_of_bounds
if i
does not belong to s
.
Pointwise addition. Raises Dimensions_mismatch
if the shape of operands are not equal.
Pointwise subtraction. Raises Dimensions_mismatch
if the shape of operands are not equal.
Pointwise multiplication. Raises Dimensions_mismatch
if the shape of operands are not equal.
Swapping of indices. Raises Out_of_bounds
if given indices are invalid.
iter v
iterates the effectful computation at each index
reduce op zero v
folds the binary, associative operator op
over the elements of v
with initial value zero
. Fold ordering is implementation-dependent: consider using commutative operators.
val (:=) :
('i shape, 'i m, 'a m, unit m) Intf.ovec ->
('i shape, 'i m, 'a m) Intf.vec ->
unit m k
Vector assignement.
Pointwise addition, stores result in first operand.
Pointwise subtraction, stores result in first operand.
Pointwise multiplication, stores result in first operand.
Indexing
cols m
returns the shape of the columns of m
.
rows m
returns the shape of the rows of m
Identity matrix
Square matrix with given vector on diagonal
Get a column.
Convert a vector into a matrix with this vector as single column.
Get a row.
Convert a vector into a matrix with this vector as single row.
Swap two rows.
Swap two columns.
Concatenate two matrices horizontally, provided they have the same number of rows.
Concatenate two matrices vertically, provided they have the same number of columns.