Package org.renjin.sexp

Examples of org.renjin.sexp.DoubleArrayVector$Builder


  public double getRight() {
    return right;
  }
 
  public Vector toVector() {
    return new DoubleArrayVector(bottom, left, top, right);
  }
View Full Code Here


  public Dimension multiplyBy(Dimension b) {
    return new Dimension(width * b.getWidth(), height * b.getHeight());
  }

  public DoubleVector toVector() {
    return new DoubleArrayVector(width, height);
  }
View Full Code Here

  @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);

    assertThat(combined.length(), equalTo(204));
View Full Code Here

      iterations = -1;
    } catch (FunctionEvaluationException e) {
      throw new EvalException(e);
    }

    return new DoubleArrayVector(root, iterations, estimatedPrecision);
  }
View Full Code Here

  public double getHeight() {
    return y2-y1;
  }
 
  public DoubleVector toVector() {
    return new DoubleArrayVector(x1, x2, y1, y2);
  }
View Full Code Here

  public void setLocked(boolean locked) {
   
  }
 
  public DoubleVector compute() {
    return new DoubleArrayVector(1,2,3);
  }
View Full Code Here

  }


  private SEXP colon(double n1, double n2) {
    Sequences fn = new Sequences();
    return fn.colonSequence(topLevelContext, new DoubleArrayVector(n1), new DoubleArrayVector(n2));
  }
View Full Code Here

  protected SEXP c_i(int... i) {
    return new IntArrayVector(i);
  }

  protected SEXP c(double... values) {
    return new DoubleArrayVector(values);
  }
View Full Code Here

public class DistanceTriangleTest {

  @Test
  public void coordinates() {

    DoubleArrayVector vector = new DoubleArrayVector(0,100,300);
    Euclidean1dDistanceTriangle triangle = new Euclidean1dDistanceTriangle(vector, AttributeMap.EMPTY);

    assertThat(triangle.get(0), equalTo(100d));
    assertThat(triangle.get(1), equalTo(300d));
    assertThat(triangle.get(2), equalTo(200d));

    vector = new DoubleArrayVector(8, 4, 1, 7, 0, 3, 6, 1, 9, 2);
    triangle = new Euclidean1dDistanceTriangle(vector, AttributeMap.EMPTY);
   
    assertThat(triangle.toDoubleArray(), equalTo(new double[] {
        4, 7, 1, 8, 5, 2, 7, 1, 6, 3, 3, 4, 1, 2, 3, 5, 2, 6, 1, 25, 0,
        8, 1, 7, 4, 1, 6, 2, 5, 3, 6, 1, 9, 2, 3, 2, 6, 1, 5, 34, 8, 1, 7,
View Full Code Here

TOP

Related Classes of org.renjin.sexp.DoubleArrayVector$Builder

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.