org.jmodelica.modelica.compiler.Indices Class Reference

Indices represents the set of array indices in each dimension. More...

Inheritance diagram for org.jmodelica.modelica.compiler.Indices:

org.jmodelica.modelica.compiler.NonConsecutiveIndices

List of all members.

Classes

class  IIndex
 Internal implementation of Index. More...
class  IIterator
 Iterates over all indices spanned by this Indices. More...

Public Member Functions

boolean isValid (Index i)
 Check that i is valid for this Indices object.
Iterator< Indexiterator ()
 Returns an Iterator, that iterates over all indices spanned by this Indices object.
int numElements ()
 Returns the number of elements spanned by this Indices object.
int ndims ()
 Returns the number of dimensions spanned by this Indices object.
Size size ()
 Returns the size of this Indices object in each dimension.
Index translate (Index i)
 Translates an Index to the corresponding Index in the underlying expression.

Static Public Member Functions

static Indices create (Size size)
 Create an Indices object based on array sizes.
static Indices createFromFas (FArraySubscripts fas)
 Create an Indices object based on FArraySubcripts.
static Indices createFromFas (ArrayList< FArraySubscripts > fasl)
 Create an Indices object based on a list of FArraySubcripts.
static Indices create (ArrayList< int[]> ind)
 Create an Indices object based on a list of int arrays.
static Indices create (Iterable<?extends CommonForIndex > forIndices)
 Create an Indices object based on a list of CommonForIndexes.

Protected Member Functions

 Indices (Size size)
 Internal constructor to create an Indices object based on array sizes.
int internal (Index i)
 Calculate the internal index in an Array that spans this Indices.

Protected Attributes

int ndims
Size size
int hash
 A perfect hash for all Indices that have consecutive indicies, ndims <= 3 and size[i] <= 1023 for 0 <= i < ndims.


Detailed Description

Indices represents the set of array indices in each dimension.

Only supports indices of the form (1..n1, 1..n2, ... , 1..nk). See NonConsecutiveIndices.

New Indices objects should be created with the create() methods. The subclass used is selected automatically.

The Indices class is typically used to iterate over all possible indices of an array access of declaration. class :0


Constructor & Destructor Documentation

org.jmodelica.modelica.compiler.Indices.Indices ( Size  size  )  [protected]

Internal constructor to create an Indices object based on array sizes.


Member Function Documentation

static Indices org.jmodelica.modelica.compiler.Indices.create ( Iterable<?extends CommonForIndex forIndices  )  [static]

Create an Indices object based on a list of CommonForIndexes.

static Indices org.jmodelica.modelica.compiler.Indices.create ( ArrayList< int[]>  ind  )  [static]

Create an Indices object based on a list of int arrays.

static Indices org.jmodelica.modelica.compiler.Indices.create ( Size  size  )  [static]

Create an Indices object based on array sizes.

static Indices org.jmodelica.modelica.compiler.Indices.createFromFas ( ArrayList< FArraySubscripts fasl  )  [static]

Create an Indices object based on a list of FArraySubcripts.

Reimplemented in org.jmodelica.modelica.compiler.NonConsecutiveIndices.

static Indices org.jmodelica.modelica.compiler.Indices.createFromFas ( FArraySubscripts  fas  )  [static]

Create an Indices object based on FArraySubcripts.

Reimplemented in org.jmodelica.modelica.compiler.NonConsecutiveIndices.

int org.jmodelica.modelica.compiler.Indices.internal ( Index  i  )  [protected]

Calculate the internal index in an Array that spans this Indices.

boolean org.jmodelica.modelica.compiler.Indices.isValid ( Index  i  ) 

Check that i is valid for this Indices object.

Iterator<Index> org.jmodelica.modelica.compiler.Indices.iterator (  ) 

Returns an Iterator, that iterates over all indices spanned by this Indices object.

Returns the number of dimensions spanned by this Indices object.

int org.jmodelica.modelica.compiler.Indices.numElements (  ) 

Returns the number of elements spanned by this Indices object.

Returns the size of this Indices object in each dimension.

Index org.jmodelica.modelica.compiler.Indices.translate ( Index  i  ) 

Translates an Index to the corresponding Index in the underlying expression.

Default implementation always returns i.

Reimplemented in org.jmodelica.modelica.compiler.NonConsecutiveIndices.


Member Data Documentation

A perfect hash for all Indices that have consecutive indicies, ndims <= 3 and size[i] <= 1023 for 0 <= i < ndims.

-1 for other Indices.


The documentation for this class was generated from the following file:

Generated on Fri Oct 7 14:50:38 2011 for JModelica.org by  doxygen 1.5.8