-
Notifications
You must be signed in to change notification settings - Fork 1.1k
change from vecmath to ejml
Jody Garnett edited this page May 12, 2015
·
11 revisions
Details:
- Contact: tyler
- Tracker: GEOT-22
- Tagline: matrix magic
- Branch: https://github.com/geotools/geotools/tree/matrix
We have a long standing technical debt to Replace Vecmath (see link for technical and license reasons). The EJML has been suggested as a good alternative for the project. This task is a blocker for Publish to Maven Central Repository and will need to be resolved for GeoGig and uDig incubation with LocationTech.
We have two uses of vecmath:
- As a data structure GeneralMatrix (which extends GMatrix) with the operations that are used are multiply, invert, negate, and transform.
- Delegating to
Matrix3d.multiply
andMatrix4d.muiltiply
References:
- Replace Vecmath
- efficient-java-matrix-library
- geotools-devel email discussion
- SimpleMatrix (javadoc)
- SimpleMatrix.java (src)
This proposal is under construction.
Voting has not started yet:
- Andrea Aime +1
- Ben Caradoc-Davies +1
- Christian Mueller +1
- Ian Turton
- Justin Deoliveira +1
- Jody Garnett
- Simone Giannecchini
- ✅ Add dependency on EJML and use SimpleMatrix for the two cases where we need to delegate a 3D and 4D Matrix
- ✅ Change GeneralMatrix to delegate to DenseMatrix64F (using SimpleMatrix / BaseMatrix as a guide on how to do this).
- ✅ Implement the XMatrix and Matrix (for method compatibility) using the DenseMatrix64F delegate
- ✅ Remove the pom.xml dependency on vecmath.
- ✅ replace other uses of vecmath classes (in org.geotools.math.Line and org.geotools.math.Plane classes)
- Point3d - can probably use one of the java classes or roll our own here
- Change from MismatchedSizeException to IllegalArgumentException
- ✅ Ask downstream applications for a sanity check
- GeoServer: GEOS-7009 two regressions based on accuracy change
- GeoMesa
- GeoWave
- uDig
- ✅ Warn users about the change in the update instructions
BEFORE:
public class GeneralMatrix extends GMatrix implements XMatrix {
public GeneralMatrix(final int size) {
super(size, size);
}
public GeneralMatrix(final int numRow, final int numCol) {
super(numRow, numCol);
}
// public void invert() provided by superclass
}
AFTER:
public class GeneralMatrix implements XMatrix {
DenseMatrix64F mat;
public GeneralMatrix(final int size) {
super(size, size);
}
public GeneralMatrix(final int numRow, final int numCol) {
mat = new DenseMatrix64F( numRows, numCol);
}
// invert matrix in place (no copy)
public void invert() {
if( !CommonOps.invert(mat,mat) ) {
throw new SingularMatrixException();
}
}
...
}
No documentation changes are expected.