Package org.ejml.simple

Examples of org.ejml.simple.SimpleMatrix.divide()


            SimpleMatrix v = QR.extractMatrix(i, END,i,i+1);
            double max = v.elementMaxAbs();

            if( max > 0 && v.getNumElements() > 1 ) {
                // normalize to reduce overflow issues
                v = v.divide(max);

                // compute the magnitude of the vector
                double tau = v.normF();

                if( v.get(0) < 0 )
View Full Code Here


                    tau *= -1.0;

                double u_0 = v.get(0) + tau;
                double gamma = u_0/tau;

                v = v.divide(u_0);
                v.set(0,1.0);

                // extract the submatrix of A which is being operated on
                SimpleMatrix A_small = QR.extractMatrix(i,END,i,END);

View Full Code Here

       
        SimpleMatrix averageVector = new SimpleMatrix(1,noFeatures);
        for (Integer sample : (ArrayList<Integer>) centroids.get(centroid).trainingExamples) {
          averageVector = averageVector.plus(datasetMatrix.extractVector(true, sample));
        }
        averageVector = averageVector.divide(centroids.get(centroid).trainingExamples.size());
       
        if (isClassification) {
          for( int i = 0; i < averageVector.getNumElements(); i++ )
            averageVector.set(i,Math.round(averageVector.get(i)));
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.