Skip to main content

mvec

Macro mvec 

Source
macro_rules! mvec {
    [$($ar_elem:expr),+] => { ... };
}
Expand description

Simpler variadic generation of [MultiVector] values. Each argument must impliment the AR trait so that it is possible to convert them to [Term]s, with the resulting MultiVector is the sum of all terms generated this way.

§Panics

Panics if any of the arguments do not impliment the AR trait.

§Examples

use arthroprod::algebra::*;

let m1 = mvec![alpha!(1), -term!(0 3)];
let mut m2 = MultiVector::new();
m2.push(Term::new(None, alpha!(1)));
m2.push(-term!(0 3));

assert_eq!(m1, m2);