Crate matrix

source ·
Expand description

Matrix laboratory.

Formats

The following storage formats are supported:

  • Banded, suitable for matrices with a small number of superdiagonals and/or subdiagonals;

  • Compressed, suitable for generic sparse matrices;

  • Conventional, suitable for dense matrices;

  • Diagonal, suitable for diagonal matrices; and

  • Packed, suitable for symmetric, Hermitian, and triangular matrices.

Example

#[macro_use]
extern crate matrix;

use matrix::prelude::*;

let mut sparse = Compressed::zero((2, 4));
sparse.set((0, 0), 42.0);
sparse.set((1, 3), 69.0);

let dense = Conventional::from(&sparse);
assert!(
    &*dense == &*matrix![
        42.0, 0.0, 0.0,  0.0;
         0.0, 0.0, 0.0, 69.0;
    ]
);

Modules

Decompositions.
Storage formats.
Basic operations.
Reexports of modules, traits, and types.

Macros

A macro for composing matrices in the natural order.

Structs

An error.

Traits

An element.
A matrix.
The base trait for numeric types, covering 0 and 1 values, comparisons, basic numeric operations, and string conversion.
A position.
A size.

Type Definitions

A result.
A complex number with 32-bit parts.
A complex number with 64-bit parts.