#! /bin/csh
#
set N = 10
if ($#argv > 1) then
    if ("$1" == "-help") then
	echo "$0 run tests of the solvers"
	exit 0;
    endif
    set N = $1
    shift
endif
#
foreach svmethod ( bdd osm )
    # -itmethod lsqr only works for nopre for now
    foreach itmethod ( gmres tcqmr bcgs cgs tfqmr )
	# lu (nd) inner method
        example3 -n $N -sv $svmethod -noheader -itmethod $itmethod $*
	# Inner iterations are not working yet...
	# Use -1 for iterate to convergence
	foreach maxit (1 2 3)
	    foreach svinner ( jacobi ssor ilu bdd osm nopre )
		foreach itinner ( richardson bcgs cgs tfqmr )
	           example3 -n $N -sv $svmethod -noheader -itmethod $itmethod \
			    -maxit $maxit -sv $svinner -itmethod $itinner \
	    -title "$svmethod $itmethod inner $svinner $itinner $maxit" $*
		end
	    end
	end
    end
end
