[BACK]Return to ts_jaco.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Polynomials

Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Polynomials/ts_jaco.adb, Revision 1.1.1.1

1.1       maekawa     1: with text_io,integer_io;                 use text_io,integer_io;
                      2: with Symbol_Table;
                      3: with Standard_Complex_Numbers;           use Standard_Complex_Numbers;
                      4: with Standard_Complex_Numbers_io;        use Standard_Complex_Numbers_io;
                      5: with Standard_Complex_Vectors;           use Standard_Complex_Vectors;
                      6: with Standard_Complex_Vectors_io;        use Standard_Complex_Vectors_io;
                      7: with Standard_Complex_Polynomials;       use Standard_Complex_Polynomials;
                      8: with Standard_Complex_Polynomials_io;    use Standard_Complex_Polynomials_io;
                      9: with Standard_Complex_Poly_Systems;      use Standard_Complex_Poly_Systems;
                     10: with Standard_Complex_Poly_Systems_io;   use Standard_Complex_Poly_Systems_io;
                     11: with Standard_Complex_Poly_SysFun;       use Standard_Complex_Poly_SysFun;
                     12: with Standard_Complex_Jaco_Matrices;     use Standard_Complex_Jaco_Matrices;
                     13: with Standard_to_Multprec_Convertors;    use Standard_to_Multprec_Convertors;
                     14: with Multprec_Complex_Polynomials_io;    use Multprec_Complex_Polynomials_io;
                     15: with Multprec_Complex_Poly_Systems;      use Multprec_Complex_Poly_Systems;
                     16: with Multprec_Complex_Jaco_Matrices;     use Multprec_Complex_Jaco_Matrices;
                     17:
                     18: procedure ts_jaco is
                     19:
                     20: -- DESCRIPTION :
                     21: --   This routine provides basic testing routines for Jacobian matrices.
                     22:
                     23:   procedure Test_Standard_Creation is
                     24:
                     25:   -- DESCRIPTION :
                     26:   --   Tests the creation of a standard Jacobian matrix.
                     27:
                     28:     lp : Standard_Complex_Poly_Systems.Link_to_Poly_Sys;
                     29:     n : natural;
                     30:
                     31:   begin
                     32:     new_line;
                     33:     put_line("Testing the creation of standard Jacobian matrices.");
                     34:     new_line;
                     35:     get(lp);
                     36:     put_line("The system : "); put(lp.all);
                     37:     n := lp'last;
                     38:     declare
                     39:       jm : Standard_Complex_Jaco_Matrices.Jaco_Mat(1..n,1..n) := Create(lp.all);
                     40:     begin
                     41:       put_line("The Jacobian matrix : ");
                     42:       for i in jm'range loop
                     43:         for j in jm'range loop
                     44:           put(jm(i,j));
                     45:         end loop;
                     46:         new_line;
                     47:       end loop;
                     48:     end;
                     49:   end Test_Standard_Creation;
                     50:
                     51:   procedure Test_Multprec_Creation is
                     52:
                     53:   -- DESCRIPTION :
                     54:   --   Tests the creation of a multi-precision Jacobian matrix.
                     55:
                     56:     lp : Standard_Complex_Poly_Systems.Link_to_Poly_Sys;
                     57:     n : natural;
                     58:
                     59:   begin
                     60:     new_line;
                     61:     put_line("Testing the creation of multi-precision Jacobian matrices.");
                     62:     new_line;
                     63:     get(lp);
                     64:     put_line("The system : "); put(lp.all);
                     65:     n := lp'last;
                     66:     declare
                     67:       mp : Multprec_Complex_Poly_Systems.Poly_Sys(1..n) := Convert(lp.all);
                     68:       jm : Multprec_Complex_Jaco_Matrices.Jaco_Mat(1..n,1..n) := Create(mp);
                     69:     begin
                     70:       put_line("The Jacobian matrix : ");
                     71:       for i in jm'range loop
                     72:         for j in jm'range loop
                     73:           put(jm(i,j));
                     74:         end loop;
                     75:         new_line;
                     76:       end loop;
                     77:     end;
                     78:   end Test_Multprec_Creation;
                     79:
                     80:   procedure Main is
                     81:
                     82:     ans : character;
                     83:
                     84:   begin
                     85:     new_line;
                     86:     put_line("Interactive testing of the operations on complex polynomials.");
                     87:     loop
                     88:       new_line;
                     89:       put_line("Choose one of the following :                              ");
                     90:       put_line("  0. Exit this program.                                    ");
                     91:       put_line("  1. Test creation of standard Jacobian matrices.          ");
                     92:       put_line("  2. Test creation of multi-precision Jacobian matrices.   ");
                     93:       put("Type 0,1 or 2 to select : "); get(ans);
                     94:       exit when (ans = '0');
                     95:       case ans is
                     96:         when '1' => Test_Standard_Creation;
                     97:         when '2' => Test_Multprec_Creation;
                     98:         when others => null;
                     99:       end case;
                    100:     end loop;
                    101:   end Main;
                    102:
                    103: begin
                    104:   Main;
                    105: end ts_jaco;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>