ucar.multiarray
Class FlattenMap

java.lang.Object
  extended by ucar.multiarray.ConcreteIndexMap
      extended by ucar.multiarray.FlattenMap
All Implemented Interfaces:
IndexMap

public class FlattenMap
extends ConcreteIndexMap

Use with MultiArrayProxy to reduce apparent rank by merging adjacent dimensions. The total number of elements remains constant.

This framework doesn't really support this operation very well. See caveats in get()

See Also:
IndexMap, MultiArrayProxy

Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.multiarray.ConcreteIndexMap
ConcreteIndexMap.ZZMap
 
Field Summary
 
Fields inherited from class ucar.multiarray.ConcreteIndexMap
iMap_, lengthsMap_
 
Constructor Summary
FlattenMap(ConcreteIndexMap prev, int position)
          Create an ConcreteIndexMap which merges two adjacent dimensions.
FlattenMap(int position)
          Create an ConcreteIndexMap which merges two adjacent dimensions.
 
Method Summary
static void main(java.lang.String[] args)
           
 
Methods inherited from class ucar.multiarray.ConcreteIndexMap
getLengths, getOutputLength, getRank, getTransformed, init, init, link, link, setInput, setLengths, toString, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FlattenMap

public FlattenMap(int position)
Create an ConcreteIndexMap which merges two adjacent dimensions. Using this in an MultiArrayProxy will result in the a MultiArray of one less rank.

Parameters:
position - this dimension and dimension (position +1) will appear as a single dimension.

FlattenMap

public FlattenMap(ConcreteIndexMap prev,
                  int position)
Create an ConcreteIndexMap which merges two adjacent dimensions. Using this in an MultiArrayProxy will result in the a MultiArray of one less rank.

Parameters:
prev - ConcreteIndexMap to be composed with this.
position - this dimension and dimension (position +1)
Method Detail

main

public static void main(java.lang.String[] args)