1.10 Math Operations

To write a fast and optimised code, one should use the jhplot.math package. Look at the corresponding API. This package is based on the jMathTools package and is designed for common scientific computing needs. For example, it has the following operations with the doubleArray objects: merge, insert, delete rows and columns, simple linear algebra, calculate mean, variance, covariance, create some random generators.

Below is a simple example to create an array with 1000 random numbers between 0 and 100:

>>> from jhplot.math.StatisticSample import randUniform
>>> a=randUniform(1000,0.0,100.0)
One can easily write this array to a file or read it back using static methods of jhplot.math.

It has to be noted that the above code is a factor 10 faster than a code in which one fills an array using a loop over each index, since Jython is not efficient for such operations.