java.lang.Object
org.bouncycastle.pqc.legacy.math.linearalgebra.Vector
Direct Known Subclasses:
GF2mVector, GF2Vector

public abstract class Vector extends Object
This abstract class defines vectors. It holds the length of vector.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    the length of this vector
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Vector
    add(Vector addend)
    Add another vector to this vector.
    abstract boolean
    equals(Object other)
    Check if the given object is equal to this vector.
    abstract byte[]
     
    final int
     
    abstract int
     
    abstract boolean
    Return whether this is the zero vector (i.e., all elements are zero).
    abstract Vector
    Multiply this vector with a permutation.
    abstract String
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • length

      protected int length
      the length of this vector
  • Constructor Details

    • Vector

      public Vector()
  • Method Details

    • 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(Object other)
      Check if the given object is equal to this vector.
      Overrides:
      equals in class Object
      Parameters:
      other - vector
      Returns:
      the result of the comparison
    • hashCode

      public abstract int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      the hash code of this vector
    • toString

      public abstract String toString()
      Overrides:
      toString in class Object
      Returns:
      a human readable form of this vector