Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Matrices/generic_norms_equals.ads, Revision 1.1.1.1
1.1 maekawa 1: with Abstract_Ring;
2: with Abstract_Ring.Field;
3: with Generic_Vectors;
4: with Generic_Matrices;
5:
6: generic
7:
8: with package Ring is new Abstract_Ring(<>);
9: with package Field is new Ring.Field(<>);
10: with package Vectors is new Generic_Vectors(Ring);
11: with package Matrices is new Generic_Matrices(Ring,Vectors);
12:
13: package Generic_Norms_Equals is
14:
15: -- DESCRIPTION :
16: -- Provides norms of vectors and decision routines for equalities.
17:
18: use Ring,Field,Vectors,Matrices;
19:
20: function Max_Norm ( v : Vector ) return number;
21:
22: -- DESCRIPTION :
23: -- Returns the absolute value of the greatest element in v.
24:
25: function Sum_Norm ( v : Vector ) return number;
26:
27: -- DESCRIPTION :
28: -- Returns the sum of all absolute values of the elements in v.
29:
30: function Max_Norm ( m : Matrix ) return number;
31:
32: -- DESCRIPTION :
33: -- Returns the maximal element in the matrix in absolute value.
34:
35: function Equal ( x,y,tol : number ) return boolean;
36:
37: -- DESCRIPTION :
38: -- Returns true if abs(x-y) < tol, otherwise false is returned.
39:
40: function Equal ( x,y : Vector; tol : number ) return boolean;
41:
42: -- DESCRIPTION :
43: -- Returns true if Equal(x(i),y(i),tol), for i in x'range=y'range,
44: -- otherwise false is returned.
45:
46: -- REQUIRED : x'range = y'range.
47:
48: end Generic_Norms_Equals;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>