Package ca.nengo.math.impl

Examples of ca.nengo.math.impl.LinearFunction


   * Test method for {@link ca.nengo.math.impl.AbstractFunction#clone()}.
   * @throws CloneNotSupportedException
   */
  public void testClone() throws CloneNotSupportedException {
    float[] map = new float[]{1, 1};
    LinearFunction f = new LinearFunction(map, 0, true);
    LinearFunction f1 = (LinearFunction) f.clone();
    f.getMap()[0] = 2;
    f.setBias(1);
    f.setRectified(false);
   
    assertTrue(f1.getMap()[0] < 1.5f);
    assertTrue(f1.getBias() < .5f);
    assertTrue(f1.getRectified());
  }
View Full Code Here


    public SpikeGenerator make() {
      float maxRate = myMaxRate.sample()[0];
      float intercept = myIntercept.sample()[0];
      float slope = maxRate / (1-intercept);
      float bias = - slope * intercept;
      Function line = new LinearFunction(new float[]{slope}, bias, myRectified);
      return new PoissonSpikeGenerator(line);
    }
View Full Code Here

TOP

Related Classes of ca.nengo.math.impl.LinearFunction

Copyright © 2018 www.massapicom. 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.