-- Package spec for Lax Wendroff scheme to solve 1-D -- Advection PDE in Ada 2005 -- by Nasser M. Abbasi -- with Ada.Numerics.Generic_Real_Arrays; package Lax_Wendroff_pkg is type Lax_Wendroff_t (<>) is tagged private; type solution_t is array (Natural range <>) of Float; -- primitive operations, constructor function make(speed,h,k : Float; u0 : solution_t) return Lax_Wendroff_t; procedure step (o : in out Lax_Wendroff_t); function get_solution (o : Lax_Wendroff_t) return solution_t; private package My_Vectors is new Ada.Numerics.Generic_Real_Arrays (Float); use My_Vectors; subtype buffer_t is Real_Vector; type Lax_Wendroff_t (N : Positive) is tagged record speed : Float; -- speed of flow h : Float; -- space grid size k : Float; -- delt u : buffer_t (-1 .. N); -- solution step_number : Natural; end record; end Lax_Wendroff_pkg;