Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Vector.java « linearalgebra « math « pqc « spongycastle « org « java « main « src « core - gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7f33d735f531b513f1ab99774990041ccb0d4be7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package org.spongycastle.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 <tt>true</tt> if this is the zero vector, <tt>false</tt>
     *         otherwise
     */
    public abstract boolean isZero();

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

    /**
     * Multiply this vector with a permutation.
     *
     * @param p the permutation
     * @return <tt>this*p = p*this</tt>
     */
    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();

}