Module ojalgo

Class RawEigenvalue

    • Field Detail

      • d

        private double[] d
        Arrays for internal storage of eigenvalues.
      • e

        private double[] e
        Arrays for internal storage of eigenvalues.
      • myD

        private transient MatrixStore<java.lang.Double> myD
      • myTransposedV

        private double[][] myTransposedV
        Array for internal storage of eigenvectors.
      • myV

        private transient MatrixStore<java.lang.Double> myV
    • Constructor Detail

      • RawEigenvalue

        protected RawEigenvalue()
    • Method Detail

      • getD

        public MatrixStore<java.lang.Double> getD()
        Return the block diagonal eigenvalue matrix
        Specified by:
        getD in interface Eigenvalue<java.lang.Double>
        Returns:
        D
      • getEigenvalues

        public Array1D<ComplexNumber> getEigenvalues()
        Description copied from interface: Eigenvalue

        Even for real matrices the eigenvalues (and eigenvectors) are potentially complex numbers. Typically they need to be expressed as complex numbers when [A] is not symmetric.

        The values should be in the same order as the matrices "V" and "D", and if they are ordered or not is indicated by the Eigenvalue.isOrdered() method.

        Specified by:
        getEigenvalues in interface Eigenvalue<java.lang.Double>
        Returns:
        The eigenvalues.
      • getEigenvalues

        public void getEigenvalues​(double[] realParts,
                                   java.util.Optional<double[]> imaginaryParts)
        Specified by:
        getEigenvalues in interface Eigenvalue<java.lang.Double>
        Parameters:
        realParts - An array that will receive the real parts of the eigenvalues
        imaginaryParts - An optional array that, if present, will receive the imaginary parts of the eigenvalues
      • getTrace

        public ComplexNumber getTrace()
        Description copied from interface: Eigenvalue
        A matrix' trace is the sum of the diagonal elements. It is also the sum of the eigenvalues. This method should return the sum of the eigenvalues.
        Specified by:
        getTrace in interface Eigenvalue<java.lang.Double>
        Returns:
        The matrix' trace
      • getV

        public MatrixStore<java.lang.Double> getV()
        Return the eigenvector matrix
        Specified by:
        getV in interface Eigenvalue<java.lang.Double>
        Returns:
        V
      • doDecompose

        protected abstract boolean doDecompose​(double[][] data,
                                               boolean valuesOnly)
      • makeD

        protected MatrixStore<java.lang.Double> makeD​(double[] d,
                                                      double[] e)
      • doGeneral

        void doGeneral​(double[][] data,
                       boolean valuesOnly)
      • doSymmetric

        void doSymmetric​(double[][] data,
                         boolean valuesOnly)
      • getImaginaryParts

        double[] getImaginaryParts()
        Return the imaginary parts of the eigenvalues
        Returns:
        imag(diag(D))
      • getRealParts

        double[] getRealParts()
        Return the real parts of the eigenvalues
        Returns:
        real(diag(D))
      • isValuesOnly

        boolean isValuesOnly()