4 #ifndef CONTAINER_CLASSES_H_ 5 #define CONTAINER_CLASSES_H_ 7 void do_dump_state(
const void* buf,
size_t nelem,
size_t size, FILE* out, int32 magic);
8 void do_restore_state(
void* buf,
size_t nelem,
size_t size, FILE *in, int32 magic);
18 static const int32
MA_VERS[
ML_TOP] = { 120070905, 220070803, 320071126 };
21 #define MEM_LAYOUT_VAL C_TYPE 23 #define MEM_LAYOUT_VAL ARPA_TYPE 27 #define lgBOUNDSCHECKVAL true 29 #define lgBOUNDSCHECKVAL false 34 template<
class T,
bool lgBC>
37 static const int p_nd = lgBC ? 3 : 1;
45 # pragma warning( disable : 4127 ) 49 if( t < p_p[1] || t >= p_p[2] )
58 # pragma warning( disable : 4127 ) 62 p_p[0] = p0; p_p[1] = p1; p_p[2] = p2;
139 template<
class T,
bool lgBC>
160 template<
class T,
bool lgBC>
169 template<
class T,
bool lgBC>
207 template<
class T,
bool lgBC>
228 for( size_type i = 0; i < n; ++i )
269 for( size_type i = 0; i < n; ++i )
280 return getvec(i-1,index).
d[index[i-1]];
287 return getvec(i-1,index).
d[index[i-1]];
293 template<
int d,mem_layout ALLOC=MEM_LAYOUT_VAL>
314 for(
int i=0; i < d; ++i )
348 for(
int i=0; i < d; ++i )
357 bool lgInbounds(
const size_type n,
const size_type index[])
const 360 return ( lgInbounds(n-1,index) && index[n-1] < v.
getvec(n-1,index).
n );
364 void reserve(
const size_type n,
const size_type index[])
366 ASSERT( n <= d && index[n-1] > 0 && lgInbounds( n-1, index ) );
375 s[n-1] =
max(s[n-1],index[n-1]);
376 nsl[n-1] += index[n-1];
382 reserve( n+1, index );
384 reserve_recursive( n+1, index );
388 size_type top = index[n-1];
389 for( size_type i=0; i < top; ++i )
392 reserve( n+1, index );
394 reserve_recursive( n+1, index );
403 # pragma warning( disable : 4127 ) 410 size_type n1[d], n2[d];
411 for(
int dim=0; dim < d; ++dim )
412 n1[dim] = n2[dim] = 0L;
414 p_setupArray( n1, n2, &v, 0 );
415 for(
int dim=0; dim < d-1; ++dim )
416 ASSERT( n1[dim] == nsl[dim] && n2[dim] == nsl[dim+1] );
419 else if( ALLOC ==
C_TYPE )
422 for(
int i = d-2; i >= 0; --i )
423 st[i] = st[i+1]*s[i];
435 for( size_type i=0; i < w->
n; ++i )
440 p_setupArray( n1, n2, &w->
d[i], l+1 );
555 template<
class T,
int N, mem_layout ALLOC,
bool lgBC>
class n_pointer;
558 template<
class T,
int N>
573 template<
class T,
int N>
618 template<
class T,
int N>
631 return value_type( *((T**)p_p+i), NULL, &p_v->
d[i] );
635 template<
class T,
int N>
648 return value_type( p_p+i*p_st[0], p_st+1, &p_v->
d[i] );
686 template<
class T,
int N>
701 template<
class T,
int N>
746 template<
class T,
int N>
759 return value_type( *((T**)p_p+i), NULL, &p_v->
d[i] );
763 template<
class T,
int N>
776 return value_type( p_p+i*p_st[0], p_st+1, &p_v->
d[i] );
940 template<
class T,
int d, mem_layout ALLOC=MEM_LAYOUT_VAL,
bool lgBC=lgBOUNDSCHECKVAL>
967 static const size_type npos =
static_cast<size_type
>(-1);
972 for(
int i=0; i < d-1; ++i )
978 for(
int i=0; i < d-1; ++i )
1001 size_type index[] = { d1, d2 };
1007 size_type index[] = { d1, d2, d3 };
1010 multi_arr(size_type d1, size_type d2, size_type d3, size_type d4)
1013 size_type index[] = { d1, d2, d3, d4 };
1016 multi_arr(size_type d1, size_type d2, size_type d3, size_type d4, size_type d5)
1019 size_type index[] = { d1, d2, d3, d4, d5 };
1022 multi_arr(size_type d1, size_type d2, size_type d3, size_type d4, size_type d5, size_type d6)
1025 size_type index[] = { d1, d2, d3, d4, d5, d6 };
1055 memset( data(), 0, p_g.
size*
sizeof(T) );
1082 ASSERT( vals().size() == 0 );
1083 const size_type index[] = { i1 };
1088 ASSERT( vals().size() == 0 );
1089 const size_type index[] = { i1, i2 };
1092 void reserve(size_type i1, size_type i2, size_type i3)
1094 ASSERT( vals().size() == 0 );
1095 const size_type index[] = { i1, i2, i3 };
1098 void reserve(size_type i1, size_type i2, size_type i3, size_type i4)
1100 ASSERT( vals().size() == 0 );
1101 const size_type index[] = { i1, i2, i3, i4 };
1104 void reserve(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
1106 ASSERT( vals().size() == 0 );
1107 const size_type index[] = { i1, i2, i3, i4, i5 };
1110 void reserve(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6)
1112 ASSERT( vals().size() == 0 );
1113 const size_type index[] = { i1, i2, i3, i4, i5, i6 };
1121 # pragma warning( disable : 4127 ) 1127 size_type n1[d], n2[d];
1129 for(
int dim=0; dim < d; ++dim )
1131 n1[dim] = n2[dim] = 0L;
1134 ASSERT( p_psl[dim] == NULL );
1135 if( p_g.
nsl[dim] > 0 )
1136 p_psl[dim] =
new T*[ p_g.
nsl[dim] ];
1140 ASSERT( p_dsl.size() == 0 );
1141 p_dsl.resize( p_g.
nsl[dim] );
1145 p_setupArray( n1, n2, &p_g.
v, 0 );
1146 p_ptr = (T*)p_psl[0];
1148 else if( ALLOC ==
C_TYPE )
1150 for(
int i=0; i < d-1; ++i )
1152 ASSERT( p_dsl.size() == 0 );
1153 p_dsl.resize( p_g.
st[0] );
1160 p_ptr2 = (T**)p_ptr;
1161 p_ptr3 = (T***)p_ptr;
1162 p_ptr4 = (T****)p_ptr;
1163 p_ptr5 = (T*****)p_ptr;
1164 p_ptr6 = (T******)p_ptr;
1179 size_type index[] = { d1, d2 };
1182 void alloc(size_type d1, size_type d2, size_type d3)
1184 size_type index[] = { d1, d2, d3 };
1187 void alloc(size_type d1, size_type d2, size_type d3, size_type d4)
1189 size_type index[] = { d1, d2, d3, d4 };
1192 void alloc(size_type d1, size_type d2, size_type d3, size_type d4, size_type d5)
1194 size_type index[] = { d1, d2, d3, d4, d5 };
1197 void alloc(size_type d1, size_type d2, size_type d3, size_type d4, size_type d5, size_type d6)
1199 size_type index[] = { d1, d2, d3, d4, d5, d6 };
1204 for(
int n=0; n < d; n++ )
1219 for( size_type i=0; i < g->
n; ++i )
1223 p_psl[l][n1[l]++] = (T*)(p_psl[l+1]+n2[l]);
1224 p_setupArray( n1, n2, &g->
d[i], l+1 );
1228 p_psl[l][n1[l]++] = &p_dsl[0]+n2[l];
1240 # pragma warning( disable : 4127 ) 1243 return p_iterator_bc( i1, i2 );
1247 return iterator( &(*t)[i1][i2] );
1252 size_type index[] = { i1 };
1256 size_type n = p_g.
v.
getvec( 1, index ).
n;
1257 T* s = ( n > 0 ) ? &(*t)[i1][0] : NULL;
1259 return iterator( s+n, s, s+n );
1261 return iterator( s+i2, s, s+n );
1266 iterator
p_iterator(size_type i1, size_type i2, size_type i3)
const 1270 # pragma warning( disable : 4127 ) 1273 return p_iterator_bc( i1, i2, i3 );
1277 return iterator( &(*t)[i1][i2][i3] );
1282 size_type index[] = { i1, i2 };
1286 size_type n = p_g.
v.
getvec( 2, index ).
n;
1287 T* s = ( n > 0 ) ? &(*t)[i1][i2][0] : NULL;
1289 return iterator( s+n, s, s+n );
1291 return iterator( s+i3, s, s+n );
1296 iterator
p_iterator(size_type i1, size_type i2, size_type i3, size_type i4)
const 1300 # pragma warning( disable : 4127 ) 1303 return p_iterator_bc(i1, i2, i3, i4);
1307 return iterator( &(*t)[i1][i2][i3][i4] );
1310 iterator
p_iterator_bc(size_type i1, size_type i2, size_type i3, size_type i4)
const 1312 size_type index[] = { i1, i2, i3 };
1316 size_type n = p_g.
v.
getvec( 3, index ).
n;
1317 T* s = ( n > 0 ) ? &(*t)[i1][i2][i3][0] : NULL;
1319 return iterator( s+n, s, s+n );
1321 return iterator( s+i4, s, s+n );
1326 iterator
p_iterator(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
const 1330 # pragma warning( disable : 4127 ) 1333 return p_iterator_bc(i1, i2, i3, i4, i5);
1337 return iterator( &(*t)[i1][i2][i3][i4][i5] );
1340 iterator
p_iterator_bc(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
const 1342 size_type index[] = { i1, i2, i3, i4 };
1346 size_type n = p_g.
v.
getvec( 4, index ).
n;
1347 T* s = ( n > 0 ) ? &(*t)[i1][i2][i3][i4][0] : NULL;
1349 return iterator( s+n, s, s+n );
1351 return iterator( s+i5, s, s+n );
1356 iterator
p_iterator(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6)
const 1360 # pragma warning( disable : 4127 ) 1363 return p_iterator_bc(i1, i2, i3, i4, i5, i6);
1367 return iterator( &(*t)[i1][i2][i3][i4][i5][i6] );
1370 iterator
p_iterator_bc(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6)
const 1372 size_type index[] = { i1, i2, i3, i4, i5 };
1376 size_type n = p_g.
v.
getvec( 5, index ).
n;
1377 T* s = ( n > 0 ) ? &(*t)[i1][i2][i3][i4][i5][0] : NULL;
1379 return iterator( s+n, s, s+n );
1381 return iterator( s+i6, s, s+n );
1407 reference
at(size_type i1, size_type i2)
1409 size_type index[] = { i1, i2 };
1412 return (*
this)[i1][i2];
1414 const_reference
at(size_type i1, size_type i2)
const 1416 size_type index[] = { i1, i2 };
1419 return (*
this)[i1][i2];
1421 reference
at(size_type i1, size_type i2, size_type i3)
1423 size_type index[] = { i1, i2, i3 };
1426 return (*
this)[i1][i2][i3];
1428 const_reference
at(size_type i1, size_type i2, size_type i3)
const 1430 size_type index[] = { i1, i2, i3 };
1433 return (*
this)[i1][i2][i3];
1435 reference
at(size_type i1, size_type i2, size_type i3, size_type i4)
1437 size_type index[] = { i1, i2, i3, i4 };
1440 return (*
this)[i1][i2][i3][i4];
1442 const_reference
at(size_type i1, size_type i2, size_type i3, size_type i4)
const 1444 size_type index[] = { i1, i2, i3, i4 };
1447 return (*
this)[i1][i2][i3][i4];
1449 reference
at(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
1451 size_type index[] = { i1, i2, i3, i4, i5 };
1454 return (*
this)[i1][i2][i3][i4][i5];
1456 const_reference
at(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
const 1458 size_type index[] = { i1, i2, i3, i4, i5 };
1461 return (*
this)[i1][i2][i3][i4][i5];
1463 reference
at(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6)
1465 size_type index[] = { i1, i2, i3, i4, i5, i6 };
1468 return (*
this)[i1][i2][i3][i4][i5][i6];
1470 const_reference
at(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6)
const 1472 size_type index[] = { i1, i2, i3, i4, i5, i6 };
1475 return (*
this)[i1][i2][i3][i4][i5][i6];
1478 iterator
ptr(size_type i1, size_type i2)
1480 return p_iterator(i1, i2);
1482 const_iterator
ptr(size_type i1, size_type i2)
const 1484 return p_iterator(i1, i2);
1486 iterator
ptr(size_type i1, size_type i2, size_type i3)
1488 return p_iterator(i1, i2, i3);
1490 const_iterator
ptr(size_type i1, size_type i2, size_type i3)
const 1492 return p_iterator(i1, i2, i3);
1494 iterator
ptr(size_type i1, size_type i2, size_type i3, size_type i4)
1496 return p_iterator(i1, i2, i3, i4);
1498 const_iterator
ptr(size_type i1, size_type i2, size_type i3, size_type i4)
const 1500 return p_iterator(i1, i2, i3, i4);
1502 iterator
ptr(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
1504 return p_iterator(i1, i2, i3, i4, i5);
1506 const_iterator
ptr(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
const 1508 return p_iterator(i1, i2, i3, i4, i5);
1510 iterator
ptr(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6)
1512 return p_iterator(i1, i2, i3, i4, i5, i6);
1514 const_iterator
ptr(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6)
const 1516 return p_iterator(i1, i2, i3, i4, i5, i6);
1521 return p_iterator(i1, 0);
1523 const_iterator
begin(size_type i1)
const 1525 return p_iterator(i1, 0);
1527 iterator
begin(size_type i1, size_type i2)
1529 return p_iterator(i1, i2, 0);
1531 const_iterator
begin(size_type i1, size_type i2)
const 1533 return p_iterator(i1, i2, 0);
1535 iterator
begin(size_type i1, size_type i2, size_type i3)
1537 return p_iterator(i1, i2, i3, 0);
1539 const_iterator
begin(size_type i1, size_type i2, size_type i3)
const 1541 return p_iterator(i1, i2, i3, 0);
1543 iterator
begin(size_type i1, size_type i2, size_type i3, size_type i4)
1545 return p_iterator(i1, i2, i3, i4, 0);
1547 const_iterator
begin(size_type i1, size_type i2, size_type i3, size_type i4)
const 1549 return p_iterator(i1, i2, i3, i4, 0);
1551 iterator
begin(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
1553 return p_iterator(i1, i2, i3, i4, i5, 0);
1555 const_iterator
begin(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
const 1557 return p_iterator(i1, i2, i3, i4, i5, 0);
1564 # pragma warning( disable : 4127 ) 1567 return p_iterator(i1, npos);
1569 return p_iterator(i1, p_g.
v.
d[i1].
n);
1571 const_iterator
end(size_type i1)
const 1575 # pragma warning( disable : 4127 ) 1578 return p_iterator(i1, npos);
1580 return p_iterator(i1, p_g.
v.
d[i1].
n);
1582 iterator
end(size_type i1, size_type i2)
1586 # pragma warning( disable : 4127 ) 1589 return p_iterator(i1, i2, npos);
1591 return p_iterator(i1, i2, p_g.
v.
d[i1].
d[i2].
n);
1593 const_iterator
end(size_type i1, size_type i2)
const 1597 # pragma warning( disable : 4127 ) 1600 return p_iterator(i1, i2, npos);
1602 return p_iterator(i1, i2, p_g.
v.
d[i1].
d[i2].
n);
1604 iterator
end(size_type i1, size_type i2, size_type i3)
1608 # pragma warning( disable : 4127 ) 1611 return p_iterator(i1, i2, i3, npos);
1613 return p_iterator(i1, i2, i3, p_g.
v.
d[i1].
d[i2].
d[i3].
n);
1615 const_iterator
end(size_type i1, size_type i2, size_type i3)
const 1619 # pragma warning( disable : 4127 ) 1622 return p_iterator(i1, i2, i3, npos);
1624 return p_iterator(i1, i2, i3, p_g.
v.
d[i1].
d[i2].
d[i3].
n);
1626 iterator
end(size_type i1, size_type i2, size_type i3, size_type i4)
1630 # pragma warning( disable : 4127 ) 1633 return p_iterator(i1, i2, i3, i4, npos);
1635 return p_iterator(i1, i2, i3, i4, p_g.
v.
d[i1].
d[i2].
d[i3].
d[i4].
n);
1637 const_iterator
end(size_type i1, size_type i2, size_type i3, size_type i4)
const 1641 # pragma warning( disable : 4127 ) 1644 return p_iterator(i1, i2, i3, i4, npos);
1646 return p_iterator(i1, i2, i3, i4, p_g.
v.
d[i1].
d[i2].
d[i3].
d[i4].
n);
1648 iterator
end(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
1652 # pragma warning( disable : 4127 ) 1655 return p_iterator(i1, i2, i3, i4, i5, npos);
1657 return p_iterator(i1, i2, i3, i4, i5, p_g.
v.
d[i1].
d[i2].
d[i3].
d[i4].
d[i5].
n);
1659 const_iterator
end(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
const 1663 # pragma warning( disable : 4127 ) 1666 return p_iterator(i1, i2, i3, i4, i5, npos);
1668 return p_iterator(i1, i2, i3, i4, i5, p_g.
v.
d[i1].
d[i2].
d[i3].
d[i4].
d[i5].
n);
1675 const_reference
front(size_type i1)
const 1679 reference
front(size_type i1, size_type i2)
1681 return *begin(i1, i2);
1683 const_reference
front(size_type i1, size_type i2)
const 1685 return *begin(i1, i2);
1687 reference
front(size_type i1, size_type i2, size_type i3)
1689 return *begin(i1, i2, i3);
1691 const_reference
front(size_type i1, size_type i2, size_type i3)
const 1693 return *begin(i1, i2, i3);
1695 reference
front(size_type i1, size_type i2, size_type i3, size_type i4)
1697 return *begin(i1, i2, i3, i4);
1699 const_reference
front(size_type i1, size_type i2, size_type i3, size_type i4)
const 1701 return *begin(i1, i2, i3, i4);
1703 reference
front(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
1705 return *begin(i1, i2, i3, i4, i5);
1707 const_reference
front(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
const 1709 return *begin(i1, i2, i3, i4, i5);
1714 return *(end(i1) - 1);
1716 const_reference
back(size_type i1)
const 1718 return *(end(i1) - 1);
1720 reference
back(size_type i1, size_type i2)
1722 return *(end(i1, i2) - 1);
1724 const_reference
back(size_type i1, size_type i2)
const 1726 return *(end(i1, i2) - 1);
1728 reference
back(size_type i1, size_type i2, size_type i3)
1730 return *(end(i1, i2, i3) - 1);
1732 const_reference
back(size_type i1, size_type i2, size_type i3)
const 1734 return *(end(i1, i2, i3) - 1);
1736 reference
back(size_type i1, size_type i2, size_type i3, size_type i4)
1738 return *(end(i1, i2, i3, i4) - 1);
1740 const_reference
back(size_type i1, size_type i2, size_type i3, size_type i4)
const 1742 return *(end(i1, i2, i3, i4) - 1);
1744 reference
back(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
1746 return *(end(i1, i2, i3, i4, i5) - 1);
1748 const_reference
back(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
const 1750 return *(end(i1, i2, i3, i4, i5) - 1);
1763 for(
int i=0; i < d-1; ++i )
1764 if( p_psl[i] != NULL )
1766 return ( p_g.
size == 0UL && p_dsl.size() == 0 );
1845 #define INSTANTIATE_MULTI_ARR( TYPE, BC ) \ 1846 template class pntr<TYPE,BC>; \ 1847 template class const_pntr<TYPE,BC>; 1849 template<
class T,
bool lgBC=lgBOUNDSCHECKVAL>
1875 delete[] p_ptr_alloc;
1896 alloc( begin, end );
1918 p_ptr_alloc =
new T[ p_size ];
1919 pointer p = p_ptr_alloc;
1921 for( size_type i=0; i < p_end-p_begin; ++i )
1923 p_ptr = p_ptr_alloc - p_begin;
1936 memset( p_ptr_alloc, 0, p_size*
sizeof(T) );
1967 # pragma warning( disable : 4127 ) 1971 ASSERT( p_ptr_alloc == NULL );
1972 p_ptr_alloc =
new T[size];
1973 p_size = (size_t)size;
1978 void alloc(size_type begin, size_type end)
1980 if( (
size_t)
max(end-begin,0) > p_size )
1984 ASSERT( p_ptr_alloc == NULL );
1985 p_ptr_alloc =
new T[end-begin];
1986 p_ptr = p_ptr_alloc - begin;
1987 p_size = (size_t)(end-begin);
1992 p_ptr = p_ptr_alloc - begin;
2002 if( (
size_t)
max(end-p_begin,0) > p_size )
2005 T* nptr_alloc =
new T[end-p_begin];
2006 T* nptr = nptr_alloc - p_begin;
2011 if( p_ptr_alloc != NULL && p_ptr != NULL )
2013 for( size_type i=p_begin; i < p_end; ++i )
2015 delete[] p_ptr_alloc;
2017 p_ptr_alloc = nptr_alloc;
2019 p_size = (size_t)(end-p_begin);
2035 # pragma warning( disable : 4127 ) 2038 return iterator( p_pointer(i), p_pointer(p_begin), p_pointer(p_end) );
2040 return iterator( p_pointer(i) );
2045 return ( i >= p_begin && i < p_end );
2052 # pragma warning( disable : 4127 ) 2056 if( ! p_lgInbounds( i ) )
2059 return *p_pointer(i);
2072 reference
at(size_type i)
2074 if( ! p_lgInbounds(i) )
2078 const_reference
at(size_type i)
const 2080 if( ! p_lgInbounds(i) )
2087 return iterator(p_iterator(i));
2089 const_iterator
ptr(size_type i)
const 2091 return const_iterator(p_iterator(i));
2098 return ptr(p_begin);
2102 return ptr(p_begin);
2134 return max(p_end-p_begin,0);
2142 return ( size() == 0 );
multi_arr< realnum, 2 >::const_iterator mr2ci
iterator begin(size_type i1)
random_access_iterator_tag iterator_category
multi_arr< double, 2 >::const_iterator md2ci
void alloc(size_type d1, size_type d2, size_type d3, size_type d4, size_type d5)
const_n_pointer(const T *p, const size_t *st=NULL, const tree_vec *v=NULL)
reference at(size_type i)
reference back(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
multi_arr< long, 5 >::iterator ml5i
reference back(size_type i1, size_type i2, size_type i3)
multi_arr< realnum, 6 >::iterator mr6i
n_pointer(T *p, const size_t *st, const tree_vec *v=NULL)
const_reference back(size_type i1, size_type i2, size_type i3, size_type i4) const
iterator p_iterator_bc(size_type i1, size_type i2, size_type i3) const
void state_do(FILE *io, bool lgGet)
multi_geom(const multi_geom &m)
pntr - interface class to replace normal pointers
const_pntr(const pntr< T, lgBC > &t)
const_iterator begin() const
iterator begin(size_type i1, size_type i2)
iterator ptr(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6)
NORETURN void TotalInsanity(void)
iterator p_iterator(size_type i1, size_type i2) const
ptrdiff_t difference_type
flex_arr< realnum >::const_iterator farci
void p_set_vals(T *p0, T *p1, T *p2)
iterator p_iterator(size_type i1, size_type i2, size_type i3) const
multi_arr< bool, 5 >::const_iterator mb5ci
bool operator==(const basic_pntr &t) const
const_iterator ptr(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6) const
multi_arr< long, 3 >::iterator ml3i
const_iterator begin(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5) const
reference at(size_type i1, size_type i2)
bool operator<(const basic_pntr &t) const
reference front(size_type i1, size_type i2)
multi_arr< long, 2 >::const_iterator ml2ci
const_iterator ptr(size_type i) const
iterator p_iterator_bc(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6) const
multi_arr< long, 2 >::iterator ml2i
void invalidate_array(T *p, size_t size)
const_pntr - same as pntr, except that it replaces const pointers rather than normal pointers ...
const_pntr< T, lgBC > const_iterator
void reserve(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6)
void reserve(const size_type n, const size_type index[])
reference front(size_type i1)
bool operator<=(const basic_pntr &t) const
basic_pntr & operator++()
const_reference at(size_type i1, size_type i2, size_type i3, size_type i4) const
void reserve(size_type i1, size_type i2)
size_type st[d]
size of each dimension (only used in C_TYPE layout)
void do_dump_state(const void *buf, size_t nelem, size_t size, FILE *out, int32 magic)
const_n_pointer(const T *p, const size_t *st, const tree_vec *v=NULL)
const ProxyIterator< P, C > operator-(const ProxyIterator< P, C > &a, typename ProxyIterator< P, C >::difference_type i)
multi_arr< realnum, 3 >::const_iterator mr3ci
flex_arr< realnum >::iterator fari
const_reference back() const
const_iterator begin(size_type i1) const
const_reference front(size_type i1) const
n_pointer(T *p, const size_t *st, const tree_vec *v)
const_n_pointer< T, d-1, ALLOC, lgBC > const_indexed_type
iterator ptr(size_type i1, size_type i2)
iterator end(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
const_reference at(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5) const
bool operator>=(const basic_pntr &t) const
void reserve(size_type size)
NORETURN void OUT_OF_RANGE(const char *str)
random_access_iterator_tag iterator_category
reference at(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6)
multi_arr< long, 4 >::const_iterator ml4ci
tree_vec & getvec(const size_type i, const size_type index[])
flex_arr(const flex_arr &f)
iterator p_iterator(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6) const
multi_arr< long, 3 >::const_iterator ml3ci
multi_arr< bool, 5 >::iterator mb5i
n_pointer< T, N-1, C_TYPE, true > value_type
multi_arr< bool, 4 >::iterator mb4i
void reserve(size_type i1, size_type i2, size_type i3)
size_type capacity() const
multi_arr< bool, 2 >::const_iterator mb2ci
basic_pntr & operator+=(const ptrdiff_t n)
iterator end(size_type i1, size_type i2, size_type i3, size_type i4)
const_n_pointer(const T *p, const size_t *st=NULL, const tree_vec *v=NULL)
bool operator>(const basic_pntr &t) const
basic_pntr(T *p0, T *p1, T *p2)
n_pointer(T *p, const size_t *st=NULL, const tree_vec *v=NULL)
const_pntr(T *p0, T *p1, T *p2)
flex_arr(size_type begin, size_type end)
void p_clear0()
sizes of each of the pointer arrays
pointer p_pointer(size_type i) const
const_reference at(size_type i1, size_type i2) const
n_pointer< T, N-1, C_TYPE, false > value_type
random_access_iterator_tag iterator_category
const_reference back(size_type i1, size_type i2, size_type i3) const
multi_arr(size_type d1, size_type d2, size_type d3, size_type d4)
multi_arr< bool, 2 >::iterator mb2i
void p_setupArray(size_type n1[], size_type n2[], const tree_vec *w, int l)
basic_pntr & operator--()
void state_do(FILE *out, bool lgGet)
reference at(size_type i1, size_type i2, size_type i3, size_type i4)
const_reference front(size_type i1, size_type i2) const
flex_arr< double >::iterator fadi
iterator ptr(size_type i1, size_type i2, size_type i3, size_type i4)
const_n_pointer< T, N-1, C_TYPE, true > value_type
n_pointer(T *p, const size_t *st, const tree_vec *v)
const const_n_pointer< T, d, ALLOC, lgBC > n_ptr() const
T & operator[](const ptrdiff_t n) const
multi_arr(size_type d1, size_type d2, size_type d3, size_type d4, size_type d5, size_type d6)
const_iterator ptr(size_type i1, size_type i2, size_type i3, size_type i4) const
multi_arr< long, 6 >::iterator ml6i
iterator p_iterator_bc(size_type i1, size_type i2) const
multi_geom< d, ALLOC > p_g
void alloc(size_type d1, size_type d2)
const_iterator begin(size_type i1, size_type i2, size_type i3, size_type i4) const
const_pntr< T, lgBC > const_iterator
iterator ptr(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
iterator end(size_type i1, size_type i2, size_type i3)
void alloc(size_type d1, size_type d2, size_type d3, size_type d4)
multi_arr< bool, 3 >::iterator mb3i
bool lgInbounds(const size_type n, const size_type index[]) const
const_reference front() const
ptrdiff_t difference_type
const_n_pointer< T, N-1, ARPA_TYPE, true > value_type
ptrdiff_t difference_type
reference p_index(size_type i) const
multi_arr< double, 5 >::const_iterator md5ci
multi_arr< double, 5 >::iterator md5i
const T & const_reference
multi_arr(const multi_geom< d, ALLOC > &g)
bool p_lgInbounds(size_type i) const
const_reference at(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5, size_type i6) const
flex_arr< double >::const_iterator fadci
const pntr< T, lgBC > operator+(const ptrdiff_t n, const pntr< T, lgBC > &t)
reference at(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
const n_pointer< T, d, ALLOC, lgBC > n_ptr()
flex_arr< long >::const_iterator falci
void restore_state(FILE *in)
multi_arr< realnum, 3 >::iterator mr3i
const_iterator end(size_type i1, size_type i2) const
const_reference back(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5) const
bool operator!=(const basic_pntr &t) const
const multi_geom< d, ALLOC > & clone() const
multi_arr(const multi_arr &m)
size_type nsl[d]
stride for each dimension (only used in C_TYPE layout)
const_n_pointer(const T *p, const size_t *st, const tree_vec *v)
iterator p_iterator_bc(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5) const
reference back(size_type i1)
multi_arr(size_type d1, size_type d2, size_type d3, size_type d4, size_type d5)
const_n_pointer(const T *p, const size_t *st, const tree_vec *v)
basic_pntr & operator-=(const ptrdiff_t n)
multi_arr< realnum, 4 >::iterator mr4i
tree_vec(const tree_vec &m)
reference back(size_type i1, size_type i2)
n_pointer(T *p, const size_t *st, const tree_vec *v)
reference front(size_type i1, size_type i2, size_type i3)
const_reference at(size_type i1, size_type i2, size_type i3) const
void dump_state(FILE *out) const
const_reference at(size_type i) const
const valarray< T > & vals() const
reference at(size_type i1, size_type i2, size_type i3)
const_iterator end(size_type i1) const
multi_arr< double, 4 >::iterator md4i
iterator begin(size_type i1, size_type i2, size_type i3)
void reserve_recursive(const size_type n, size_type index[])
T * p_index_checked(const ptrdiff_t n) const
multi_arr(size_type d1, size_type d2, size_type d3)
multi_arr< realnum, 2 >::iterator mr2i
const_iterator end(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5) const
multi_arr< realnum, 4 >::const_iterator mr4ci
void dump_state(FILE *out) const
iterator end(size_type i1, size_type i2)
void reserve(size_type i1)
multi_arr< bool, 6 >::const_iterator mb6ci
void realloc(size_type end)
const_pointer data() const
iterator begin(size_type i1, size_type i2, size_type i3, size_type i4)
n_pointer< T, N-1, ARPA_TYPE, true > value_type
void do_restore_state(void *buf, size_t nelem, size_t size, FILE *in, int32 magic)
const_reference front(size_type i1, size_type i2, size_type i3, size_type i4) const
n_pointer(T *p, const size_t *st=NULL, const tree_vec *v=NULL)
iterator end(size_type i1)
pntr(T *p0, T *p1, T *p2)
multi_arr< double, 2 >::iterator md2i
const_pointer data() const
n_pointer(T *p, const size_t *st, const tree_vec *v=NULL)
n_pointer(T *p, const size_t *st, const tree_vec *v)
static const int32 MA_VERS[ML_TOP]
multi_arr< long, 5 >::const_iterator ml5ci
void alloc(size_type d1, size_type d2, size_type d3, size_type d4, size_type d5, size_type d6)
const_n_pointer(const T *p, const size_t *st, const tree_vec *v)
const tree_vec & getvec(const size_type i, const size_type index[]) const
multi_arr< double, 6 >::const_iterator md6ci
multi_arr< bool, 4 >::const_iterator mb4ci
const_iterator ptr(size_type i1, size_type i2, size_type i3) const
iterator p_iterator_bc(size_type i1, size_type i2, size_type i3, size_type i4) const
const T & const_reference
iterator begin(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
iterator p_iterator(size_type i) const
const_iterator end() const
multi_arr< bool, 3 >::const_iterator mb3ci
const_reference front(size_type i1, size_type i2, size_type i3) const
multi_arr< double, 3 >::const_iterator md3ci
reference front(size_type i1, size_type i2, size_type i3, size_type i4)
const_iterator begin(size_type i1, size_type i2) const
multi_arr(size_type d1, size_type d2)
void reserve(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
flex_arr< long >::iterator fali
const_iterator end(size_type i1, size_type i2, size_type i3) const
multi_arr< long, 6 >::const_iterator ml6ci
reference front(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5)
n_pointer< T, N-1, ARPA_TYPE, false > value_type
const_n_pointer(const T *p, const size_t *st, const tree_vec *v=NULL)
const_iterator begin(size_type i1, size_type i2, size_type i3) const
multi_arr< double, 6 >::iterator md6i
n_pointer< T, d-1, ALLOC, lgBC > indexed_type
multi_arr< double, 4 >::const_iterator md4ci
void alloc(size_type begin, size_type end)
multi_arr< double, 3 >::iterator md3i
void alloc(size_type index[])
const T & const_reference
void alloc(size_type d1, size_type d2, size_type d3)
void alloc(const multi_geom< d, ALLOC > &g)
void reserve(size_type i1, size_type i2, size_type i3, size_type i4)
iterator p_iterator(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5) const
tree_vec - a simple class to store the bounds checking information for multi_arr
reference back(size_type i1, size_type i2, size_type i3, size_type i4)
basic_pntr(const basic_pntr &t)
const_reference front(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5) const
void restore_state(FILE *in)
flex_arr< bool >::const_iterator fabci
iterator ptr(size_type i1, size_type i2, size_type i3)
const_iterator ptr(size_type i1, size_type i2) const
const_reference back(size_type i1) const
const_n_pointer< T, N-1, C_TYPE, false > value_type
const_iterator ptr(size_type i1, size_type i2, size_type i3, size_type i4, size_type i5) const
multi_arr< realnum, 6 >::const_iterator mr6ci
const_n_pointer(const T *p, const size_t *st, const tree_vec *v)
const_iterator end(size_type i1, size_type i2, size_type i3, size_type i4) const
flex_arr< bool >::iterator fabi
multi_arr< realnum, 5 >::iterator mr5i
const_n_pointer< T, N-1, ARPA_TYPE, false > value_type
void p_setupArray(size_type n1[], size_type n2[], const tree_vec *g, int l)
multi_arr< realnum, 5 >::const_iterator mr5ci
multi_arr< bool, 6 >::iterator mb6i
iterator ptr(size_type i)
const_reference back(size_type i1, size_type i2) const
size_type capacity() const
multi_arr< long, 4 >::iterator ml4i
iterator p_iterator(size_type i1, size_type i2, size_type i3, size_type i4) const
size_type s[d]
allocated size (number of data elements, pointers are not counted)