Package org.renjin.primitives.sequence

Examples of org.renjin.primitives.sequence.DoubleSequence


  @Test
  public void simplificationPreservesAttributes() {

   
    Vector x = new DoubleSequence(AttributeMap.builder().setDim(200,40).build(), 1, 1, 8000);
    TransposingMatrix xt = new TransposingMatrix(x, AttributeMap.builder().setDim(40,200).build());
   
    SimpleVectorPipeliner pipeliner = new SimpleVectorPipeliner();
   
    Vector xts = pipeliner.simplify(xt);
View Full Code Here


  private static SEXP newSequence(double from, double by, double to, int length) {
    if(isIntegerRange(from, to, by)) {
      return new IntSequence((int)from, (int)by, length);
    } else {
      return new DoubleSequence(from, by, length);
    }
  }
View Full Code Here

public class CombinedDoubleVectorTest {

  @Test
  public void test() {
    Vector vectors[] = new Vector[] {
      new DoubleSequence(1, 1, 100),
      new DoubleSequence(98, 2, 100),
      new DoubleArrayVector(5, 4, 3, 2)
    };

    DoubleVector combined = CombinedDoubleVector.combine(vectors, AttributeMap.EMPTY);
View Full Code Here

public class TransposingMatrixTest {

@Test
  public void transposed() {
    DoubleVector x = new DoubleSequence(1,1,12);
    x = (DoubleVector)x.setAttribute(Symbols.DIM, new IntArrayVector(4,3));

    DoubleVector y = new TransposingMatrix(x, AttributeMap.dim(3, 4));
    assertThat(y.getElementAsDouble(9), equalTo(4d));
    assertThat(y.getElementAsDouble(4), equalTo(6d));
  }
View Full Code Here

TOP

Related Classes of org.renjin.primitives.sequence.DoubleSequence

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.