org.apache.commons.math3.linear

## Class OpenMapRealMatrix

- java.lang.Object
- - org.apache.commons.math3.linear.RealLinearOperator
  - - org.apache.commons.math3.linear.AbstractRealMatrix
    - - org.apache.commons.math3.linear.OpenMapRealMatrix

All Implemented Interfaces:
  java.io.Serializable, AnyMatrix, RealMatrix, SparseRealMatrix

Deprecated.
As of version 3.1, this class is deprecated, for reasons exposed in this JIRA ticket. This class will be removed in version 4.0.

    @Deprecated
    public class OpenMapRealMatrix
    extends AbstractRealMatrix
    implements SparseRealMatrix, java.io.Serializable

Sparse matrix implementation based on an open addressed map.

Since:
  2.0
Version:
  $Id: OpenMapRealMatrix.java 1416643 2012-12-03 19:37:14Z tn $
See Also:
  Serialized Form

### Field Summary

Fields
`private int` `columns` Deprecated. Number of columns of the matrix.
`private OpenIntToDoubleHashMap` `entries` Deprecated. Storage for (sparse) matrix elements.
`private int` `rows` Deprecated. Number of rows of the matrix.
`private static long` `serialVersionUID` Deprecated. Serializable version identifier.

### Constructor Summary

Constructors
Constructor and Description
`OpenMapRealMatrix(int rowDimension, int columnDimension)` Deprecated. Build a sparse matrix with the supplied row and column dimensions.
`OpenMapRealMatrix(OpenMapRealMatrix matrix)` Deprecated. Build a matrix by copying another one.

### Method Summary

Methods
`OpenMapRealMatrix` `add(OpenMapRealMatrix m)` Deprecated. Compute the sum of this matrix and `m`.
`void` `addToEntry(int row, int column, double increment)` Deprecated. Adds (in place) the specified value to the specified entry of `this` matrix.
`private int` `computeKey(int row, int column)` Deprecated. Compute the key to access a matrix element
`OpenMapRealMatrix` `copy()` Deprecated. Returns a (deep) copy of this.
`OpenMapRealMatrix` `createMatrix(int rowDimension, int columnDimension)` Deprecated. Create a new RealMatrix of the same type as the instance with the supplied row and column dimensions.
`int` `getColumnDimension()` Deprecated. Returns the number of columns of this matrix.
`double` `getEntry(int row, int column)` Deprecated. Get the entry in the specified row and column.
`int` `getRowDimension()` Deprecated. Returns the number of rows of this matrix.
`OpenMapRealMatrix` `multiply(OpenMapRealMatrix m)` Deprecated. Postmultiply this matrix by `m`.
`RealMatrix` `multiply(RealMatrix m)` Deprecated. Returns the result of postmultiplying `this` by `m`.
`void` `multiplyEntry(int row, int column, double factor)` Deprecated. Multiplies (in place) the specified entry of `this` matrix by the specified value.
`void` `setEntry(int row, int column, double value)` Deprecated. Set the entry in the specified row and column.
`OpenMapRealMatrix` `subtract(OpenMapRealMatrix m)` Deprecated. Subtract `m` from this matrix.
`OpenMapRealMatrix` `subtract(RealMatrix m)` Deprecated. Returns `this` minus `m`.

### Methods inherited from class org.apache.commons.math3.linear.AbstractRealMatrix

`add, copySubMatrix, copySubMatrix, equals, getColumn, getColumnMatrix, getColumnVector, getData, getFrobeniusNorm, getNorm, getRow, getRowMatrix, getRowVector, getSubMatrix, getSubMatrix, getTrace, hashCode, isSquare, operate, operate, power, preMultiply, preMultiply, preMultiply, scalarAdd, scalarMultiply, setColumn, setColumnMatrix, setColumnVector, setRow, setRowMatrix, setRowVector, setSubMatrix, toString, transpose, walkInColumnOrder, walkInColumnOrder, walkInColumnOrder, walkInColumnOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInRowOrder, walkInRowOrder, walkInRowOrder, walkInRowOrder`

### Methods inherited from class org.apache.commons.math3.linear.RealLinearOperator

`isTransposable, operateTranspose`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.commons.math3.linear.RealMatrix

`add, copySubMatrix, copySubMatrix, getColumn, getColumnMatrix, getColumnVector, getData, getFrobeniusNorm, getNorm, getRow, getRowMatrix, getRowVector, getSubMatrix, getSubMatrix, getTrace, operate, operate, power, preMultiply, preMultiply, preMultiply, scalarAdd, scalarMultiply, setColumn, setColumnMatrix, setColumnVector, setRow, setRowMatrix, setRowVector, setSubMatrix, transpose, walkInColumnOrder, walkInColumnOrder, walkInColumnOrder, walkInColumnOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInRowOrder, walkInRowOrder, walkInRowOrder, walkInRowOrder`

### Methods inherited from interface org.apache.commons.math3.linear.AnyMatrix

`isSquare`

### Field Detail

#### serialVersionUID

    private static final long serialVersionUID

Deprecated.
Serializable version identifier.

See Also:
  Constant Field Values

#### rows

    private final int rows

Deprecated.
Number of rows of the matrix.

#### columns

    private final int columns

Deprecated.
Number of columns of the matrix.

#### entries

    private final OpenIntToDoubleHashMap entries

Deprecated.
Storage for (sparse) matrix elements.

### Constructor Detail

#### OpenMapRealMatrix

    public OpenMapRealMatrix(int rowDimension,
                     int columnDimension)
                      throws NotStrictlyPositiveException,
                             NumberIsTooLargeException

Deprecated.
Build a sparse matrix with the supplied row and column dimensions.

Parameters:
  `rowDimension` - Number of rows of the matrix.
  `columnDimension` - Number of columns of the matrix.
Throws:
  `NotStrictlyPositiveException` - if row or column dimension is not positive.
  `NumberIsTooLargeException` - if the total number of entries of the matrix is larger than `Integer.MAX_VALUE`.

#### OpenMapRealMatrix

    public OpenMapRealMatrix(OpenMapRealMatrix matrix)

Deprecated.
Build a matrix by copying another one.

Parameters:
  `matrix` - matrix to copy.

### Method Detail

#### copy

    public OpenMapRealMatrix copy()

Deprecated.
Returns a (deep) copy of this.

Specified by:
  `copy` in interface `RealMatrix`
Specified by:
  `copy` in class `AbstractRealMatrix`
Returns:
  matrix copy

#### createMatrix

    public OpenMapRealMatrix createMatrix(int rowDimension,
                                 int columnDimension)
                                   throws NotStrictlyPositiveException,
                                          NumberIsTooLargeException

Deprecated.
Create a new RealMatrix of the same type as the instance with the supplied row and column dimensions.

Specified by:
  `createMatrix` in interface `RealMatrix`
Specified by:
  `createMatrix` in class `AbstractRealMatrix`
Parameters:
  `rowDimension` - the number of rows in the new matrix
  `columnDimension` - the number of columns in the new matrix
Returns:
  a new matrix of the same type as the instance
Throws:
  `NumberIsTooLargeException` - if the total number of entries of the matrix is larger than `Integer.MAX_VALUE`.
  `NotStrictlyPositiveException` - if row or column dimension is not positive.

#### getColumnDimension

    public int getColumnDimension()

Deprecated.
Returns the number of columns of this matrix.

Specified by:
  `getColumnDimension` in interface `AnyMatrix`
Specified by:
  `getColumnDimension` in class `AbstractRealMatrix`
Returns:
  the number of columns.

#### add

    public OpenMapRealMatrix add(OpenMapRealMatrix m)
                          throws MatrixDimensionMismatchException

Deprecated.
Compute the sum of this matrix and `m`.

Parameters:
  `m` - Matrix to be added.
Returns:
  `this` + `m`.
Throws:
  `MatrixDimensionMismatchException` - if `m` is not the same size as `this`.

#### subtract

    public OpenMapRealMatrix subtract(RealMatrix m)
                               throws MatrixDimensionMismatchException

Deprecated.
Returns `this` minus `m`.

Specified by:
  `subtract` in interface `RealMatrix`
Overrides:
  `subtract` in class `AbstractRealMatrix`
Parameters:
  `m` - matrix to be subtracted
Returns:
  `this - m`
Throws:
  `MatrixDimensionMismatchException` - if `m` is not the same size as `this`.

#### subtract

    public OpenMapRealMatrix subtract(OpenMapRealMatrix m)
                               throws MatrixDimensionMismatchException

Deprecated.
Subtract `m` from this matrix.

Parameters:
  `m` - Matrix to be subtracted.
Returns:
  `this` - `m`.
Throws:
  `MatrixDimensionMismatchException` - if `m` is not the same size as `this`.

#### multiply

    public RealMatrix multiply(RealMatrix m)
                        throws DimensionMismatchException,
                               NumberIsTooLargeException

Deprecated.
Returns the result of postmultiplying `this` by `m`.

Specified by:
  `multiply` in interface `RealMatrix`
Overrides:
  `multiply` in class `AbstractRealMatrix`
Parameters:
  `m` - matrix to postmultiply by
Returns:
  `this * m`
Throws:
  `NumberIsTooLargeException` - if `m` is an `OpenMapRealMatrix`, and the total number of entries of the product is larger than `Integer.MAX_VALUE`.
  `DimensionMismatchException` - if `columnDimension(this) != rowDimension(m)`

#### multiply

    public OpenMapRealMatrix multiply(OpenMapRealMatrix m)
                               throws DimensionMismatchException,
                                      NumberIsTooLargeException

Deprecated.
Postmultiply this matrix by `m`.

Parameters:
  `m` - Matrix to postmultiply by.
Returns:
  `this` * `m`.
Throws:
  `DimensionMismatchException` - if the number of rows of `m` differ from the number of columns of `this` matrix.
  `NumberIsTooLargeException` - if the total number of entries of the product is larger than `Integer.MAX_VALUE`.

#### getEntry

    public double getEntry(int row,
                  int column)
                    throws OutOfRangeException

Deprecated.
Get the entry in the specified row and column. Row and column indices start at 0.

Specified by:
  `getEntry` in interface `RealMatrix`
Specified by:
  `getEntry` in class `AbstractRealMatrix`
Parameters:
  `row` - Row index of entry to be fetched.
  `column` - Column index of entry to be fetched.
Returns:
  the matrix entry at `(row, column)`.
Throws:
  `OutOfRangeException` - if the row or column index is not valid.

#### getRowDimension

    public int getRowDimension()

Deprecated.
Returns the number of rows of this matrix.

Specified by:
  `getRowDimension` in interface `AnyMatrix`
Specified by:
  `getRowDimension` in class `AbstractRealMatrix`
Returns:
  the number of rows.

#### setEntry

    public void setEntry(int row,
                int column,
                double value)
                  throws OutOfRangeException

Deprecated.
Set the entry in the specified row and column. Row and column indices start at 0.

Specified by:
  `setEntry` in interface `RealMatrix`
Specified by:
  `setEntry` in class `AbstractRealMatrix`
Parameters:
  `row` - Row index of entry to be set.
  `column` - Column index of entry to be set.
  `value` - the new value of the entry.
Throws:
  `OutOfRangeException` - if the row or column index is not valid

#### addToEntry

    public void addToEntry(int row,
                  int column,
                  double increment)
                    throws OutOfRangeException

Deprecated.
Adds (in place) the specified value to the specified entry of `this` matrix. Row and column indices start at 0.

Specified by:
  `addToEntry` in interface `RealMatrix`
Overrides:
  `addToEntry` in class `AbstractRealMatrix`
Parameters:
  `row` - Row index of the entry to be modified.
  `column` - Column index of the entry to be modified.
  `increment` - value to add to the matrix entry.
Throws:
  `OutOfRangeException` - if the row or column index is not valid.

#### multiplyEntry

    public void multiplyEntry(int row,
                     int column,
                     double factor)
                       throws OutOfRangeException

Deprecated.
Multiplies (in place) the specified entry of `this` matrix by the specified value. Row and column indices start at 0.

Specified by:
  `multiplyEntry` in interface `RealMatrix`
Overrides:
  `multiplyEntry` in class `AbstractRealMatrix`
Parameters:
  `row` - Row index of the entry to be modified.
  `column` - Column index of the entry to be modified.
  `factor` - Multiplication factor for the matrix entry.
Throws:
  `OutOfRangeException` - if the row or column index is not valid.

#### computeKey

    private int computeKey(int row,
                 int column)

Deprecated.
Compute the key to access a matrix element

Parameters:
  `row` - row index of the matrix element
  `column` - column index of the matrix element
Returns:
  key within the map to access the matrix element