Hi all, I've now implemented a test for the iterative solvers and preconditioners, using generate_fdm_laplace. This is good because it gives consistent results, though compared to using a randomly generated system matrix it means that the solvers are only tested on one set of input data.
My test works by constructing the system matrix, choosing a solution vector that is just a vector of 1.0s of the correct size, and multiplying to find the RHS to put into the solver. I then run the solver and compare the output to my vector of 1.0s. I report a failure if the error is greater than some tolerance value specific for the datatype. Of course, this absolute error tolerance has a different definition to that in (for instance) the GMRES solver, where we have "solver quits if ||r|| < tolerance * ||r_initial|| obtains." This means that the solver might return successfully, and yet cause a false test failure. I have a crude work-around for this. It seems to suffice to set the solver tolerance to 1e-1 times the test tolerance, which strictly might be stronger than is ideally warranted. I think this should suffice for the purposes of this test, however; else I'll have to do silly solver-specific things like computing ||r_initial||. Currently, I use a test tolerance of 1e-2 for single-precision, which means a solver tolerance of 1e-3. This seems less precise than I'd like; machine epsilon should be around 1e-7, and so I feel like I should be able to use a test tolerance of 1e-3 and a solver tolerance of 1e-4. However, using GMRES, this gives incorrect results (regardless of max_iterations) -- wildly so when combined with some preconditioners. I suspect that this is caused by rounding errors, but I'm not sure. I tried to check for what the ViennaCL test does, but I couldn't find one for the iterative solvers! Cheers, Toby -- Toby St Clere Smithe http://tsmithe.net ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ ViennaCL-devel mailing list ViennaCL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viennacl-devel