Class SparseFieldMatrix<T extends FieldElement<T>>

java.lang.Object
org.hipparchus.linear.AbstractFieldMatrix<T>
org.hipparchus.linear.SparseFieldMatrix<T>
Type Parameters:
T - the type of the field elements
All Implemented Interfaces:
AnyMatrix, FieldMatrix<T>, FieldBlendable<FieldMatrix<T>,T>

public class SparseFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMatrix<T>
Sparse matrix implementation based on an open addressed map.

Caveat: This implementation assumes that, for any x, the equality x * 0d == 0d holds. But it is is not true for NaN. Moreover, zero entries will lose their sign. Some operations (that involve NaN and/or infinities) may thus give incorrect results.

  • Constructor Details

    • SparseFieldMatrix

      public SparseFieldMatrix(Field<T> field)
      Create a matrix with no data.
      Parameters:
      field - Field to which the elements belong.
    • SparseFieldMatrix

      public SparseFieldMatrix(Field<T> field, int rowDimension, int columnDimension)
      Create a new SparseFieldMatrix with the supplied row and column dimensions.
      Parameters:
      field - Field to which the elements belong.
      rowDimension - Number of rows in the new matrix.
      columnDimension - Number of columns in the new matrix.
      Throws:
      MathIllegalArgumentException - if row or column dimension is not positive.
    • SparseFieldMatrix

      public SparseFieldMatrix(SparseFieldMatrix<T> other)
      Copy constructor.
      Parameters:
      other - Instance to copy.
    • SparseFieldMatrix

      public SparseFieldMatrix(FieldMatrix<T> other)
      Generic copy constructor.
      Parameters:
      other - Instance to copy.
  • Method Details