comp.lang.ada
 help / color / mirror / Atom feed
From: "Nasser M. Abbasi" <nma@12000.org>
Subject: Re: how to copy complete column (or row) of matrix to another?
Date: Tue, 5 Sep 2017 18:10:23 -0500
Date: 2017-09-05T18:10:23-05:00	[thread overview]
Message-ID: <oonat2$crh$1@gioia.aioe.org> (raw)
In-Reply-To: oon9f2$ejs$1@franka.jacob-sparre.dk

On 9/5/2017 5:45 PM, Randy Brukardt wrote:
> "Nasser M. Abbasi" <nma@12000.org> wrote in message
> news:oolo0a$1djr$1@gioia.aioe.org...
>> I have not programmed in Ada for long time. I forgot now if
>> Ada supports copying whole column or whole row of 2D matrix
>> in one operation or not?
> 
> No, that's not supported. It would be a distributed overhead to allow (that
> is, it would make all 2D operations slower), as the components of a slice
> would not necessarily be contiguous.
> 
> In some cases, it makes more sense to declare a 1D array of a 1D array. Then
> you can slice the arrays. (That wouldn't make much sense for a true matrix;
> that's not something I use much, so most of my types tend to be arrays of
> arrays.)
> 
> ...
>> I see old thread that slicing is not allowed for matrix?
>>
>> https://groups.google.com/forum/#!topic/comp.lang.ada/vwPXMabvUR8
>> "Copying rows in a two dimensional array."
>>
>> Is this the reason for the error I get or Am I doing something
>> silly in the above?
> 
> Yup. (Both statements are true. ;-)
> 
>                          Randy.
> 


Thank you Randy for the answer. Ok. I understand. But
this unfortunately takes Ada out of possible languages
to use for me for now. I am planning to take numerical
course where we have choice to use Fortran or Matlab or
another language, but without being able to do such
common operations on matrices, (without writing
much more code) I will now look at using Fortran
or Matlab for this.

Too bad, because Ada is good language in terms of its
strong typing and other features, which I think will
make numerical software more robust, but it has little
support for many common operations build-in for working
with matrices and vectors as Fortran and Matlab already
has.

Someone should design a solid Ada like language but
with focus on numerical and computational work. That
will be a winner.

--Nasser


  reply	other threads:[~2017-09-05 23:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05  8:41 how to copy complete column (or row) of matrix to another? Nasser M. Abbasi
2017-09-05 22:45 ` Randy Brukardt
2017-09-05 23:10   ` Nasser M. Abbasi [this message]
2017-09-06  5:34     ` faryumg
2018-03-21 13:58       ` Marius Amado-Alves
2018-03-30 21:25         ` gerdien.de.kruyf
2017-09-06  7:17     ` Simon Wright
2017-09-06  7:31   ` Dmitry A. Kazakov
2017-09-09 22:33 ` darek
2017-09-09 22:48 ` darek
2017-09-12 12:57   ` Lucretia
2017-10-02 23:08     ` Randy Brukardt
2017-09-12 21:22 ` Johan Söderlind Åström
2017-09-17 12:01 ` Robert Eachus
replies disabled

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