B4A Library EJML - Efficient Java Matrix Library

This is a wrapper for the efficient-java-matrix-library library. Specifically the SimpleMatrix class intended for linera algebra computations.

The included "demo" is utterly trivial but then if you know how to do linear algebra you shouldn't need whatever feeble atttempt at a demo that I could come up with to understand how to use this library. :)


EDIT:- Version 1.1 posted. See post #4 for details.

EDIT:- Version 1.2 posted. See post #7 for details.

EDIT:- Version 1.3 posted. See post #9 for details.

EDIT:- Version 1.4 posted. See post #12 for details.
 

Attachments

  • EJML1.4.zip
    218.3 KB · Views: 784
Last edited:

rbghongade

Active Member
Licensed User
Longtime User
Dear agraham,
Thank you so very much! I have tested your library and it is simply wonderful, very intuitive for usage.

warm regards,
rajesh
 
Last edited:

agraham

Expert
Licensed User
Longtime User
Version 1.2 now posted includes matrix decompositions, specifically Eigendecomposition and Singular Value decomposition by providing two extra objects SimpleEVD and SimpleSVD. The authors of EJML say

These decompositions should meet most people needs. Direct access to other decompositions (e.g. QR and Cholesky) is not provided in SimpleMatrix because solve() and inv() is provided instead

I think that the exposure of the SimpleXXX functionality of EJML is complete. Other decompositions are available in the original ejml.jar library and could probably be exposed if required.
 

kiki78

Active Member
Licensed User
Longtime User
Get & Set

Thank you very much agraham for this useful wrapper. :)

May you add in future release, wrapper for unique index version of set and get ?
You can, for example, name it as "SetElement1Id" and "GetElement1Id".
It's interesting when we use it as Vector.

Best Regards
 
Last edited:

kiki78

Active Member
Licensed User
Longtime User
Thank you agraham :sign0098:

Sorry for late thanks, but I work on other project and lack update.

Regards
 

kiki78

Active Member
Licensed User
Longtime User
If it's not too much, may you also give access to inherited underlying double array "data". :sign0060:

This permit to go back to double array after some calculation.
"data" is one dimension array, that is good for quicker access than 2 dimensions. As Basic4Android doesn't give embedded size property of each dimensions for multi-dimension array, I think it's also good idea to live it in one dimension.

Thank you by advance agraham.
 

kiki78

Active Member
Licensed User
Longtime User
Hi agraham,

May you implements following methods ?
- elementMax
- elementMin

Thank you by advance agraham.
 

agraham

Expert
Licensed User
Longtime User
It looks like it would be just as efficient for you to write your own methods to iterate over the double array returned by the Data property as that is what EJML does.
B4X:
  public static double elementMax(D1Matrix64F paramD1Matrix64F)
  {
    int i = paramD1Matrix64F.getNumElements();
    double d1 = paramD1Matrix64F.get(0);
    for (int j = 1; j < i; j++)
    {
      double d2 = paramD1Matrix64F.get(j);
      if (d2 >= d1)
        d1 = d2;
    }
    return d1;
  }
 

ilan

Expert
Licensed User
Longtime User
hi agraham

i am searching for a solution to handle a database without a control that i have to add to my app
until now i used tableview but i need to add it, now i found your lib
its great but i cannot add STRING as value only double

i understand that its not made for my uses but it could be perfect to use it as a tableview (with strings)
its also saving to csv files exactly what i need

do u have a idee how i could use your lib and instead of doubles as value use string?

thank you
 

rbghongade

Active Member
Licensed User
Longtime User
Dear agraham,
I am in the process of writing a function for computing roots of a polynomial using eigen value decomposition, hence I require to have complex roots. Is it possible to modify your library to return complex roots as well? Above documentation says that it returns only real eigen values. The link given below describes the java code for computing roots of polynomial using EJML.
https://code.google.com/p/efficient-java-matrix-library/wiki/PolynomialRootExample
Since I do not know java language ,I am stuck there.
regards,
 
Top