/* SCCS - @(#)NslRamp.java 1.7 - 09/01/99 - 00:18:08 */
// Copyright: Copyright (c) 1997 University of Southern California Brain Project.
// Copyright: This software may be freely copied provided the toplevel
// Copyright: COPYRIGHT file is included with each such copy.
// Copyright: Email nsl@java.usc.edu.
////////////////////////////////////////////////////////////
//
// Ramp threshold routines
//
//
/**
Ramp threshold routines.
There are four basic format for the evaluation method in
this routine:
1, eval(a) -> c
a is the input parameter to pass the threshold function:
if a < 0, c = 0,
else c = a.
2. eval(dest, a) -> c
a is the parameter of the threshold function and
dest is the temporary space to hold the result.
The method returns the reference to dest.
3. eval(a, kx1, ky1, ky2) -> c
if a < kx1, c = ky1,
else, c = a - kx1 + ky2.
2. eval(dest, a, kx1, ky1, ky2) -> c
a is the parameter of the threshold function and
dest is the temporary space to hold the result.
The method returns the reference to dest.
*/
////////////////////////////////////////////////////////////////////////////////
// ramp functions
package nslj.src.math;
import nslj.src.lang.*;
public final class NslRamp {
// doubles
private static double value(double x, double kx1, double ky1, double ky2) {
double temp;
if (x