Examples of map()

Examples of ca.nengo.math.Function.map()

 `2627282930313233343536` ```    CurveFitter lcf = new LinearCurveFitter();     float[][] values = new float[2][10];         for (int i=0; i
View Full Code Here

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

 `4142434445464748495051` ```  /*    * Test method for 'ca.nengo.math.impl.IndicatorPDF.map(float[])'    */   public void testMap() {     PDF pdf = new IndicatorPDF(-1, 1);     assertClose(0f, pdf.map(new float[]{-1.5f}));     assertClose(.5f, pdf.map(new float[]{-0.5f}));     assertClose(.5f, pdf.map(new float[]{0.5f}));     assertClose(0f, pdf.map(new float[]{1.5f}));         pdf = new IndicatorPDF(5, 5); ```
View Full Code Here

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

 `5152535455565758596061` ```  public void testGetDerivative() {     SigmoidFunction f = new SigmoidFunction(-1f,0.5f,1f,2f);     AbstractFunction g = (AbstractFunction)f.getDerivative();         assertEquals(1, g.getDimension());     TestUtil.assertClose(0.209987f, g.map(new float[]{0f}), .00001f);     TestUtil.assertClose(0.5f, g.map(new float[]{-1f}), .00001f);     TestUtil.assertClose(0.000670475f, g.map(new float[]{3f}), .00001f);   } } ```
View Full Code Here

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

 `2223242526272829303132` ```  /*    * Test method for 'ca.nengo.math.impl.ConstantFunction.map(float[])'    */   public void testMap() {     ConstantFunction f = new ConstantFunction(1, 1f);     assertClose(1f, f.map(new float[]{0f}), .00001f);     assertClose(1f, f.map(new float[]{1f}), .00001f);   }   /*    * Test method for 'ca.nengo.math.impl.ConstantFunction.multiMap(float[][])' ```
View Full Code Here

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

 `1213141516171819202122` ```  /*    * Test method for 'ca.nengo.math.impl.FourierFunction.FourierFunction(float[], float[], float[])'    */   public void testFourierFunctionFloatArrayFloatArrayFloatArray() {     FourierFunction f = new FourierFunction(new float[]{1.5f}, new float[]{5f}, new float[]{.2f});     assertClose(0.0000f, f.map(new float[]{.2f}));     assertClose(1.5451f, f.map(new float[]{1.5f}));     assertClose(2.9389f, f.map(new float[]{2.8f}));   }   /*   ```
View Full Code Here

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

 `6263646566676869707172` ```   */   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

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

 `2021222324252627282930` ```  /*    * Test method for 'ca.nengo.math.impl.IdentityFunction.map(float[])'    */   public void testMap() {     IdentityFunction f = new IdentityFunction(3, 0);     TestUtil.assertClose(.1f, f.map(new float[]{.1f, .2f, .3f}), .00001f);     f = new IdentityFunction(3, 1);     TestUtil.assertClose(.2f, f.map(new float[]{.1f, .2f, .3f}), .00001f);   } ```
View Full Code Here

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

 `4142434445464748495051` ```  /*    * Test method for 'ca.nengo.math.impl.IndicatorPDF.map(float[])'    */   public void testMap() {     PDF pdf = new IndicatorPDF(-1, 1);     assertClose(0f, pdf.map(new float[]{-1.5f}));     assertClose(.5f, pdf.map(new float[]{-0.5f}));     assertClose(.5f, pdf.map(new float[]{0.5f}));     assertClose(0f, pdf.map(new float[]{1.5f}));         pdf = new IndicatorPDF(5, 5); ```
View Full Code Here

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

 `2627282930313233343536` ```   */   public void testMap() {     SigmoidFunction f = new SigmoidFunction();     NumericallyDifferentiableFunction wrap = new NumericallyDifferentiableFunction(f, 0, 0.1f);         assertEquals(wrap.map(new float[]{0}), f.map(new float[]{0}));     assertEquals(wrap.map(new float[]{3}), f.map(new float[]{3}));     assertEquals(wrap.map(new float[]{100}), f.map(new float[]{100}));   }   /*   ```
View Full Code Here

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

 `4849505152535455565758` ```  }     private static void doTestMap(float rate, float observation, float probability) {     float tolerance = .00001f;     PoissonPDF pdf = new PoissonPDF(rate);     float result = pdf.map(new float[]{observation});     TestUtil.assertClose(probability, result, tolerance);   }     public void testSample() {     doTestSample(1); ```
View Full Code Here