Documentation API of the 'org.ejml.simple.SimpleMatrix' Java class
SimpleMatrix
org.ejml.simple

Class SimpleMatrix

  • All Implemented Interfaces:
    Serializable


    public class SimpleMatrixextends SimpleBase<SimpleMatrix>

    SimpleMatrix is a wrapper around DenseMatrix64F that provides an easy to use object oriented interface for performing matrix operations. It is designed to be more accessible to novice programmers and provide a way to rapidly code up solutions by simplifying memory management and providing easy to use functions.

    Most functions in SimpleMatrix do not modify the original matrix. Instead they create a new SimpleMatrix instance which is modified and returned. This greatly simplifies memory management and writing of code in general. It also allows operations to be chained, as is shown below:

    SimpleMatrix K = P.mult(H.transpose().mult(S.invert()));

    Working with both DenseMatrix64F and SimpleMatrix in the same code base is easy. To access the internal DenseMatrix64F in a SimpleMatrix simply call SimpleBase.getMatrix(). To turn a DenseMatrix64F into a SimpleMatrix use wrap(org.ejml.data.DenseMatrix64F). Not all operations in EJML are provided for SimpleMatrix, but can be accessed by extracting the internal DenseMatrix64F.

    EXTENDING: SimpleMatrix contains a list of narrowly focused functions for linear algebra. To harness the functionality for another application and to the number of functions it supports it is recommended that one extends SimpleBase instead. This way the returned matrix type's of SimpleMatrix functions will be of the appropriate types. See StatisticsMatrix inside of the examples directory.

    PERFORMANCE: The disadvantage of using this class is that it is more resource intensive, since it creates a new matrix each time an operation is performed. This makes the JavaVM work harder and Java automatically initializes the matrix to be all zeros. Typically operations on small matrices or operations that have a runtime linear with the number of elements are the most affected. More computationally intensive operations have only a slight unnoticeable performance loss. MOST PEOPLE SHOULD NOT WORRY ABOUT THE SLIGHT LOSS IN PERFORMANCE.

    It is hard to judge how significant the performance hit will be in general. Often the performance hit is insignificant since other parts of the application are more processor intensive or the bottle neck is a more computationally complex operation. The best approach is benchmark and then optimize the code.

    If SimpleMatrix is extended then the protected function {link #createMatrix} should be extended and return the child class. The results of SimpleMatrix operations will then be of the correct matrix type.

    The object oriented approach used in SimpleMatrix was originally inspired by Jama. http://math.nist.gov/javanumerics/jama/

    See Also:
    Serialized Form

Warning: You cannot see the full API documentation of this class since the access to the DatMelt documentation for third-party Java classes is denied. Guests can only view jhplot Java API. To view the complete description of this class and its methods, please request the full DataMelt membership.

If you are already a full member, please login to the DataMelt member area before visiting this documentation.