Examples of DenseVector


Examples of edu.ucla.sspace.vector.DenseVector

    @Test (expected=UnsupportedOperationException.class)
    public void testFailSetRowFull() {
        Matrix base = new ArrayMatrix(VALUES);
        Matrix scaled = new RowScaledMatrix(base, SCALE);
        scaled.setRow(0, new DenseVector(VALUES[0]));
    }
View Full Code Here

Examples of no.uib.cipr.matrix.DenseVector

        super(numRows, numColumns);
        this.comm = comm;
        this.A = A;
        this.B = B;

        locR = new DenseVector(numRows);
        locC = new DenseVector(numColumns);
        rank = comm.rank();
        size = comm.size();
        n = new int[size + 1];
        m = new int[size + 1];
View Full Code Here

Examples of no.uib.cipr.matrix.DenseVector

        this.comm = A.getCommunicator();
        rank = comm.rank();
        size = comm.size();

        A0 = new DenseMatrix(size, size);
        b0 = new DenseVector(size);
        lu = new DenseLU(size, size);

        Ai = new double[size];
        if (rank == root) {
            Ai0 = new double[size][size];
View Full Code Here

Examples of no.uib.cipr.matrix.DenseVector

        this.comm = A.getCommunicator();
        rank = comm.rank();
        size = comm.size();

        A0 = new DenseMatrix(size, size);
        b0 = new DenseVector(size);
        lu = new DenseLU(size, size);

        Ai = new double[size];
        if (rank == root) {
            Ai0 = new double[size][size];
View Full Code Here

Examples of no.uib.cipr.matrix.DenseVector

    entries[0] = 0.0;
    entries[1] = 0.0;
    entries[2] = 1.0;
    entries[3] = 0.0;
    entries[4] = 2.0;
    Vector dense = new DenseVector(entries, false);
    vector = new SparseVector(dense);

    // NOTE: must compact before calling getIndex()!!!
    // vector.compact();
    index = vector.getIndex();
View Full Code Here

Examples of no.uib.cipr.matrix.DenseVector

        + index.length + ", with elements " + Arrays.toString(index);
  }

  public void testBug27() {
    double[] tfVector = {0.0,0.5,0.0,0.4,0.0};
    DenseVector dense= new DenseVector(tfVector, false);
    SparseVector vectorTF =  new SparseVector(dense);
    vectorTF.compact();

    assertTrue(vectorTF.getUsed() == 2)// vectorTF.getUsed() returns 5
View Full Code Here

Examples of no.uib.cipr.matrix.DenseVector

            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();

            int[] n = getRowOwnerships(A);
            for (int i = n[rank]; i < n[rank + 1]; ++i)
View Full Code Here

Examples of no.uib.cipr.matrix.DenseVector

        do {
            Utilities.addDiagonal(A_symm, shift);
        } while (!Utilities.spd(A_symm));

        x = new DenseVector(n);
        b_unsymm = x.copy();
        b_symm = x.copy();

        Utilities.populate(x);
        A_unsymm.mult(x, b_unsymm);
View Full Code Here

Examples of org.apache.mahout.math.DenseVector

  public static void main(String args[]) throws Exception {
    List<NamedVector> apples = new ArrayList<NamedVector>();
   
    NamedVector apple;
    apple = new NamedVector(                   
        new DenseVector(new double[] {0.11, 510, 1}),
        "Small round green apple");
    apples.add(apple);
    apple = new NamedVector(
      new DenseVector(new double[] {0.23, 650, 3}),
        "Large oval red apple");
    apples.add(apple);
    apple = new NamedVector(
      new DenseVector(new double[] {0.09, 630, 1}),
        "Small elongated red apple");
    apples.add(apple);
    apple = new NamedVector(
      new DenseVector(new double[] {0.25, 590, 3}),
        "Large round yellow apple");
    apples.add(apple);
    apple = new NamedVector(
      new DenseVector(new double[] {0.18, 520, 2}),
        "Medium oval green apple");

   
    Configuration conf = new Configuration();
    FileSystem fs = FileSystem.get(conf);
View Full Code Here

Examples of org.apache.mahout.math.DenseVector

    FeatureVectorEncoder[] encoder = new FeatureVectorEncoder[FIELDS];
    for (int i = 0; i < FIELDS; i++) {
      encoder[i] = new ConstantValueEncoder("v" + i);
    }
    long t0 = System.currentTimeMillis();
    Vector v = new DenseVector(1000);
    ByteBuffer buf = ByteBuffer.wrap(FileUtils
        .readFileToByteArray(new File(args[1])));
    FastLine line = FastLine.read(buf);
    while (line != null) {
      v.assign(0);
      for (int i = 0; i < FIELDS; i++) {
        encoder[i].addToVector((byte[]) null, line.getDouble(i), v);
      }
      line = FastLine.read(buf);
    }
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.