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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d275ad890e7b3ecc X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.106.102 with SMTP id gt6mr21560wib.0.1348190011378; Thu, 20 Sep 2012 18:13:31 -0700 (PDT) Path: q11ni3492521wiw.1!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.131.MISMATCH!xlned.com!feeder3.xlned.com!news.astraweb.com!border5.a.newsrouter.astraweb.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: problem with Real_Matrix*Real_Matrix Date: Mon, 17 Sep 2012 20:01:02 +0300 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 X-Trace: individual.net w1828UTnfxt+47hS65DvlAMmLj4stQr1XB8d6o8sZJFlkHRGsbCejxsbdCSTp9nabT Cancel-Lock: sha1:9N2BWrvDkPMw1f+Fb3qeDplg+oY= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2012-09-17T20:01:02+03:00 List-Id: On 12-09-17 16:37 , reinkor wrote: > Dear All, > > I am confused about my result from the multiplication r*M where > r is Real_Vector and M is Real_Matrix. Enclosed is my test program > including comments. Could someone look at it and maybe help me out > of my bubble? > > > I use gcc-ada-4.7-2.1.1.x86_64 under OpenSuse 12.2 I get the expected result: ** r*M : 3010.0 4020.0 on my Mac, with GNAT 4.5.0 20100221 (experimental) [trunk revision 156937]. I suspect your Ada installation is broken, but I don't have any advice on how to fix it, sorry. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ . > > reinert > > > with Text_IO; > use Text_IO; > with ada.numerics.Generic_Real_Arrays; > > with Ada.Strings.Fixed; > use Ada.Strings,Ada.Strings.Fixed; > > > procedure test3 is > > type Real is new Float; > > package Real_Io is new Text_IO.Float_Io (Real); > use Real_Io; > > package Int_Io is new Text_IO.Integer_Io (Integer); > use Int_Io; > > package GRA is new Ada.Numerics.Generic_Real_Arrays(Real); > use GRA; > > procedure Put (X : Real_Vector) is > begin > for I in X'Range (1) loop > Put (X (I),6,1,0); > end loop; > end Put; > > M : Real_Matrix := ((1.0, 2.0), > (3.0, 4.0)); > > r : Real_Vector := (10.0,1000.0); > > begin > > Put("** r*M : ");New_Line; > Put(r*M); > > -- Extect: r*M = (10*1 + 1000*3, 10*2 + 1000*4) = (3010,4020) > -- i.e. should r*M consists of the inner product between r and > -- the columns of M ? But my program gives: > -- > -- ** r*M : > -- 40.0 6000.0 > -- > > end test3; > >