org.deidentifier.arx.framework.data

## Class DataMatrix

- java.lang.Object
- - org.deidentifier.arx.framework.data.DataMatrix

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  DataMatrixSubset

    public class DataMatrix
    extends java.lang.Object
    implements java.io.Serializable

A fast implementation of an array of arrays of equal size

Author:
  Fabian Prasser
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`DataMatrix(int rows, int columns)` Instantiates a new memory block.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `and(int row, int value)` ANDs the first value of the row with the given value
`DataMatrix` `clone()`
`void` `copyFrom(int row, DataMatrix sourceMatrix, int sourceRow)` Copies a row from the given matrix into this matrix
`boolean` `equals(int row1, int row2)` Compares two rows for equality
`boolean` `equals(int row, int[] data)` Returns whether the given row has the given data
`boolean` `equalsIgnore(int row1, int row2, int ignore)` Internal equals
`boolean` `equalsIgnoringOutliers(int row1, int row2)` Equals ignoring outliers
`int` `get(int row, int col)` Returns the specified value
`int` `getNumColumns()` Returns the number of columns
`int` `getNumRows()` Returns the number of rows
`int` `getValueAtColumn(int column)` Gets the value in the given column for the row which has been set via setRow(row).
`int` `hashCode(int row)` Returns an hashcode for the given row
`int` `hashCode(int[] array)` Computes a hashcode for an integer array, partially unrolled.
`int` `hashCodeIgnore(int row, int ignore)` Returns an hashcode for the given row
`boolean` `iterator_hasNext()` First iterator
`int` `iterator_next()` First iterator
`void` `iterator_write(int value)` First iterator
`void` `iterator(int row)` First iterator
`void` `or(int row, int value)` ORs the first value of the row with the given value
`void` `set(int row, int column, int value)` Sets a value
`void` `setRow(int row)` Sets the row index for data access
`void` `setRow(int row, int[] data)` Sets the data for one row
`void` `setValueAtColumn(int column, int value)` Sets the value in the given column for the row which has been set via setRow(row).
`void` `swap(int row1, int row2)` Swaps the data in both rows

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

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DataMatrix

    public DataMatrix(int rows,
                      int columns)

Instantiates a new memory block.

Parameters:
  `rows` - the num rows
  `columns` - the num columns

### Method Detail

#### and

    public void and(int row,
                    int value)

ANDs the first value of the row with the given value

Parameters:
  `row` -
  `value` -

#### clone

    public DataMatrix clone()

Overrides:
  `clone` in class `java.lang.Object`

#### copyFrom

    public void copyFrom(int row,
                         DataMatrix sourceMatrix,
                         int sourceRow)

Copies a row from the given matrix into this matrix

Parameters:
  `row` -
  `sourceMatrix` -
  `sourceRow` -

#### equals

    public boolean equals(int row1,
                          int row2)

Compares two rows for equality

Parameters:
  `row1` -
  `row2` -
Returns:

#### equals

    public boolean equals(int row,
                          int[] data)

Returns whether the given row has the given data

Parameters:
  `row` -
  `data` -
Returns:

#### equalsIgnore

    public boolean equalsIgnore(int row1,
                                int row2,
                                int ignore)

Internal equals

Parameters:
  `row1` -
  `row2` -
  `ignore` -
Returns:

#### equalsIgnoringOutliers

    public boolean equalsIgnoringOutliers(int row1,
                                          int row2)

Equals ignoring outliers

Parameters:
  `row1` -
  `row2` -
Returns:

#### get

    public int get(int row,
                   int col)

Returns the specified value

Parameters:
  `row` -
  `col` -
Returns:

#### getNumColumns

    public int getNumColumns()

Returns the number of columns

Returns:

#### getNumRows

    public int getNumRows()

Returns the number of rows

Returns:

#### getValueAtColumn

    public int getValueAtColumn(int column)

Gets the value in the given column for the row which has been set via setRow(row).

Parameters:
  `column` -
  `value` -

#### hashCode

    public int hashCode(int row)

Returns an hashcode for the given row

Parameters:
  `row` -
Returns:

#### hashCode

    public final int hashCode(int[] array)

Computes a hashcode for an integer array, partially unrolled.

Parameters:
  `array` -
Returns:
  the hashcode

#### hashCodeIgnore

    public int hashCodeIgnore(int row,
                              int ignore)

Returns an hashcode for the given row

Parameters:
  `row` -
  `ignore` -
Returns:

#### iterator

    public void iterator(int row)

First iterator

Parameters:
  `row` -

#### iterator_hasNext

    public boolean iterator_hasNext()

First iterator

Returns:

#### iterator_next

    public int iterator_next()

First iterator

Returns:

#### iterator_write

    public void iterator_write(int value)

First iterator

Parameters:
  `value` -

#### or

    public void or(int row,
                   int value)

ORs the first value of the row with the given value

Parameters:
  `row` -
  `value` -

#### set

    public void set(int row,
                    int column,
                    int value)

Sets a value

Parameters:
  `row` -
  `column` -
  `value` -

#### setRow

    public void setRow(int row)

Sets the row index for data access

Parameters:
  `row` -

#### setRow

    public void setRow(int row,
                       int[] data)

Sets the data for one row

Parameters:
  `row` -
  `data` -

#### setValueAtColumn

    public void setValueAtColumn(int column,
                                 int value)

Sets the value in the given column for the row which has been set via setRow(row).

Parameters:
  `column` -
  `value` -

#### swap

    public void swap(int row1,
                     int row2)

Swaps the data in both rows

Parameters:
  `row1` -
  `row2` -