Blitz logo

Blitz Support :

From: Robert M Dorazio (bob_dorazio_at_[hidden])
Date: 2004-12-23 07:43:12


This seems to be a recurring question on the Blitz support mailing list, so
I am posting a previous reply:

The enclosed file "Extract.h" contains source code for extracting the
elements of a 1D Array or of a row or column of a 2D Array using an integer
array or a boolean array to index the elements to be extracted. I make no
claims about the code's efficiency, but it does work. The enclosed file
"driver.cc" provides examples of how the function extract() may be used.

Bob Dorazio

(See attached file: driver.cc)(See attached file: Extract.h)

******************************************************************************

Bob Dorazio
United States Geological Survey
7920 NW 71 Street
Gainesville, Florida 32653
Phone: (352) 264-3533
Internet: http://cars.er.usgs.gov/All_Staff/all_staff.html

|---------+------------------------------------>
| | Faheem Mitha |
| | <faheem_at_[hidden]> |
| | Sent by: |
| | blitz-support-bounces_at_oon|
| | umerics.org |
| | |
| | |
| | 12/22/2004 06:11 PM |
| | Please respond to Support|
| | list for Blitz++ |
| | |
|---------+------------------------------------>
>---------------------------------------------------------------------------------------------------------|
  | |
  | To: Support list for Blitz++ <blitz-support_at_[hidden]> |
  | cc: |
  | Subject: [Blitz-support] subarrays with arbitary index values |
>---------------------------------------------------------------------------------------------------------|

Hi,

I'm need to get subarrays (or possibly slices) of an array, but the index
values need to be arbitrary. In other words, not necessarily a set of
regularly spaced index values like Range objects.

According to the documentation this is not supported but perhaps I am
missing something. Can anyone suggest a method for doing this, or do I
need to write my own function for doing so?

Thanks in advance. Faheem.
_______________________________________________
Blitz-support mailing list
Blitz-support_at_[hidden]
http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support