Package mikera.vectorz.impl

Source Code of mikera.vectorz.impl.TestMiscVectors

package mikera.vectorz.impl;

import static org.junit.Assert.*;
import mikera.vectorz.AVector;
import mikera.vectorz.Vector;

import org.junit.Test;

public class TestMiscVectors {
  @Test
  public void testTriangularIndexedVector() {
    double[] data=new double[]{0,1,2,3,4,5,6,7,8,9};
    AVector t1=TriangularIndexedVector.wrap(3, data, 1, 1);
    AVector t2=TriangularIndexedVector.wrap(4, data, 0, 0);
   
    assertEquals(Vector.of(1,3,6),t1);
    assertEquals(Vector.of(0,1,3,6),t2);
    assertEquals(t1,t2.subVector(1, 3));
  }

}
TOP

Related Classes of mikera.vectorz.impl.TestMiscVectors

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.