Package cern.colt.matrix.linalg

Examples of cern.colt.matrix.linalg.SingularValueDecomposition


*/
public class MultinormalPCAGen extends MultinormalGen {
   private double[] lambda;

   private static SingularValueDecomposition getSvd (DoubleMatrix2D sigma) {
      return (new SingularValueDecomposition (sigma));
   }
View Full Code Here


   public static DoubleMatrix2D decompPCA (DoubleMatrix2D sigma)   {
      // L'objet SingularValueDecomposition permet de recuperer la matrice
      // des valeurs propres en ordre decroissant et celle des vecteurs propres de
      // sigma (pour une matrice symetrique et definie-positive seulement).

      SingularValueDecomposition sv = getSvd (sigma);
      // D contient les valeurs propres sur la diagonale
      DoubleMatrix2D D = sv.getS ();
      // Calculer la racine carree des valeurs propres
      for (int i = 0; i < D.rows(); ++i)
         D.setQuick (i, i, Math.sqrt (D.getQuick (i, i)));
      DoubleMatrix2D P = sv.getV();
      // Multiplier par la matrice orthogonale (ici P)
      return P.zMult (D, null);
   }
View Full Code Here

    * Computes and returns the eigenvalues of <TT>sigma</TT> in
    *  decreasing order.
    *
    */
   public static double[] getLambda (DoubleMatrix2D sigma) {
      SingularValueDecomposition sv = getSvd (sigma);
      DoubleMatrix2D D = sv.getS ();
      double[] lambd = new double[D.rows()];
      for (int i = 0; i < D.rows(); ++i)
         lambd[i] = D.getQuick (i, i);
      return lambd;
   }
View Full Code Here

  @Override
  public SVDecompositionResult evaluate(final DoubleMatrix2D x) {
    Validate.notNull(x);
    MatrixValidate.notNaNOrInfinite(x);
    final cern.colt.matrix.DoubleMatrix2D coltMatrix = ColtMathWrapper.wrap(x);
    final SingularValueDecomposition svd = new SingularValueDecomposition(coltMatrix);
    return new SVDecompositionColtResult(svd);
  }
View Full Code Here

TOP

Related Classes of cern.colt.matrix.linalg.SingularValueDecomposition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.