Package ca.nengo.math.impl

Examples of ca.nengo.math.impl.PostfixFunction.map()


    PostfixFunction f = null;
   
    ArrayList<Serializable> l = new ArrayList<Serializable>();
    l.add(new Float(5.5f));
    f = new PostfixFunction(l, "", 0);
    TestUtil.assertClose(5.5f, f.map(new float[0]), .0001f);

    l.clear();
    l.add(Integer.valueOf(0));
    f = new PostfixFunction(l, "", 1);
    TestUtil.assertClose(1f, f.map(new float[]{1f}), .0001f);
View Full Code Here


    TestUtil.assertClose(5.5f, f.map(new float[0]), .0001f);

    l.clear();
    l.add(Integer.valueOf(0));
    f = new PostfixFunction(l, "", 1);
    TestUtil.assertClose(1f, f.map(new float[]{1f}), .0001f);

    l.clear();
    l.add(Integer.valueOf(0));
    l.add(new SineFunction(1));
    f = new PostfixFunction(l, "", 1);
View Full Code Here

    l.clear();
    l.add(Integer.valueOf(0));
    l.add(new SineFunction(1));
    f = new PostfixFunction(l, "", 1);
    TestUtil.assertClose(0f, f.map(new float[]{(float) Math.PI}), .0001f);
  }

  /*
   * Test method for 'ca.nengo.math.impl.PostfixFunction.multiMap(float[][])'
   */
 
View Full Code Here

  public void testClone() throws CloneNotSupportedException {
    PostfixFunction f1 = new PostfixFunction("x0 + x1^2", 2);
    PostfixFunction f2 = (PostfixFunction) f1.clone();
    f2.setExpression("x1");
    assertEquals("x0 + x1^2", f1.getExpression());
    assertTrue(f1.map(new float[]{0, 2}) - f2.map(new float[]{0, 2}) > 1);
  }

}
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.