Package ca.nengo.math.impl

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


   */
  public void testMap() {
    float tolerance = .0001f;

    GaussianPDF pdf = new GaussianPDF(0f, 1f);   
    TestUtil.assertClose(0.1109f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(0.3989f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(0.3910f, pdf.map(new float[]{.2f}), tolerance);

    pdf = new GaussianPDF(1f, 2f);   
    TestUtil.assertClose(0.0521f, pdf.map(new float[]{-1.6f}), tolerance);
View Full Code Here


  public void testMap() {
    float tolerance = .0001f;

    GaussianPDF pdf = new GaussianPDF(0f, 1f);   
    TestUtil.assertClose(0.1109f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(0.3989f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(0.3910f, pdf.map(new float[]{.2f}), tolerance);

    pdf = new GaussianPDF(1f, 2f);   
    TestUtil.assertClose(0.0521f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(0.2197f, pdf.map(new float[]{0f}), tolerance);
View Full Code Here

    float tolerance = .0001f;

    GaussianPDF pdf = new GaussianPDF(0f, 1f);   
    TestUtil.assertClose(0.1109f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(0.3989f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(0.3910f, pdf.map(new float[]{.2f}), tolerance);

    pdf = new GaussianPDF(1f, 2f);   
    TestUtil.assertClose(0.0521f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(0.2197f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(0.2404f, pdf.map(new float[]{.2f}), tolerance);
View Full Code Here

    TestUtil.assertClose(0.1109f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(0.3989f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(0.3910f, pdf.map(new float[]{.2f}), tolerance);

    pdf = new GaussianPDF(1f, 2f);   
    TestUtil.assertClose(0.0521f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(0.2197f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(0.2404f, pdf.map(new float[]{.2f}), tolerance);
  }
 
  /**
 
View Full Code Here

    TestUtil.assertClose(0.3989f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(0.3910f, pdf.map(new float[]{.2f}), tolerance);

    pdf = new GaussianPDF(1f, 2f);   
    TestUtil.assertClose(0.0521f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(0.2197f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(0.2404f, pdf.map(new float[]{.2f}), tolerance);
  }
 
  /**
   * Test of optional peak constructor argument
View Full Code Here

    TestUtil.assertClose(0.3910f, pdf.map(new float[]{.2f}), tolerance);

    pdf = new GaussianPDF(1f, 2f);   
    TestUtil.assertClose(0.0521f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(0.2197f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(0.2404f, pdf.map(new float[]{.2f}), tolerance);
  }
 
  /**
   * Test of optional peak constructor argument
   */
 
View Full Code Here

  public void testScale() {
    float tolerance = .002f;

    GaussianPDF pdf = new GaussianPDF(1f, 2f, 10f);
    float scale = 35.4491f; //based on unscaled peak of .2821
    TestUtil.assertClose(scale*0.0521f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(scale*0.2197f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(scale*0.2404f, pdf.map(new float[]{.2f}), tolerance);
   
//    Plotter.plot(pdf, -3, .001f, 3, "foo");
//    try { Thread.sleep(1000*10); } catch (InterruptedException e) {}
View Full Code Here

    float tolerance = .002f;

    GaussianPDF pdf = new GaussianPDF(1f, 2f, 10f);
    float scale = 35.4491f; //based on unscaled peak of .2821
    TestUtil.assertClose(scale*0.0521f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(scale*0.2197f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(scale*0.2404f, pdf.map(new float[]{.2f}), tolerance);
   
//    Plotter.plot(pdf, -3, .001f, 3, "foo");
//    try { Thread.sleep(1000*10); } catch (InterruptedException e) {}
  }
View Full Code Here

    GaussianPDF pdf = new GaussianPDF(1f, 2f, 10f);
    float scale = 35.4491f; //based on unscaled peak of .2821
    TestUtil.assertClose(scale*0.0521f, pdf.map(new float[]{-1.6f}), tolerance);
    TestUtil.assertClose(scale*0.2197f, pdf.map(new float[]{0f}), tolerance);
    TestUtil.assertClose(scale*0.2404f, pdf.map(new float[]{.2f}), tolerance);
   
//    Plotter.plot(pdf, -3, .001f, 3, "foo");
//    try { Thread.sleep(1000*10); } catch (InterruptedException e) {}
  }

View Full Code Here

   * Test method for 'ca.nengo.math.impl.GaussianPDF.multiMap(float[][])'
   */
  public void testMultiMap() {
    GaussianPDF pdf = new GaussianPDF(0f, 1f);
    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);
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.