comp.lang.ada
 help / color / mirror / Atom feed
From: darek <darek.maksimiuk@gmail.com>
Subject: Re: how to copy complete column (or row) of matrix to another?
Date: Sat, 9 Sep 2017 15:33:38 -0700 (PDT)
Date: 2017-09-09T15:33:38-07:00	[thread overview]
Message-ID: <d8e7d93e-2326-4e7e-b0c2-4c9fc09e1281@googlegroups.com> (raw)
In-Reply-To: <oolo0a$1djr$1@gioia.aioe.org>

On Tuesday, 5 September 2017 10:41:49 UTC+2, Nasser M. Abbasi  wrote:
> 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?
> 
> Here is a toy example. I want to copy one matrix
> to another using a loop (to see if this is allowed)
> 
> --------------------------
> procedure t1 is
>     type Matrix is array (Integer range <>, Integer range <>) of Integer;
>     A : Matrix  :=
>             (( 1,  2,  3),
>             (  4,  5,  6),
>             (  7,  8,  9));
>     B: Matrix(1..3,1..3);
> begin -- copy A to B one row at a time
> 
>     FOR I in A'range(1) LOOP
>         B(I,1..3):=A(I,1..3); -- error at this line
>     END LOOP;
> 
> end t1;
> ---------------------
> 
> 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?
> 
> Using gnat 2017
> 
> thanks
> --Nasser

It is not Ada but ...
Have a look at this article: 
http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=FF8CA42FE18D109BFC4798DF3BB91926?doi=10.1.1.205.9658&rep=rep1&type=pdf

These extensions have been implemented in the  ActiveOberon language running under the A2 operating system (which can run natively, under Windows, under Linux). You can get the whole system here: 
http://www.ocp.inf.ethz.ch/wiki/Development/Repository
The user forum is here:
 http://www.ocp.inf.ethz.ch/forum/

The ActiveOberon language supports COMPLEX/LONGCOMPLEX data types natively.

Regards,
 Darek 
 

  parent reply	other threads:[~2017-09-09 22:33 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
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 [this message]
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