@@ -1201,51 +1201,6 @@ struct Slice(SliceKind kind, size_t[] packs, Iterator)
12011201 assert (slice.shape == cast (size_t [3 ])[0 , 0 , 0 ]);
12021202 }
12031203
1204- // package void popFront(size_t dimension)
1205- // {
1206- // assert(dimension < N, __FUNCTION__ ~ ": dimension should be less than N = " ~ N.stringof);
1207- // assert(_lengths[dimension], ": length!dim should be greater than 0.");
1208- // _lengths[dimension]--;
1209- // _iterator += _strides[dimension];
1210- // }
1211-
1212-
1213- // package void popBack(size_t dimension)
1214- // {
1215- // assert(dimension < N, __FUNCTION__ ~ ": dimension should be less than N = " ~ N.stringof);
1216- // assert(_lengths[dimension], ": length!dim should be greater than 0.");
1217- // _lengths[dimension]--;
1218- // }
1219-
1220- // package void popFrontExactly(size_t dimension, size_t n)
1221- // {
1222- // assert(dimension < N, __FUNCTION__ ~ ": dimension should be less than N = " ~ N.stringof);
1223- // assert(n <= _lengths[dimension], __FUNCTION__ ~ ": n should be less than or equal to length!dim");
1224- // _lengths[dimension] -= n;
1225- // _iterator += _strides[dimension] * n;
1226- // }
1227-
1228- // package void popBackExactly(size_t dimension, size_t n)
1229- // {
1230- // assert(dimension < N, __FUNCTION__ ~ ": dimension should be less than N = " ~ N.stringof);
1231- // assert(n <= _lengths[dimension], __FUNCTION__ ~ ": n should be less than or equal to length!dim");
1232- // _lengths[dimension] -= n;
1233- // }
1234-
1235- // package void popFrontN(size_t dimension, size_t n)
1236- // {
1237- // assert(dimension < N, __FUNCTION__ ~ ": dimension should be less than N = " ~ N.stringof);
1238- // import std.algorithm.comparison : min;
1239- // popFrontExactly(dimension, min(n, _lengths[dimension]));
1240- // }
1241-
1242- // package void popBackN(size_t dimension, size_t n)
1243- // {
1244- // assert(dimension < N, __FUNCTION__ ~ ": dimension should be less than N = " ~ N.stringof);
1245- // import std.algorithm.comparison : min;
1246- // popBackExactly(dimension, min(n, _lengths[dimension]));
1247- // }
1248-
12491204 /+ +
12501205 Returns: `true` if for any dimension the length equals to `0`, and `false` otherwise.
12511206 +/
@@ -1444,52 +1399,6 @@ struct Slice(SliceKind kind, size_t[] packs, Iterator)
14441399
14451400 }
14461401
1447- // ///ditto
1448- // auto ref opCall()(size_t[N] _indexes...)
1449- // {
1450- // static if (packs.length == 1)
1451- // return _iterator[mathIndexStride(_indexes)];
1452- // else
1453- // return DeepElemType(_lengths[N .. $], _strides[N .. $], _iterator + mathIndexStride(_indexes));
1454- // }
1455-
1456- // static if (doUnittest)
1457- // ///
1458- // pure nothrow unittest
1459- // {
1460- // auto slice = slice!int(5, 2);
1461-
1462- // auto q = &slice[3, 1]; // D & C order
1463- // auto p = &slice(1, 3); // Math & Fortran order
1464- // assert(p is q);
1465- // *q = 4;
1466- // assert(slice[3, 1] == 4); // D & C order
1467- // assert(slice(1, 3) == 4); // Math & Fortran order
1468-
1469- // size_t[2] indexP = [1, 3];
1470- // size_t[2] indexQ = [3, 1];
1471- // assert(slice[indexQ] == 4); // D & C order
1472- // assert(slice(indexP) == 4); // Math & Fortran order
1473- // }
1474-
1475- // static if (doUnittest)
1476- // pure nothrow unittest
1477- // {
1478- // // check with different N
1479- // import mir.ndslice.topology : pack, iota;
1480- // auto pElements = iota(2, 3, 4, 5).pack!2;
1481- // import std.range : iota;
1482- // import std.algorithm.comparison : equal;
1483-
1484- // // D & C order
1485- // assert(pElements[$-1, $-1][$-1].equal([5].iota(115)));
1486- // assert(pElements[[1, 2]][$-1].equal([5].iota(115)));
1487-
1488- // // Math & Fortran
1489- // assert(pElements(2, 1)[$-1].equal([5].iota(115)));
1490- // assert(pElements([2, 1])[$-1].equal([5].iota(115)));
1491- // }
1492-
14931402 /+ +
14941403 $(BOLD Partially or fully defined slice.)
14951404 +/
0 commit comments