slicing bidimensional arrays

This is a discussion on slicing bidimensional arrays within the ADA forums in Programming Languages category; 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 ...

Go Back   Application Development Forum > Programming Languages > ADA

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-08-2008, 11:26 AM
amado.alves@gmail.com
Guest
 
Default slicing bidimensional arrays

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.
Reply With Quote
  #2  
Old 08-09-2008, 10:16 AM
Brian Drummond
Guest
 
Default Re: slicing bidimensional arrays

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

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 02:08 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.