summaryrefslogtreecommitdiff
path: root/gcc/ada/s-gearop.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-13 10:52:59 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-13 10:52:59 +0000
commitb1886bc97486972dedc8b2b6d12bc442e9c3effc (patch)
tree8e5e1172e323700d9fd7404e8fb2237e05c628e6 /gcc/ada/s-gearop.adb
parent149095e59cb5dc536fa970dac92587253298cdc0 (diff)
downloadgcc-b1886bc97486972dedc8b2b6d12bc442e9c3effc.tar.gz
2011-10-13 Geert Bosch <bosch@adacore.com>
* s-gearop.ads (Forward_Eliminate): Add "abs" formal function returning a Real. * s-gearop.adb (Forward_Eliminate): Remove local "abs" function and use formal. * a-ngrear.adb (Forward_Eliminate): Adjust instantiation for new profile. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179910 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-gearop.adb')
-rw-r--r--gcc/ada/s-gearop.adb9
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/ada/s-gearop.adb b/gcc/ada/s-gearop.adb
index 1380cd449cd..3aba5b9f450 100644
--- a/gcc/ada/s-gearop.adb
+++ b/gcc/ada/s-gearop.adb
@@ -161,9 +161,6 @@ package body System.Generic_Array_Operations is
pragma Assert (M'First (1) = N'First (1) and then
M'Last (1) = N'Last (1));
- function "abs" (X : Scalar) return Scalar is
- (if X < Zero then Zero - X else X);
-
-- The following are variations of the elementary matrix row operations:
-- row switching, row multiplication and row addition. Because in this
-- algorithm the addition factor is always a negated value, we chose to
@@ -274,14 +271,14 @@ package body System.Generic_Array_Operations is
for J in M'Range (2) loop
declare
Max_Row : Integer := Row;
- Max_Abs : Scalar := Zero;
+ Max_Abs : Real'Base := 0.0;
begin
-- Find best pivot in column J, starting in row Row
for K in Row .. M'Last (1) loop
declare
- New_Abs : constant Scalar := abs M (K, J);
+ New_Abs : constant Real'Base := abs M (K, J);
begin
if Max_Abs < New_Abs then
Max_Abs := New_Abs;
@@ -290,7 +287,7 @@ package body System.Generic_Array_Operations is
end;
end loop;
- if Zero < Max_Abs then
+ if Max_Abs > 0.0 then
Switch_Row (M, N, Row, Max_Row);
Divide_Row (M, N, Row, M (Row, J));