Class DefaultSparseDoubleVector1D

All Implemented Interfaces:
Serializable, Cloneable, Comparable<Matrix>, HasMetaData, BaseMatrix, BooleanCalculations, CanPerformCalculations, DenseMatrix, DenseMatrix2D, DenseMatrixMultiD, BaseDoubleMatrix, BasicDoubleCalculations, DoubleCalculations, BasicEntrywiseDoubleCalculations, CreatorDoubleCalculations, EntrywiseDoubleCalculations, HyperbolicDoubleCalculations, MiscEntrywiseDoubleCalculations, RoundingDoubleCalculations, TrigonometricDoubleCalculations, DecompositionDoubleCalculations, DiscretizeCalculations, GeneralDoubleCalculations, MiscGeneralDoubleCalculations, MissingValueDoubleCalculations, StatisticalDoubleCalculations, DenseDoubleMatrix, DenseDoubleMatrix2D, DenseDoubleMatrixMultiD, DoubleMatrix, DoubleMatrix2D, DoubleMatrixMultiD, SparseDoubleMatrix, SparseDoubleMatrix2D, SparseDoubleMatrixMultiD, BaseGenericMatrix<Double>, DenseGenericMatrix<Double>, DenseGenericMatrix2D<Double>, DenseGenericMatrixMultiD<Double>, GenericMatrix<Double>, GenericMatrix2D<Double>, GenericMatrixMultiD<Double>, SparseGenericMatrix<Double>, SparseGenericMatrix2D<Double>, SparseGenericMatrixMultiD<Double>, BaseMatrixProperties, Clearable, Conversions, CoordinateFunctions, CoreObject, DistanceMeasures, ExtendedMatrixProperties, GettersAndSetters, HasDescription, HasGUIObject, HasId, HasLabel, IntCalculations, Matrix, Matrix2D, MatrixMultiD, BaseNumberMatrix<Double>, DenseNumberMatrix<Double>, DenseNumberMatrix2D<Double>, DenseNumberMatrixMultiD<Double>, NumberMatrix<Double>, NumberMatrix2D<Double>, NumberMatrixMultiD<Double>, SparseNumberMatrix<Double>, SparseNumberMatrix2D<Double>, SparseNumberMatrixMultiD<Double>, ObjectCalculations, SparseMatrix, SparseMatrix2D, SparseMatrixMultiD, StringCalculations

public class DefaultSparseDoubleVector1D extends AbstractSparseDoubleMatrix2D
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • initialCapacity

      private static final int initialCapacity
      See Also:
    • growFactor

      private static final double growFactor
      See Also:
    • indices

      private long[] indices
    • values

      private double[] values
    • capacity

      private int capacity
    • valueCount

      private int valueCount
    • transposed

      private boolean transposed
  • Constructor Details

    • DefaultSparseDoubleVector1D

      public DefaultSparseDoubleVector1D(DefaultSparseDoubleVector1D source)
    • DefaultSparseDoubleVector1D

      public DefaultSparseDoubleVector1D(long rows, long columns)
  • Method Details

    • clear

      public final void clear()
    • getDouble

      public double getDouble(long row, long column)
    • setDouble

      public void setDouble(double value, long row, long column)
    • findInsertPosition

      public static final int findInsertPosition(long[] values, int fromIndex, int toIndex, long key)
    • getDouble

      public double getDouble(int row, int column)
    • setDouble

      public void setDouble(double value, int row, int column)
    • containsCoordinates

      public boolean containsCoordinates(long... coordinates)
      Description copied from interface: CoordinateFunctions
      Determines if the given Coordinates are part of the Matrix. If the Matrix is dense, true is returned for all Coordinates smaller than the Matrix's size. For sparse Matrices, this function checks if the coordinates are actually stored in the matrix or not.
      Parameters:
      coordinates - The coordinates to check
      Returns:
      a boolean stating if the coordinates are part of the Matrix
    • divide

      public Matrix divide(double value)
      Description copied from interface: BasicDoubleCalculations
      Divides every entry in the matrix by a scalar.
      Specified by:
      divide in interface BasicDoubleCalculations
      Overrides:
      divide in class AbstractMatrix
      Parameters:
      value - factor by which to divide
      Returns:
      Matrix with all entries divided by a factor.
    • times

      public Matrix times(double value)
      Description copied from interface: BasicDoubleCalculations
      Multiplies every entry in the matrix with a scalar.
      Specified by:
      times in interface BasicDoubleCalculations
      Overrides:
      times in class AbstractMatrix
      Parameters:
      value - factor to multiply with
      Returns:
      Matrix with all entries multiplied by a factor.
    • times

      public Matrix times(Matrix matrix)
      Description copied from interface: BasicDoubleCalculations
      Calculates the entrywise product of the two matrices.
      Specified by:
      times in interface BasicDoubleCalculations
      Overrides:
      times in class AbstractMatrix
      Parameters:
      matrix - the second matrix
      Returns:
      matrix with product of all entries
    • divide

      public Matrix divide(Matrix matrix)
      Description copied from interface: BasicDoubleCalculations
      Calculates an entrywise division of the two matrices.
      Specified by:
      divide in interface BasicDoubleCalculations
      Overrides:
      divide in class AbstractMatrix
      Parameters:
      matrix - the second matrix
      Returns:
      matrix with all entries divided by the second matrix's entry.
    • availableCoordinates

      public Iterable<long[]> availableCoordinates()
      Description copied from interface: CoordinateFunctions
      Returns an Iterator that only goes over the coordinates in the Matrix that are stored. For most Matrices, this is the same as allCoordinates(). For sparse Matrices, it iterates only over the entries in it.
      Specified by:
      availableCoordinates in interface CoordinateFunctions
      Specified by:
      availableCoordinates in class AbstractSparseDoubleMatrix2D
      Returns:
      Iterable over the saved entries in a Matrix.