[BACK]Return to generic_norms_equals.ads CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Matrices

File: [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Matrices / generic_norms_equals.ads (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:23 2000 UTC (23 years, 7 months ago) by maekawa
Branch: PHC, MAIN
CVS Tags: v2, maekawa-ipv6, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, HEAD
Changes since 1.1: +0 -0 lines

Import the second public release of PHCpack.

OKed by Jan Verschelde.

with Abstract_Ring;
with Abstract_Ring.Field;
with Generic_Vectors;
with Generic_Matrices;

generic

  with package Ring is new Abstract_Ring(<>);
  with package Field is new Ring.Field(<>);
  with package Vectors is new Generic_Vectors(Ring);
  with package Matrices is new Generic_Matrices(Ring,Vectors);

package Generic_Norms_Equals is

-- DESCRIPTION :
--   Provides norms of vectors and decision routines for equalities.

  use Ring,Field,Vectors,Matrices;

  function Max_Norm ( v : Vector ) return number;

  -- DESCRIPTION :
  --   Returns the absolute value of the greatest element in v.

  function Sum_Norm ( v : Vector ) return number;

  -- DESCRIPTION :
  --   Returns the sum of all absolute values of the elements in v.

  function Max_Norm ( m : Matrix ) return number;

  -- DESCRIPTION :
  --   Returns the maximal element in the matrix in absolute value.

  function Equal ( x,y,tol : number ) return boolean;

  -- DESCRIPTION :
  --   Returns true if abs(x-y) < tol, otherwise false is returned.

  function Equal ( x,y : Vector; tol : number ) return boolean;

  -- DESCRIPTION :
  --   Returns true if Equal(x(i),y(i),tol), for i in x'range=y'range,
  --   otherwise false is returned.

  -- REQUIRED : x'range = y'range.

end Generic_Norms_Equals;