pub struct SimpleFormat {}Expand description
The elements of a simple code-generation format (C++
DASimpleFormat): strings used around signs, products, variables, and
powers, plus line wrapping.
Fields§
§pos: StringPrefix of a positive term (e.g. "+").
neg: StringPrefix of a negative term with the coefficient negated (e.g. "-").
mul: StringMultiplication separator (e.g. "*").
pre_pow: StringPower prefix (e.g. "pow(").
var: StringVariable name prefix (e.g. "p").
pre_var: StringBefore the variable index (e.g. "[").
post_var: StringAfter the variable index (e.g. "]").
pow: StringPower separator (e.g. ",").
post_pow: StringPower suffix (e.g. ")").
linebreak: StringLine break inserted between wrapped lines.
first_var: i64Offset added to the 0-based variable position.
first_pow: i64Offset added to each exponent.
monperline: u32Monomials per line before wrapping.
shorten: boolSkip the power syntax for exponent 1.
Implementations§
Source§impl SimpleFormat
impl SimpleFormat
Sourcepub fn c() -> SimpleFormat
pub fn c() -> SimpleFormat
C array-output preset (p[0]*p[1]).
Sourcepub fn c_pow() -> SimpleFormat
pub fn c_pow() -> SimpleFormat
C preset using pow(...).
Sourcepub fn fortran() -> SimpleFormat
pub fn fortran() -> SimpleFormat
Fortran preset (p(1)*p(2)).
Sourcepub fn fortran_pow() -> SimpleFormat
pub fn fortran_pow() -> SimpleFormat
Fortran preset using **( ).
Sourcepub fn matlab() -> SimpleFormat
pub fn matlab() -> SimpleFormat
MATLAB preset (p(1).*p(2)).
Sourcepub fn matlab_pow() -> SimpleFormat
pub fn matlab_pow() -> SimpleFormat
MATLAB preset using .( ).
Sourcepub fn latex() -> SimpleFormat
pub fn latex() -> SimpleFormat
LaTeX preset (x_{1} \cdot x_{2}^{3}).