donpir / JMATRW

Java Library to read/write *.MAT Files
GNU Lesser General Public License v3.0
1 stars 0 forks source link

[JMATRW4Analytics] Read decimal constants in the math formula #14

Open donpir opened 8 years ago

donpir commented 8 years ago

JMATRW4Analystics has a module to parse string with mathematical expressions and produce a syntax tree. Actually the library does not read decimal constants.

donpir commented 8 years ago

This is the JUnit testing code to reproduce the issue

`

 def testFormulaWithConstValues() {
     val filterFormula : String = "Peak > mean - 4,7 * stddev";
     val variables = Map[String, Double]("Peak" -> 10, "mean" -> 10, "stddev" -> 0);
     val expres = new MathExpEvaluator(filterFormula).evaluate(variables);
     expres match {
       case res : DTBool => assertFalse(res.value)
       case _ => fail();
     }
  }

`