All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.pqc.math.linearalgebra.Vector Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java APIs for CMS, PKCS, EAC, TSP, CMP, CRMF, OCSP, and certificate generation. This jar contains APIs for JDK 1.5 and up. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs.

There is a newer version: 1.2.2.1-jre17
Show newest version
package org.bouncycastle.pqc.math.linearalgebra;

/**
 * This abstract class defines vectors. It holds the length of vector.
 */
public abstract class Vector
{

    /**
     * the length of this vector
     */
    protected int length;

    /**
     * @return the length of this vector
     */
    public final int getLength()
    {
        return length;
    }

    /**
     * @return this vector as byte array
     */
    public abstract byte[] getEncoded();

    /**
     * Return whether this is the zero vector (i.e., all elements are zero).
     *
     * @return true if this is the zero vector, false
     *         otherwise
     */
    public abstract boolean isZero();

    /**
     * Add another vector to this vector.
     *
     * @param addend the other vector
     * @return this + addend
     */
    public abstract Vector add(Vector addend);

    /**
     * Multiply this vector with a permutation.
     *
     * @param p the permutation
     * @return this*p = p*this
     */
    public abstract Vector multiply(Permutation p);

    /**
     * Check if the given object is equal to this vector.
     *
     * @param other vector
     * @return the result of the comparison
     */
    public abstract boolean equals(Object other);

    /**
     * @return the hash code of this vector
     */
    public abstract int hashCode();

    /**
     * @return a human readable form of this vector
     */
    public abstract String toString();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy