Package mikera.vectorz

Examples of mikera.vectorz.Vector


    return index.indexPosition(i)>=0;
  }
 
  @Override
  public Vector toVector() {
    Vector v=Vector.createLength(length);
    double[] data=this.data;
    int[] ixs=index.data;
    for (int i=0; i<data.length; i++) {
      v.unsafeSet(ixs[i],data[i]);
   
    return v;
  }
View Full Code Here


    add(0,a,0,length);
  }
 
  @Override
  public Vector addCopy(AVector a) {
    Vector r=this.toVector();
    r.add(a);
    return r;
  }
View Full Code Here

    return r;
  }
 
  @Override
  public Vector subCopy(AVector a) {
    Vector r=this.toVector();
    r.sub(a);
    return r;
  }
View Full Code Here

  }
 
  @Override
  public ADenseArrayVector applyOpCopy(Op op) {
    int len=length();
    Vector v=Vector.createLength(len);
    op.applyTo(v.getArray(), v.getArrayOffset(), len);
    return v;
  }
View Full Code Here

    return index.indexPosition(i)>=0;
  }
 
  @Override
  public Vector dense() {
    Vector v=Vector.createLength(length);
    addToArray(v.data,0);
    return v;
  }
View Full Code Here

  }
 
  @Override
  public AVector innerProduct(AVector v) {
    int rc=rowCount();
    Vector r=Vector.createLength(rc);
    for (int i=0; i<rc; i++) {
      r.unsafeSet(i, getRow(i).dotProduct(v));
    }
    return r;
  }
View Full Code Here

    return transform(a);
  }
 
  @Override
  public AVector transform(AVector a) {
    Vector r=Vector.createLength(rows);
    for (int i=0; i<cols; i++) {
      getColumn(i).addMultipleToArray(a.get(i), 0, r.getArray(), 0, rows);
    }
    return r;
  }
View Full Code Here

   *
   * @param v
   * @return
   */
  public AVector transform(AVector v) {
    Vector temp=Vector.createLength(outputDimensions());
    transform(v,temp);
    return temp;
  }
View Full Code Here

   *
   * @param v
   * @return
   */
  public Vector transform(Vector v) {
    Vector temp=Vector.createLength(outputDimensions());
    transform(v,temp);
    return temp;
  }
View Full Code Here

    assertEquals(a,new Scalar(1.0));
    assertFalse(a.equals(new Scalar(0.0)));
  }
 
  @Test public void testWrap() {
    Vector v=Vector.of(0,1,2,3);
    assertEquals(v,NDArray.wrap(v));
   
    Matrix m=Matrix.create(Matrixx.createRandomSquareMatrix(3));
    assertEquals(m,NDArray.wrap(m));
View Full Code Here

TOP

Related Classes of mikera.vectorz.Vector

Copyright © 2018 www.massapicom. 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.