[][src]Macro arthroprod::alpha

macro_rules! alpha {
    ($($num:expr) *) => { ... };
}

Simpler variadic generation of [Alpha] values. This is the recommended way of creating raw alpha values if they are needed. Arguments are u8s in the range 0-3.

Panics

Panics if the specified alpha indices do not correspond to an allowed alpha (see [ALLOWED_ALPHA_FORMS]).

Examples

use arthroprod::algebra::*;

let a1 = alpha!(0 2 3);
let a2 = -alpha!(0 1);
let a3 = alpha!();

assert_eq!(a1, Alpha::new(Sign::Pos, Form::Trivector(Index::Zero, Index::Two, Index::Three)).unwrap());
assert_eq!(a2, Alpha::new(Sign::Neg, Form::Bivector(Index::Zero, Index::One)).unwrap());
assert_eq!(a3, Alpha::new(Sign::Pos, Form::Point).unwrap());