Examples of AVector


Examples of mikera.vectorz.AVector

  }
 
  @Override
  public AVector addCopy(AVector v) {
    checkSameLength(v);
    AVector r=v.clone();
    r.addAt(index, 1.0);
    return r;
  }
View Full Code Here

Examples of mikera.vectorz.AVector

  }
 
  @Override
  public AVector subCopy(AVector v) {
    checkSameLength(v);
    AVector r=v.negateCopy().mutable();
    r.addAt(index, 1.0);
    return r;
  }
View Full Code Here

Examples of mikera.vectorz.AVector

 
  @Override
  public void setElements(double[] values, int offset) {
    int n=segmentCount();
    for (int i=0; i<n; i++) {
      AVector v=getSegment(i);
      v.setElements(values,offset);
      offset+=v.length();
    }
  }
View Full Code Here

Examples of mikera.vectorz.AVector

 
  @Override
  public boolean equalsArray(double[] values, int offset) {
    int n=segmentCount();
    for (int i=0; i<n; i++) {
      AVector v=getSegment(i);
      if (!v.equalsArray(values, offset)) return false;
      offset+=v.length();
    }
    return true;
  }
View Full Code Here

Examples of mikera.vectorz.AVector

    int outputDim=t.outputDimensions();
   
    assertEquals(inputDim==outputDim,t.isSquare());
    assertTrue(t.isLinear());
   
    AVector v=Vectorz.createUniformRandomVector(inputDim);
    AVector d=Vectorz.createUniformRandomVector(inputDim);
   
    AVector td=t.getMatrix().transform(d);
    AVector tv=t.transform(v);
   
    AVector r1=tv.clone();
    r1.add(td);
   
    AVector r2=v.clone();
    r2.add(d);
    r2=t.transform(r2);
   
    assertTrue(r1.epsilonEquals(r2));
  }
View Full Code Here

Examples of mikera.vectorz.AVector

    assertTrue(t.getMatrix().columnCount()==t.inputDimensions());
    assertTrue(t.getMatrix().rowCount()==t.outputDimensions());
    assertTrue(t.getTranslation().inputDimensions()==t.outputDimensions());
    assertTrue(t.getTranslation().outputDimensions()==t.outputDimensions());
   
    AVector z=Vectorz.createUniformRandomVector(t.inputDimensions());
   
    AVector r1=t.transform(z);
   
    AVector r2=t.getMatrix().transform(z);
    t.getTranslation().transformInPlace(r2);
   
    assertTrue(r1.epsilonEquals(r2));
  }
View Full Code Here

Examples of mikera.vectorz.AVector

   
    assertTrue(r1.epsilonEquals(r2));
  }
 
  private void testApplyToZeroVector(AAffineTransform t) {
    AVector z=Vectorz.createZeroVector(t.inputDimensions());
   
    AVector r=t.transform(z);
    assertNotNull(r);
    assertTrue(r.epsilonEquals(t.getTranslation().getTranslationVector()))
    assertTrue(r.epsilonEquals(t.copyOfTranslationVector()))
  }
View Full Code Here

Examples of mikera.vectorz.AVector

    assertTrue(r.epsilonEquals(t.copyOfTranslationVector()))
  }
 

  private void testCloneTransform(AAffineTransform t) {
    AVector z=Vectorz.createZeroVector(t.inputDimensions());
    AVector r1=t.transform(z);
    AVector r2=t.clone().transform(z);
    assertTrue(r1.epsilonEquals(r2))
   
    assertEquals(t.getTranslationVector(),t.copyOfTranslationVector());
   
    assertEquals(t,t.clone());
View Full Code Here

Examples of mikera.vectorz.AVector

  }
 
  private void testNormalTransform(AAffineTransform t) {
    if (!t.isSquare()) return;
    int dimensions=t.inputDimensions();
    AVector d=Vectorz.newVector(dimensions);
    Vectorz.fillGaussian(d);
    d.normalise();
   
    AVector r=Vectorz.newVector(dimensions);
   
    t.transformNormal(d, r);
    assertTrue(r.isZero()||r.isUnitLengthVector());
  }
View Full Code Here

Examples of mikera.vectorz.AVector

    doAffineTests(Transformz.identityTranslation(7));
   
    doAffineTests(Matrixx.createRandomSquareMatrix(3));
    doAffineTests(Matrixx.createRandomSquareMatrix(5));
   
    AVector rvector=Vectorz.createUniformRandomVector(5);
    ATranslation rtrans=Transformz.createTranslation(rvector);
    doAffineTests(rtrans);
   
    doAffineTests(new AffineMN(Matrixx.createRandomSquareMatrix(5),rtrans));
   
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.