Package org.renjin.compiler.pipeline

Source Code of org.renjin.compiler.pipeline.SimplifyTest

package org.renjin.compiler.pipeline;


import org.junit.Test;
import org.renjin.EvalTestCase;
import org.renjin.primitives.matrix.TransposingMatrix;
import org.renjin.primitives.sequence.DoubleSequence;
import org.renjin.sexp.AttributeMap;
import org.renjin.sexp.Symbols;
import org.renjin.sexp.Vector;

import java.util.concurrent.Executors;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;

public class SimplifyTest extends EvalTestCase {

  @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);
   
    assertThat(xts.getAttribute(Symbols.DIM), equalTo(c_i(40,200)));
  }

}
TOP

Related Classes of org.renjin.compiler.pipeline.SimplifyTest

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.