DistVector

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 DistVector

    java.lang.Object
      no.uib.cipr.matrix.AbstractVector
          no.uib.cipr.matrix.distributed.DistVector

All Implemented Interfaces:
  java.io.Serializable, java.lang.Iterable<VectorEntry>, Vector

    public class DistVector

extends AbstractVector

Distributed memory vector

See Also:
  Serialized Form

Nested Class Summary

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

Field Summary

Fields inherited from class no.uib.cipr.matrix.AbstractVector
`size`

Constructor Summary
`DistVector(int size, Communicator comm, Vector x)` Constructor for DistVector

Method Summary
`DistVector` | `add(double alpha, Vector y)` `x = alpha*y + x`
`void` | `add(int index, double value)` `x(index) += value`
`DistVector` | `copy()` Creates a deep copy of the vector
`double` | `dot(Vector y)` `xT*y`
`double` | `get(int index)` Returns `x(index)`
`Communicator` | `getCommunicator()` Gets the communicator associated with this vector
`Vector` | `getLocal()` Returns the local part of the vector
`int[]` | `getOwnerships()` Returns which indices are owned by which ranks.
`java.util.Iterator<VectorEntry>` | `iterator()`
`boolean` | `local(int index)` Returns true if the insertion index is local to this rank, and no communication is needed afterwards.
`protected double` | `norm1()`
`protected double` | `norm2_robust()`
`protected double` | `norm2()`
`protected double` | `normInf()`
`DistVector` | `scale(double alpha)` `x=alpha*x`
`DistVector` | `set(double alpha, Vector y)` `x=alpha*y`
`void` | `set(int index, double value)` `x(index) = value`
`DistVector` | `zero()` Zeros all the entries in the vector, while preserving any underlying structure

Methods inherited from class no.uib.cipr.matrix.AbstractVector
`add, check, checkSize, norm, set, size, toString`

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

Constructor Detail

### DistVector

    public DistVector(int size,
                      Communicator comm,
                      Vector x)

  Constructor for DistVector

  Parameters:
    `size` - Global vector size
    `comm` - Communicator to use
    `x` - Local vector, its size cannot exceed the global size, and the sum of the local vector sizes must equal the global vector size (this is checked)

Method Detail

### set

    public void set(int index,
                    double value)

  Description copied from interface: `Vector`
  `x(index) = value`

  Specified by:
    `set` in interface `Vector`
  Overrides:
    `set` in class `AbstractVector`

### add

    public void add(int index,
                    double value)

  Description copied from interface: `Vector`
  `x(index) += value`

  Specified by:
    `add` in interface `Vector`
  Overrides:
    `add` in class `AbstractVector`

### get

    public double get(int index)

  Description copied from interface: `Vector`
  Returns `x(index)`

  Specified by:
    `get` in interface `Vector`
  Overrides:
    `get` in class `AbstractVector`

### copy

    public DistVector copy()

  Description copied from interface: `Vector`
  Creates a deep copy of the vector

  Specified by:
    `copy` in interface `Vector`
  Overrides:
    `copy` in class `AbstractVector`

### zero

    public DistVector zero()

  Description copied from interface: `Vector`
  Zeros all the entries in the vector, while preserving any underlying structure

  Specified by:
    `zero` in interface `Vector`
  Overrides:
    `zero` in class `AbstractVector`

### scale

    public DistVector scale(double alpha)

  Description copied from interface: `Vector`
  `x=alpha*x`

  Specified by:
    `scale` in interface `Vector`
  Overrides:
    `scale` in class `AbstractVector`
  Returns:
    x

### set

    public DistVector set(double alpha,
                          Vector y)

  Description copied from interface: `Vector`
  `x=alpha*y`

  Specified by:
    `set` in interface `Vector`
  Overrides:
    `set` in class `AbstractVector`
  Returns:
    x

### add

    public DistVector add(double alpha,
                          Vector y)

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

  Specified by:
    `add` in interface `Vector`
  Overrides:
    `add` in class `AbstractVector`
  Returns:
    x

### dot

    public double dot(Vector y)

  Description copied from interface: `Vector`
  `xT*y`

  Specified by:
    `dot` in interface `Vector`
  Overrides:
    `dot` in class `AbstractVector`

### norm1

    protected double norm1()

  Overrides:
    `norm1` in class `AbstractVector`

### norm2_robust

    protected double norm2_robust()

  Overrides:
    `norm2_robust` in class `AbstractVector`

### norm2

    protected double norm2()

  Overrides:
    `norm2` in class `AbstractVector`

### normInf

    protected double normInf()

  Overrides:
    `normInf` in class `AbstractVector`

### getLocal

    public Vector getLocal()

  Returns the local part of the vector

### getOwnerships

    public int[] getOwnerships()

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

### local

    public boolean local(int index)

  Returns true if the insertion index is local to this rank, and no communication is needed afterwards.

### iterator

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

  Specified by:
    `iterator` in interface `java.lang.Iterable<VectorEntry>`
  Overrides:
    `iterator` in class `AbstractVector`

### getCommunicator

    public Communicator getCommunicator()

  Gets the communicator associated with this vector

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

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