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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,ad3b8638a6e09884 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Nicholas_Collin_Paul_de_Glouce=C5=BFter?= Newsgroups: comp.lang.ada Subject: Re: Incorrect error? Date: Mon, 18 Jul 2011 10:39:55 +0000 Organization: A noiseless patient Spider Message-ID: References: <4e23f350$0$2573$703f8584@news.kpn.nl> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Injection-Info: mx04.eternal-september.org; posting-host="kheEuXGHhE2Z5eF1gAST+A"; logging-data="29666"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+On6Mx8Ec8j4QPDTcV45YGxRBzkYUrAhbEcTjIMsFxGg==" User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) In-Reply-To: <4e23f350$0$2573$703f8584@news.kpn.nl> Cancel-Lock: sha1:2HgmoBiyeUnDV8Wmof22/92UwuM= X-X-Sender: Colin_Paul@Bluewhite64.example.net Xref: g2news2.google.com comp.lang.ada:21185 Date: 2011-07-18T10:39:55+00:00 List-Id: L. Dries sent on July 18th, 2011: |--------------------------------------------------------------------------------| |"I'm using Ada.Numerics.Generic_Real_Arrays. While Compiling I got the following| |error message: | | | |65:21 expected type "Ada.Numerics.Generic_Real_Arrays.Real_Vector" from | |instance at line 6 | |65:21 found type "Ada.Numerics.Generic_Real_Arrays.Real_Matrix" from | |instance at line 6 | | | |As can be seen Cross, a and b declared as Real_Vector . | |What do I do wrong? | | | |L. Dries | | | |[..] | | a : Real_Vector(0 .. 2); | | b : Real_Vector(0 .. 2); | |[..] | | cross : Real_Vector(0 .. 2); | |[..] | | a := X1 - X0; -- VecSub( a, X1, X0 ); | | b := X2 - X0; -- VecSub( b, X2, X0 ); | | Cross := a * b; -- VecCross( a, b, Cross ); <---------------- line 65 the | |cursor is standing just before * | |[..]" | |--------------------------------------------------------------------------------| The product of a 3x1 vector and a 1x3 vector is a 3x3 matrix. The product of a 3x1 vector and a 3x1 vector can not exist. You are trying to assign a 2d matrix (that is a * b) to a variable declared to be a 1d vector.