Interface ProblemAPIOnVars

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default <T> T[] addObject​(T[] t, T object)
      Appends the specified object to the specified array.
      default <T> T[] addObject​(T[] t, T object, int index)
      Inserts the specified object in the specified array at the specified index.
      default <T extends IVar>
      T[]
      clean​(T[] vars)
      Builds and returns a 1-dimensional array of variables from the specified 1-dimensional array of variables, by discarding null values.
      default <T> T[] columnOf​(T[][] vars, int idColumn)
      Selects from the specified 2-dimensional array of objects (e.g., variables) the column at the specified index.
      default boolean contains​(Object[] t, Object object)
      Returns true iff the specified object is contained in the specified array
      default <T> T[] diagonalDown​(T[][] vars)
      Selects from the specified 2-dimensional array of objects (e.g., variables) the main downward diagonal.
      default <T> T[] diagonalDown​(T[][] vars, int idDiagonal)
      Selects from the specified 2-dimensional array of objects (e.g., variables) the downward diagonal at the specified index.
      default <T> T[] diagonalDown​(T[][] vars, int i, int j)
      Selects from the specified 2-dimensional array of objects (e.g., variables), which must represent a square of size n*n, the downward diagonal that contains the cell at row i and column j.
      default <T> T[][] diagonalsDown​(T[][] vars)
      Returns a 2-dimensional array of objects (e.g., variables) such that each intern array corresponds to the objects on a (non-unit) downward diagonal of the specified 2-dimensional array of objects (which must represent a square of size n*n).
      default <T> T[][] diagonalsUp​(T[][] vars)
      Returns a 2-dimensional array of objects (e.g., variables) such that each intern array corresponds to the objects on a (non-unit) upward diagonal of the specified 2-dimensional array of objects (which must represent a square of size n*n).
      default <T> T[] diagonalUp​(T[][] vars)
      Selects from the specified 2-dimensional array of objects (e.g., variables) the main upward diagonal.
      default <T> T[] diagonalUp​(T[][] vars, int idDiagonal)
      Selects from the specified 2-dimensional array of objects (e.g., variables) the upward diagonal at the specified index.
      default <T> T[] diagonalUp​(T[][] vars, int i, int j)
      Selects from the specified 2-dimensional array of objects (e.g., variables), which must represent a square, the upward diagonal that contains the cell at row i and column j.
      default <T> T[][] eliminateDim2​(T[][][] vars, int idx)
      Returns a 2-dimensional array of objects (e.g., variables) obtained from the specified 3-dimensional array of objects by eliminating the second dimension after fixing it to the idx argument.
      default <T> T[][] eliminateDim3​(T[][][] vars, int idx)
      Returns a 2-dimensional array of objects (e.g., variables) obtained from the specified 3-dimensional array of objects by eliminating the third dimension after fixing it to the idx argument.
      default <T> T firstFrom​(T[] t, java.util.function.Predicate<T> p)
      Returns the first object in the specified array that satisfies the specified predicate, if any, or null.
      default <T> T[] select​(T[][][][][] vars, FunctionalInterfaces.Intx5Predicate p)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index (i,j,k,l,m) that satisfies the specified predicate.
      default <T> T[] select​(T[][][][][] vars, Range.Rangesx5 rangesx5)
      Builds and returns a 1-dimensional array of object (e.g., variables)s, obtained by selecting from the specified array any object, at index (i,j,k,l,m), that belongs to the specified quintuple range.
      default <T> T[] select​(T[][][][] vars, FunctionalInterfaces.Intx4Predicate p)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index (i,j,k,l) that satisfies the specified predicate.
      default <T> T[] select​(T[][][][] vars, Range.Rangesx4 rangesx4)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object, at index (i,j,k,l), that belongs to the specified quadruple range.
      default <T> T[] select​(T[][][] vars, FunctionalInterfaces.Intx3Predicate p)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index (i,j,k) that satisfies the specified predicate.
      default <T> T[] select​(T[][][] vars, Range.Rangesx3 rangesx3)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object, at index (i,j,k), that belongs to the specified triple range.
      default <T> T[] select​(T[][] vars, FunctionalInterfaces.Intx2Predicate p)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index (i,j) that satisfies the specified predicate.
      default <T> T[] select​(T[][] vars, Range.Rangesx2 rangesx2)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object, at index (i,j), that belongs to the specified double range.
      default <T> T[] select​(T[] vars, int[] indexes)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index i present in the indexes argument.
      default <T> T[] select​(T[] vars, int fromIndex, int toIndex)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index i going from the specified fromIndex (inclusive) to the specified toIndex (exclusive).
      default <T> T[] select​(T[] vars, Collection<Integer> indexes)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index i present in the indexes argument.
      default <T> T[] select​(T[] vars, FunctionalInterfaces.Intx1Predicate p)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index i that satisfies the specified predicate.
      default <T> T[] select​(T[] vars, Range range)
      Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object, at index i, that belongs to the specified range.
      default <T extends IVar,​U>
      T[]
      singleVariablesFrom​(Collection<U> c, java.util.function.Function<U,​Object> f)
      Builds and returns a 1-dimensional array of variables from the specified collection.
      default <T extends IVar,​U>
      T[]
      singleVariablesFrom​(java.util.stream.Stream<U> stream, java.util.function.Function<U,​Object> f)
      Builds and returns a 1-dimensional array of variables from the specified stream.
      default <T extends IVar>
      T[]
      singleVariablesIn​(Object... objects)
      Builds and returns a 1-dimensional array of variables from the specified sequence of parameters.
      default <T> T[][] transpose​(T[]... vars)
      Returns the transpose of the specified 2-dimensional array of objects (e.g., variables).
      default <T extends IVar>
      T[]
      variablesFrom​(int[] t, java.util.function.Function<Integer,​Object> f)
      Builds and returns a 1-dimensional array of variables from the specified array.
      default <T extends IVar,​U>
      T[]
      variablesFrom​(Collection<U> c, java.util.function.Function<U,​Object> f)
      Builds and returns a 1-dimensional array of variables from the specified collection.
      default <T extends IVar,​U>
      T[]
      variablesFrom​(java.util.stream.IntStream stream, java.util.function.Function<Integer,​Object> f)
      Builds and returns a 1-dimensional array of variables from the specified stream.
      default <T extends IVar,​U>
      T[]
      variablesFrom​(java.util.stream.Stream<U> stream, java.util.function.Function<U,​Object> f)
      Builds and returns a 1-dimensional array of variables from the specified stream.
      default <T extends IVar>
      T[]
      variablesFrom​(Range r, java.util.function.Function<Integer,​Object> f)
      Returns a 1-dimensional array of variables, obtained after collecting the variables returned by the specified function when executed on all values in this range.
      default <T extends IVar,​U>
      T[]
      variablesFrom​(U[] t, java.util.function.Function<U,​Object> f)
      Builds and returns a 1-dimensional array of variables from the specified array.
      default <T extends IVar>
      T[]
      variablesIn​(Object object, Object... otherObjects)
      Builds and returns a 1-dimensional array of variables from the specified sequence of parameters.
      default <T extends IVar>
      T[]
      vars​(Object first, Object... others)
      Builds and returns a 1-dimensional array of variables from the specified sequence of parameters.
      default <T extends IVar>
      T[]
      vars​(Object first, T x)
      Builds and returns a 1-dimensional array of variables from the specified parameters.
      default <T extends IVar>
      T[]
      vars​(Object first, T[] x)
      Builds and returns a 1-dimensional array of variables from the specified parameters.
      default <T extends IVar>
      T[]
      vars​(Object first, T[][] x)
      Builds and returns a 1-dimensional array of variables from the specified parameters.
      default <T extends IVar>
      T[]
      vars​(java.util.stream.Stream<T> stream)
      Returns a 1-dimensional array of variables by collecting them in order from the specified stream.
      default <T extends IVar>
      T[]
      vars​(T[][] vars)
      Builds and returns a 1-dimensional array of variables from the specified array.
      default <T extends IVar>
      T[]
      vars​(T[][][] vars)
      Builds and returns a 1-dimensional array of variables from the specified array.
      default <T extends IVar>
      T[]
      vars​(T x, T... others)
      Returns a 1-dimensional array containing the specified variables.
    • Method Detail

      • vars

        default <T extends IVar> T[] vars​(Object first,
                                          Object... others)
        Builds and returns a 1-dimensional array of variables from the specified sequence of parameters. All variables encountered in the parameters, extracting them from arrays (of any dimension), collections and streams, are recursively collected in order, and concatenated to form a 1-dimensional array. Note that null values, as well as any simple object not implementing IVar, are simply discarded.
        Parameters:
        first - a first object that may involve one or several variables (possibly in arrays, collections and streams)
        others - other objects that may involve one or several variables (possibly in arrays, collections and streams)
        Returns:
        a 1-dimensional array of variables
      • vars

        default <T extends IVar> T[] vars​(T x,
                                          T... others)
        Returns a 1-dimensional array containing the specified variables.
        Parameters:
        x - a first variable
        others - a sequence of other variables
        Returns:
        a 1-dimensional array containing the specified variables
      • vars

        default <T extends IVar> T[] vars​(T[][] vars)
        Builds and returns a 1-dimensional array of variables from the specified array. All variables are collected in order, and null values are simply discarded.
        Parameters:
        vars - a 2-dimensional array of variables
        Returns:
        a 1-dimensional array of variables
      • vars

        default <T extends IVar> T[] vars​(T[][][] vars)
        Builds and returns a 1-dimensional array of variables from the specified array. All variables are collected in order, and null values are simply discarded.
        Parameters:
        vars - a 3-dimensional array of variables
        Returns:
        a 1-dimensional array of variables
      • vars

        default <T extends IVar> T[] vars​(Object first,
                                          T x)
        Builds and returns a 1-dimensional array of variables from the specified parameters. All variables encountered in the first parameter, extracting them from arrays (of any dimension), collections and streams, are recursively collected in order, and concatenated to form a 1-dimensional array. Note that null values, as well as any simple object not implementing IVar, are simply discarded.
        Parameters:
        first - an object that may involve one or several variables (possibly in arrays, collections and streams)
        x - a variable
        Returns:
        a 1-dimensional array of variables
      • vars

        default <T extends IVar> T[] vars​(Object first,
                                          T[] x)
        Builds and returns a 1-dimensional array of variables from the specified parameters. All variables encountered in the parameters, extracting them from arrays (of any dimension), collections and streams, are recursively collected in order, and concatenated to form a 1-dimensional array. Note that null values, as well as any simple object not implementing IVar, are simply discarded.
        Parameters:
        first - an object that may involve one or several variables (possibly in arrays, collections and streams)
        x - a 1-dimensional array of variables
        Returns:
        a 1-dimensional array of variables
      • vars

        default <T extends IVar> T[] vars​(Object first,
                                          T[][] x)
        Builds and returns a 1-dimensional array of variables from the specified parameters. All variables encountered in the parameters, extracting them from arrays (of any dimension), collections and streams, are recursively collected in order, and concatenated to form a 1-dimensional array. Note that null values, as well as any simple object not implementing IVar, are simply discarded.
        Parameters:
        first - an object that may involve one or several variables (possibly in arrays, collections and streams)
        x - a 2-dimensional array of variables
        Returns:
        a 1-dimensional array of variables
      • vars

        default <T extends IVar> T[] vars​(java.util.stream.Stream<T> stream)
        Returns a 1-dimensional array of variables by collecting them in order from the specified stream.
        Parameters:
        stream - a stream of variables
        Returns:
        a 1-dimensional array of variables
      • clean

        default <T extends IVar> T[] clean​(T[] vars)
        Builds and returns a 1-dimensional array of variables from the specified 1-dimensional array of variables, by discarding null values.
        Parameters:
        vars - a 1-dimensional array of variables
        Returns:
        a 1-dimensional array of variables after discarding all occurrences of null
      • variablesIn

        default <T extends IVar> T[] variablesIn​(Object object,
                                                 Object... otherObjects)
        Builds and returns a 1-dimensional array of variables from the specified sequence of parameters. All variables encountered in the parameters, extracting them from arrays (of any dimension), collections and streams, are recursively collected in order, and concatenated to form a 1-dimensional array. Note that null values, as well as any simple object not implementing IVar, are simply discarded.
        Parameters:
        object - a first object that may involve one or several variables (possibly in arrays, collections and streams)
        otherObjects - other objects that may involve one or several variables (possibly in arrays, collections and streams)
        Returns:
        a 1-dimensional array of variables
      • variablesFrom

        default <T extends IVar,​U> T[] variablesFrom​(java.util.stream.Stream<U> stream,
                                                           java.util.function.Function<U,​Object> f)
        Builds and returns a 1-dimensional array of variables from the specified stream. Each object of the stream is mapped to another object by the specified function. Then, all variables are collected and concatenated to form a 1-dimensional array. null values are discarded.
        Parameters:
        stream - a stream of objects
        f - a function mapping objects of the stream into other objects
        Returns:
        a 1-dimensional array formed of collected variables (occurrences of null being discarded}
      • variablesFrom

        default <T extends IVar,​U> T[] variablesFrom​(java.util.stream.IntStream stream,
                                                           java.util.function.Function<Integer,​Object> f)
        Builds and returns a 1-dimensional array of variables from the specified stream. Each integer of the stream is mapped to another object by the specified function. Then, all variables are collected and concatenated to form a 1-dimensional array. null values are discarded.
        Parameters:
        stream - a stream of integers
        f - a function mapping integers of the stream into other objects
        Returns:
        a 1-dimensional array formed of collected variables (occurrences of null being discarded}
      • variablesFrom

        default <T extends IVar,​U> T[] variablesFrom​(U[] t,
                                                           java.util.function.Function<U,​Object> f)
        Builds and returns a 1-dimensional array of variables from the specified array. Each object of the array is mapped to another object by the specified function. Then, all variables are collected and concatenated to form a 1-dimensional array. null values are discarded.
        Parameters:
        t - an array of objects
        f - a function mapping objects of the array into other objects
        Returns:
        a 1-dimensional array formed of collected variables (occurrences of null being discarded}
      • variablesFrom

        default <T extends IVar,​U> T[] variablesFrom​(Collection<U> c,
                                                           java.util.function.Function<U,​Object> f)
        Builds and returns a 1-dimensional array of variables from the specified collection. Each object of the collection is mapped to another object by the specified function. Then, all variables are collected and concatenated to form a 1-dimensional array. null values are discarded.
        Parameters:
        c - a collection of objects
        f - a function mapping objects of the collection into other objects
        Returns:
        a 1-dimensional array formed of collected variables (occurrences of null being discarded}
      • variablesFrom

        default <T extends IVar> T[] variablesFrom​(int[] t,
                                                   java.util.function.Function<Integer,​Object> f)
        Builds and returns a 1-dimensional array of variables from the specified array. Each integer of the array is mapped to another object by the specified function. Then, all variables are collected and concatenated to form a 1-dimensional array. null values are discarded.
        Parameters:
        t - a 1-dimensional array of integers
        f - a function mapping integers of the array into other objects
        Returns:
        a 1-dimensional array formed of collected variables (occurrences of null being discarded}
      • variablesFrom

        default <T extends IVar> T[] variablesFrom​(Range r,
                                                   java.util.function.Function<Integer,​Object> f)
        Returns a 1-dimensional array of variables, obtained after collecting the variables returned by the specified function when executed on all values in this range. Note that null values are simply discarded, if ever generated. Be careful: in case, no variable is obtained, null is returned.
        Parameters:
        r - a range of integers
        f - a function to convert integer values into objects (typically, variables, but can also be structures containing variables)
        Returns:
        a non-empty 1-dimensional array of variables or null
      • singleVariablesIn

        default <T extends IVar> T[] singleVariablesIn​(Object... objects)
        Builds and returns a 1-dimensional array of variables from the specified sequence of parameters. All variables encountered in the parameters, extracting them from arrays (of any dimension), collections and streams, are recursively collected in order, sorted, made distinct, so as to form a 1-dimensional array. Note that null values, as well as any simple object not implementing IVar, are simply discarded.
        Parameters:
        objects - a sequence of objects that may involve one or several variables (possibly in arrays, collections and streams)
        Returns:
        a 1-dimensional array of variables
      • singleVariablesFrom

        default <T extends IVar,​U> T[] singleVariablesFrom​(java.util.stream.Stream<U> stream,
                                                                 java.util.function.Function<U,​Object> f)
        Builds and returns a 1-dimensional array of variables from the specified stream. Each object of the stream is mapped to another object by the specified function. Then, all variables are collected, sorted and made distinct so as to form a 1-dimensional array. null values are discarded.
        Parameters:
        stream - a stream of objects
        f - a function mapping objects of the stream into other objects
        Returns:
        a 1-dimensional array formed of collected variables (occurrences of null being discarded}
      • singleVariablesFrom

        default <T extends IVar,​U> T[] singleVariablesFrom​(Collection<U> c,
                                                                 java.util.function.Function<U,​Object> f)
        Builds and returns a 1-dimensional array of variables from the specified collection. Each object of the collection is mapped to another object by the specified function. Then, all variables are collected, sorted and made distinct so as to form a 1-dimensional array. null values are discarded.
        Parameters:
        c - a collection of objects
        f - a function mapping objects of the stream into other objects
        Returns:
        a 1-dimensional array formed of collected variables (occurrences of null being discarded}
      • select

        default <T> T[] select​(T[] vars,
                               int[] indexes)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index i present in the indexes argument. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 1-dimensional array of objects
        indexes - the indexes of the objects to be selected
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[] vars,
                               int fromIndex,
                               int toIndex)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index i going from the specified fromIndex (inclusive) to the specified toIndex (exclusive). Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 1-dimensional array of objects
        fromIndex - the index of the first object (inclusive) to be selected
        toIndex - the index of the last object (exclusive) to be selected
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[] vars,
                               Collection<Integer> indexes)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index i present in the indexes argument. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 1-dimensional array of objects
        indexes - the indexes of the objects to be selected
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[] vars,
                               FunctionalInterfaces.Intx1Predicate p)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index i that satisfies the specified predicate. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 1-dimensional array of objects
        p - a predicate allowing us to test if a object at index i must be selected
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[][] vars,
                               FunctionalInterfaces.Intx2Predicate p)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index (i,j) that satisfies the specified predicate. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 2-dimensional array of objects
        p - a predicate allowing us test if a object at index (i,j) must be selected
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[][][] vars,
                               FunctionalInterfaces.Intx3Predicate p)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index (i,j,k) that satisfies the specified predicate. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 3-dimensional array of objects
        p - a predicate allowing us test if a object at index (i,j,k) must be selected
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[][][][] vars,
                               FunctionalInterfaces.Intx4Predicate p)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index (i,j,k,l) that satisfies the specified predicate. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 4-dimensional array of objects
        p - a predicate allowing us to test if a object at index (i,j,k,l) must be selected
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[][][][][] vars,
                               FunctionalInterfaces.Intx5Predicate p)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object at an index (i,j,k,l,m) that satisfies the specified predicate. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 5-dimensional array of objects
        p - a predicate allowing us to test if a object at index (i,j,k,l,m) must be selected
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[] vars,
                               Range range)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object, at index i, that belongs to the specified range. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 1-dimensional array of objects
        range - an object representing a range of indexes
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[][] vars,
                               Range.Rangesx2 rangesx2)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object, at index (i,j), that belongs to the specified double range. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 2-dimensional array of objects
        rangesx2 - an object representing a double range of indexes (seen as a Cartesian product)
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[][][] vars,
                               Range.Rangesx3 rangesx3)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object, at index (i,j,k), that belongs to the specified triple range. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 3-dimensional array of objects
        rangesx3 - an object representing a triple range of indexes (seen as a Cartesian product)
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[][][][] vars,
                               Range.Rangesx4 rangesx4)
        Builds and returns a 1-dimensional array of objects (e.g., variables), obtained by selecting from the specified array any object, at index (i,j,k,l), that belongs to the specified quadruple range. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 4-dimensional array of objects
        rangesx4 - an object representing a quadruple range of indexes (seen as a Cartesian product)
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • select

        default <T> T[] select​(T[][][][][] vars,
                               Range.Rangesx5 rangesx5)
        Builds and returns a 1-dimensional array of object (e.g., variables)s, obtained by selecting from the specified array any object, at index (i,j,k,l,m), that belongs to the specified quintuple range. Note that null values are simply discarded, if ever present.
        Parameters:
        vars - a 5-dimensional array of objects
        rangesx5 - an object representing a quintuple range of indexes (seen as a Cartesian product)
        Returns:
        a 1-dimensional array of objects (possibly, of length 0)
      • columnOf

        default <T> T[] columnOf​(T[][] vars,
                                 int idColumn)
        Selects from the specified 2-dimensional array of objects (e.g., variables) the column at the specified index.
        Parameters:
        vars - a 2-dimensional array of objects
        idColumn - the index of a column
        Returns:
        the column from the specified 2-dimensional array of objects, at the specified index
      • diagonalDown

        default <T> T[] diagonalDown​(T[][] vars,
                                     int idDiagonal)
        Selects from the specified 2-dimensional array of objects (e.g., variables) the downward diagonal at the specified index.
        Parameters:
        vars - a 2-dimensional array of objects
        idDiagonal - the index of a downward diagonal
        Returns:
        the downward diagonal from the specified 2-dimensional array of objects, at the specified index
      • diagonalUp

        default <T> T[] diagonalUp​(T[][] vars,
                                   int idDiagonal)
        Selects from the specified 2-dimensional array of objects (e.g., variables) the upward diagonal at the specified index.
        Parameters:
        vars - a 2-dimensional array of objects
        idDiagonal - the index of an upward diagonal
        Returns:
        the upward diagonal from the specified 2-dimensional array of objects, at the specified index
      • diagonalDown

        default <T> T[] diagonalDown​(T[][] vars)
        Selects from the specified 2-dimensional array of objects (e.g., variables) the main downward diagonal.
        Parameters:
        vars - a 2-dimensional array of objects
        Returns:
        the main downward diagonal
      • diagonalUp

        default <T> T[] diagonalUp​(T[][] vars)
        Selects from the specified 2-dimensional array of objects (e.g., variables) the main upward diagonal.
        Parameters:
        vars - a 2-dimensional array of objects
        Returns:
        the main upward diagonal
      • diagonalDown

        default <T> T[] diagonalDown​(T[][] vars,
                                     int i,
                                     int j)
        Selects from the specified 2-dimensional array of objects (e.g., variables), which must represent a square of size n*n, the downward diagonal that contains the cell at row i and column j. Either i=0 and j is in 0..n-2, or j=0 and i is in 0..n-2.
        Parameters:
        vars - a 2-dimensional array of objects
        i - the index of a row
        j - the index of a column
        Returns:
        the downward diagonal that includes the cell at row i and column j
      • diagonalsDown

        default <T> T[][] diagonalsDown​(T[][] vars)
        Returns a 2-dimensional array of objects (e.g., variables) such that each intern array corresponds to the objects on a (non-unit) downward diagonal of the specified 2-dimensional array of objects (which must represent a square of size n*n). The length of the (first dimension) of the returned array is 2*n -3.
        Parameters:
        vars - a 2-dimensional array of objects
        Returns:
        a 2-dimensional array of objects, each intern array corresponding to a (non-unit) downward diagonal.
      • diagonalUp

        default <T> T[] diagonalUp​(T[][] vars,
                                   int i,
                                   int j)
        Selects from the specified 2-dimensional array of objects (e.g., variables), which must represent a square, the upward diagonal that contains the cell at row i and column j. Either j=0 and i is in 1..n-1, or i=n-1 and j is in 0..n-2.
        Parameters:
        vars - a 2-dimensional array of objects
        i - the index of a row
        j - the index of a column
        Returns:
        the upward diagonal that includes the cell at row i and column j
      • diagonalsUp

        default <T> T[][] diagonalsUp​(T[][] vars)
        Returns a 2-dimensional array of objects (e.g., variables) such that each intern array corresponds to the objects on a (non-unit) upward diagonal of the specified 2-dimensional array of objects (which must represent a square of size n*n). The length of the (first dimension) of the returned array is 2*n -3.
        Parameters:
        vars - a 2-dimensional array of objects
        Returns:
        a 2-dimensional array of objects, each intern array corresponding to a (non-unit) upward diagonal.
      • transpose

        default <T> T[][] transpose​(T[]... vars)
        Returns the transpose of the specified 2-dimensional array of objects (e.g., variables).
        Parameters:
        vars - a 2-dimensional array of objects
        Returns:
        the transpose of the specified 2-dimensional array of objects
      • eliminateDim2

        default <T> T[][] eliminateDim2​(T[][][] vars,
                                        int idx)
        Returns a 2-dimensional array of objects (e.g., variables) obtained from the specified 3-dimensional array of objects by eliminating the second dimension after fixing it to the idx argument. The array t returned by this function is such that t[i][j]=vars[i][idx][j].
        Parameters:
        vars - a 3-dimensional array of objects
        idx - the index that is fixed for the second dimension
        Returns:
        a 2-dimensional array of objects corresponding to the elimination of the second dimension by fixing it to the specified index
      • eliminateDim3

        default <T> T[][] eliminateDim3​(T[][][] vars,
                                        int idx)
        Returns a 2-dimensional array of objects (e.g., variables) obtained from the specified 3-dimensional array of objects by eliminating the third dimension after fixing it to the idx argument. The array t returned by this function is such that t[i][j]=vars[i][j][idx].
        Parameters:
        vars - a 3-dimensional array of objects
        idx - the index that is fixed for the third dimension
        Returns:
        a 2-dimensional array of objects corresponding to the elimination of the third dimension by fixing it to the specified index
      • addObject

        default <T> T[] addObject​(T[] t,
                                  T object,
                                  int index)
        Inserts the specified object in the specified array at the specified index. The new array is returned.
        Parameters:
        t - a 1-dimensional array
        object - an object to be inserted
        index - the index at which the object must be inserted
        Returns:
        an array obtained after the insertion of the specified object in the specified array at the specified index
      • addObject

        default <T> T[] addObject​(T[] t,
                                  T object)
        Appends the specified object to the specified array. The new array is returned.
        Parameters:
        t - a 1-dimensional array
        object - an object to be inserted
        Returns:
        an array obtained after appending the specified object to the specified array
      • contains

        default boolean contains​(Object[] t,
                                 Object object)
        Returns true iff the specified object is contained in the specified array
        Parameters:
        t - a 1-dimensional array of objects
        object - an object
        Returns:
        true iff the specified object is contained in the specified array
      • firstFrom

        default <T> T firstFrom​(T[] t,
                                java.util.function.Predicate<T> p)
        Returns the first object in the specified array that satisfies the specified predicate, if any, or null.
        Parameters:
        t - a 1-dimensional array of objects
        p - a predicate
        Returns:
        the first object in the specified array that satisfies the specified predicate, if any, or null