
ArrayExtract |
ptolemy.actor.lib.ArrayExtract |
Extract a subarray from an array. This actor reads an array from the
input port and sends a subarray to the output
port, possibly padded with zeros. The segment of the input array
starting at sourcePosition with length extractLength is
copied to the output array, starting at destinationPosition.
The total length of the output array is outputArrayLength.
Any of its entries that are not supplied by the input have value
zero (of the same type as the entries in the input array).
With the default values of the parameters, only the first element
of the input array is copied to the output array, which has length one.
Author(s): Edward A. Lee, Elaine Cheong
Version:$Id: ArrayExtract.java,v 1.25 2005/10/28 20:14:31 cxh Exp $
Pt.Proposed Rating:Green (celaine)
Pt.Accepted Rating:Green (cxh)
sourcePosition
The index into the input array at which to start copying.
This is a non-negative integer that defaults to 0, and is
required to be less than the length of the input array.
extractLength
The length of the segment of the input array that is copied
to the output. This is a non-negative integer that defaults
to 1. The sum of it and the sourcePosition is
required to be less than or equal to the length of the input array.
destinationPosition
The index into the output array at which to start copying.
This is a non-negative integer that defaults to 0, and is
required to be less than the length of the output array.
outputArrayLength
The total length of the output array.
This is a non-negative integer that defaults to 1. It is
required to be at least destinationPosition plus
extractLength.