Implemented most of the grid_search() method.
Authored by: bugman 2009-06-19
Parent: [r9086]
Child: [r9088]