comp.lang.ada
 help / color / mirror / Atom feed
From: "Nasser M. Abbasi" <nma@12000.org>
Subject: Re: unconstrained subtype in component declaration, tagged OO
Date: Sat, 26 Mar 2011 15:50:17 -0700
Date: 2011-03-26T15:50:17-07:00	[thread overview]
Message-ID: <imlqjf$b7m$1@speranza.aioe.org> (raw)
In-Reply-To: 1v6bdfssnx5jd$.1k5a6782kgvu5.dlg@40tude.net

On 3/26/2011 1:42 PM, Dmitry A. Kazakov wrote:

>> -------------------foo.ads-------
>> package foo is
>>      type foo_t is tagged private;

>
>     type foo_t (<>) is tagged private;
>

Thanks Dmitry, that is one I did not find, the use of (<>) there.

It is now all working well.

I also like that I can write  o.method() now in Ada and do not
have to write method(o) as before.

I am converting some of my Matlab functions and scripts for
solving PDE's to Ada to see how it works out. So far, it is
working very well. I really like the Ada array predefined
operators, very useful. Also I like that I can define my array
to start from 0 or other index values and not only from 1.

Some numerical schemes I use are more natural when using starting
anindex other than from 1.

Only problem is plotting the solution. So far, I write the
data from one simulation run to one text file and then use Matlab
to load and plot the data at the end of the simulation. Works well,
but data size can get very large, and when I load it to Matlab, it
requires lots of RAM.

This is because I have to save the data for each time step to be able
to create all the plots.

In Matlab, I do not need to save all the data, since I can plot each
frame as I go, and then throw the current data away, and hence only
need the data (solution) for the current time step.

I might figure a way to improve this, as may be using one text file to
save the output for each time step. But then I will get huge number
of files created on my disk each time I run the program. Sometimes I
run it for 2000 or 3000 time steps, each time step can generate 1000
data points.

If Only Ada had plotting in it, it will be just perfect :)

--Nasser



  reply	other threads:[~2011-03-26 22:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-26 20:24 unconstrained subtype in component declaration, tagged OO Nasser M. Abbasi
2011-03-26 20:42 ` Dmitry A. Kazakov
2011-03-26 22:50   ` Nasser M. Abbasi [this message]
2011-03-27  3:23     ` John B. Matthews
2011-03-27  9:42     ` Dmitry A. Kazakov
2011-03-27 20:58       ` Nasser M. Abbasi
replies disabled

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