comp.lang.ada
 help / color / mirror / Atom feed
From: Ada novice <posts@gmx.us>
Subject: Re: Interfacing Ada with C
Date: Sun, 1 Aug 2010 02:36:03 -0700 (PDT)
Date: 2010-08-01T02:36:03-07:00	[thread overview]
Message-ID: <0fb0420f-ca2a-4904-921c-e279aecc8d5e@k8g2000prh.googlegroups.com> (raw)
In-Reply-To: m2y6crbc1d.fsf@pushface.org

On Jul 31, 11:02 pm, Simon Wright <si...@pushface.org> wrote:

> Was this perhaps with the ada-numerics* files? there may be some -gnatpg
> problem with inconsistent line terminators, I guess GPS is clever enough
> to know that it's going to be anuisance and fix it.

Once I had a similar problem with another adb or ads file which I got
from the web a few weeks back. The problem was then with GPS and not
with AdaGIDE. As GPS was complaining, what I did afterwards was to
save the "raw text" into
AdaGIDE and I didn't get any complain when compiling the file into
GPS after that. Is that because a raw text can be using a different
end of line
marker? The file encoding that's being used in an editor may be
different and not pure ASCII. In any case, one can always play around
and save the raw files in Notepad on Windows or in another editor like
WinEdt also.

> > I didn't add -gnatpg for the compiler switch. I had these: -gnatqQ -
> > gnat05 and I can compile fine and output the results. Is the -gnatpg a
> > necessity?
> Yes *but only in the src/ directory*, which is why it's in
> ada_math_build.gpr & not in test_extensions.gpr.
> This is part of a clean compile...
>    gcc -c -g -fPIC -gnatpg -gnatqQ -gnat05 -I- -gnatA /Users/simon/gnat-math-extn/src/ada-numerics-generic_complex_arrays-extensions.adb
>    gcc -c -g -gnatqQ -gnat05 -I- -gnatA /Users/simon/gnat-math-extn/test/test_extensions.adb
> and the first line, for the library, has the additional flags -fPIC
> (because, on this architecture, you need position-independent code for a
> shared library) and -gnatpg (from ada_math_build.gpr, as discussed).

Thanks for the explanation.

> > Thanks very much for helping me with the compilation. Now it's good
> > that some more testing is done on different cases. Do you plan to add
> > the output for eigenvectors also?
> Seemed like a plan! Also real non-symmetric, I think.
> I found the LAPACK test suite described here -http://www.netlib.org/lapack/lawns/lawn41.ps- could be useful though it
> could also be a pain to translate.

A long-term goal might perhaps be to be able to solve the generalized
eigenvalue problem. See for example here:

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/eig.html

Now, the code has a function like (from the link above)

eig(A) returns a vector of the eigenvalues of matrix A.

In engineering, for example in vibration analysis, one is more
interested in the generalized eigenvalue problem (from the above link)

eig(A,B) returns a vector containing the generalized eigenvalues, if A
and B are square matrices.

In vibration analysis, matrices representing the mass, stiffness and
damping of a structure are readily formed from a model of the real-
life structure. When the generalized eigenvalue problem is solved,
then the eigenvalues give the resonances of the structure i.e.
frequencies at which large vibration occur. Normally only the first
few eigenvalues are of interest as they represent those resonant
frequencies that can give the most damage to the structure. The
corresponding eigenvectors represent then the relative displacements
between different locations of the structure at a given resonant
frequency and give a general idea how the structure is deformed at a
given resonant frequency (or eigenvalue). The eigenvectors don't give
the actual displacements but only an indication of how the different
parts of the structure will deform in relation to each other. Actual
magnitude of displacements can only be obtained under actual testing
when a force is applied to the structure. Of course the mass,
stiffness
and damping matrix are real matrices (but not necessarily symmetric).

Some information on the algorithm is found here in the IMSL C user
guide:

http://www.vni.com/products/imsl/documentation/CNL700_Docs/html/cmath...

in Chapter 2: Eigensystem analysis (on the left of the page and expand
the chapter to get the different sections) at the bottom of the
section "Usage notes", and in the sections eig_symgen, geneig.
There's
the section: genig (complex) where both A and B are complex but I
don't have a
clue where this can be used in engineering. It may be more of
relevance to mathematicians though.
But these are very complex algorithms. Your link to lawn41.ps also has
some information.
And as you said, this can be a pain to translate.

YC



  reply	other threads:[~2010-08-01  9:36 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-24 11:57 Interfacing Ada with C Ada novice
2010-07-24 12:08 ` Robert A Duff
2010-07-24 12:32   ` Ada novice
2010-07-24 14:52   ` Marco
2010-07-24 16:38 ` Simon Wright
2010-07-24 17:58   ` Ada novice
2010-07-25  8:29     ` Simon Wright
2010-07-25 12:21       ` Ada novice
2010-07-25 13:50         ` Dmitry A. Kazakov
2010-07-25 14:12           ` Ada novice
2010-07-25 14:17             ` Ada novice
2010-07-25 14:26               ` Simon Wright
2010-07-25 16:18                 ` Ada novice
2010-07-25 17:06                   ` Dmitry A. Kazakov
2010-07-25 17:42                     ` Ada novice
     [not found]                     ` <a5ba4513-ce2b-45d1-a5f4-ff1a7945b0b0@q12g2000yqj.googlegroups.com>
2010-07-25 18:26                       ` Dmitry A. Kazakov
2010-07-25 18:52                         ` Ada novice
2010-07-25 18:58                           ` Dmitry A. Kazakov
2010-07-25 19:13                             ` Ada novice
2010-07-25 19:19                               ` Dmitry A. Kazakov
2010-07-25 19:28                                 ` Ada novice
2010-07-25 20:04                                   ` Dmitry A. Kazakov
2010-07-26 13:40                                     ` Ada novice
2010-07-26 14:52                                       ` Dmitry A. Kazakov
2010-07-26 17:14                                         ` Ada novice
     [not found]                                         ` <a2da2804-c19b-44cf-9855-834c602c4520@y11g2000yqm.googlegroups.com>
2010-07-26 17:32                                           ` Dmitry A. Kazakov
2010-07-26 17:50                                             ` Ada novice
2010-07-27 12:24                                               ` Peter Hermann
2010-07-27 19:01                                                 ` Ada novice
2010-07-28  9:56                                                   ` team-ada (was e: " Peter Hermann
2010-07-27  5:50                     ` Ada novice
2010-07-27  7:27                       ` Dmitry A. Kazakov
2010-07-27  7:43                         ` Georg Bauhaus
2010-07-27 18:37                           ` Ada novice
2010-07-27 18:40                         ` Ada novice
2010-07-25 17:24                   ` Simon Wright
2010-07-25 17:47                     ` Simon Wright
2010-07-25 17:58                       ` Ada novice
2010-07-25 23:21         ` Simon Wright
2010-07-26  1:24           ` John B. Matthews
2010-07-26 14:01           ` Ada novice
2010-07-26 15:46           ` sjw
     [not found]           ` <da987804-3948-4871-ab52-4a8e95f06d44@k39g2000yqb.googlegroups.com>
2010-07-26 19:46             ` Simon Wright
2010-07-26 20:39               ` Dmitry A. Kazakov
2010-07-27  5:46                 ` Ada novice
2010-07-27  5:43               ` Ada novice
2010-07-27 17:33                 ` Simon Wright
2010-07-27 18:34                   ` Ada novice
2010-07-28 22:26               ` Simon Wright
2010-07-29  9:19                 ` Ada novice
2010-07-29 19:14                   ` Simon Wright
2010-07-29 20:25                     ` Ada novice
2010-07-30  1:46                     ` John B. Matthews
2010-07-30  9:09                       ` sjw
2010-07-30 12:41                         ` Ada novice
2010-07-30 15:13                           ` John B. Matthews
2010-07-30 17:25                             ` Ada novice
2010-07-30 19:41                               ` John B. Matthews
2010-07-30 21:08                                 ` Ada novice
2010-07-30 22:19                                   ` Simon Wright
2010-07-31 12:19                                     ` Ada novice
2010-07-31 13:25                                       ` Simon Wright
2010-07-31 19:39                                         ` Ada novice
2010-07-31 21:02                                           ` Simon Wright
2010-08-01  9:36                                             ` Ada novice [this message]
2010-08-01 16:14                                               ` Simon Wright
2010-08-01 16:27                                                 ` Ada novice
2010-08-01 17:33                                                   ` Simon Wright
     [not found]                                     ` <997036dd-ca13-4cdf-8f88-9b47a9f83b2d@s9g2000yqd.googlegroups.com>
2010-07-31 13:08                                       ` Simon Wright
2010-07-31 13:17                                         ` Simon Wright
2010-07-30 15:10                         ` John B. Matthews
2010-08-01 10:47                 ` John B. Matthews
2010-08-01 17:08                   ` Simon Wright
2010-08-02  1:08                     ` John B. Matthews
2010-08-02 16:36                       ` Simon Wright
2010-08-02 16:55                         ` Ada novice
2010-08-05  9:14                           ` Ada novice
2010-08-05 13:23                             ` John B. Matthews
2010-08-05 13:57                               ` sjw
2010-08-05 17:24                                 ` Ada novice
2010-08-05 17:59                                   ` Jeffrey Carter
2010-08-05 20:25                                     ` Simon Wright
2010-08-06  1:15                                       ` John B. Matthews
2010-08-06  9:11                                       ` Ada novice
2010-08-06  9:17                                     ` Ada novice
2010-08-06  8:04                                   ` Jacob Sparre Andersen
2010-08-06  8:42                                     ` Dmitry A. Kazakov
2010-08-06  9:26                                       ` Ada novice
2010-08-06  9:51                                         ` Dmitry A. Kazakov
2010-08-06 12:04                                           ` Ada novice
2010-08-06 16:49                                       ` Simon Wright
2010-08-06 17:27                                         ` Dmitry A. Kazakov
2010-08-06 18:15                                           ` Ada novice
2010-08-06 20:26                                           ` Simon Wright
2010-08-07  0:46                                             ` John B. Matthews
2010-08-07  7:59                                               ` Dmitry A. Kazakov
2010-08-07  9:09                                               ` Georg Bauhaus
2010-08-07 12:33                                                 ` John B. Matthews
2010-08-06  9:49                                     ` Peter Hermann
2010-08-06 12:03                                       ` Ada novice
2010-08-07  4:07                                         ` Randy Brukardt
2010-08-07  8:10                                           ` Ada novice
2010-08-06 16:41                                     ` Simon Wright
2010-08-06  8:39                                   ` sjw
2010-07-24 16:44 ` Dmitry A. Kazakov
2010-07-24 18:04   ` Ada novice
2010-07-24 19:16     ` Dmitry A. Kazakov
2010-07-25  0:22     ` tmoran
  -- strict thread matches above, loose matches on Subject: below --
2003-04-14 21:39 Paul Anderson
2003-04-14 23:05 ` tmoran
2003-04-16  2:56 ` Steve
2003-04-16  4:25   ` Steve
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox