Elenco delle funzioni con commenti estratto dagli header files.
PlotFunction
Class representing a plottable function z=f(x,y). A plottable function has a rectangular domain minX <= x <= maxX, minY <= y <= maxY, and a number of rows and columns used to discretize the rectangular domain into a grid. There are functions returning the coordinates of a grid vertex given its indices (i,j) in the grid. This is an abstract class. The algorithm for computing f will be provided in the sub-classes.
Funzioni pubbliche:
int setDomain(double x0, double y0, double x1, double y1);
Set the domain limits, provided that x0<=x1 and y0<=y1,
return 1 if parameters are ok, otherwise return 0 and do nothing.
If parameters are ok also compute the limits of the function range.
double getMinX(void) double getMinY(void)
double getMaxX(void) double getMaxY(void)
Return the domain limits.
double getMinZ(void) double getMaxZ(void)
Return the limits of the function range (which have been computed
based on the current grid).
int setRowColNum(int r, int c);
Set the number of rows and columns for domain
discretization, provided that r>0 and c>0.
Return 1 if parameters are ok, otherwise return 0 and do nothing.
If parameters are ok also compute the limits of the function range.
int getRowNum(void) int getColNum(void)
Return the number of rows and columns for domain discretization.
double pointZ(double x, double y)
double vertexZ(int i, int j)
Abstract functions (not implemented here).
Return the function value at a point (x,y) and at a
vertex (i,j) of the grid, where i = row index and j = column index,
i and j must be >=0 and <= numRow and numCol, respectively,
otherwise a run-time error may occur.
double gridEdgeX(void) double gridEdgeY(void)
Return the length of the grid edge on the x and y axis.
double vertexX(int i, int j) double vertexY(int i, int j)
Return the x and y coordinates of vertex (i,j) of the grid,
where i = row index and j = column index,
i and j must be >=0 and <= numRow and numCol, respectively,
otherwise a run-time error may occur.
MathFunction
Class representing a plottable function z=f(x,y) where f has an analytic expression. There is a pointer to a function returning the function value at a point (x,y) within the domain.
Public functions:
MathFunction(void)
Constructor, create a null function with domain = point (0,0)
and discretized into 1 rows and 1 columns.
void setFunction(double (*f) (double,double))
Set the function, and also compute the limits of the function
range based on the current grid.
The argument is a function of type double f(double x, double y).
double vertexZ(int i, int j) Implementation of the abstract function from superclass PlotFunction. Return the function value at a vertex (i,j) of the grid.
double pointZ(double x, double y)
Implementation of the abstract function from superclass.
Return the function value at a point (x,y).