Examples of DistVector


Examples of no.uib.cipr.matrix.distributed.DistVector

            Matrix A = createMatrix(comm);
            populateMatrix(A);

            DenseVector bl = new DenseVector(localLength[rank]);
            DistVector b_dist = new DistVector(x.size(), comm, bl);
            DistVector x_dist = b_dist.copy();

            int[] n = getRowOwnerships(A);
            for (int i = n[rank]; i < n[rank + 1]; ++i)
                b_dist.set(i, getVectorEntry(i));

            IterativeSolver solver = createSolver(b_dist);

            IterationMonitor monitor = new DefaultIterationMonitor(1000, 1e-50,
                    1e-12, 1e+5);
            monitor.setNormType(norm);
            solver.setIterationMonitor(monitor);

            try {
                solver.solve(A, b_dist, x_dist);
            } catch (IterativeSolverNotConvergedException e) {
                // This will just lead to an error later on
            }

            for (int i = n[rank]; i < n[rank + 1]; ++i)
                output[i] = x_dist.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.