Ejemplo n.º 1
0
  // grabs c
  CArrayIndexIndexed( BaseGDL* c, bool strictArrSubs_ = false)
  : strictArrSubs( strictArrSubs_)
  , ix( NULL), ixDim( NULL)
  , rawData( c)
  {
    assert( rawData != NULL);
    
    if( rawData->Rank() == 0) // type ONE
    {
      rawData->Scalar2RangeT(sInit);
      s = sInit; // in case of assoc NIter is not called
      isScalar = true;
      return;
    }

    // type INDEXED
    isScalar = false;;
    
    ixDim = &rawData->Dim();

    assert( rawData->Type() != GDL_UNDEF);
    DType dType = rawData->Type();
    int typeCheck = DTypeOrder[ dType];
    if( typeCheck >= 100)
      throw GDLException(-1, NULL,"Type not allowed as subscript.",true,false);

    if( strictArrSubs)
      ix = new (ixBuf) AllIxIndicesStrictT( rawData);
    else
      ix = new (ixBuf) AllIxIndicesT( rawData);
  }