Class GenVectorModul<C extends RingElem<C>>

    • Constructor Detail

      • GenVectorModul

        public GenVectorModul​(RingFactory<C> b,
                              int s)
        Constructor for GenVectorModul.
    • Method Detail

      • toString

        public java.lang.String toString()
        Get the String representation as RingElem.
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • toScript

        public java.lang.String toScript()
        Get a scripting compatible string representation.
        Specified by:
        toScript in interface ElemFactory<C extends RingElem<C>>
        Returns:
        script compatible representation for this ElemFactory.
        See Also:
        ElemFactory.toScript()
      • equals

        public boolean equals​(java.lang.Object other)
        Comparison with any other object.
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Hash code for this vector module.
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • fromInteger

        public GenVector<C> fromInteger​(long a)
        Get the vector for a.
        Specified by:
        fromInteger in interface ElemFactory<C extends RingElem<C>>
        Parameters:
        a - long
        Returns:
        vector corresponding to a.
      • fromInteger

        public GenVector<C> fromInteger​(java.math.BigInteger a)
        Get the vector for a.
        Specified by:
        fromInteger in interface ElemFactory<C extends RingElem<C>>
        Parameters:
        a - long
        Returns:
        vector corresponding to a.
      • random

        public GenVector<C> random​(int k)
        Random vector.
        Specified by:
        random in interface ElemFactory<C extends RingElem<C>>
        Parameters:
        k - size of random coefficients.
        Returns:
        random vector.
      • random

        public GenVector<C> random​(int k,
                                   float q)
        Random vector.
        Specified by:
        random in interface ModulFactory<GenVector<C extends RingElem<C>>,​C extends RingElem<C>>
        Parameters:
        k - size of random coefficients.
        q - density of nonzero coefficients.
        Returns:
        random vector.
      • random

        public GenVector<C> random​(int k,
                                   java.util.Random random)
        Random vector.
        Specified by:
        random in interface ElemFactory<C extends RingElem<C>>
        Parameters:
        k - size of random coefficients.
        random - is a source for random bits.
        Returns:
        a random element.
      • random

        public GenVector<C> random​(int k,
                                   float q,
                                   java.util.Random random)
        Random vector.
        Parameters:
        k - size of random coefficients.
        q - density of nonzero coefficients.
        random - is a source for random bits.
        Returns:
        a random element.
      • parse

        public GenVector<C> parse​(java.lang.String s)
        Parse a vector from a String. Syntax: [ c, ..., c ]
        Specified by:
        parse in interface ElemFactory<C extends RingElem<C>>
        Parameters:
        s - String with vector.
        Returns:
        parsed vector.
      • parse

        public GenVector<C> parse​(java.io.Reader r)
        Parse a vector from a Reader.
        Specified by:
        parse in interface ElemFactory<C extends RingElem<C>>
        Parameters:
        r - Reader containing a vector.
        Returns:
        parsed vector.