oj! Algorithms – ojAlgo – is Open Source Java code to do mathematics, linear algebra and optimisation
Questions tagged [ojalgo]
74 questions
1
vote
1 answer
How do one solve linear programming problems with ojAlgo?
I am trying to learn how to solve a linear programming problem and I want to use ojAlgo LinearSolver.
I solve the equality constraints using a SolverTask and get a single feasible point. Nice!
Then I solve what I believe is an identical problem…

Magnus
- 35
- 5
1
vote
1 answer
Is there any ojAlgo solver for when the condition number is large and the matrix is symmetric and indefinite?
I use ojAlgo to solve a system of linear equations.
In one case I get a RecoverableCondition exception. Probably because matrix is ill-conditioned, the condition number is about 1e15.
I use ojAlgo to solve it as seen in the code below. It usually…

Magnus
- 35
- 5
1
vote
2 answers
Integer Optimization using OjAlgo objective function
I'm trying to use ojAlgo library in Java for Integer Optimization but I'm unable to provide it the objective function I intend to.
I'd like to minimize the function: (A - B.X)'(A - B.X), where A is a (n x 1) matrix, B is a (n x n) diagonal matrix…

SGI
- 303
- 3
- 10
1
vote
1 answer
Obtaining a good suboptimal solution from ojalgo for a linear optimisation
Introduction
I'm trying to use the ojalgo library to produce a solution to controlling thrusters placed in arbitrary places to generate an overall requested rotation and translation. Sometimes the requested rotation and translation will not be…

Richard Tingle
- 16,906
- 5
- 52
- 77
1
vote
2 answers
get more than 1 result from Optimisation,Result - OjAlgo, kotlin
i have simple binary liinear programming funcjon and i want to get more than one, for example 10 best solutions from Optimisation.Result = model.minimise(). Is this posible with OjAlgo?
I knew that purpose of function is to find one, best solution…

Rafał Kaczor
- 21
- 3
1
vote
1 answer
limit amount of variables used in solution - oj! Algo & kotlin
im working on app to optimize meal planning. My app has 10 meals (x1-x10) with price, carb value, protein value and calories value. I want to choose always 3 meals from these 10. How to set this limit?
My code:
val model = ExpressionsBasedModel()
…

Rafał Kaczor
- 21
- 3
1
vote
1 answer
Sparse Matrix Decomposition in ojalgo
I want to do Least-Squares Adjustment with ojalgo.
The problem is that my Designmatrix is very huge (more than 100kx100k) but very sparse.
To set up huge sparse matrices with ojalgo is no problem. Also do some basic mathematical operations.
When i…

RonnieHerbert
- 11
- 1
1
vote
1 answer
How to get multipliers after solving a quadratic program in ojAlgo
I implement a Sequential quadratic programming (SQP) optimizer and use ojAlgo for the quadratic programming (QP) subproblem.
My question is:
How do I get hold of the "Lagrange multipliers" for the QP solution?
In the attached example code that solve…

Magnus
- 35
- 5
1
vote
1 answer
ojalgo BUG: constraint breaking weights while using the ConvexSolver in ojAlgo
I wanted to calculate the efficient frontier with equality and inequality constraints for given covariance matrix and expected returns. While doing so, the solver calculates weights that unfortunately seem to break the constraints. The overall…

HubertHauser123
- 11
- 1
1
vote
1 answer
How do I seralize Primitive64Matrix in OjAlgo?
I'm working on a image classification library, in 100% Java. It does not include deep neural networks. It uses Fisherfaces by OjAlgo. jFaces works very similar to regular machine learning software. Train model and validate it. I want to serialize…

euraad
- 2,467
- 5
- 30
- 51
1
vote
1 answer
Insert Access2D element in Primitive64Store in OjAlgo at specific column and row
Is it possible to insert a Access2D element in a Primitive64Store in OjAlgo?
Access2D data = Access2D.wrap(mu.toRawCopy2D());
Primitive64Store B = Primitive64Store.FACTORY.make(rows * m, columns * n);
I want to insert data into B at…

euraad
- 2,467
- 5
- 30
- 51
1
vote
0 answers
Detecting costs/variables resulting in unbounded optimization problem in ojAlgo
I am using the ojAlgo linear/quadratic solver via ExpressionsBasedModel to solve the layout of graphical elements in a plotting library so that they fit neatly into the screen boundaries. Specifically, I want to solve for scale and translation so…

Rulle
- 4,496
- 1
- 15
- 21
1
vote
2 answers
ojAlgo solve least-squares problem using ExpressionsBasedModel
I am trying to understand how to use the ExpressionsBasedModel class to solve least-squares problems and have constructed a minimal problem but I do not obtain the result that I would expect. My toy problem is to minimize
f(x) = (x - 4)^2
with…

Rulle
- 4,496
- 1
- 15
- 21
1
vote
1 answer
Performing Inversion on a large matrix (i.e 10,000 x 10,000)
I am trying to perform inversion on matrices larger than 10,000 x 10,000.
InverterTask matrixInverter = InverterTask.PRIMITIVE.make(storeM);
try{
storeI = matrixInverter.invert(storeM);
}catch (RecoverableCondition e){
throw…

YAMAZAKI1996
- 35
- 1
- 10
1
vote
1 answer
Is there a way on ojAlgo to normalize a Matrix?
I am interested to know if there is a way to find a normalized form for a MatrixStore using the ojAlgo matrix library.
Perhaps a routine or a task that once performed on a MatrixStore will cause each of the rows to have a mean of 0 and a standard…

YAMAZAKI1996
- 35
- 1
- 10