Vector (Bouncy Castle Library 1.52 API Specification)

org.bouncycastle.pqc.math.linearalgebra

## Class Vector

- java.lang.Object
- - org.bouncycastle.pqc.math.linearalgebra.Vector

- Direct Known Subclasses:
    GF2mVector, GF2Vector

      public abstract class Vector
      extends java.lang.Object

  This abstract class defines vectors. It holds the length of vector.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `length` the length of this vector

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Vector()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract Vector` | `add(Vector addend)` Add another vector to this vector.
    `abstract boolean` | `equals(java.lang.Object other)` Check if the given object is equal to this vector.
    `abstract byte[]` | `getEncoded()`
    `int` | `getLength()`
    `abstract int` | `hashCode()`
    `abstract boolean` | `isZero()` Return whether this is the zero vector (i.e., all elements are zero).
    `abstract Vector` | `multiply(Permutation p)` Multiply this vector with a permutation.
    `abstract java.lang.String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### length

          protected int length

      the length of this vector

  - ### Constructor Detail

    - #### Vector

          public Vector()

  - ### Method Detail

    - #### getLength

          public final int getLength()

      Returns:
        the length of this vector

    - #### getEncoded

          public abstract byte[] getEncoded()

      Returns:
        this vector as byte array

    - #### isZero

          public abstract boolean isZero()

      Return whether this is the zero vector (i.e., all elements are zero).
      Returns:
        `true` if this is the zero vector, `false` otherwise

    - #### add

          public abstract Vector add(Vector addend)

      Add another vector to this vector.
      Parameters:
        `addend` - the other vector
      Returns:
        `this + addend`

    - #### multiply

          public abstract Vector multiply(Permutation p)

      Multiply this vector with a permutation.
      Parameters:
        `p` - the permutation
      Returns:
        `this*p = p*this`

    - #### equals

          public abstract boolean equals(java.lang.Object other)

      Check if the given object is equal to this vector.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `other` - vector
      Returns:
        the result of the comparison

    - #### hashCode

          public abstract int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        the hash code of this vector

    - #### toString

          public abstract java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a human readable form of this vector