From: "Nicholas Collin Paul de Glouceſter" <Colin_Paul_Gloster@ACM.org>
Subject: Re: Incorrect error?
Date: Mon, 18 Jul 2011 10:39:55 +0000
Date: 2011-07-18T10:39:55+00:00 [thread overview]
Message-ID: <alpine.LNX.2.00.1107181031510.3546@Bluewhite64.example.net> (raw)
In-Reply-To: <4e23f350$0$2573$703f8584@news.kpn.nl>
L. Dries <bertus.dries@Planet.NL> 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.
next prev parent reply other threads:[~2011-07-18 10:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-18 8:47 Incorrect error? ldries46
2011-07-18 9:45 ` stefan-lucks
2011-07-18 10:10 ` Georg Bauhaus
2011-07-18 11:46 ` ldries46
2011-07-18 10:40 ` AdaMagica
2011-07-18 12:39 ` Dmitry A. Kazakov
2011-07-18 12:45 ` stefan-lucks
2011-07-18 13:24 ` stefan-lucks
2011-07-18 10:39 ` Nicholas Collin Paul de Glouceſter [this message]
2011-07-18 15:58 ` Adam Beneschan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox