comp.lang.ada
 help / color / mirror / Atom feed
* slicing bidimensional arrays
@ 2008-08-08 15:26 amado.alves
  2008-08-09 14:16 ` Brian Drummond
  0 siblings, 1 reply; 2+ messages in thread
From: amado.alves @ 2008-08-08 15:26 UTC (permalink / raw)


I want to slice a bidimensional array. Or extract/view a row thereof
as a unidimensional array (of the same component type of course). This
is illegal in Ada. So I am designing a slicer/extractor/viewer
subprogram. The arrays can be large, so I want to approximate the
efficiency of view conversions. I'd appreciate confirmation/
infirmation of the following premises.

The internal representation of a bidimensional array is one row after
the other sans separators.
This representation equates that of a unidimensional array (of the
same component type).
All this excluding the range information of course, i.e. looking only
at the data part.
So we can safely (unchecked?) convert between the two array types.

Thanks a lot.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: slicing bidimensional arrays
  2008-08-08 15:26 slicing bidimensional arrays amado.alves
@ 2008-08-09 14:16 ` Brian Drummond
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Drummond @ 2008-08-09 14:16 UTC (permalink / raw)


On Fri, 8 Aug 2008 08:26:42 -0700 (PDT), amado.alves@gmail.com wrote:

>I want to slice a bidimensional array. Or extract/view a row thereof
>as a unidimensional array (of the same component type of course). This
>is illegal in Ada. 

Barnes ("Programming in Ada 2005") discusses some interesting
possibilities for slicing - not using a 2-D array, but an array of
arrays. The array can be sliced; as can each individual array. I don't
know if this would help in your situation, but it is another tool in the
box.

- Brian




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-09 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-08 15:26 slicing bidimensional arrays amado.alves
2008-08-09 14:16 ` Brian Drummond

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