6 releases

0.3.1 Jul 23, 2019
0.3.0 Jul 23, 2019
0.2.1 Jul 22, 2019
0.1.2 Jul 20, 2019

#11 in #formulas

27 downloads per month
Used in xalg-bin

GPL-3.0 license

17KB
342 lines

A library for generating random formulas.

Features

  • Export to LaTeX.
  • Control the operators which are involved in generating process.

Getting Started

use {
   lib_xalg::{
       formula::{OperatorFlag, OperatorFlag::*},
       generate,
   },
   std::collections::HashSet,
};
let hashset = [Add, Sub, Mul, Div, Pow].iter().copied().collect::<HashSet<OperatorFlag>>();
println!("{}", generate(5, 3, 3, &hashset).unwrap());

lib.rs:

A library for generating random formulas.

Features

  • Export to LaTeX.

  • Control the operators which are involved in generating process.

Getting Started

use {
   lib_xalg::{
       formula::{OperatorFlag, OperatorFlag::*},
       generate,
   },
   std::collections::HashSet,
};
let hashset = [Add, Sub, Mul, Div, Pow].iter().copied().collect::<HashSet<OperatorFlag>>();
println!("{}", generate(5, 3, 3, &hashset).unwrap());

Dependencies

~1.6–2.7MB
~47K SLoC