summary refs log tree commit diff
path: root/crypto/src/pqc/math/linearalgebra/Vector.cs
blob: e50c5479272129ceddceccf542ef999f1eaba04b (plain) (blame)
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
using System;

namespace 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 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 bool 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 bool Equals(Object other);

    }
}