Interface ObjectCalculations

    • Method Detail

      • extractAnnotation

        Matrix extractAnnotation​(Calculation.Ret returnType,
                                 int dimension)
        Generates annotation such as row or column labels from the content of this matrix. This is useful for example for data imported from CSV files with labels in the first line.
        Parameters:
        returnType - Specify whether to return a new matrix, or a link
        dimension - Which axis should be shortened to extract the labels. E.g. if you want column labels, you must specify Matrix.ROW, which does not seem very intuitive at first glance. However, if you're dealing with multi-dimensional data, this becomes more clear. If you want annotation generated for all dimensions, you can specify Matrix.ALL or omit the dimensions parameter.
        Returns:
        new Matrix with annotation generated from content. @
      • fill

        Matrix fill​(Calculation.Ret ret,
                    java.lang.Object value)
        Returns a matrix with equal size, where all entries are set to a desired value.
        Parameters:
        value - fill with this value
        Returns:
        Matrix with ones.
      • replace

        Matrix replace​(Calculation.Ret returnType,
                       java.lang.Object search,
                       java.lang.Object replacement)
        Replaces matching values in the matrix with another value
        Parameters:
        returnType - Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix
        search - Object to search for
        replacement - Object used to replace the original value
        Returns:
        matrix with modified entries @
      • transpose

        Matrix transpose()
        Returns the transpose of the Matrix, where rows and columns are exchanged. This works also if the Matrix has more than two dimensions.
        Returns:
        transposed Matrix.
      • transpose

        Matrix transpose​(Calculation.Ret returnType)
        Returns the transpose of the Matrix, where rows and columns are exchanged. This works also if the Matrix has more than two dimensions.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        Returns:
        transposed Matrix.
      • convert

        Matrix convert​(ValueType newValueType)
        Creates a copy of the matrix with the desired type for matrix entries.
        Parameters:
        newValueType - defines the new format of the matrix
        Returns:
        Matrix with the same entries in the new format
      • select

        Matrix select​(Calculation.Ret returnType,
                      long[]... selection)
        Selects rows and columns in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        selection - selected rows and columns
        Returns:
        Link to original Matrix with desired rows and columns @
      • delete

        Matrix delete​(Calculation.Ret returnType,
                      long[]... selection)
        Delete rows and columns in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        selection - selected rows and columns
        Returns:
        Link to original Matrix with desired rows and columns @
      • select

        Matrix select​(Calculation.Ret returnType,
                      java.util.Collection<? extends java.lang.Number>... selection)
        Selects rows and columns in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        selection - selected rows and columns
        Returns:
        Link to original Matrix with desired rows and columns @
      • delete

        Matrix delete​(Calculation.Ret returnType,
                      java.util.Collection<? extends java.lang.Number>... selection)
        Delete rows and columns in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        selection - selected rows and columns
        Returns:
        Link to original Matrix with desired rows and columns @
      • selectRows

        Matrix selectRows​(Calculation.Ret returnType,
                          long... rows)
        Selects rows in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        rows - selected rows
        Returns:
        Link to original Matrix with desired rows @
      • deleteRows

        Matrix deleteRows​(Calculation.Ret returnType,
                          long... rows)
        Deletes rows in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        rows - selected rows
        Returns:
        Link to original Matrix with desired rows @
      • selectRows

        Matrix selectRows​(Calculation.Ret returnType,
                          java.util.Collection<? extends java.lang.Number> rows)
        Selects rows in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        rows - selected rows
        Returns:
        Link to original Matrix with desired rows @
      • deleteRows

        Matrix deleteRows​(Calculation.Ret returnType,
                          java.util.Collection<? extends java.lang.Number> rows)
        Deletes rows in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        rows - selected rows
        Returns:
        Link to original Matrix with desired rows @
      • selectColumns

        Matrix selectColumns​(Calculation.Ret returnType,
                             long... colums)
        Selects columns in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        columns - selected columns
        Returns:
        Link to original Matrix with desired columns @
      • deleteColumns

        Matrix deleteColumns​(Calculation.Ret returnType,
                             long... colums)
        Deletes columns in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        columns - selected columns
        Returns:
        Link to original Matrix with desired columns @
      • selectColumns

        Matrix selectColumns​(Calculation.Ret returnType,
                             java.util.Collection<? extends java.lang.Number> columns)
        Selects columns in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        columns - selected columns
        Returns:
        Link to original Matrix with desired columns @
      • deleteColumns

        Matrix deleteColumns​(Calculation.Ret returnType,
                             java.util.Collection<? extends java.lang.Number> columns)
        Deletes columns in the Matrix and returns a link to it.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        columns - selected columns
        Returns:
        Link to original Matrix with desired columns @
      • select

        Matrix select​(Calculation.Ret returnType,
                      java.lang.String selection)
        Selects rows and columns in the Matrix and returns a link to it. Selections can be made in Matlab/Octave style or similar, e.g. "1,2,5-6,8:5;*". Dimensions are separated by ';'. Selections in one dimension are separated by spaces or ','. Ranges are selected using '-' or ':'. A whole dimension can be selected with '*'.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        selection - String defining the selection
        Returns:
        Link to original Matrix with desired rows and columns @
      • delete

        Matrix delete​(Calculation.Ret returnType,
                      java.lang.String selection)
        Deletes rows and columns in the Matrix and returns a link to it. Selections can be made in Matlab/Octave style or similar, e.g. "1,2,5-6,8:5;*". Dimensions are separated by ';'. Selections in one dimension are separated by spaces or ','. Ranges are selected using '-' or ':'. A whole dimension can be selected with '*'.
        Parameters:
        returnType - Defines if a new Matrix or a link should be returned.
        minAndMaxCoordinates - start and end coordinates
        Returns:
        Link to original Matrix with desired rows and columns deleted @