From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d275ad890e7b3ecc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.98.234 with SMTP id el10mr2433157wib.3.1347963494837; Tue, 18 Sep 2012 03:18:14 -0700 (PDT) Received: by 10.236.154.194 with SMTP id h42mr2229612yhk.8.1347963494673; Tue, 18 Sep 2012 03:18:14 -0700 (PDT) Path: ed8ni114471314wib.0!nntp.google.com!v8no38624qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 18 Sep 2012 03:18:14 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.178.107.175; posting-account=g6PEmwoAAADhFsmVm6Epjviaw4MLU0b5 NNTP-Posting-Host: 82.178.107.175 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <31325794-475b-430c-a419-a96da29251f0@googlegroups.com> Subject: Re: problem with Real_Matrix*Real_Matrix From: Anatoly Chernyshev Injection-Date: Tue, 18 Sep 2012 10:18:14 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-09-18T03:18:14-07:00 List-Id: Got the same mistake on Win7/GNAT 2012. As I'm doing matrix calculations too, I had to investigate, and here's the culprit from s-gearop.adb: --------------------------------------------------------------- function Vector_Matrix_Product (Left : Left_Vector; Right : Matrix) return Result_Vector is begin return R : Result_Vector (Right'Range (2)) do if Left'Length /= Right'Length (2) then raise Constraint_Error with "incompatible dimensions in vector-matrix multiplication"; end if; for J in Right'Range (2) loop declare S : Result_Scalar := Zero; begin for K in Right'Range (1) loop S := S + Left (J - Right'First (1) + Left'First) * Right (K, J); end loop; R (J) := S; end; end loop; end return; end Vector_Matrix_Product; --------------------------------------------------------------- S := S + Left (J - Right'First (1) + Left'First) * Right (K, J); - in this fragment Left is kept constant within the K-cycle. Replacing Left'First with K would correct the problem. I believe, it was straightened for some reason for the Mac distribution; would be interesting to compare.