55 int numBlocks = (int)ceil( (
double)
hit_shapeSigCard( blocksShape, dim ) / blockSizes[dim] );
56 hit_shapeSig( blocksShape, dim ) = hit_sigStd( numBlocks );
64 container->childSize[dim] = blockSizes[dim];
86 hit_shapeSig( blockShape, dim ) = hit_sigStd( container->childSize[dim] );
92 block.baseExtent = baseSizeExtent;
96 if ( fillValue != NULL )
hit_tileFill( &block, fillValue );
107 for ( original = (
HitTile*)container;
108 original->ref != NULL;
109 original = (
HitTile*)original->ref )
110 if ( original->hierDepth != HIT_NONHIERARCHICAL ) fullBlockTile = original;
115 int lastBlockSize = lastElement % container->childSize[0];
116 if ( lastBlockSize != 0 ) {
122 HitTile *lastBlock = &( container->data[ container->acumCard-1 ] );
125 if ( lastBlock->unpadded == NULL )
hit_errInternal(__FUNCTION__,
"Allocating unpadded blocks",
"", __FILE__, __LINE__ );
137 int lastBlockSize[2];
138 for (dim=0; dim<2; dim++) {
140 lastBlockSize[dim] = lastElement[dim] % container->childSize[dim];
141 if ( lastBlockSize[dim] != 0 ) {
146 HitShape noPaddedShape = blockShape;
147 hit_shapeSig( noPaddedShape, dim ) = hit_sigStd(lastBlockSize[dim]);
154 int invDim = ( dim == 0 ) ? 1:0;
155 for ( numBlock[invDim]=0;
158 numBlock[invDim]++ ) {
163 HitTile *lastBlock = &( hit_tileGet(*container, 2, numBlock[0], numBlock[1] ) );
166 if ( lastBlock->unpadded == NULL )
hit_errInternal(__FUNCTION__,
"Allocating unpadded blocks",
"", __FILE__, __LINE__ );
176 else lastBlockSize[dim] = container->childSize[dim];
179 if ( lastBlockSize[0] != 0 || lastBlockSize[1] != 0 ) {
187 HitTile *lastBlock = &( container->data[ container->acumCard-1 ] );
190 if ( lastBlock->unpadded == NULL )
hit_errInternal(__FUNCTION__,
"Allocating unpadded blocks",
"", __FILE__, __LINE__ );
195 hit_shape( 2, hit_sigStd(lastBlockSize[0]), hit_sigStd(lastBlockSize[1]) );
201 else hit_warnInternal(__FUNCTION__,
"MBTiles not fully implemented for more than 2 dimensions",
"", __FILE__, __LINE__ );
208 if ( container.memStatus != HIT_MS_OWNER )
return;
219 if ( block->unpadded != NULL ) {
222 free ( block->unpadded );
#define hit_shape(nd,...)
void hit_blockTileAllocInternal(HitBlockTile *container, size_t baseSizeExtent, void *fillValue)
#define hit_tileFill(var, value)
#define hit_shapeDimsSet(shape, value)
#define hit_tileDims(var)
#define hit_tileAlloc(var)
#define hit_tileCard(var)
#define hit_tileSelect(newVar, oldVar, shape)
#define hit_tileDimCard(var, dim)
void hit_blockTileFree(HitBlockTile container)
#define hit_tileDomainShape(newVarP, baseType, shape)
#define hit_tileDimEnd(var, dim)
#define hit_shapeSigCard(shape, dim)
#define hit_warnInternal(routine, text, extraParam, file, numLine)
#define hit_shapeSig(shape, dim)
#define hit_tileFree(var)
void hit_blockTileNew(HitBlockTile *container, void *originalVar, int blockSizes[HIT_MAXDIMS])
#define hit_errInternal(routine, text, extraParam, file, numLine)
#define hit_tileShape(var)