Questions tagged [apache-commons-math]

Apache Commons Math is a library of lightweight, self-contained mathematics and statistics components addressing the most common problems not available in the Java programming language or Apache Commons Lang.

Apache Commons Math is a library of lightweight, self-contained mathematics and statistics components addressing the most common problems not available in the Java programming language or Apache Commons Lang.

Binaries and source code for Apache Commons Math can be downloaded from here.

202 questions
1
vote
1 answer

FastSineTransformer - pad array with zeros to fit length

I'm trying to implement a poisson solver for image blending in Java. After descretization with 5-star method, the real work begins. To do that i do these three steps with the color values: using sine transformation on rows and columns multiply…
MiVoth
  • 972
  • 6
  • 16
1
vote
1 answer

Getting a gradient of a bi-variant function

I'm doing some video processing, for each frame I need to get a gradient of a bi-variate function. The function is represented as a two dimensional array of doubles. Where the domain is the rows and columns indices and the range is the double value…
sagioto
  • 251
  • 1
  • 5
  • 16
1
vote
0 answers

Jama and Commons Math don't give desired result for relatively big matrix

I am using Jama and Apache Commons Math to solve linear algebra equations. They both work fine when the matrix is small (4x4). But not when it is relatively big (25x25). Below are my implemenations: Jama: public double[][] solve(double[][]…
Balkrishna Rawool
  • 1,865
  • 3
  • 21
  • 35
0
votes
1 answer

RealMatrix object in Java class

It seems that I can`t use this Apache Commons Math library in my class because I get unexpected token on matrixSim when I try to use RealMatrix in my consructor like this: class vecGenUn { double[][] prevMat; RealMatrix matrixSim; //this is…
Fedja Blagojevic
  • 813
  • 1
  • 10
  • 18
0
votes
0 answers

Java Equation Evaluation

I have string equation like x +(23 + 78 ) = (32112 / 432) and inputting this equation I need to get the value of 'x' programmatically, also equation might be different in different times, but it will only have one variable, and I need this variable…
Sameesh
  • 315
  • 8
  • 18
0
votes
1 answer

SpearmansCorrelation throws NotANumberException when calculating correlation of eigenvector centrality

I am trying to calculate Spearman's correlation for shell indices and eigenvector centralities in Java. I need to export eigenvector values and Spearman's correlation to a .csv file. Here are the given Java files. CentralitiesAnalyzer.java: public…
IgorArnaut
  • 33
  • 6
0
votes
1 answer

Android Studio: getStandardDeviation() Method from org.apache.commons.math4.stat.descriptive doesnt give me the exact value of the Std

I was wondering if someone could help me a bit. Im developing a program that extracts mean and standard deviation from a list of double values. Im using org.apache.commons.math4.stat.descriptive to do so, this library has a method called…
0
votes
1 answer

How to correctly import from apache commons in Java

First of all, forgive my poor programming skills. I recently downloaded commons math 2.2, which came with 3 .jar files: commons-math-2.2-javadoc.jar commons-math-2.2-sources.jar commons-math-2.2.jar I want to use the normal distribution methods but…
Ben Gorman
  • 1
  • 1
  • 1
0
votes
1 answer

Java commons-math Issue forming and extracting verices of ConvexHull2D

I am working on ConvexHull problem and I need to identify vertices of a convex hull. I am using Apache commons-math's - ConvexHull2D. Here is what I have so far public static void main(String[] args) { Vector2D v1 = new Vector2D(1, 3); …
Chandan
  • 640
  • 4
  • 10
0
votes
0 answers

Difference in Singular values between OjAlgo and Commons-math while decomposing SVD

We are currently evaluating OjAlgo library as a replacement to commons-math library for SVD computation. For below input, there is a difference between singular values of OjAlgo and commons-math. I have worked with OjAlgo 47.1.2 and with latest…
Sudheer
  • 5
  • 2
0
votes
1 answer

Huge difference between SVD solution output of commons math3 and ojalgo libraries

Solution of SVD difference is very high between commons-math3 and ojalgo libraries. Is there any way to reduce the difference based on any input params. double[][] olsColumns = { { 1.0, 1.0 }, { 1.0, 1.0 }, { 1.0, 1.0 }, { 1.0, 1.0 }, { 1.0,…
Sudheer
  • 5
  • 2
0
votes
1 answer

How to get the last best guess from LeastSquareOptimizer?

Is there a way to get the last best guess of the LeastSquaresOptimizer? I am using Apache Commons Math to perform a least squares optimization. To do this, I must provide a maxEvaluations() and maxIterations() value. The issue is, if the…
Espresso
  • 740
  • 13
  • 32
0
votes
0 answers

How to integrate y(x) using Apache Commons Math

I am looking for the java Apache Commons Math equivalent of the python's scipy integration of y(x) using samples along the given axis and the composite Simpson’s rule: data = df.Y.values samples = df.X.values result = scipy.integrate.simps(data ,…
kofucii
  • 7,393
  • 12
  • 51
  • 79
0
votes
1 answer

Possible to get shadow prices with org.apache.commons.math3.optim?

I have a large LP problem looking like: max z = c^T * x s.t. A*x <= b and Aeq * x = beq After writing the constraints the code looks like: import org.apache.commons.math3.optim.linear.LinearConstraint; import…
0
votes
0 answers

null space of an upper triangle Matrix

I am trying to find the null space (basis for the Kernel) of an any given matrix in Java.To make life easier I am using ApacheMath's QR decomposition such that A=QR, where Q is Invertable (by itself) and R is an upper triangle Matrix. which method…