Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Supports/ts_lstvec.adb, Revision 1.1
1.1 ! maekawa 1: with text_io,integer_io; use text_io,integer_io;
! 2: with Standard_Natural_Vectors; use Standard_Natural_Vectors;
! 3: with Standard_Natural_Vectors_io; use Standard_Natural_Vectors_io;
! 4: with Lists_of_Integer_Vectors; use Lists_of_Integer_Vectors;
! 5: with Lists_of_Integer_Vectors_io; use Lists_of_Integer_Vectors_io;
! 6: with Lists_of_Floating_Vectors; use Lists_of_Floating_Vectors;
! 7: with Lists_of_Floating_Vectors_io; use Lists_of_Floating_Vectors_io;
! 8: with Arrays_of_Integer_Vector_Lists; use Arrays_of_Integer_Vector_Lists;
! 9: with Arrays_of_Integer_Vector_Lists_io; use Arrays_of_Integer_Vector_Lists_io;
! 10: with Arrays_of_Floating_Vector_Lists; use Arrays_of_Floating_Vector_Lists;
! 11: with Arrays_of_Floating_Vector_Lists_io; use Arrays_of_Floating_Vector_Lists_io;
! 12:
! 13: procedure ts_lstvec is
! 14:
! 15: -- DESCRIPTION :
! 16: -- Test on operations on lists of links to vectors.
! 17:
! 18: procedure Test_Integer_List_io is
! 19:
! 20: m,n : natural;
! 21: l : Lists_of_Integer_Vectors.List;
! 22:
! 23: begin
! 24: new_line;
! 25: put_line("Testing input/output of lists of links to integer vectors.");
! 26: new_line;
! 27: put("Give the dimension of the vectors : "); get(n);
! 28: put("Give the number of vectors : "); get(m);
! 29: put("Give "); put(m,1); put(" "); put(n,1); put_line("-vectors :");
! 30: get(n,m,l);
! 31: put_line("Your list : "); put(l);
! 32: end Test_Integer_List_io;
! 33:
! 34: procedure Test_Floating_List_io is
! 35:
! 36: m,n : natural;
! 37: l : Lists_of_Floating_Vectors.List;
! 38:
! 39: begin
! 40: new_line;
! 41: put_line("Testing input/output of lists of links to floating vectors.");
! 42: new_line;
! 43: put("Give the dimension of the vectors : "); get(n);
! 44: put("Give the number of vectors : "); get(m);
! 45: put("Give "); put(m,1); put(" "); put(n,1); put_line("-vectors :");
! 46: get(n,m,l);
! 47: put_line("Your list : "); put(l);
! 48: end Test_Floating_List_io;
! 49:
! 50: procedure Test_Integer_Array_List_io is
! 51:
! 52: n : natural;
! 53:
! 54: begin
! 55: new_line;
! 56: put_line("Testing input/output of arrays of lists of integer vectors.");
! 57: new_line;
! 58: put("Give the dimension : "); get(n);
! 59: declare
! 60: l : Arrays_of_Integer_Vector_Lists.Array_of_Lists(1..n);
! 61: m : Standard_Natural_Vectors.Vector(1..n);
! 62: begin
! 63: put("Give the cardinalities of the lists : "); get(m);
! 64: put_line("Give the lists : "); get(n,m,l);
! 65: put_line("Your lists : "); put(l);
! 66: end;
! 67: end Test_Integer_Array_List_io;
! 68:
! 69: procedure Test_Floating_Array_List_io is
! 70:
! 71: n : natural;
! 72:
! 73: begin
! 74: new_line;
! 75: put_line("Testing input/output of arrays of lists of floating vectors.");
! 76: new_line;
! 77: put("Give the dimension : "); get(n);
! 78: declare
! 79: l : Arrays_of_Floating_Vector_Lists.Array_of_Lists(1..n);
! 80: m : Standard_Natural_Vectors.Vector(1..n);
! 81: begin
! 82: put("Give the cardinalities of the lists : "); get(m);
! 83: put_line("Give the lists : "); get(n,m,l);
! 84: put_line("Your lists : "); put(l);
! 85: end;
! 86: end Test_Floating_Array_List_io;
! 87:
! 88: procedure Main is
! 89:
! 90: ans : character;
! 91:
! 92: begin
! 93: new_line;
! 94: put_line("Interactive testing of lists of links to vectors.");
! 95: loop
! 96: new_line;
! 97: put_line("Choose one of the following : ");
! 98: put_line(" 0. Exit this program.");
! 99: put_line(" 1. i/o for lists of links to standard integer vectors.");
! 100: put_line(" 2. i/o for lists of links to standard floating vectors.");
! 101: put_line(" 3. i/o for arrays of standard integer vector lists.");
! 102: put_line(" 4. i/o for arrays of standard floating vector lists.");
! 103: put("Type 0,1,2,3 or 4 to select : "); get(ans);
! 104: exit when (ans = '0');
! 105: case ans is
! 106: when '1' => Test_Integer_List_io;
! 107: when '2' => Test_Floating_List_io;
! 108: when '3' => Test_Integer_Array_List_io;
! 109: when '4' => Test_Floating_Array_List_io;
! 110: when others => null;
! 111: end case;
! 112: end loop;
! 113: end Main;
! 114:
! 115: begin
! 116: Main;
! 117: end ts_lstvec;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>