Ejemplo n.º 1
0
        /**
         * Compute singular values and U and V at the same time
         */
        private bool computeUWV()
        {
            bidiag.getDiagonal(diag, off);
            qralg.setMatrix(_numRowsT, _numColsT, diag, off);

//        long pointA = System.currentTimeMillis();
            // compute U and V matrices
            if (computeU)
            {
                Ut = bidiag.getU(Ut, true, compact);
            }
            if (computeV)
            {
                Vt = bidiag.getV(Vt, true, compact);
            }

            qralg.setFastValues(false);
            if (computeU)
            {
                qralg.setUt(Ut);
            }
            else
            {
                qralg.setUt(null);
            }
            if (computeV)
            {
                qralg.setVt(Vt);
            }
            else
            {
                qralg.setVt(null);
            }

//        long pointB = System.currentTimeMillis();

            bool ret = !qralg.process();

//        long pointC = System.currentTimeMillis();
//        Console.WriteLine("  compute UV "+(pointB-pointA)+"  QR = "+(pointC-pointB));

            return(ret);
        }
 public virtual FMatrixRMaj getV(FMatrixRMaj V, bool transpose, bool compact)
 {
     return(decompBi.getV(V, transpose, compact));
 }