//***********************************************************************************
/** Class to return nf'th iterate of map function.
* To be subclassed by specific functions, which must provide:
*
- a method iterate(double[] x) to return the new values of {x,y}.
*
- an int variable nParameters giving the number of map parameters (1 or 2)
*
- the initialization of a[nParamters] and aDefault[nParameters]
* Optional parameters are:
* - double xminDefault, xmaxDefault, yminDefault, ymaxDefault giving the
* default plot range
*
- String title giving the name of the function to use as a graph title
*
- boolean showWinding set to true if winding number to be displayed
*
.
*/
public class Map2DFunction {
/** number of map parameters (1,2 or 3) */
public int nParameters;
/** array giving map paramters */
double[] a;
/** array giving default values of map parameters */
public double[] aDefault;
/** the name of the function to use as a graph title */
public String title = "Function";
// Axes ranges
/** the default value of xmin */
public double xminDefault=0.;
/** the default value of xmax */
public double xmaxDefault=1.;
/** the default value of ymin */
public double yminDefault=0.;
/** the default value of ymax */
public double ymaxDefault=1.;
/** winding number for circle map */
public int winding;
/** set to zero in transients so winding number not updated */
public int windingAdd=1;
/** number of iterations contributing to winding */
public int total=0;
/** true if winding number to be shown */
public boolean showWinding=false;
//***********************************************************************************
/** Sets the map paramters
* @param paramters the array of input paramters
*/
//***********************************************************************************
public void setParameters(double[] parameters) {
for(int i=0; i1.) {
winding=winding+windingAdd;
x=x-1.;
}
while (x<0.) {
winding=winding-windingAdd;
x=x+1.;
}
total=total+windingAdd;
return x;
}
//***********************************************************************************
}