Function nalgebra_glm::comp_add

source ·
pub fn comp_add<N: Number, R: Dimension, C: Dimension>(m: &TMat<N, R, C>) -> Nwhere
    DefaultAllocator: Alloc<N, R, C>,
Expand description

The sum of every component of the given matrix or vector.

Examples:

let vec = glm::vec2(3.0, 4.0);
assert_eq!(7.0, glm::comp_add(&vec));

let mat = glm::mat2(0.0, 1.0, -3.0, 3.0);
assert_eq!(1.0, glm::comp_add(&mat));

See also: