(*----------------------------------------------------------------------*)

<<Torelli.m

(* Test the computation of the Torelli mapping *)
TestTorelli[n_] := 
	Block[{a = {{1001, 999},{999, 1001}}, b = {{I*1001, 999},{-999, I*1001}},
		p1 = -1/2, p2 = 4985/5015, theta = N[999/1001, 16], 
		cputime, result},
	cputime = TimeUsed[];
	result = Torelli[{p1, p2, theta, n}, {a,b}];
	cputime = TimeUsed[] - cputime;
	{cputime, result}]

(* Test with non-optimal basis *)
TestNielsen1[n_] :=
	Block[{a =  {{-49536 - 16256 I, -48768 - 16512 I}, 
			{-48768 + 16512 I, -49536 + 16256 I}},
		b = {{3, 1}, {1, 3}}, cputime, result},
	cputime = TimeUsed[];
	result = Nielsen[{a,b}, n];
	cputime = TimeUsed[] - cputime;
	{cputime, result}]

(* Test with optimal basis *)
TestNielsen2[n_] :=
	Block[{a =  {{-6, -2*I}, {2*I, -6}}, b = {{3, 1}, {1, 3}}, cputime, result},
	cputime = TimeUsed[];
	result = Nielsen[{a,b}, n];
	cputime = TimeUsed[] - cputime;
	{cputime, result}]

(************************************************************************)

tor = Map[TestTorelli, {0,1,2,3}]

n1 = Map[TestNielsen1, {1,2,3,4,5,6,7,8}]
n2 = Map[TestNielsen2, {1,2,3,4,5,6,7,8}]


(*----------------------------------------------------------------------*)
