83 questions
2
votes
0
answers
38
views
OjAlgo presolving constraints with only the quadratic part
Using ojAlgo 55.2.0 i'm encountering some problems when defining constraints with only the quadratic part like the code below
public class PureQuadTest {
public static void main(String[] args) {
...
3
votes
1
answer
69
views
Using SCIP with ojAlgo for QPQC problems via JSCIPOpt
I'm exploring the use of ojAlgo in a project that involves solving QPQC problems (Quadratically Constrained Quadratic Programming).
I've looked into the ojAlgo-extensions ecosystem and the various ...
2
votes
1
answer
75
views
How to find the relative gap from an ojalgo optimisation result?
After the (mixed integer) model is successfully solved, how to find the relative gap of the result?
ExpressionsBasedModel model = new ExpressionsBasedModel();
//... create objective, variables and ...
0
votes
1
answer
74
views
Integer Solver vs ExpressionsBasedModel.minimise()
I am trying to implement an integer solver using Ojalgo across time series data, with only first-order constraints and a linear first-order objective function. All my variables are integers. I am ...
1
vote
1
answer
111
views
ojAlgo MatrixR032 creation from string, normalization, and cosine similarity calculation
I have two comma delimited strings containing embeddings. Each index should be able to fit into a float and they are 128 elements long. I am following this linear algebra intro in the ojAlgo library. ...
0
votes
0
answers
59
views
Clear the model and the solver,
I am using the OjAlgo for a linear programming problem which runs on a small gateway (not that much of computation capability). The inputs are changing and I solve the problem each 5 minutes. Before ...
1
vote
1
answer
261
views
ojalgo : How to sort each row of a matrix?
I have a question about using the oj algo library,
I would like to know if there is an easy and efficient way to take a row out of a Primitive64Matrix, sort it, and then replace it in the matrix,
Or ...
1
vote
1
answer
128
views
How to find the index of maximum element in ojalgo?
How to find the index of maximum element in ojalgo?
To find maximum I can use double res = mat.aggregateAll(Aggregator.MAXIMUM);, but how to find the maximum's indices?
PS: the mat is type of ...
1
vote
1
answer
121
views
How to get multiple values by index in an ojAlgo-array?
Let's say I have an ojAlgo-array defined like this
ArrayAnyD<Double> regularArray = ArrayAnyD.PRIMITIVE64.make(10);
regularArray.loopAll((final long[] ref) -> regularArray.set(ref, ref[0]*ref[...
1
vote
1
answer
356
views
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 ...
1
vote
1
answer
187
views
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 ...
1
vote
1
answer
140
views
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 ...
1
vote
1
answer
105
views
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?...
1
vote
1
answer
310
views
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. ...
1
vote
1
answer
151
views
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 ...
0
votes
1
answer
173
views
Cannot perform generalized eigenvalue problem with positive definitive symmetrical matricies with OjAlgo - What wrong am I doing?
Trying to solve generalized eigenvalues on the form:
A*V = B*V*D
By using OjAlgo. According to the documentation here A and B bust be real symmetric or complex Hermitian and B is positive definite. ...
0
votes
2
answers
160
views
Is OjAlgo eigenvalues always on descended order?
When computing the eigenvalues with OjAlgo. Are the eigenvalues always on a descended order?
0
votes
1
answer
91
views
Insert column into a matrix in OjAlgo - How to do that?
I have an matrix
Primitive64Store X
And I want to insert a column vector y
double[] y
To a specific column in X. How can I do that in OjAlgo?
2
votes
2
answers
662
views
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 ...
2
votes
1
answer
255
views
How to add all elements of an ojalgo SparseArray?
I have a SparseArray and need to obtain the sum of all its elements
I'm currently doing a dot product of the array with a same-sized array filled with ones, but I feel there should be something more ...
0
votes
0
answers
135
views
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 ...
0
votes
0
answers
375
views
How to use the MarkovitzModel of ojalgo finance
I have been trying to use the MarkowitzModel of ojalgo to determine the optimal weights of a portfolio. The documentation refers to a BasixMatrix for the constructor, but I believe this has been ...
1
vote
1
answer
2k
views
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<Double> matrixInverter = InverterTask.PRIMITIVE.make(storeM);
try{
storeI = matrixInverter.invert(...
0
votes
0
answers
461
views
ojAlgo - Multiply 2x2 matrix by 1x1 vector?
I'm new to ojAlgo. What is the best way to multiply a 2x2 matrix by a 2x1 vector? Can I use the PrimitiveMatrix class or does this require using Arrays? Please provide an example.
1
vote
1
answer
54
views
How do I test the equality of two MatrixStore in ojalgo up until a certain degree?
Does ojalgo provide an efficient way to test whether two matrix are equal ?
For instance, I would like to know if MatrixStore A is equal to MatrixStore B up until a certain tolerance level.
I could ...