Package org.apache.mahout.math

Examples of org.apache.mahout.math.DenseVector.minus()


    enc.setProbes(2);
    enc.addToVector("123", v2);
    assertEquals(123, v2.maxValue(), 0);
    assertEquals(2 * 123, v2.norm(1), 0);

    v1 = v2.minus(v1);
    assertEquals(123, v1.maxValue(), 0);
    assertEquals(123, v1.norm(1), 0);

    Vector v3 = new DenseVector(20);
    enc.setProbes(2);
View Full Code Here


    // this should set the same 6 locations to the same values
    Vector v3 = new DenseVector(200);
    w.addToVector("test1", v3);
    w.addToVector("and", v3);
    w.addToVector("more", v3);
    assertEquals(0, v3.minus(v2).norm(1), 0);

    // moreover, the locations set in the unweighted case should be the same as in the weighted case
    assertEquals(v3.zSum(), v3.dot(v1), 0);
  }
View Full Code Here

    // this should set the same 6 locations to the same values
    Vector v3 = new DenseVector(200);
    w.addToVector("test1", v3);
    w.addToVector("and", v3);
    w.addToVector("more", v3);
    assertEquals(0, v3.minus(v2).norm(1), 0);

    // moreover, the locations set in the unweighted case should be the same as in the weighted case
    assertEquals(v3.zSum(), v3.dot(v1), 0);
  }
View Full Code Here

    assertEquals(123, v2.maxValue(), 0);
    assertEquals(2 * 123, v2.norm(1), 0);

    // v1 has one probe, v2 has two.  The first probe in v2 should be in the same
    // place as the only probe in v1
    v1 = v2.minus(v1);
    assertEquals(123, v1.maxValue(), 0);
    assertEquals(123, v1.norm(1), 0);

    Vector v3 = new DenseVector(20);
    enc.setProbes(2);
View Full Code Here

    assertEquals(123, v2.maxValue(), 0);
    assertEquals(2 * 123, v2.norm(1), 0);

    // v1 has one probe, v2 has two.  The first probe in v2 should be in the same
    // place as the only probe in v1
    v1 = v2.minus(v1);
    assertEquals(123, v1.maxValue(), 0);
    assertEquals(123, v1.norm(1), 0);

    Vector v3 = new DenseVector(20);
    enc.setProbes(2);
View Full Code Here

    // this should set the same 6 locations to the same values
    Vector v3 = new DenseVector(200);
    w.addToVector("test1", v3);
    w.addToVector("and", v3);
    w.addToVector("more", v3);
    assertEquals(0, v3.minus(v2).norm(1), 0);

    // moreover, the locations set in the unweighted case should be the same as in the weighted case
    assertEquals(v3.zSum(), v3.dot(v1), 0);
  }
View Full Code Here

    assertEquals(123, v2.maxValue(), 0);
    assertEquals(2 * 123, v2.norm(1), 0);

    // v1 has one probe, v2 has two.  The first probe in v2 should be in the same
    // place as the only probe in v1
    v1 = v2.minus(v1);
    assertEquals(123, v1.maxValue(), 0);
    assertEquals(123, v1.norm(1), 0);

    Vector v3 = new DenseVector(20);
    enc.setProbes(2);
View Full Code Here

    assertEquals(123, v2.maxValue(), 0);
    assertEquals(2 * 123, v2.norm(1), 0);

    // v1 has one probe, v2 has two.  The first probe in v2 should be in the same
    // place as the only probe in v1
    v1 = v2.minus(v1);
    assertEquals(123, v1.maxValue(), 0);
    assertEquals(123, v1.norm(1), 0);

    Vector v3 = new DenseVector(20);
    enc.setProbes(2);
View Full Code Here

    // this should set the same 6 locations to the same values
    Vector v3 = new DenseVector(200);
    w.addToVector("test1", v3);
    w.addToVector("and", v3);
    w.addToVector("more", v3);
    assertEquals(0, v3.minus(v2).norm(1), 0);

    // moreover, the locations set in the unweighted case should be the same as in the weighted case
    assertEquals(v3.zSum(), v3.dot(v1), 0);
  }
View Full Code Here

    // this should set the same 6 locations to the same values
    Vector v3 = new DenseVector(200);
    w.addToVector("test1", v3);
    w.addToVector("and", v3);
    w.addToVector("more", v3);
    assertEquals(0, v3.minus(v2).norm(1), 0);

    // moreover, the locations set in the unweighted case should be the same as in the weighted case
    assertEquals(v3.zSum(), v3.dot(v1), 0);
  }
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.