facaiy / math-expression-parser Goto Github PK
View Code? Open in Web Editor NEWA scala library for parsing mathemitical expressions with support for parentheses and variables.
License: MIT License
A scala library for parsing mathemitical expressions with support for parentheses and variables.
License: MIT License
Hi,
Any 2 arguments function from scala.math (max
, min
, pow
, atan2
, hypot
) throws a ArrayIndexOutOfBoundsException:
ex: io.github.facaiy.math.expression.Expression[String => Double,Double] = Expression(<function1>)
java.lang.ArrayIndexOutOfBoundsException: 2
at io.github.facaiy.math.expression.Expression$$anonfun$toExpression$3.apply(Expression.scala:29)
at io.github.facaiy.math.expression.Expression$$anonfun$toExpression$3.apply(Expression.scala:26)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:44)
... 38 elided
Code example:
val ex = io.github.facaiy.math.expression.MathExp.parse("pow(2, 10)")
ex.eval(Map.empty)
We are interested in using your library but would like to extend it to other types, for example Saddle Vecs.
For example, be able to define operators that are Map[String, Vec[Double] => Vec[Double]]
As it stands now, we have to fork your library, and rewrite object FunctionRegister
to have two different function registers: OperatorDouble
and OperatorVector
(Saddle is a Scala library for numeric operations not unlike Pandas - http://saddle.github.io/)
The Travis CI build for math-expression-parser is failing.
Installing oraclejdk8
$ export JAVA_HOME=~/oraclejdk8
$ export PATH="$JAVA_HOME/bin:$PATH"
$ ~/bin/install-jdk.sh --target "/home/travis/oraclejdk8" --workspace "/home/travis/.cache/install-jdk" --feature "8" --license "BCL"
Ignoring license option: BCL -- using GPLv2+CE by default
install-jdk.sh 2019-07-17
Expected feature release number in range of 9 to 14, but got: 8
The command "~/bin/install-jdk.sh --target "/home/travis/oraclejdk8" --workspace "/home/travis/.cache/install-jdk" --feature "8" --license "BCL"" failed and exited with 3 during .
Your build has been stopped.
I propose we use OpenJDK8.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.