## org.apache.mahout.math.matrix.impl
Class AbstractMatrix1D

    java.lang.Object
      org.apache.mahout.math.PersistentObject
          org.apache.mahout.math.matrix.impl.AbstractMatrix
              org.apache.mahout.math.matrix.impl.AbstractMatrix1D

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable

Direct Known Subclasses:
  DoubleMatrix1D

Deprecated. until unit tests are in place. Until this time, this class/interface is unsupported.

    @Deprecated
    public abstract class AbstractMatrix1D

extends AbstractMatrix

See Also:
  Serialized Form

Field Summary
`protected int` `size` Deprecated. the number of cells this matrix (view) has
`protected int` `stride` Deprecated. the number of indexes between any two elements, i.e.
`protected int` `zero` Deprecated. the index of the first element

Fields inherited from class org.apache.mahout.math.matrix.impl.AbstractMatrix
`isNoView`

Constructor Summary
`protected` `AbstractMatrix1D()` Deprecated. Makes this class non instantiable, but still let's others inherit from it.

Method Summary
`protected void` `checkIndex(int index)` Deprecated. Sanity check for operations requiring an index to be within bounds.
`protected void` `checkIndexes(int[] indexes)` Deprecated. Checks whether indexes are legal and throws an exception, if necessary.
`protected void` `checkRange(int index, int width)` Deprecated. Checks whether the receiver contains the given range and throws an exception, if necessary.
`void` `checkSize(AbstractMatrix1D b)` Deprecated. Sanity check for operations requiring two matrices with the same size.
`protected void` `checkSize(double[] b)` Deprecated. Sanity check for operations requiring two matrices with the same size.
`protected int` `index(int rank)` Deprecated. Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array.
`protected int` `offset(int absRank)` Deprecated. Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array.
`protected int` `rank(int rank)` Deprecated. Returns the absolute rank of the given relative rank.
`protected void` `setUp(int size)` Deprecated. Sets up a matrix with a given number of cells.
`protected void` `setUp(int size, int zero, int stride)` Deprecated. Sets up a matrix with the given parameters.
`int` `size()` Deprecated. Returns the number of cells.
`protected int` `stride(int dimension)` Deprecated. Returns the stride of the given dimension (axis, rank).
`protected AbstractMatrix1D` `vFlip()` Deprecated. Self modifying version of viewFlip().
`protected AbstractMatrix1D` `vPart(int index, int width)` Deprecated. Self modifying version of viewPart().
`protected AbstractMatrix1D` `vStrides(int stride)` Deprecated. Self modifying version of viewStrides().

Methods inherited from class org.apache.mahout.math.matrix.impl.AbstractMatrix
`ensureCapacity, isView, trimToSize`

Methods inherited from class org.apache.mahout.math.PersistentObject
`clone`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### size

    protected int size

  Deprecated.
  the number of cells this matrix (view) has

### zero

    protected int zero

  Deprecated.
  the index of the first element

### stride

    protected int stride

  Deprecated.
  the number of indexes between any two elements, i.e. `index(i+1) - index(i)`.

Constructor Detail

### AbstractMatrix1D

    protected AbstractMatrix1D()

  Deprecated.
  Makes this class non instantiable, but still let's others inherit from it.

Method Detail

### offset

    protected int offset(int absRank)

  Deprecated.
  Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. Default implementation. Override, if necessary.

  Parameters:
    `absRank` - the absolute rank of the element.
  Returns:
    the position.

### rank

    protected int rank(int rank)

  Deprecated.
  Returns the absolute rank of the given relative rank.

  Parameters:
    `rank` - the relative rank of the element.
  Returns:
    the absolute rank of the element.

### checkIndex

    protected void checkIndex(int index)

  Deprecated.
  Sanity check for operations requiring an index to be within bounds.

  Throws:
    `java.lang.IndexOutOfBoundsException` - if `index < 0 || index >= size()`.

### checkIndexes

    protected void checkIndexes(int[] indexes)

  Deprecated.
  Checks whether indexes are legal and throws an exception, if necessary.

  Throws:
    `java.lang.IndexOutOfBoundsException` - if `! (0 <= indexes[i] < size())` for any i=0..indexes.length()-1.

### checkRange

    protected void checkRange(int index,
                              int width)

  Deprecated.
  Checks whether the receiver contains the given range and throws an exception, if necessary.

  Throws:
    `java.lang.IndexOutOfBoundsException` - if `index<0 || index+width>size()`.

### checkSize

    protected void checkSize(double[] b)

  Deprecated.
  Sanity check for operations requiring two matrices with the same size.

  Throws:
    `java.lang.IllegalArgumentException` - if `size() != b.size()`.

### checkSize

    public void checkSize(AbstractMatrix1D b)

  Deprecated.
  Sanity check for operations requiring two matrices with the same size.

  Throws:
    `java.lang.IllegalArgumentException` - if `size() != b.size()`.

### index

    protected int index(int rank)

  Deprecated.
  Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array. You may want to override this method for performance.

  Parameters:
    `rank` - the rank of the element.

### setUp

    protected void setUp(int size)

  Deprecated.
  Sets up a matrix with a given number of cells.

  Parameters:
    `size` - the number of cells the matrix shall have.
  Throws:
    `java.lang.IllegalArgumentException` - if `size<0`.

### setUp

    protected void setUp(int size,
                         int zero,
                         int stride)

  Deprecated.
  Sets up a matrix with the given parameters.

  Parameters:
    `size` - the number of elements the matrix shall have.
    `zero` - the index of the first element.
    `stride` - the number of indexes between any two elements, i.e. `index(i+1)-index(i)`.
  Throws:
    `java.lang.IllegalArgumentException` - if `size<0`.

### size

    public int size()

  Deprecated.
  Returns the number of cells.

  Specified by:
    `size` in class `AbstractMatrix`

### stride

    protected int stride(int dimension)

  Deprecated.
  Returns the stride of the given dimension (axis, rank).

  Returns:
    the stride in the given dimension.
  Throws:
    `java.lang.IllegalArgumentException` - if `dimension != 0`.

### vFlip

    protected AbstractMatrix1D vFlip()

  Deprecated.
  Self modifying version of viewFlip(). What used to be index `0` is now index `size()-1`, ..., what used to be index `size()-1` is now index `0`.

### vPart

    protected AbstractMatrix1D vPart(int index,
                                     int width)

  Deprecated.
  Self modifying version of viewPart().

  Throws:
    `java.lang.IndexOutOfBoundsException` - if `index<0 || index+width>size()`.

### vStrides

    protected AbstractMatrix1D vStrides(int stride)

  Deprecated.
  Self modifying version of viewStrides().

  Throws:
    `java.lang.IndexOutOfBoundsException` - if `stride <= 0`.

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.