Skip to main content

monomial

Macro monomial 

Source
macro_rules! monomial {
    ($($id:expr),+) => { ... };
}
Expand description

Creates a crate::MonomialDyn from variable ID expressions.

This macro creates a general monomial from one or more variable ID expressions. The degree of the monomial depends on the number of variables provided.

ยงExamples

use ommx::{monomial, MonomialDyn, VariableID};

// Create a linear monomial (x1)
let x1 = monomial!(1);

// Create a quadratic monomial (x1 * x2)
let x1_x2 = monomial!(1, 2);

// Create a cubic monomial (x1 * x2 * x3)
let x1_x2_x3 = monomial!(1, 2, 3);

// Create from expressions
let i = 1;
let j = 2;
let k = 3;
let xi_xj_xk = monomial!(i, j, k);