rustmodel/examples/old/utils.rs

17 lines
347 B
Rust
Raw Permalink Normal View History

2023-11-16 22:28:16 +00:00
use nalgebra::base::*;
/// `<Type, Rows, Columns>`
pub type Mat<T, const R: usize, const C: usize> =
Matrix<T, Const<R>, Const<C>, ArrayStorage<T, R, C>>;
pub type Vect<T, const R: usize> = Matrix<T, Const<R>, U1, ArrayStorage<T, R, 1>>;
pub fn max(l: &[f64]) -> f64 {
let mut m = l[0];
for &i in &l[1..] {
if i > m {
m = i;
}
}
m
}