Class Mpi_IntegerArrayImpl

    • Constructor Detail

      • Mpi_IntegerArrayImpl

        public Mpi_IntegerArrayImpl​(int dim)
        Constructor for zero-initialized mpi with dim entries.
        Parameters:
        dim -
      • Mpi_IntegerArrayImpl

        public Mpi_IntegerArrayImpl​(int[] values)
        Constructor from element array, with element copy.
        Parameters:
        values -
      • Mpi_IntegerArrayImpl

        public Mpi_IntegerArrayImpl​(Collection<Integer> values)
        Constructor from value collection.
        Parameters:
        values -
      • Mpi_IntegerArrayImpl

        public Mpi_IntegerArrayImpl​(Mpi original)
        Copy constructor.
        Parameters:
        original -
      • Mpi_IntegerArrayImpl

        public Mpi_IntegerArrayImpl​(String str)
        Constructor from a comma-separated string of values.
        Parameters:
        str -
    • Method Detail

      • getDim

        public int getDim()
        Specified by:
        getDim in interface Mpi
        Returns:
        dimension of the multipartite number, it's "partiteness"
      • getCardinality

        public int getCardinality()
        Specified by:
        getCardinality in interface Mpi
        Returns:
        total number of entries = the sum of the elements of this multipartite number
      • getElem

        public int getElem​(int index)
        Description copied from interface: Mpi
        Returns the entry of the given index, with 0<=index
        Specified by:
        getElem in interface Mpi
        Returns:
        entry at index 'index'
      • setElem

        public void setElem​(int index,
                            int value)
        Description copied from interface: Mpi
        Sets the entry of the given index, with 0<=index
        Specified by:
        setElem in interface Mpi
      • firstNonZeroPartIndex

        public int firstNonZeroPartIndex()
        Specified by:
        firstNonZeroPartIndex in interface Mpi
        Returns:
        the index of the first non-zero entry
      • subtract

        public Mpi[] subtract​(Mpi other)
        Description copied from interface: Mpi
        Returns the pair [lower, upper] of consecutive subvalues of this (according to the ordering relation) such that lower + other <= this and upper + other >= this.
        Specified by:
        subtract in interface Mpi
        Returns:
        the lower and upper bound of this - other
      • complement

        public Mpi complement​(Mpi other)
        Description copied from interface: Mpi
        Like subtract() but when we know that other fits piece-wise into this. That means faster ;)
        Specified by:
        complement in interface Mpi
        Parameters:
        other - a multipartite integer that has no element greater than the corresponding element of this
        Returns:
        this - other
      • div2

        public Mpi[] div2()
        Description copied from interface: Mpi
        Computes a kind of division by 2 of this. The result is a pair of [lower, upper] values with lower + upper = this (element-wise addition) and lower<=upper.
        Specified by:
        div2 in interface Mpi
        Returns:
        [lower, upper]
      • maxNextPart

        public Mpi maxNextPart​(Mpi firstPart,
                               Mpi lastPart)
        Description copied from interface: Mpi
        Special operation computing the biggest allowed subvalue of this that is not greater than lastPart and not greater than this-firstPart.
        Specified by:
        maxNextPart in interface Mpi
        Returns:
        min(lastPart, lower(this - firstPart))
      • compareTo

        public int compareTo​(Mpi other)
        Description copied from interface: Mpi
        Compare this with another multipartite integer. The first element that differs decides, i.e. [2,0,0] is bigger than [1,2,3].
        Specified by:
        compareTo in interface Comparable<Mpi>
        Specified by:
        compareTo in interface Mpi
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object