Package edu.jas.poly

Class ExpVectorLong

    • Constructor Detail

      • ExpVectorLong

        public ExpVectorLong​(int n)
        Constructor for ExpVector.
        Parameters:
        n - length of exponent vector.
      • ExpVectorLong

        public ExpVectorLong​(int n,
                             int i,
                             long e)
        Constructor for ExpVector. Sets exponent i to e.
        Parameters:
        n - length of exponent vector.
        i - index of exponent to be set.
        e - exponent to be set.
      • ExpVectorLong

        public ExpVectorLong​(long[] v)
        Constructor for ExpVector. Sets val.
        Parameters:
        v - representation array.
      • ExpVectorLong

        protected ExpVectorLong​(long[] v,
                                boolean alloc)
        Internal constructor for ExpVector. Sets val.
        Parameters:
        v - internal representation array.
        alloc - true if internal representation array is newly allocated, else false.
      • ExpVectorLong

        public ExpVectorLong​(java.lang.String s)
                      throws java.lang.NumberFormatException
        Constructor for ExpVector. Converts a String representation to an ExpVector. Accepted format = (1,2,3,4,5,6,7).
        Parameters:
        s - String representation.
        Throws:
        java.lang.NumberFormatException
    • Method Detail

      • parse

        public static ExpVectorLong parse​(java.lang.String s)
                                   throws java.lang.NumberFormatException
        parser for ExpVector. Converts a String representation to an ExpVector. Accepted format = (1,2,3,4,5,6,7).
        Parameters:
        s - String representation.
        Returns:
        paresed ExpVector
        Throws:
        java.lang.NumberFormatException
      • valueOf

        public static ExpVector valueOf​(ExpVector e)
        Value of other.
        Parameters:
        e - other ExpVector.
        Returns:
        value in sub class of ExpVector.
      • getVal

        public long[] getVal()
        Get the exponent vector.
        Specified by:
        getVal in class ExpVector
        Returns:
        val.
      • getVal

        public long getVal​(int i)
        Get the exponent at position i.
        Specified by:
        getVal in class ExpVector
        Parameters:
        i - position.
        Returns:
        val[i].
      • setVal

        protected long setVal​(int i,
                              long e)
        Set the exponent at position i to e.
        Specified by:
        setVal in class ExpVector
        Parameters:
        i -
        e -
        Returns:
        old val[i].
      • length

        public int length()
        Get the length of this exponent vector.
        Specified by:
        length in class ExpVector
        Returns:
        val.length.
      • extend

        public ExpVectorLong extend​(int i,
                                    int j,
                                    long e)
        Extend variables. Used e.g. in module embedding. Extend this by i elements and set val[j] to e.
        Specified by:
        extend in class ExpVector
        Parameters:
        i - number of elements to extend.
        j - index of element to be set.
        e - new exponent for val[j].
        Returns:
        extended exponent vector.
      • extendLower

        public ExpVectorLong extendLower​(int i,
                                         int j,
                                         long e)
        Extend lower variables. Extend this by i lower elements and set val[j] to e.
        Specified by:
        extendLower in class ExpVector
        Parameters:
        i - number of elements to extend.
        j - index of element to be set.
        e - new exponent for val[j].
        Returns:
        extended exponent vector.
      • contract

        public ExpVectorLong contract​(int i,
                                      int len)
        Contract variables. Used e.g. in module embedding. Contract this to len elements.
        Specified by:
        contract in class ExpVector
        Parameters:
        i - position of first element to be copied.
        len - new length.
        Returns:
        contracted exponent vector.
      • reverse

        public ExpVectorLong reverse​(int j)
        Reverse lower j variables. Used e.g. in opposite rings. Reverses the first j-1 variables, the rest is unchanged.
        Specified by:
        reverse in class ExpVector
        Parameters:
        j - index of first variable reversed.
        Returns:
        reversed exponent vector.
      • reverseUpper

        public ExpVectorLong reverseUpper​(int j)
        Reverse upper j variables. Reverses the last j-1 variables, the rest is unchanged.
        Parameters:
        j - index of first variable not reversed.
        Returns:
        reversed exponent vector.
      • combine

        public ExpVectorLong combine​(ExpVector V)
        Combine with ExpVector. Combine this with the other ExpVector V.
        Specified by:
        combine in class ExpVector
        Parameters:
        V - the other exponent vector.
        Returns:
        combined exponent vector.
      • toString

        public java.lang.String toString()
        Get the string representation.
        Overrides:
        toString in class ExpVector
        See Also:
        Object.toString()
      • equals

        public boolean equals​(java.lang.Object B)
        Comparison with any other object.
        Specified by:
        equals in interface Element<ExpVector>
        Overrides:
        equals in class ExpVector
        Returns:
        true if this is equal to b, else false.
        See Also:
        Object.equals(java.lang.Object)
      • subst

        public ExpVectorLong subst​(int i,
                                   long d)
        ExpVector substitution. Clone and set exponent to d at position i.
        Overrides:
        subst in class ExpVector
        Parameters:
        i - position.
        d - new exponent.
        Returns:
        substituted ExpVector.
      • signum

        public int signum()
        ExpVector signum.
        Specified by:
        signum in interface AbelianGroupElem<ExpVector>
        Specified by:
        signum in class ExpVector
        Returns:
        0 if this is zero, -1 if some entry is negative, 1 if no entry is negative and at least one entry is positive.
      • totalDeg

        public long totalDeg()
        ExpVector total degree.
        Specified by:
        totalDeg in class ExpVector
        Returns:
        sum of all exponents.
      • maxDeg

        public long maxDeg()
        ExpVector maximal degree.
        Specified by:
        maxDeg in class ExpVector
        Returns:
        maximal exponent.
      • minDeg

        public long minDeg()
        ExpVector minimal degree.
        Specified by:
        minDeg in class ExpVector
        Returns:
        minimal exponent.
      • weightDeg

        public long weightDeg​(long[][] w)
        ExpVector weighted degree.
        Specified by:
        weightDeg in class ExpVector
        Parameters:
        w - weights.
        Returns:
        weighted sum of all exponents.
      • weightDeg

        public long weightDeg​(long[] w)
        ExpVector weighted degree.
        Specified by:
        weightDeg in class ExpVector
        Parameters:
        w - weights.
        Returns:
        weighted sum of all exponents.
      • gcd

        public ExpVectorLong gcd​(ExpVector V)
        ExpVector greatest common divisor.
        Specified by:
        gcd in class ExpVector
        Parameters:
        V -
        Returns:
        component wise minimum of this and V.
      • multipleOf

        public boolean multipleOf​(ExpVector V)
        ExpVector multiple test. Test if this is component wise greater or equal to V.
        Specified by:
        multipleOf in class ExpVector
        Parameters:
        V -
        Returns:
        true if this is a multiple of V, else false.
      • invLexCompareTo

        public int invLexCompareTo​(ExpVector V,
                                   int begin,
                                   int end)
        ExpVector inverse lexicographical compareTo.
        Specified by:
        invLexCompareTo in class ExpVector
        Parameters:
        V -
        begin -
        end -
        Returns:
        0 if U == V, -1 if U < V, 1 if U > V.
      • invGradCompareTo

        public int invGradCompareTo​(ExpVector V,
                                    int begin,
                                    int end)
        ExpVector inverse graded lexicographical compareTo.
        Specified by:
        invGradCompareTo in class ExpVector
        Parameters:
        V -
        begin -
        end -
        Returns:
        0 if U == V, -1 if U < V, 1 if U > V.
      • revInvLexCompareTo

        public int revInvLexCompareTo​(ExpVector V,
                                      int begin,
                                      int end)
        ExpVector reverse inverse lexicographical compareTo.
        Specified by:
        revInvLexCompareTo in class ExpVector
        Parameters:
        V -
        begin -
        end -
        Returns:
        0 if U == V, -1 if U < V, 1 if U > V.
      • invWeightCompareTo

        public int invWeightCompareTo​(long[][] w,
                                      ExpVector V)
        ExpVector inverse weighted lexicographical compareTo.
        Specified by:
        invWeightCompareTo in class ExpVector
        Parameters:
        w - weight array.
        V -
        Returns:
        0 if U == V, -1 if U < V, 1 if U > V.
      • invWeightCompareTo

        public int invWeightCompareTo​(long[][] w,
                                      ExpVector V,
                                      int begin,
                                      int end)
        ExpVector inverse weighted lexicographical compareTo.
        Specified by:
        invWeightCompareTo in class ExpVector
        Parameters:
        w - weight array.
        V -
        begin -
        end -
        Returns:
        0 if U == V, -1 if U < V, 1 if U > V.