Examples of Matrix


Examples of mikera.matrixx.Matrix

  }
 
  @Override
  public Matrix innerProduct(Matrix a) {
    if (!(dimensions==a.rowCount())) throw new IllegalArgumentException(ErrorMessages.incompatibleShapes(this,a));
    Matrix m=a.clone();
    for (int i=0; i<dimensions; i++) {
      double dv=unsafeGetDiagonalValue(i);
      m.multiplyRow(i, dv);
    }
    return m;
  }
View Full Code Here

Examples of no.uib.cipr.matrix.Matrix

    public void setMatrix(Matrix A) {
        if (!(A instanceof DistMatrix))
            throw new IllegalArgumentException(
                    "A is not a DistRowMatrix or a DistColMatrix");

        Matrix Ad = this.A.getBlock();
        Matrix Ao = this.A.getOff();

        super.setMatrix(A);

        Arrays.fill(Ai, 0);
        for (MatrixEntry e : Ad)
View Full Code Here

Examples of no.uib.cipr.matrix.Matrix

        protected abstract IterativeSolver createSolver(Vector x);

        public void run() {
            Communicator comm = coll.createCommunicator(rank);

            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();
View Full Code Here

Examples of no.uib.cipr.matrix.Matrix

        @Override
        protected Matrix createMatrix(Communicator comm) {
            int n = x.size();

            Matrix Al = new DenseMatrix(localLength[rank], localLength[rank]);
            Matrix Bl = new DenseMatrix(localLength[rank], n);

            return new DistRowMatrix(n, n, comm, Al, Bl);
        }
View Full Code Here

Examples of no.uib.cipr.matrix.Matrix

        @Override
        protected Matrix createMatrix(Communicator comm) {
            int n = x.size();

            Matrix Al = new DenseMatrix(localLength[rank], localLength[rank]);
            Matrix Bl = new DenseMatrix(n, localLength[rank]);

            return new DistColMatrix(n, n, comm, Al, Bl);
        }
View Full Code Here

Examples of no.uib.cipr.matrix.Matrix

    }

    public void testMatrixRank2Dense() {
        if (A.isSquare()) {
            int n = Utilities.getInt(1, max);
            Matrix B = Matrices.random(A.numRows(), n), C = Matrices.random(A
                    .numRows(), n);
            double[][] Bd = Matrices.getArray(B), Cd = Matrices.getArray(C);
            double alpha = Math.random();

            A = A.rank2(alpha, B, C);
View Full Code Here

Examples of no.uib.cipr.matrix.Matrix

    }

    public void testMatrixRank2() {
        if (A.isSquare()) {
            int n = Utilities.getInt(1, max);
            Matrix B = Matrices.synchronizedMatrix(Matrices.random(A.numRows(),
                    n)), C = Matrices.synchronizedMatrix(Matrices.random(A
                    .numRows(), n));
            double[][] Bd = Matrices.getArray(B), Cd = Matrices.getArray(C);
            double alpha = Math.random();
View Full Code Here

Examples of no.uib.cipr.matrix.Matrix

    }

    public void testMatrixTransRank2Dense() {
        if (A.isSquare()) {
            int n = Utilities.getInt(1, max);
            Matrix B = Matrices.random(n, A.numColumns()), C = Matrices.random(
                    n, A.numColumns());
            double[][] Bd = Matrices.getArray(B), Cd = Matrices.getArray(C);
            double alpha = Math.random();

            A = A.transRank2(alpha, B, C);
View Full Code Here

Examples of no.uib.cipr.matrix.Matrix

    }

    public void testMatrixTransRank2() {
        if (A.isSquare()) {
            int n = Utilities.getInt(1, max);
            Matrix B = Matrices.synchronizedMatrix(Matrices.random(n, A
                    .numColumns())), C = Matrices.synchronizedMatrix(Matrices
                    .random(n, A.numColumns()));
            double[][] Bd = Matrices.getArray(B), Cd = Matrices.getArray(C);
            double alpha = Math.random();
View Full Code Here

Examples of no.uib.cipr.matrix.Matrix

        }
    }

    public void testMatrixRank1Dense() {
        if (A.isSquare()) {
            Matrix C = Matrices.random(A.numRows(), A.numColumns());
            double[][] Cd = Matrices.getArray(C);
            double alpha = Math.random();

            A = A.rank1(alpha, C);
            rank1(Ad, alpha, Cd);
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.