Examples of multiMap()


Examples of ca.nengo.math.PDF.multiMap()

  /*
   * Test method for 'ca.nengo.math.impl.IndicatorPDF.multiMap(float[][])'
   */
  public void testMultiMap() {
    PDF pdf = new IndicatorPDF(-1, 1);
    float[] result = pdf.multiMap(new float[][]{new float[]{0f}, new float[]{2f}});
   
    assertEquals(2, result.length);
    assertClose(.5f, result[0]);
    assertClose(0f, result[1]);
  }
View Full Code Here

Examples of ca.nengo.math.impl.ConstantFunction.multiMap()

  /*
   * Test method for 'ca.nengo.math.impl.ConstantFunction.multiMap(float[][])'
   */
  public void testMultiMap() {
    ConstantFunction f = new ConstantFunction(1, 1f);
    float[] result = f.multiMap(new float[][]{new float[]{0f}, new float[]{1f}});
   
    assertEquals(2, result.length);
    assertClose(1f, result[0], .00001f);
    assertClose(1f, result[1], .00001f);
  }
View Full Code Here

Examples of ca.nengo.math.impl.FourierFunction.multiMap()

    float[] from1 = new float[]{.5f};
    float val1 = f.map(from1);
    float[] from2 = new float[]{.6f};
    float val2 = f.map(from2);
   
    float[] vals = f.multiMap(new float[][]{from1, from2});
    assertClose(vals[0], val1);
    assertClose(vals[1], val2);
  }
 
  private void assertClose(float a, float b) {
View Full Code Here

Examples of ca.nengo.math.impl.GaussianPDF.multiMap()

    float[] from1 = new float[]{-.5f};   
    float val1 = pdf.map(from1);
    float[] from2 = new float[]{-.3f};   
    float val2 = pdf.map(from2);
   
    float[] vals = pdf.multiMap(new float[][]{from1, from2});
    TestUtil.assertClose(val1, vals[0], .0001f);
    TestUtil.assertClose(val2, vals[1], .0001f);
  }
 
  public static void main(String[] args) {
View Full Code Here

Examples of ca.nengo.math.impl.IdentityFunction.multiMap()

   * Test method for 'ca.nengo.math.impl.IdentityFunction.multiMap(float[][])'
   */
  public void testMultiMap() {
    IdentityFunction f = new IdentityFunction(3, 0);

    float[] values = f.multiMap(new float[][]{new float[]{.1f, .2f, .3f}, new float[]{.2f, .3f, .4f}});
    TestUtil.assertClose(.1f, values[0], .00001f);
    TestUtil.assertClose(.2f, values[1], .00001f);
  }

}
View Full Code Here

Examples of ca.nengo.math.impl.IndicatorPDF.multiMap()

  /*
   * Test method for 'ca.nengo.math.impl.IndicatorPDF.multiMap(float[][])'
   */
  public void testMultiMap() {
    PDF pdf = new IndicatorPDF(-1, 1);
    float[] result = pdf.multiMap(new float[][]{new float[]{0f}, new float[]{2f}});
   
    assertEquals(2, result.length);
    assertClose(.5f, result[0]);
    assertClose(0f, result[1]);
  }
View Full Code Here

Examples of ca.nengo.math.impl.NumericallyDifferentiableFunction.multiMap()

  public void testMultiMap() {
    SigmoidFunction f = new SigmoidFunction();
    NumericallyDifferentiableFunction wrap = new NumericallyDifferentiableFunction(f, 0, 0.1f);

    float[] values = f.multiMap(new float[][]{new float[]{3}, new float[]{-2}});
    float[] newVals = wrap.multiMap(new float[][]{new float[]{3}, new float[]{-2}});
    assertEquals(values[0],newVals[0]);
    assertEquals(values[1],newVals[1]);
  }
 
  /*
 
View Full Code Here

Examples of ca.nengo.math.impl.NumericallyDifferentiableFunction.multiMap()

  public void testMultiMap() {
    SigmoidFunction f = new SigmoidFunction();
    NumericallyDifferentiableFunction wrap = new NumericallyDifferentiableFunction(f, 0, 0.1f);

    float[] values = f.multiMap(new float[][]{new float[]{3}, new float[]{-2}});
    float[] newVals = wrap.multiMap(new float[][]{new float[]{3}, new float[]{-2}});
    assertEquals(values[0],newVals[0]);
    assertEquals(values[1],newVals[1]);
  }
 
  /*
 
View Full Code Here

Examples of ca.nengo.math.impl.Polynomial.multiMap()

   * Test method for 'ca.nengo.math.impl.Polynomial.multiMap(float[][])'
   */
  public void testMultiMap() {
    Polynomial f = new Polynomial(new float[]{-1,0,2,-1});

    float[] values = f.multiMap(new float[][]{new float[]{3}, new float[]{-2}});
    TestUtil.assertClose(-10, values[0], .00001f);
    TestUtil.assertClose(15, values[1], .00001f);
  }

}
View Full Code Here

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

   */
  public void testMultiMap() {
    ArrayList<Serializable> l = new ArrayList<Serializable>();
    l.add(Integer.valueOf(0));
    PostfixFunction f = new PostfixFunction(l, "", 1);
    float[] values = f.multiMap(new float[][]{new float[]{1f}, new float[]{2f}});
    TestUtil.assertClose(1f, values[0], .0001f);
    TestUtil.assertClose(2f, values[1], .0001f);
  }
 
  public void testClone() throws CloneNotSupportedException {
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.