Documentation of 'org.jquantlib.math.matrixutilities.Cells' Java class
Cells
org.jquantlib.math.matrixutilities

Class Cells<T extends Address>

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    Array, Matrix


    public abstract class Cells<T extends Address>
    extends java.lang.Object
    implements java.lang.Cloneable
    This class provides efficient basement for matrix operations by mapping matrices onto a linear array, which performs better than bidimensional arrays.

    In addition, access to elements is calculated by a certain policy which is intended to Matrix elements need to be translated to the underlying linear storage when they are read or written.

    • Field Detail

      • $

        @Deprecated
        public double[] $
        Deprecated. 
        This is the internal data storage where data is kept in an uni-dimensional double[]

        The use of this field is highly discouraged by end-user applications.

        Note: this field is deprecated in order to remind application developers avoid its use.

        If you cannot avoid access to the underlying data, please remember that it can be non-contiguous, chained or mapped, which means that:

      • you'd better obtain a reference to this internal data structure via method Cells#data() instead;
      • you must be sure to use methods Array._(int) and Matrix._(int, int) in order to guarantee you calculate properly addresses of elements in the underlying data structure.
      • This internal data structure is exposed for convenience purposes only, given the fact that algorithms in general handle arrays or matrices directly. It's recommended that application code never calculate indexes directly, but employ Address mappings in order to perform this task.

        In particular, when employing f2j in order to translate algorithms from FORTRAN into Java, the obtained code is 1-based indexed, like it is in FORTRAN, like this:

            for (i = 1; i <= n; i++)
         
        rather than 0-based, like it is in Java, like this:
            for (i = 0; i < n; i++)
         
        For this reason, you'd better let JQuantLib manage indexing. The only thing you need to adjust is direct access to elements of arrays and matrices, converting things like a[i] to a.$[a._(i)] in case of arrays and things like m[i][j] to m.$[m._(i,j)] in case of matrices.
See Also:
Array._(int), Matrix._(int, int)
Skip navigation links

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.