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,a83584e000bc28fa X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.205.126.4 with SMTP id gu4mr821960bkc.8.1345295615227; Sat, 18 Aug 2012 06:13:35 -0700 (PDT) Received: by 10.180.106.199 with SMTP id gw7mr1042888wib.0.1345295614785; Sat, 18 Aug 2012 06:13:34 -0700 (PDT) Path: m12ni111320bkm.0!nntp.google.com!news1.google.com!7no22124049wig.0!news-out.google.com!q11ni187225919wiw.1!nntp.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: ada lapack Date: Sat, 18 Aug 2012 16:13:33 +0300 Organization: Tidorum Ltd Message-ID: References: <12f929e9-eea3-4dc9-b10d-71e4f5732e0d@googlegroups.com> <615dd222-9c8b-4878-94f7-b1cd4792bd3e@googlegroups.com> <36bc4009-6240-4797-991c-b72ec290cedc@googlegroups.com> <12606f3f-aec1-489c-8325-18e13007b6a6@googlegroups.com> <11959826-e12e-4455-b9d9-1ac4dcaf2952@googlegroups.com> <3bdbf14a-52ff-4b72-9e7b-42b543538959@googlegroups.com> <5865849c-3897-4be5-8d54-1de2e1acc3a7@googlegroups.com> Mime-Version: 1.0 X-Trace: individual.net OtSfCvgm3zswCJyInEBBjACMV1FWmPV1pmUER/y0A85kyGs/iDQI7RDe1FeZL+2yz6 Cancel-Lock: sha1:bHSlFXA3Jr51fUl1eU3hQApEi+c= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: <5865849c-3897-4be5-8d54-1de2e1acc3a7@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2012-08-18T16:13:33+03:00 List-Id: On 12-08-18 14:57 , Ada novice wrote: > If in an example file given say example01.adb one needs to add 2 > matrices. We have the given "matrix" and we can make a copy > "matrix_copy". Writing > > sum_two_matrices := matrix + matrix_copy; > > gives an compilation error > > ---there is no applicable operator "+" for type "Complex_Matrix" at > ada_lapack.ads:69, instance at line 24--- > > The Complex_Matrix type defined in G.3.2 complex vectors and matrices > of the ARM can do addition + operations. The Complex_Matrix as > defined in ada_lapack.ads:69 seems different. They are indeed different types. The standard package Ada.Numerics.Generic_Complex_Arrays provides the "+" operator (and several other operators) but ada_lapack.ads does not. If you want a "+" for Ada_Lapack.Complex_Matrix, you must define one yourself, either in ada_lapack.ads/adb (best option) or in your own code. You code the "+" function just like any other Ada function, except that its name is "+": function "+" (Left, Right : Complex_Matrix) return Complex_Matrix is begin ... end "+"; -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .