Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yannrichet/jmatharray
Basic math in Java
https://github.com/yannrichet/jmatharray
Last synced: 11 days ago
JSON representation
Basic math in Java
- Host: GitHub
- URL: https://github.com/yannrichet/jmatharray
- Owner: yannrichet
- License: bsd-2-clause
- Created: 2015-03-14T13:20:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-03-16T17:04:24.000Z (over 3 years ago)
- Last Synced: 2024-10-08T18:06:22.569Z (30 days ago)
- Language: Java
- Homepage:
- Size: 439 KB
- Stars: 2
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.yannrichet/JMathArray/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.yannrichet/JMathArray)
[![Build Status](https://travis-ci.org/yannrichet/jmatharray.png)](https://travis-ci.org/yannrichet/jmatharray)
[![codecov](https://codecov.io/gh/yannrichet/jmatharray/branch/master/graph/badge.svg)](https://codecov.io/gh/yannrichet/jmatharray)# JMathArray: basic math in Java
JMathArray provides classes with static methods for basic math in Java. Random number generations is based on RngPack?, linear algebra is based on Jama.
List of static methods applicable on int and double arrays (double[][]):
* merge, insert, delete rows and columns : org.math.array.DoubleArray, org.math.array.IntegerArray
* simple linear algebra: LU, QR, EigenValues?, Cholesky, SingularValues? (based on JAMA package): org.math.array.LinearAlgebra
* simple statistics: mean, variance, covariance, histograms : org.math.array.StatisticSample
* some random generators (based on RnGPack): normal, lognormal, triangular, chi square, weibull, ... : org.math.array.StatisticSample## Example Java code ##
```java
import static org.math.array.LinearAlgebra.*;
...
// random 4 x 4 matrix + Id
double[][] A = plus(random(4, 4), identity(4));
// Eigen values Decomposition : A = V * D * V^-1
EigenvalueDecomposition eig = eigen(A);
double[][] V = eig.getV();
double[][] D = eig.getD();
```
JMathArray syntax is stable. Only new features may be added, and current syntax will stay available.## Use it ##
Put https://github.com/yannrichet/jmatharray/blob/master/dist/jmatharray.jar in your java classpath
Or include maven dependency:
```xml...
com.github.yannrichet
jmatharray
1.0
...```
Then add a static import statement in your class:
```java
import static org.math.array.DoubleArray.*;
import static org.math.array.LinearAlgebra.*;
import static org.math.array.StatisticSample.*;
```![Analytics](https://ga-beacon.appspot.com/UA-109580-20/jmatharray)