qmat 0.5.1

A simple library for 2-dimensional matrices.
Documentation
1
2
3
4
5
6
7
#![warn(clippy::all, clippy::pedantic)]

use std::{iter::Sum, ops::Mul};

pub fn arr_dot<T: Mul + Sum<<T as Mul>::Output> + Copy, const M: usize>(a: [T; M], b: [T; M]) -> T {
    a.iter().enumerate().map(|(i, x)| *x * b[i]).sum()
}