Version History

Jep 3 Releases | Jep 2 Releases | Jep 1 Releases

Version 4.0

Add support for Java Modules

A modularized version of Jep for use with Java 11 is available in the modules directory. The code is written to be compatible with both long term support versions Java SE 1.8 and Java SE 1.11.

Handling of non-thread safe functions

Most functions can work fine in multiple threads, there are some which need special treatment. These functions can be indicated by implementing JepComponent which provides a getLightWeightInstance() to return a thread-safe copy of the function.

By when using the FunctionTable and OperatorTable in multiple threads their getLightWeightInstance() methods will just return this which is more memory efficient in the default case. This is the behaviour in Jep 3.4 and earlier.

Starting in version 4.0, both FunctionTable and OperatorTableI have shallowCopy() methods. This will create new instance of the table and copies all functions operators into the new table. If the function implements JepComponent then its getLightWeightInstance() is called to return a thread-safe version.

There is also a MediumWeightComponentSet class which can be used to create a Jep instance which insures thread-safe versions of functions. To use

Jep jep = new Jep();
Jep copy = new Jep(new MediumWeightComponentSet(jep));
and the copy instance can be safely used in new thread.

To implement this functionality FunctionTable, and EmptyOperatorTable have protected threadSafeMapCopy() methods which returns a copy of the internal map respecting JepComponents. They also have protected FunctionTable(Map<,>), EmptyOperatorTable(Map<,>) constructors. This allows subclasses it easily implement this behaviour

class MyFunctionTable extends FunctionTable {
    ...
    protected MyFunctionTable(Map<String, PostfixMathCommandI> tbl) {
		super(tbl);
	}

	public FunctionTable shallowCopy() {
    	Map<String,PostfixMathCommandI> newMap = this.threadSafeMapCopy();
        FunctionTable ft = new MyFunctionTable(newMap);
        return ft;
    }
All sub-classes also implement these constructors.

The Jep 3.5 release had a broken implementation of getLightWeightInstance() which would always return an empty table.

Evaluation

A new UncheckedEvaluator evaluator which does no checking of intermediate values during evaluation. Produces a 10-20% speed increase.

Slight change in the logic of the FastEvaluator. Test for functions which implement CallbackEvaluationI happens after tests for UnaryFunction etc.

Support for Lambda expressions

The UnaryFunction, BinaryFunction and NaryBinaryFunction have static factory methods which allow creation using lambda functions. For example

// Function using explicit class
UnaryFunction recip = UnaryFunction.instanceOf(
         x -> 1.0 / ((Number) x).doubleValue());
// Function where arguments are of an explicit type
UnaryFunction neg = UnaryFunction.instanceOf(Integer.class, x -> -x );
// Function using a method reference
UnaryFunction cubrt = UnaryFunction.instanceOf(Double.class,Math::cbrt);
// Binary function
BinaryFunction diff =  BinaryFunction.instanceOf(Number.class, 
        (x,y) -> x.doubleValue() -  y.doubleValue());
// NaryBinaryFunction
NaryBinaryFunction sum =  NaryBinaryFunction.instanceOf(
        (x,y) -> ((Number) x).doubleValue() + ((Number) y).doubleValue());

Complex

Bug Fixes

Other changes

Parsing

Functions and operators

Printing

Variables

Light weight components, hooks and serialization

Other changes

Examples and tests

Version 3.5

Major new features

Localization:

Threads

Bound variables:

Major changes

ConfigurableParser:

Functions:

BigDecimals:

NullWapper package:

Other new features

Removed features

Bug fixes

Other changes

Version 3.4 (released 2010/11/01)

Core Jep changes

Functions

Configurable Parser

Misc classes

Tests and Examples

Bug fixes

Version 3.3 (released 2008/11/30)

Core Jep changes

Functions

Examples

top

Version 3.2 (released 2008/02/12)

General Changes:

Changes to the configurable parser:

Known issues:

top

Version 3.1 (released 2007/09/22)

Known issues:

top

Version 3.0 (released 2007/07/01)

Known issues: