## org.apache.mahout.math.matrix.linalg
Class Algebra

    java.lang.Object
      org.apache.mahout.math.PersistentObject
          org.apache.mahout.math.matrix.linalg.Algebra

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

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

    @Deprecated
    public final class Algebra

extends org.apache.mahout.math.PersistentObject

See Also:
  Serialized Form

Field Summary
`static Algebra` `DEFAULT` Deprecated. A default Algebra object; has `Property.DEFAULT` attached for tolerance.

Constructor Summary
`Algebra()` Deprecated. Constructs a new instance with an equality tolerance given by `Property.DEFAULT.tolerance()`.
`Algebra(double tolerance)` Deprecated. Constructs a new instance with the given equality tolerance.

Method Summary
`java.lang.Object` `clone()` Deprecated. Returns a copy of the receiver.
`static double` `det(DoubleMatrix2D A)` Deprecated. Returns the determinant of matrix `A`.
`static DoubleMatrix1D` `permute(DoubleMatrix1D A, int[] indexes, double[] work)` Deprecated. Modifies the given vector `A` such that it is permuted as specified; Useful for pivoting.
`static DoubleMatrix2D` `permute(DoubleMatrix2D A, int[] rowIndexes, int[] columnIndexes)` Deprecated. Constructs and returns a new row and column permuted selection view of matrix `A`; equivalent to `DoubleMatrix2D.viewSelection(int[],int[])`.
`static DoubleMatrix2D` `permuteColumns(DoubleMatrix2D A, int[] indexes, int[] work)` Deprecated. Modifies the given matrix `A` such that it's columns are permuted as specified; Useful for pivoting.
`static DoubleMatrix2D` `permuteRows(DoubleMatrix2D A, int[] indexes, int[] work)` Deprecated. Modifies the given matrix `A` such that it's rows are permuted as specified; Useful for pivoting.
`Property` `property()` Deprecated. Returns the property object attached to this Algebra, defining tolerance.
`void` `setProperty(Property property)` Deprecated. Attaches the given property object to this Algebra, defining tolerance.
`static DoubleMatrix2D` `solve(DoubleMatrix2D A, DoubleMatrix2D B)` Deprecated. Solves A*X = B.

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

Field Detail

### DEFAULT

    public static final Algebra DEFAULT

  Deprecated.
  A default Algebra object; has `Property.DEFAULT` attached for tolerance. Allows ommiting to construct an Algebra object time and again. Note that this Algebra object is immutable. Any attempt to assign a new Property object to it (via method `setProperty`), or to alter the tolerance of its property object (via `property().setTolerance(...)`) will throw an exception.

Constructor Detail

### Algebra

    public Algebra()

  Deprecated.
  Constructs a new instance with an equality tolerance given by `Property.DEFAULT.tolerance()`.

### Algebra

    public Algebra(double tolerance)

  Deprecated.
  Constructs a new instance with the given equality tolerance.

  Parameters:
    `tolerance` - the tolerance to be used for equality operations.

Method Detail

### clone

    public java.lang.Object clone()

  Deprecated.
  Returns a copy of the receiver. The attached property object is also copied. Hence, the property object of the copy is mutable.

  Overrides:
    `clone` in class `org.apache.mahout.math.PersistentObject`
  Returns:
    a copy of the receiver.

### det

    public static double det(DoubleMatrix2D A)

  Deprecated.
  Returns the determinant of matrix `A`.

  Returns:
    the determinant.

### permute

    public static DoubleMatrix1D permute(DoubleMatrix1D A,
                                         int[] indexes,
                                         double[] work)

  Deprecated.
  Modifies the given vector `A` such that it is permuted as specified; Useful for pivoting. Cell `A[i]` will go into cell `A[indexes[i]]`.

  Example:

       Reordering
       [A,B,C,D,E] with indexes [0,4,2,3,1] yields
       [A,E,C,D,B]
       In other words A[0]<--A[0], A[1]<--A[4], A[2]<--A[2], A[3]<--A[3], A[4]<--A[1].

       Reordering
       [A,B,C,D,E] with indexes [0,4,1,2,3] yields
       [A,E,B,C,D]
       In other words A[0]<--A[0], A[1]<--A[4], A[2]<--A[1], A[3]<--A[2], A[4]<--A[3].

  Parameters:
    `A` - the vector to permute.
    `indexes` - the permutation indexes, must satisfy `indexes.length==A.size() && indexes[i] >= 0 && indexes[i] < A.size()`;
    `work` - the working storage, must satisfy `work.length >= A.size()`; set `work==null` if you don't care about performance.
  Returns:
    the modified `A` (for convenience only).
  Throws:
    `java.lang.IndexOutOfBoundsException` - if `indexes.length != A.size()`.

### permute

    public static DoubleMatrix2D permute(DoubleMatrix2D A,
                                         int[] rowIndexes,
                                         int[] columnIndexes)

  Deprecated.
  Constructs and returns a new row and column permuted selection view of matrix `A`; equivalent to `DoubleMatrix2D.viewSelection(int[],int[])`. The returned matrix is backed by this matrix, so changes in the returned matrix are reflected in this matrix, and vice-versa. Use idioms like `result = permute(...).copy()` to generate an independent sub matrix.

  Returns:
    the new permuted selection view.

### permuteColumns

    public static DoubleMatrix2D permuteColumns(DoubleMatrix2D A,
                                                int[] indexes,
                                                int[] work)

  Deprecated.
  Modifies the given matrix `A` such that it's columns are permuted as specified; Useful for pivoting. Column `A[i]` will go into column `A[indexes[i]]`. Equivalent to `permuteRows(transpose(A), indexes, work)`.

  Parameters:
    `A` - the matrix to permute.
    `indexes` - the permutation indexes, must satisfy `indexes.length==A.columns() && indexes[i] >= 0 && indexes[i] < A.columns()`;
    `work` - the working storage, must satisfy `work.length >= A.columns()`; set `work==null` if you don't care about performance.
  Returns:
    the modified `A` (for convenience only).
  Throws:
    `java.lang.IndexOutOfBoundsException` - if `indexes.length != A.columns()`.

### permuteRows

    public static DoubleMatrix2D permuteRows(DoubleMatrix2D A,
                                             int[] indexes,
                                             int[] work)

  Deprecated.
  Modifies the given matrix `A` such that it's rows are permuted as specified; Useful for pivoting. Row `A[i]` will go into row `A[indexes[i]]`.

  Example:

       Reordering
       [A,B,C,D,E] with indexes [0,4,2,3,1] yields
       [A,E,C,D,B]
       In other words A[0]<--A[0], A[1]<--A[4], A[2]<--A[2], A[3]<--A[3], A[4]<--A[1].

       Reordering
       [A,B,C,D,E] with indexes [0,4,1,2,3] yields
       [A,E,B,C,D]
       In other words A[0]<--A[0], A[1]<--A[4], A[2]<--A[1], A[3]<--A[2], A[4]<--A[3].

  Parameters:
    `A` - the matrix to permute.
    `indexes` - the permutation indexes, must satisfy `indexes.length==A.rows() && indexes[i] >= 0 && indexes[i] < A.rows()`;
    `work` - the working storage, must satisfy `work.length >= A.rows()`; set `work==null` if you don't care about performance.
  Returns:
    the modified `A` (for convenience only).
  Throws:
    `java.lang.IndexOutOfBoundsException` - if `indexes.length != A.rows()`.

### property

    public Property property()

  Deprecated.
  Returns the property object attached to this Algebra, defining tolerance.

  Returns:
    the Property object.
  See Also:
    `setProperty(Property)`

### setProperty

    public void setProperty(Property property)

  Deprecated.
  Attaches the given property object to this Algebra, defining tolerance.

  Parameters:
    `property` - the Property object to be attached.
  Throws:
    `java.lang.UnsupportedOperationException` - if `this==DEFAULT && property!=this.property()` - The DEFAULT Algebra object is immutable.
    `java.lang.UnsupportedOperationException` - if `this==ZERO && property!=this.property()` - The ZERO Algebra object is immutable.
  See Also:
    `property`

### solve

    public static DoubleMatrix2D solve(DoubleMatrix2D A,
                                       DoubleMatrix2D B)

  Deprecated.
  Solves A*X = B.

  Returns:
    X; a new independent matrix; solution if A is square, least squares solution otherwise.

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