DistColMatrix

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## no.uib.cipr.matrix.distributed
Class DistColMatrix

    java.lang.Object
      no.uib.cipr.matrix.AbstractMatrix
          no.uib.cipr.matrix.distributed.DistColMatrix

All Implemented Interfaces:
  java.lang.Iterable<MatrixEntry>, Matrix

    public class DistColMatrix

extends AbstractMatrix

Distributed matrix with column major blocks

Nested Class Summary

Nested classes/interfaces inherited from interface no.uib.cipr.matrix.Matrix
`Matrix.Norm`

Field Summary

Fields inherited from class no.uib.cipr.matrix.AbstractMatrix
`numColumns, numRows`

Constructor Summary
`DistColMatrix(int numRows, int numColumns, Communicator comm, Matrix A, Matrix B)` Constructor for DistColMatrix

Method Summary
`void` | `add(int row, int column, double value)` `A(row,column) += value`
`DistColMatrix` | `copy()` Creates a deep copy of the matrix
`double` | `get(int row, int column)` Returns `A(row,column)`
`Matrix` | `getBlock()` Returns the diagonal block matrix
`int[]` | `getColumnOwnerships()` Returns which columns are owned by which ranks.
`Communicator` | `getCommunicator()` Gets the communicator associated with this matrix
`Matrix` | `getOff()` Returns the off-diagonal matrix
`int[]` | `getRowOwnerships()` Returns which rows are owned by which ranks.
`java.util.Iterator<MatrixEntry>` | `iterator()`
`boolean` | `local(int row, int column)` Returns true if the insertion indices are local to this rank, and no communication is required afterwards.
`protected double` | `max()` Returns the largest absolute value
`Vector` | `multAdd(double alpha, Vector x, Vector y)` `y = alpha*A*x + y`
`protected double` | `norm1()` Computes the 1 norm
`protected double` | `normF()` Computes the Frobenius norm.
`protected double` | `normInf()` Computes the infinity norm
`Matrix` | `rank1(double alpha, Vector x, Vector y)` `A = alpha*x*yT + A`.
`Matrix` | `rank2(double alpha, Vector x, Vector y)` `A = alpha*x*yT + alpha*y*xT + A`.
`void` | `set(int row, int column, double value)` `A(row,column) = value`
`Vector` | `transMultAdd(double alpha, Vector x, Vector y)` `y = alpha*AT*x + y`
`DistColMatrix` | `zero()` Zeros all the entries in the matrix, while preserving any underlying structure.

Methods inherited from class no.uib.cipr.matrix.AbstractMatrix
`add, add, check, checkMultAdd, checkMultAdd, checkRank1, checkRank1, checkRank2, checkRank2, checkSize, checkSolve, checkSolve, checkTransABmultAdd, checkTransAmultAdd, checkTransBmultAdd, checkTransMultAdd, checkTranspose, checkTranspose, checkTransRank1, checkTransRank2, isSquare, max, mult, mult, mult, mult, multAdd, multAdd, multAdd, norm, numColumns, numRows, rank1, rank1, rank1, rank1, rank1, rank2, rank2, rank2, scale, set, set, solve, solve, toString, transABmult, transABmult, transABmultAdd, transABmultAdd, transAmult, transAmult, transAmultAdd, transAmultAdd, transBmult, transBmult, transBmultAdd, transBmultAdd, transMult, transMult, transMultAdd, transpose, transpose, transRank1, transRank1, transRank2, transRank2, transSolve, transSolve`

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

Constructor Detail

### DistColMatrix

    public DistColMatrix(int numRows,
                         int numColumns,
                         Communicator comm,
                         Matrix A,
                         Matrix B)

  Constructor for DistColMatrix

  Parameters:
    `numRows` - Global number of rows
    `numColumns` - Global number of columns
    `comm` - Communicator to use
    `A` - Block diagonal matrix. The sum of the local row sizes of `A` must equal the global number, and likewise with the column sizes.
    `B` - Off-diagonal matrix part. Its number of rows must equal the global number of rows, and its number of columns must equal that of `A`

Method Detail

### add

    public void add(int row,
                    int column,
                    double value)

  Description copied from interface: `Matrix`
  `A(row,column) += value`

  Specified by:
    `add` in interface `Matrix`
  Overrides:
    `add` in class `AbstractMatrix`

### set

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

  Description copied from interface: `Matrix`
  `A(row,column) = value`

  Specified by:
    `set` in interface `Matrix`
  Overrides:
    `set` in class `AbstractMatrix`

### get

    public double get(int row,
                      int column)

  Description copied from interface: `Matrix`
  Returns `A(row,column)`

  Specified by:
    `get` in interface `Matrix`
  Overrides:
    `get` in class `AbstractMatrix`

### copy

    public DistColMatrix copy()

  Description copied from interface: `Matrix`
  Creates a deep copy of the matrix

  Specified by:
    `copy` in interface `Matrix`
  Overrides:
    `copy` in class `AbstractMatrix`
  Returns:
    A

### iterator

    public java.util.Iterator<MatrixEntry> iterator()

  Specified by:
    `iterator` in interface `java.lang.Iterable<MatrixEntry>`
  Overrides:
    `iterator` in class `AbstractMatrix`

### multAdd

    public Vector multAdd(double alpha,
                          Vector x,
                          Vector y)

  Description copied from interface: `Matrix`
  `y = alpha*A*x + y`

  Specified by:
    `multAdd` in interface `Matrix`
  Overrides:
    `multAdd` in class `AbstractMatrix`
    `x` - Vector of size `A.numColumns()`
    `y` - Vector of size `A.numRows()`
  Returns:
    y

### transMultAdd

    public Vector transMultAdd(double alpha,
                               Vector x,
                               Vector y)

  Description copied from interface: `Matrix`
  `y = alpha*AT*x + y`

  Specified by:
    `transMultAdd` in interface `Matrix`
  Overrides:
    `transMultAdd` in class `AbstractMatrix`
    `x` - Vector of size `A.numRows()`
    `y` - Vector of size `A.numColumns()`
  Returns:
    y

### local

    public boolean local(int row,
                         int column)

  Returns true if the insertion indices are local to this rank, and no communication is required afterwards. However, you still need to call `flushAssembly` to set up things like matrix/vector multiplication

### norm1

    protected double norm1()

  Description copied from class: `AbstractMatrix`
  Computes the 1 norm

  Overrides:
    `norm1` in class `AbstractMatrix`

### normInf

    protected double normInf()

  Description copied from class: `AbstractMatrix`
  Computes the infinity norm

  Overrides:
    `normInf` in class `AbstractMatrix`

### zero

    public DistColMatrix zero()

  Description copied from interface: `Matrix`
  Zeros all the entries in the matrix, while preserving any underlying structure. Useful for general, unstructured matrices.

  Specified by:
    `zero` in interface `Matrix`
  Returns:
    A

### getRowOwnerships

    public int[] getRowOwnerships()

  Returns which rows are owned by which ranks. The current rank owns the rows `n[comm.rank()]` (inclusive) to `n[comm.rank()+1]` (exclusive)

### getColumnOwnerships

    public int[] getColumnOwnerships()

  Returns which columns are owned by which ranks. The current rank owns the columns `m[comm.rank()]` (inclusive) to `m[comm.rank()+1]` (exclusive)

### getBlock

    public Matrix getBlock()

  Returns the diagonal block matrix

### getOff

    public Matrix getOff()

  Returns the off-diagonal matrix

### max

    protected double max()

  Description copied from class: `AbstractMatrix`
  Returns the largest absolute value

  Overrides:
    `max` in class `AbstractMatrix`

### normF

    protected double normF()

  Description copied from class: `AbstractMatrix`
  Computes the Frobenius norm. This implementation is overflow resistant

  Overrides:
    `normF` in class `AbstractMatrix`

### rank1

    public Matrix rank1(double alpha,
                        Vector x,
                        Vector y)

  Description copied from interface: `Matrix`
  `A = alpha*x*yT + A`. The matrix must be square, and the vectors of the same length

  Specified by:
    `rank1` in interface `Matrix`
  Overrides:
    `rank1` in class `AbstractMatrix`
  Returns:
    A

### rank2

    public Matrix rank2(double alpha,
                        Vector x,
                        Vector y)

  Description copied from interface: `Matrix`
  `A = alpha*x*yT + alpha*y*xT + A`. The matrix must be square, and the vectors of the same length

  Specified by:
    `rank2` in interface `Matrix`
  Overrides:
    `rank2` in class `AbstractMatrix`
  Returns:
    A

### getCommunicator

    public Communicator getCommunicator()

  Gets the communicator associated with this matrix

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD