aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/s-gearop.ads
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/s-gearop.ads')
-rw-r--r--gcc/ada/s-gearop.ads66
1 files changed, 65 insertions, 1 deletions
diff --git a/gcc/ada/s-gearop.ads b/gcc/ada/s-gearop.ads
index dfbceb3..51e3b92 100644
--- a/gcc/ada/s-gearop.ads
+++ b/gcc/ada/s-gearop.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2006-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2006-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -32,6 +32,50 @@
package System.Generic_Array_Operations is
pragma Pure (Generic_Array_Operations);
+ ---------------------
+ -- Back_Substitute --
+ ---------------------
+
+ generic
+ type Scalar is private;
+ type Matrix is array (Integer range <>, Integer range <>) of Scalar;
+ with function "-" (Left, Right : Scalar) return Scalar is <>;
+ with function "*" (Left, Right : Scalar) return Scalar is <>;
+ with function "/" (Left, Right : Scalar) return Scalar is <>;
+ with function Is_Non_Zero (X : Scalar) return Boolean is <>;
+ procedure Back_Substitute (M, N : in out Matrix);
+
+ --------------
+ -- Diagonal --
+ --------------
+
+ generic
+ type Scalar is private;
+ type Vector is array (Integer range <>) of Scalar;
+ type Matrix is array (Integer range <>, Integer range <>) of Scalar;
+ function Diagonal (A : Matrix) return Vector;
+
+ -----------------------
+ -- Forward_Eliminate --
+ -----------------------
+
+ -- Use elementary row operations to put square matrix M in row echolon
+ -- form. Identical row operations are performed on matrix N, must have the
+ -- same number of rows as M.
+
+ generic
+ type Scalar is private;
+ type Matrix is array (Integer range <>, Integer range <>) of Scalar;
+ with function "-" (Left, Right : Scalar) return Scalar is <>;
+ with function "*" (Left, Right : Scalar) return Scalar is <>;
+ with function "/" (Left, Right : Scalar) return Scalar is <>;
+ with function "<" (Left, Right : Scalar) return Boolean is <>;
+ Zero, One : Scalar;
+ procedure Forward_Eliminate
+ (M : in out Matrix;
+ N : in out Matrix;
+ Det : out Scalar);
+
--------------------------
-- Square_Matrix_Length --
--------------------------
@@ -242,6 +286,17 @@ pragma Pure (Generic_Array_Operations);
(Left : Left_Vector;
Right : Right_Vector) return Result_Scalar;
+ -------------
+ -- L2_Norm --
+ -------------
+
+ generic
+ type Scalar is private;
+ type Vector is array (Integer range <>) of Scalar;
+ with function Inner_Product (Left, Right : Vector) return Scalar is <>;
+ with function Sqrt (X : Scalar) return Scalar is <>;
+ function L2_Norm (X : Vector) return Scalar;
+
-------------------
-- Outer_Product --
-------------------
@@ -332,6 +387,15 @@ pragma Pure (Generic_Array_Operations);
(Left : Left_Matrix;
Right : Right_Matrix) return Result_Matrix;
+ -----------------
+ -- Swap_Column --
+ -----------------
+
+ generic
+ type Scalar is private;
+ type Matrix is array (Integer range <>, Integer range <>) of Scalar;
+ procedure Swap_Column (A : in out Matrix; Left, Right : Integer);
+
---------------
-- Transpose --
---------------