22 #include <tensor/indices.h>
26 const ListGenerator<index> igen = {};
27 const ListGenerator<double> rgen = {};
28 const ListGenerator<cdouble> cgen = {};
30 template class Vector<index>;
32 bool all_equal(
const Indices &a,
const Indices &b) {
33 return (a.size() == b.size()) &&
34 std::equal(a.begin_const(), a.end_const(), b.begin_const());
37 index Indices::total_size()
const {
39 return std::accumulate(begin_const(), end_const(),
40 static_cast<index>(1), std::multiplies<index>());
46 const Indices Indices::range(index min, index max, index step) {
50 index size = (max - min) / step + 1;
52 for (Indices::iterator it = output.begin(); it != output.end(); it ++) {