Package ca.nengo.math

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


        Plotter.plot(pdf, 0, .001f, .5f, "aagg");

        float binSize = .05f;
        float[] bins = new float[8];
        for (int i = 0; i < 10000; i++) {
            float foo = pdf.sample()[0];
            int bin = (int) Math.floor(foo / binSize);
            if (bin <= 7) {
                bins[bin] += 1;
            }
        }
View Full Code Here


   */
  public void testSample() {
    PDF pdf = new IndicatorPDF(-1, 1);
   
    for (int i = 0; i < 10; i++) {
      float[] s = pdf.sample();
      assertEquals(1, s.length);
      assertTrue(s[0] > -1 && s[0] < 1);
    }
   
    pdf = new IndicatorPDF(0, 0);
View Full Code Here

      assertEquals(1, s.length);
      assertTrue(s[0] > -1 && s[0] < 1);
    }
   
    pdf = new IndicatorPDF(0, 0);
    assertEquals(0f, pdf.sample()[0]);
  }

  /*
   * Test method for 'ca.nengo.math.impl.IndicatorPDF.getDimension()'
   */
 
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.