From -2650908176151515718
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,94e9c2bbb0060b48
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-09-02 01:15:05 PST
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Delivered-To: std-c++@ncar.ucar.edu
Message-ID: <3D7300EE.8030504@animats.com>
From: John Nagle <nagle@animats.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1
X-Accept-Language: en-us
MIME-Version: 1.0
Newsgroups: comp.std.c++
Subject: Re: Proposals for small vectors?
References: <87d6rxwoti.fsf@grue.ucsd.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@prodigy.net
X-Trace: newssvr21.news.prodigy.com 1030946843 ST000 64.166.226.187 (Mon, 02 Sep 2002 02:07:23 EDT)
NNTP-Posting-Date: Mon, 02 Sep 2002 02:07:23 EDT
Organization: Prodigy Internet http://www.prodigy.com
X-UserInfo1: FKPO@SBE[JTIRVX[]BCD^VX@WB]^PCPDLXUNNHLHEQR@ETUCCNSKQFCY@TXDX_WHSVB]ZEJLSNY\^J[CUVSA_QLFC^RQHUPH[P[NRWCCMLSNPOD_ESALHUK@TDFUZHBLJ\XGKL^NXA\EVHSP[D_C^B_^JCX^W]CHBAX]POG@SSAZQ\LE[DCNMUPG_VSC@VJM
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Date: Mon,  2 Sep 2002 03:12:59 CST
Lines: 63
Xref: archiver1.google.com comp.std.c++:13546

Walter Landry wrote:

> Noah Stein wrote:
> 
>>"Walter Landry" <wlandry@ucsd.edu> wrote in message
>>
>>>Another thing that I should mention is that this tensor notation
>>>solves the problem of what happens when you multiply two vectors
>>>together.  Does U*V give an inner product, an outer product, or a
>>>cross product?  Tensor notation makes it clear which one is happening.
>>>
>>Yes, tensor notation succinctly states what is going on in the vector
>>operation; however, it doesn't solve the poster's original problem.  The
>>original poster's problem wasn't that he couldn't remember the operation
>>being performed, his problem is that he couldn't know at the code-time which
>>variation of vectors he was using: row-major or column-major.  Different
>>graphics APIs use different layouts.  He wouldn't know until
>>compilation-time which format was used, thus, he suggested that V*M would
>>transparently become M*V for those environments that were of the opposite
>>orientation.  It's nice for graphics, but as I already said, I think it's a
>>very dangerous construct as presented.
>>
> 
> Ah, I see what is going on.  This is why John Nagle's valmatrix code
> allows column-major or row-major storage, depending on a template
> parameter.  Certainly that could be added to the tensor code, it just
> isn't there now.  Patches always welcome.


    Yes.  My point was not that I wanted to change the meaning of
operations.  It's that I wanted the ability to change the
underlying representation easily to match lower-level APIs.
Users of these objects don't see the underlying representation
unless they explicitly ask for it.

    I'm also trying not to get sucked into the "POD" morass.
My general position is that these small matrix/vector objects
need not be PODs, but should, on request, return a pointer to
a POD.  Think of how STL "string" offers a ".data()" member
function, which returns a C string.

    This is all very practical; it's about making up the
matrices that graphics and game APIs need.  The motivation
behind all this is that there are many libraries that use
order 2, 3, and 4 vectors and matrices, many applications
use more than one of these libraries, and lack of standarization
prevents these libraries from interoperating cleanly.

    (For example, I have an application which has a graphics
API, an interface to an animation system, a collision detection
system, a convex hull system, and a physics system, all of which
have incompatible representations for small vectors and matrices.
This is all too common in game, animation, and simulation work.)

					John Nagle
					Animats

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



