protected class GridSearch.Grid extends Object implements Serializable, RevisionHandler
Modifier and Type | Field and Description |
---|---|
protected int |
m_Height
the number of points on the Y axis
|
protected String |
m_LabelX
the label for the X axis
|
protected String |
m_LabelY
the label for the Y axis
|
protected double |
m_MaxX
the maximum on the X axis
|
protected double |
m_MaxY
the maximum on the Y axis
|
protected double |
m_MinX
the minimum on the X axis
|
protected double |
m_MinY
the minimum on the Y axis
|
protected double |
m_StepX
the step size for the X axis
|
protected double |
m_StepY
the step size for the Y axis
|
protected int |
m_Width
the number of points on the X axis
|
Constructor and Description |
---|
Grid(double minX,
double maxX,
double stepX,
double minY,
double maxY,
double stepY)
initializes the grid
|
Grid(double minX,
double maxX,
double stepX,
String labelX,
double minY,
double maxY,
double stepY,
String labelY)
initializes the grid
|
Modifier and Type | Method and Description |
---|---|
Enumeration<GridSearch.PointDouble> |
column(int x)
returns an Enumeration over all pairs in the given column
|
boolean |
equals(Object o)
Tests itself against the provided grid object
|
GridSearch.Grid |
extend(GridSearch.PointDouble values)
returns an extended grid that encompasses the given point (won't be on
the border of the grid).
|
String |
getLabelX()
returns the label for the X axis
|
String |
getLabelY()
returns the label for the Y axis
|
GridSearch.PointInt |
getLocation(GridSearch.PointDouble values)
returns the closest index pair for the given value pair in the grid.
|
double |
getMaxX()
returns the right border
|
double |
getMaxY()
returns the top border
|
double |
getMinX()
returns the left border
|
double |
getMinY()
returns the bottom border
|
String |
getRevision()
Returns the revision string.
|
double |
getStepX()
returns the step size on the X axis
|
double |
getStepY()
returns the step size on the Y axis
|
GridSearch.PointDouble |
getValues(int x,
int y)
returns the values at the given point in the grid
|
int |
height()
returns the number of points in the grid on the Y axis (incl.
|
boolean |
isOnBorder(GridSearch.PointDouble values)
checks whether the given values are on the border of the grid
|
boolean |
isOnBorder(GridSearch.PointInt location)
checks whether the given location is on the border of the grid
|
Enumeration<GridSearch.PointDouble> |
row(int y)
returns an Enumeration over all pairs in the given row
|
GridSearch.Grid |
subgrid(int top,
int left,
int bottom,
int right)
returns a subgrid with the same step sizes, but different borders
|
String |
toString()
returns a string representation of the grid
|
int |
width()
returns the number of points in the grid on the X axis (incl.
|
protected double m_MinX
protected double m_MaxX
protected double m_StepX
protected String m_LabelX
protected double m_MinY
protected double m_MaxY
protected double m_StepY
protected String m_LabelY
protected int m_Width
protected int m_Height
public Grid(double minX, double maxX, double stepX, double minY, double maxY, double stepY)
minX
- the minimum on the X axismaxX
- the maximum on the X axisstepX
- the step size for the X axisminY
- the minimum on the Y axismaxY
- the maximum on the Y axisstepY
- the step size for the Y axispublic Grid(double minX, double maxX, double stepX, String labelX, double minY, double maxY, double stepY, String labelY)
minX
- the minimum on the X axismaxX
- the maximum on the X axisstepX
- the step size for the X axislabelX
- the label for the X axisminY
- the minimum on the Y axismaxY
- the maximum on the Y axisstepY
- the step size for the Y axislabelY
- the label for the Y axispublic boolean equals(Object o)
public double getMinX()
public double getMaxX()
public double getStepX()
public String getLabelX()
public double getMinY()
public double getMaxY()
public double getStepY()
public String getLabelY()
public int height()
public int width()
public GridSearch.PointDouble getValues(int x, int y)
x
- the x-th point on the X axisy
- the y-th point on the Y axispublic GridSearch.PointInt getLocation(GridSearch.PointDouble values)
values
- the values to get the indices forpublic boolean isOnBorder(GridSearch.PointDouble values)
values
- the values to checkpublic boolean isOnBorder(GridSearch.PointInt location)
location
- the location to checkpublic GridSearch.Grid subgrid(int top, int left, int bottom, int right)
top
- the top indexleft
- the left indexbottom
- the bottom indexright
- the right indexpublic GridSearch.Grid extend(GridSearch.PointDouble values)
values
- the point that the grid should containpublic Enumeration<GridSearch.PointDouble> row(int y)
y
- the row to retrievegetValues(int, int)
public Enumeration<GridSearch.PointDouble> column(int x)
x
- the column to retrievegetValues(int, int)
public String toString()
public String getRevision()
getRevision
in interface RevisionHandler
Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.