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: 103376,46f8241fa721a139 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feeds.phibee-telecom.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Question on procedure parameter style Date: Thu, 23 Dec 2010 20:38:44 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx03.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="12752"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ufhx6uPLEiK08rxMNw4XiJ61Y4+lIOZM=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:QaZhEUQYkrzDkSmF7pn+lb/+tOM= sha1:WQ0Hb00uUjsDwFD79j/aErH7Wjs= Xref: g2news1.google.com comp.lang.ada:16117 Date: 2010-12-23T20:38:44+00:00 List-Id: Simon Wright writes: > My question is, what do people think about this way of returning the > eigenvalues (in Alphas & Betas)? An alternative would be to declare > types > > type Real_Eigenvalue is record > Alpha : Complex; > Beta : Real; > end record; > type Real_Eigenvalue_Vector > is array (Integer range <>) of Real_Eigenvalue; > > and replace the Alphas and Betas 'out' parameters by > > Values : out Real_Eigenvalue_Vector; > > but then I have the problem that for the complex generalized eigenvalue > problem I'd have to write > > type Complex_Eigenvalue is record > Alpha : Complex; > Beta : Complex; > end record; > type Complex_Eigenvalue_Vector > is array (Integer range <>) of Complex_Eigenvalue; I've now read up on this at http://en.wikipedia.org/wiki/Generalized_eigenvalue_problem#Generalized_eigenvalue_problem, and there's a hint there that lambda is in fact complex. So I think I'll go with type General_Eigenvalue is record Alpha : General; Beta : General; end record; type General_Eigenvalue_Vector is array (Integer range <>) of General_Eigenvalue; for both the Real and the Complex problem. Also, instead of Generalized_Eigensystem, the procedure will be called just Eigensystem (another overloading).