Expand description
Provides scalar, vector, vector-vector, vector-matrix and matrix-matrix operations.
Most of the operations are optimized using the underlying BLAS implementation. For each function it is explicitly documented whether or not BLAS is used.
§Examples
The following example adds two vectors using BLAS and stores the result in the first vector.
use rustml::*;
let mut a = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0];
let b = [3.0, 6.0, 2.0, 3.0, 6.0, 9.0];
a.iadd(&b);
assert_eq!(a, [4.0, 8.0, 5.0, 7.0, 11.0, 15.0]);
Traits§
- Functions
InPlace - Trait for common mathematical functions for scalars, vectors and matrices.
- Matrix
Matrix OpsIn Place - Trait for matrix-matrix operations.
- Matrix
Scalar OpsIn Place - Trait for matrix-scalar operations.
- Vector
Vector OpsIn Place - Trait for inplace vector-vector operations.
Functions§
- d_axpy
- Computes
alpha * x + y
and stores the result iny
. (optimized via BLAS) - d_gemm
- Computes
alpha * op(A) * op(B) + beta * C
and stores the result inC
. (optimized via BLAS) - d_gemv
- Computes
alpha * A * x + beta * y
oralpha * A^T * x + beta * y
and stores the result iny
. (optimized via BLAS) - d_nrm2
- Computes the L2 norm (euclidean norm) of a vector. (optimized via BLAS)
- s_axpy
- Computes
alpha * x + y
and stores the result iny
. (optimized via BLAS) - s_gemm
- Computes
alpha * op(A) * op(B) + beta * C
and stores the result inC
. (optimized via BLAS) - s_gemv
- Computes
alpha * A * x + beta * y
oralpha * A^T * x + beta * y
and stores the result iny
. (optimized via BLAS) - s_nrm2
- Computes the L2 norm (euclidean norm) of a vector. (optimized via BLAS)