Index: trunk/tests/test_ArrayND.cc =================================================================== --- trunk/tests/test_ArrayND.cc (revision 643) +++ trunk/tests/test_ArrayND.cc (revision 644) @@ -1,1495 +1,1514 @@ #include #include #include #include "UnitTest++.h" #include "test_utils.hh" #include "npstat/nm/ArrayND.hh" #include "npstat/stat/ArrayProjectors.hh" #include "npstat/stat/StatAccumulator.hh" using namespace npstat; using namespace std; struct MaxOfPair : public Functor1 > { double operator()(const std::pair& two) const { return two.first > two.second ? two.first : two.second; } }; static double poly(const double x, const double *p, int i) { double ans = *p++; while (--i) { ans *= x; ans += *p++; } return ans; } namespace { typedef Interval ArrayRange1D; struct DummyFunctor { double operator()(const unsigned* ind, const unsigned len) const { const double a[3] = {7.0, 13.0, 3.0}; assert(len == 3); return ind[0]*a[0] + ind[1]*a[1] + ind[2]*a[2] + 12134; } }; static int int_rng() { return static_cast(50.0*test_rng()) - 25; } // Simple class for checking the projection code. // Should be equivalent to slicing. template class DeltaProjector : public AbsArrayProjector { public: DeltaProjector(const unsigned *fixedIndices, const unsigned *fixedIndexValues, const unsigned nFixedIndices) : fixedIndices_(makeShape(fixedIndices, nFixedIndices)), fixedIndexValues_(makeShape(fixedIndexValues, nFixedIndices)), value_(Input()), count_(0U) { } void clear() { count_ = 0U; value_ = Input(); } void process(const unsigned *index, unsigned indexLen, unsigned long linearIndex, const Input& value) { const unsigned ifixed = fixedIndices_.size(); for (unsigned i=0; i a1; ArrayND a11; ArrayND a2; ArrayND > a3; CHECK(a1 == a11); ArrayShape shape(3, 10); ArrayND b1(shape); ArrayND b2(shape); ArrayND > b3(shape); ArrayND > b4 = b3; CHECK(b4 == b3); ArrayND >*> b5(shape); b5.clear(); for (unsigned i=0; i > > b6(shape); } TEST(ArrayNDInspectors) { ArrayShape shape(3); shape.at(0) = 2; shape.at(1) = 3; shape.at(2) = 4; ArrayND a1(shape); CHECK(shape == a1.shape()); CHECK_EQUAL(3U, a1.rank()); CHECK_EQUAL(24U, a1.length()); CHECK(a1.isShapeKnown()); CHECK(a1.fullRange() == ArrayRange(a1.shape())); for (unsigned i=0; i a2; CHECK(!a2.isShapeKnown()); } TEST(Array3Dassignment) { ArrayND a1(makeShape(2, 3, 4)); int sum = 0; for (int i=0; i<2; ++i) for (int j=0; j<3; ++j) for (int k=0; k<4; ++k) { int value = i*3*4 + j*4 + k; a1.at(i, j, k) = value; sum += value; } ArrayND a2; a2 = a1; CHECK(a2 == a1); ArrayND a3(makeShape(5, 6, 7)); a3.uninitialize() = a1; CHECK(a3 == a1); CHECK(sum == a1.sum()); CHECK(sum == a1.sum()); } TEST(Array1Dclosest) { ArrayND a1(makeShape(4)); double x = 0.1; a1.closest(&x, 1) = 3; x = 0.6; a1.closest(&x, 1) = 4; x = 1.4; a1.closest(&x, 1) = 5; x = 1.6; a1.closest(&x, 1) = 6; x = 2.6; a1.closest(&x, 1) = 7; ArrayND a2(makeShape(4)); a2(0) = 3; a2(1) = 5; a2(2) = 6; a2(3) = 7; CHECK(a2 == a1); x = -1.0; CHECK_EQUAL(a1.closest(&x, 1), 3); x = 10.0; CHECK_EQUAL(a1.closest(&x, 1), 7); x = 0.6; CHECK_EQUAL(a1.closest(&x, 1), 5); } TEST(Array3DIndices) { ArrayShape shape(3); shape.at(0) = 2; shape.at(1) = 3; shape.at(2) = 4; ArrayND a1(shape); for (int i=0; i<3; ++i) CHECK(a1.span(i) == shape[i]); CHECK(a1.maximumSpan() == 4); for (int i=0; i<2; ++i) for (int j=0; j<3; ++j) for (int k=0; k<4; ++k) a1.at(i, j, k) = i*3*4 + j*4 + k; unsigned idx[3]; for (int i=0; i<2; ++i) { idx[0] = i; for (int j=0; j<3; ++j) { idx[1] = j; for (int k=0; k<4; ++k) { idx[2] = k; CHECK_EQUAL(i*3*4 + j*4 + k, a1.at(i, j, k)); CHECK_EQUAL(i*3*4 + j*4 + k, a1.valueAt(idx, 3)); } } } ArrayShape s; ArrayND a2(s); a2() = 123; CHECK_EQUAL(123, a2()); a2() = 345; CHECK_EQUAL(345, a2()); } TEST(Array3Dsubrange) { ArrayShape shape(3); shape.at(0) = 5; shape.at(1) = 6; shape.at(2) = 7; ArrayND a1(shape); for (unsigned i=0; i<5; ++i) for (unsigned j=0; j<6; ++j) for (unsigned k=0; k<7; ++k) a1(i, j, k) = i*6*7 + j*7 + k + 1; ArrayND a2(a1, ArrayRange(shape)); CHECK(a1 == a2); ArrayRange rng; rng.push_back(ArrayRange1D(3, 5)); rng.push_back(ArrayRange1D(2, 4)); rng.push_back(ArrayRange1D(0, 3)); ArrayND a3(a1, rng); CHECK(rng.rangeSize() == a3.length()); for (unsigned i=rng[0].min(), ii=0; i a4(rng.shape()); a4.clear(); unsigned corner[3] = {3, 2, 0}; a1.exportSubrange(corner, 3, &a4); CHECK(a3 == a4); } TEST(Array3DfunctorFill) { double c[3] = {7.0, 13.0, 3.0}; ArrayShape shape(3); shape.at(0) = 2; shape.at(1) = 3; shape.at(2) = 4; ArrayND a1(shape); a1.functorFill(DummyFunctor()); ArrayND a2(shape); a2.linearFill(c, 3, 12134); CHECK(a1 == a2); } TEST(Array3DlinearFill) { double c[3] = {7.0, 13.0, 3.0}; ArrayShape shape(3); shape.at(0) = 2; shape.at(1) = 3; shape.at(2) = 4; ArrayND a1(shape); for (int i=0; i<2; ++i) for (int j=0; j<3; ++j) for (int k=0; k<4; ++k) a1.at(i, j, k) = i*c[0] + j*c[1] + k*c[2] + 12134; ArrayND a2(shape); a2.linearFill(c, 3, 12134); CHECK(a1 == a2); } TEST(Array8DIndices) { ArrayShape shape(8); shape.at(0) = 2; shape.at(1) = 3; shape.at(2) = 4; shape.at(3) = 5; shape.at(4) = 6; shape.at(5) = 7; shape.at(6) = 8; shape.at(7) = 9; ArrayND a1(shape); for (int i=0; i<2; ++i) for (int j=0; j<3; ++j) for (int k=0; k<4; ++k) for (int l=0; l<5; ++l) for (int m=0; m<6; ++m) for (int n=0; n<7; ++n) for (int o=0; o<8; ++o) for (int p=0; p<9; ++p) a1.at(i, j, k, l, m, n, o, p) = 1 + i*181440 + j*60480 + k*15120 + l*3024 + m*504 + n*72 + o*9 + p; unsigned idx[8]; for (int i=0; i<2; ++i) { idx[0] = i; for (int j=0; j<3; ++j) { idx[1] = j; for (int k=0; k<4; ++k) { idx[2] = k; for (int l=0; l<5; ++l) { idx[3] = l; for (int m=0; m<6; ++m) { idx[4] = m; for (int n=0; n<7; ++n) { idx[5] = n; for (int o=0; o<8; ++o) { idx[6] = o; for (int p=0; p<9; ++p) { idx[7] = p; const int expect = 1 + i*181440 + j*60480 + k*15120 + l*3024 + m*504 + n*72 + o*9 + p; CHECK_EQUAL(expect, a1.at(i, j, k, l, m, n, o, p)); CHECK_EQUAL(expect,a1.valueAt(idx,8)); } } } } } } } } double c[8] = {181440, 60480, 15120, 3024, 504, 72, 9, 1}; ArrayND a2(shape); a2.linearFill(c, 8, 1.0); CHECK(a1 == a2); } TEST(ArrayNDUnaryOps) { ArrayShape shape(3); shape.at(0) = 2; shape.at(1) = 3; shape.at(2) = 4; ArrayND a1(shape); for (int i=0; i<2; ++i) for (int j=0; j<3; ++j) for (int k=0; k<4; ++k) a1.at(i, j, k) = i*3*4 + j*4 + k; CHECK(a1 == +a1); ArrayND a2(-1*a1); for (int i=0; i<2; ++i) for (int j=0; j<3; ++j) for (int k=0; k<4; ++k) CHECK_EQUAL(-a1.at(i, j, k), a2.at(i, j, k)); } TEST(ArrayNDreshape) { unsigned sh1[3] = {1, 2, 3}; unsigned sh2[3] = {3, 2, 2}; unsigned sh3[2] = {2, 1}; ArrayND a(sh1, sizeof(sh1)/sizeof(sh1[0])); CHECK(a.isCompatible(sh1, sizeof(sh1)/sizeof(sh1[0]))); CHECK(!a.isCompatible(sh2, sizeof(sh2)/sizeof(sh2[0]))); a.reshape(sh2, sizeof(sh2)/sizeof(sh2[0])); CHECK(a.isCompatible(sh2, sizeof(sh2)/sizeof(sh2[0]))); a.reshape(sh3, sizeof(sh3)/sizeof(sh3[0])); CHECK(a.isCompatible(sh3, sizeof(sh3)/sizeof(sh3[0]))); ArrayND b; b.reshape(sh2, sizeof(sh2)/sizeof(sh2[0])); CHECK(b.isCompatible(sh2, sizeof(sh2)/sizeof(sh2[0]))); } TEST(ArrayNDclose) { ArrayShape shape(2, 1); ArrayND a1(shape); ArrayND a2(shape); a1(0U, 0U) = 1.0; a2(0U, 0U) = 1.000001; CHECK(a1.isClose(a2, 1.e-3)); CHECK(!a1.isClose(a2, 1.e-10)); ArrayND > a3(shape); ArrayND > a4(shape); a3(0U, 0U) = complex(1.0, 1.0); a4(0U, 0U) = complex(1.0, 1.000001); CHECK(a3.isClose(a4, 1.e-3)); CHECK(!a3.isClose(a4, 1.e-10)); } TEST(ArrayNDapply) { const unsigned n = 10; ArrayShape shape(2, n); ArrayND a1(shape); ArrayND a2(shape); for (unsigned i=0; i((i+1)*n + j + 1)); } a1.apply(FcnFunctor1(log)); CHECK(a1 == a2); } TEST(ArrayNDtransform) { const unsigned n = 10; ArrayShape shape(2, n); ArrayND > a1(shape); ArrayND a2(shape); for (unsigned i=0; i two(test_rng(), test_rng()); a1(i, j) = two; a2(i, j) = two.first > two.second ? two.first : two.second; } CHECK(ArrayND(a1, MaxOfPair()) == a2); } TEST(ArrayNDEquality) { const unsigned n = 10; ArrayShape shape(2, n); ArrayND a1(shape); for (unsigned i=0; i a2(a1); CHECK(a1 == a2); unsigned* last = 0; unsigned lastValue = 0; for (unsigned i=0; i a1(shape1); ArrayND a2(shape2); ArrayND a3(shape3); ArrayND a4(shape4); for (unsigned icycle=0; icycle<5; ++icycle) { for (k[0]=0; k[0] a5(a1, a2); CHECK(a3 == a5); CHECK(a3 == a1.outer(a2)); ArrayND a6(a2, a1); CHECK(a4 == a6); CHECK(a4 == a2.outer(a1)); } } TEST(Array1Ddot) { double data[] = {3, 7, 11, 53}; double sum = 0.0; for (unsigned i=0; i a1(shape); a1.setData(data, sizeof(data)/sizeof(data[0])); ArrayND cn(a1.dot(a1)); CHECK_EQUAL(0U, cn.rank()); CHECK_EQUAL(sum, cn()); } TEST(ArrayNDaddmul) { ArrayND m1(makeShape(2, 3)); ArrayND m2(makeShape(2, 3)); const unsigned long len = m1.length(); for (unsigned icycle=1; icycle<5; ++icycle) { for (unsigned i=0; i(test_rng()*10000); m2.linearValue(i) = static_cast(test_rng()*10000); } ArrayND m3(m1); m3 += m2*icycle; CHECK(m1.addmul(m2, icycle) == m3); } } TEST(ArrayNDdot) { const unsigned dim1 = 3; const unsigned dim2 = 4; ArrayShape shape1(dim1); ArrayShape shape2(dim2); shape1[0] = 7; shape1[1] = 3; shape1[2] = 5; shape2[0] = 5; shape2[1] = 11; shape2[2] = 13; shape2[3] = 7; ArrayND a1(shape1); ArrayND a2(shape2); for (unsigned icycle=0; icycle<5; ++icycle) { const unsigned long len1 = a1.length(); for (unsigned long i=0; i(test_rng()*10000); const unsigned long len2 = a2.length(); for (unsigned long i=0; i(test_rng()*10000); CHECK(a1.outer(a2).contract(2,3) == a1.dot(a2)); CHECK(a2.outer(a1).contract(3,4) == a2.dot(a1)); } } TEST(ArrayNDdot2) { int a1[2][3] = {{1, 4, 2}, {2, 8, 13}}; int a2[3][4] = {{2, 5, -3, 8}, {8, 3, 16, 7}, {7, 4, 2, -3}}; int a3[2][4] = {{48, 25, 65, 30}, {159, 86, 148, 33}}; ArrayND m1(makeShape(2, 3)); m1.setData(&a1[0][0], m1.length()); #ifdef CPP11_STD_AVAILABLE CHECK(m1 == externalMemArrayND(&a1[0][0], 2, 3)); #endif ArrayND m2(makeShape(3, 4)); m2.setData(&a2[0][0], m2.length()); ArrayND m3(makeShape(2, 4)); m3.setData(&a3[0][0], m3.length()); CHECK(m1.dot(m2) == m3); int a4[3][3] = {{1, 4, 2}, {2, 8, 13}, {27, 33, 45}}; ArrayND m4(makeShape(3, 3)); m4.setData(&a4[0][0], m4.length()); ArrayND unit(makeShape(3, 3)); unit.makeUnit(); CHECK(m4.dot(unit) == m4); CHECK(unit.dot(m4) == m4); } TEST(ArrayNDdot3) { int a1[2][3] = {{1, 4, 2}, {2, 8, 13}}; int a2[3] = {6, 3, 15}; int a3[2] = {48, 231}; ArrayND m1(makeShape(2, 3)); m1.setData(&a1[0][0], m1.length()); ArrayND m2(makeShape(3, 1)); m2.setData(&a2[0], m2.length()); ArrayND m3(makeShape(2, 1)); m3.setData(&a3[0], m3.length()); CHECK(m3 == m1.dot(m2)); } TEST(ArrayNDScalarOps) { - int a1[2][3] = {{1, 2, 3}, {4, 5, 6}}; + int a1[2][3] = {{1, 2, 3}, {4, 5, 6}}; int a3[2][3] = {{5, 10, 15}, {20, 25, 30}}; ArrayND m1(makeShape(2, 3)); m1.setData(&a1[0][0], m1.length()); ArrayND m3(makeShape(2, 3)); m3.setData(&a3[0][0], m3.length()); - ArrayND m2 = m1*5; + ArrayND m2 = 5*m1; ArrayND m4 = m1; m1 *= 5; CHECK(m1 == m2); CHECK(m1 == m3); m1 /= 5; CHECK(m1 == m4); } + TEST(ArrayNDmultiplication) + { + int a1[2][3] = {{1, 2, 3}, {4, 5, 6}}; + int a3[2][3] = {{5, 10, 15}, {20, 25, 30}}; + int a5[2][3] = {{5, 20, 45}, {80, 125, 180}}; + + ArrayND m1(makeShape(2, 3)); + m1.setData(&a1[0][0], m1.length()); + + ArrayND m3(makeShape(2, 3)); + m3.setData(&a3[0][0], m3.length()); + + ArrayND m5(makeShape(2, 3)); + m5.setData(&a5[0][0], m5.length()); + + CHECK(m5 == m1*m3); + CHECK(m1 == m5/m3); + } + TEST(ArrayNDsubtraction) { int a1[2][3] = {{1, 4, 2}, {2, 8, 13}}; int a2[2][3] = {{7, 5, 4}, {8, 3, -5}}; int a3[2][3] = {{-6, -1, -2,}, {-6, 5, 18}}; ArrayND m1(makeShape(2, 3)); m1.setData(&a1[0][0], m1.length()); ArrayND m2(makeShape(2, 3)); m2.setData(&a2[0][0], m2.length()); ArrayND m3(makeShape(2, 3)); m3.setData(&a3[0][0], m3.length()); CHECK(m3 == m1 - m2); m1 -= m2; CHECK(m3 == m1); } TEST(ArrayNDaddition) { int a1[2][3] = {{1, 4, 2}, {2, 8, 13}}; int a2[2][3] = {{7, 5, 4}, {8, 3, -5}}; int a3[2][3] = {{-6, -1, -2,}, {-6, 5, 18}}; ArrayND m1(makeShape(2, 3)); m1.setData(&a1[0][0], m1.length()); ArrayND m2(makeShape(2, 3)); m2.setData(&a2[0][0], m2.length()); ArrayND m3(makeShape(2, 3)); m3.setData(&a3[0][0], m3.length()); CHECK(m1 == m3 + m2); CHECK(m1 == m2 + m3); m3 += m2; CHECK(m1 == m3); } TEST(ArrayNDcontract0) { double data[] = {3, 7, 11, 53}; double sum = 0.0; for (unsigned i=0; i a1(shape); a1.setData(data, sizeof(data)/sizeof(data[0])); ArrayND a2(a1); ArrayND cn(a1.outer(a2).contract(0,1)); CHECK_EQUAL(0U, cn.rank()); CHECK_EQUAL(sum, cn()); } TEST(ArrayNDcontract1) { ArrayShape shape2(4); unsigned k[4]; shape2[0] = 3; shape2[1] = 5; shape2[2] = 7; shape2[3] = 11; const unsigned pos1 = 0; const unsigned pos2 = 2; shape2[pos2] = shape2[pos1]; ArrayND a3(shape2); for (k[0]=0; k[0](test_rng()*10000); ArrayShape shape3; for (unsigned i=0; i<4; ++i) if (i != pos1 && i != pos2) shape3.push_back(shape2[i]); ArrayND a4(shape3); for (k[0]=0; k[0] contracted(a3.contract(pos1, pos2)); CHECK(a4.shape() == contracted.shape()); CHECK(a4 == contracted); } TEST(ArrayNDcontract2) { ArrayShape shape2(4); unsigned k[4]; shape2[0] = 3; shape2[1] = 5; shape2[2] = 7; shape2[3] = 11; const unsigned pos1 = 1; const unsigned pos2 = 3; shape2[pos2] = shape2[pos1]; ArrayND a3(shape2); for (k[0]=0; k[0](test_rng()*10000); ArrayShape shape3; for (unsigned i=0; i<4; ++i) if (i != pos1 && i != pos2) shape3.push_back(shape2[i]); ArrayND a4(shape3); for (k[0]=0; k[0] contracted(a3.contract(pos1, pos2)); CHECK(a4.shape() == contracted.shape()); CHECK(a4 == contracted); } TEST(ArrayNDcontract3) { ArrayShape shape2(4); unsigned k[4]; shape2[0] = 3; shape2[1] = 5; shape2[2] = 7; shape2[3] = 11; const unsigned pos1 = 2; const unsigned pos2 = 3; shape2[pos2] = shape2[pos1]; ArrayND a3(shape2); for (k[0]=0; k[0](test_rng()*10000); ArrayShape shape3; for (unsigned i=0; i<4; ++i) if (i != pos1 && i != pos2) shape3.push_back(shape2[i]); ArrayND a4(shape3); for (k[0]=0; k[0] contracted(a3.contract(pos1, pos2)); CHECK(a4.shape() == contracted.shape()); CHECK(a4 == contracted); } TEST(ArrayNDcontract4) { ArrayShape shape2(4); unsigned k[4]; shape2[0] = 3; shape2[1] = 5; shape2[2] = 7; shape2[3] = 11; const unsigned pos1 = 0; const unsigned pos2 = 1; shape2[pos2] = shape2[pos1]; ArrayND a3(shape2); for (k[0]=0; k[0](test_rng()*10000); ArrayShape shape3; for (unsigned i=0; i<4; ++i) if (i != pos1 && i != pos2) shape3.push_back(shape2[i]); ArrayND a4(shape3); for (k[0]=0; k[0] contracted(a3.contract(pos1, pos2)); CHECK(a4.shape() == contracted.shape()); CHECK(a4 == contracted); } TEST(Array2Dtranspose) { unsigned k[2]; ArrayShape shape2(2); shape2[0] = 3; shape2[1] = 5; ArrayShape shape3(shape2); std::swap(shape3[0], shape3[1]); ArrayND a2(shape2); ArrayND a3(shape3); for (k[0]=0; k[0]( test_rng()*10000); a2.at(k[0], k[1]) = v; a3.at(k[1], k[0]) = v; } CHECK(a3 == a2.transpose()); } TEST(Array4Dtranspose) { ArrayShape shape2(4); unsigned k[4]; shape2[0] = 3; shape2[1] = 5; shape2[2] = 7; shape2[3] = 11; const unsigned positions[6][2] = { {0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}, {2, 3} }; for (unsigned icycle=0; icycle < 6; ++icycle) { const unsigned pos1 = positions[icycle][0]; const unsigned pos2 = positions[icycle][1]; unsigned perm[4] = {0, 1, 2, 3}; ArrayShape shape3(shape2); std::swap(shape3[pos1], shape3[pos2]); std::swap(perm[pos1], perm[pos2]); ArrayND a2(shape2); ArrayND a3(shape3); for (k[0]=0; k[0]( test_rng()*10000); a2.at(k[0], k[1], k[2], k[3]) = v; a3.at(k[perm[0]], k[perm[1]], k[perm[2]], k[perm[3]]) = v; } CHECK(a3 == a2.transpose(pos1, pos2)); } } TEST(ArrayNDinterpolate3) { const unsigned dim = 6; const unsigned npt = 5; const unsigned ncycles = 10; const unsigned nrandom = 100; ArrayShape shape(dim, npt); ArrayND a1(shape); double poly_coeffs[dim][4]; for (unsigned icycle=0; icycle m1(makeShape(7, 3, 4, 13, 2)); ArrayShape sh(m1.rank()); const unsigned long len = m1.length(); for (unsigned long i=0; i m1(makeShape(3, 4)); m1.setData(&a1[0][0], m1.length()); CHECK_EQUAL(arrayMin(m1), -3); CHECK_EQUAL(arrayMax(m1), 16); int sum = 0, sumsq = 0; for (unsigned i=0; i<3; ++i) for (unsigned j=0; j<4; ++j) { sum += a1[i][j]; sumsq += a1[i][j]*a1[i][j]; } CHECK_EQUAL(m1.sumsq(), sumsq); CHECK_EQUAL(m1.sum(), sum); ArrayND m2(makeShape(3, 4, 5, 6)); unsigned maxind[4], minind[4]; for (unsigned icycle=0; icycle<1000; ++icycle) { double maxval = -1.0; double minval = 2.0; for (unsigned i=0; i<3; ++i) for (unsigned j=0; j<4; ++j) for (unsigned k=0; k<5; ++k) for (unsigned l=0; l<6; ++l) { const double nextval = test_rng(); if (nextval > maxval) { maxval = nextval; maxind[0] = i; maxind[1] = j; maxind[2] = k; maxind[3] = l; } if (nextval < minval) { minval = nextval; minind[0] = i; minind[1] = j; minind[2] = k; minind[3] = l; } m2(i, j, k, l) = nextval; } const std::pair& minmax = arrayMinMax(m2); const double amin = minmax.first; const double amax = minmax.second; const ArrayShape& minlook = arrayArgmin(m2); const ArrayShape& maxlook = arrayArgmax(m2); CHECK_EQUAL(amin, minval); CHECK_EQUAL(amax, maxval); for (unsigned i=0; i<4; ++i) CHECK_EQUAL(minlook[i], minind[i]); for (unsigned i=0; i<4; ++i) CHECK_EQUAL(maxlook[i], maxind[i]); } } TEST(ArrayNDslice) { int a1[3][4] = {{2, 5, -3, 8}, {8, 3, 16, 7}, {7, 4, 2, -3}}; ArrayND m1(makeShape(3, 4)); m1.setData(&a1[0][0], m1.length()); const unsigned fixed1[] = {0, 1}; unsigned values[] = {1, 2}; ArrayND slice1(m1, fixed1, sizeof(fixed1)/sizeof(fixed1[0])); ArrayND slice1_2(m1, fixed1, sizeof(fixed1)/sizeof(fixed1[0])); CHECK_EQUAL(slice1.shape().size(), 0U); const ArrayShape& sh1 = m1.sliceShape( fixed1, sizeof(fixed1)/sizeof(fixed1[0])); CHECK(sh1 == slice1.shape()); for (unsigned i=0; i<3; ++i) { values[0] = i; for (unsigned j=0; j<4; ++j) { values[1] = j; m1.exportSlice(&slice1, fixed1, values, 2U); m1.exportMemSlice(const_cast(slice1_2.data()), slice1_2.length(), fixed1, values, 2U); CHECK_EQUAL(a1[i][j], slice1()); CHECK(slice1 == slice1_2); DeltaProjector dp(fixed1, values, 2U); m1.project(&slice1, dp, fixed1, 2U); CHECK_EQUAL(a1[i][j], slice1()); } } const unsigned fixed2[] = {0}; ArrayND* slice2 = new ArrayND(m1, fixed2, sizeof(fixed2)/sizeof(fixed2[0])); ArrayND* slice2_2 = new ArrayND(m1, fixed2, sizeof(fixed2)/sizeof(fixed2[0])); const ArrayShape& sh2 = m1.sliceShape( fixed2, sizeof(fixed2)/sizeof(fixed2[0])); CHECK_EQUAL(slice2->shape().size(), 1U); CHECK_EQUAL(slice2->shape()[0], 4U); CHECK(sh2 == slice2->shape()); for (unsigned i=0; i<3; ++i) { values[0] = i; m1.exportSlice(slice2, fixed2, values, 1U); m1.exportMemSlice(const_cast(slice2_2->data()), slice2_2->length(), fixed2, values, 1U); for (unsigned j=0; j<4; ++j) CHECK_EQUAL(a1[i][j], (*slice2)(j)); CHECK(*slice2 == *slice2_2); DeltaProjector dp(fixed2, values, 1U); m1.project(slice2, dp, fixed2, 1U); for (unsigned j=0; j<4; ++j) CHECK_EQUAL(a1[i][j], (*slice2)(j)); } int a3[3][4] = {{2, 5, -3, 8}, {0, 0, 0, 0}, {7, 4, 2, -3}}; ArrayND mcopy2(makeShape(3, 4)); mcopy2.setData(&a3[0][0], mcopy2.length()); values[0] = 1; m1.exportSlice(slice2, fixed2, values, 1U); mcopy2.importSlice(*slice2, fixed2, values, 1U); CHECK(m1 == mcopy2); const unsigned fixed3[] = {1}; ArrayND* slice3 = new ArrayND(m1, fixed3, sizeof(fixed3)/sizeof(fixed3[0])); ArrayND* slice3_2 = new ArrayND(m1, fixed3, sizeof(fixed3)/sizeof(fixed3[0])); const ArrayShape& sh3 = m1.sliceShape( fixed3, sizeof(fixed3)/sizeof(fixed3[0])); CHECK_EQUAL(slice3->shape().size(), 1U); CHECK_EQUAL(slice3->shape()[0], 3U); CHECK(sh3 == slice3->shape()); for (unsigned j=0; j<4; ++j) { values[0] = j; m1.exportSlice(slice3, fixed3, values, 1U); m1.exportMemSlice(const_cast(slice3_2->data()), slice3_2->length(), fixed3, values, 1U); for (unsigned i=0; i<3; ++i) CHECK_EQUAL(a1[i][j], (*slice3)(i)); CHECK(*slice3 == *slice3_2); } int a2[3][4] = {{2, 5, 0, 8}, {8, 3, 0, 7}, {7, 4, 0, -3}}; ArrayND mcopy(makeShape(3, 4)); mcopy.setData(&a2[0][0], mcopy.length()); values[0] = 2; m1.exportSlice(slice3, fixed3, values, 1U); mcopy.importSlice(*slice3, fixed3, values, 1U); CHECK(m1 == mcopy); m1.exportMemSlice(const_cast(slice3_2->data()), slice3_2->length(), fixed3, values, 1U); mcopy.importMemSlice(slice3_2->data(), slice3_2->length(), fixed3, values, 1U); CHECK(m1 == mcopy); delete slice3_2; delete slice3; delete slice2_2; delete slice2; } TEST(ArrayNDcdfArray) { std::vector*> arrays; ArrayND m1(makeShape(7)); unsigned long len = m1.length(); for (unsigned long i=0; i m2(makeShape(4, 5)); len = m2.length(); for (unsigned long i=0; i m3(makeShape(6, 4, 5)); len = m3.length(); for (unsigned long i=0; i m4(makeShape(6, 4, 5, 7)); len = m4.length(); for (unsigned long i=0; i cdf(arrays[i]->cdfArray()); ArrayND deri(cdf.derivative()); CHECK(deri == *arrays[i]); } } TEST(ArrayNDproject) { int a1[3][4] = {{2, 5, -3, 8}, {8, 3, 16, 7}, {7, 4, 2, -3}}; ArrayND m1(makeShape(3, 4)); m1.setData(&a1[0][0], m1.length()); const unsigned fixed1[] = {0, 1}; ArrayND* slice1 = new ArrayND(m1, fixed1, sizeof(fixed1)/sizeof(fixed1[0])); CHECK_EQUAL(slice1->shape().size(), 0U); ArraySumProjector projector; m1.project(slice1, projector, fixed1, 2U); CHECK_EQUAL(m1.sum(), slice1->value(0, 0U)); const unsigned fixed2[] = {0}; ArrayND* slice2 = new ArrayND(m1, fixed2, sizeof(fixed2)/sizeof(fixed2[0])); m1.project(slice2, projector, fixed2, 1U); for (unsigned j=0; j<4U; ++j) { int sum = 0; for (unsigned i=0; i<3U; ++i) sum += a1[i][j]; CHECK_EQUAL((*slice2)(j), sum); } ArrayMaxProjector proj2; m1.project(slice2, proj2, fixed2, 1U); CHECK_EQUAL((*slice2)(0), 8); CHECK_EQUAL((*slice2)(1), 5); CHECK_EQUAL((*slice2)(2), 16); CHECK_EQUAL((*slice2)(3), 8); const unsigned fixed3[] = {1}; ArrayND* slice3 = new ArrayND(m1, fixed3, sizeof(fixed3)/sizeof(fixed3[0])); m1.project(slice3, projector, fixed3, 1U); for (unsigned i=0; i<3U; ++i) { int sum = 0; for (unsigned j=0; j<4U; ++j) sum += a1[i][j]; CHECK_EQUAL((*slice3)(i), sum); } ArrayMaxProjector proj; m1.project(slice3, proj, fixed3, 1U); CHECK_EQUAL((*slice3)(0), 8); CHECK_EQUAL((*slice3)(1), 16); CHECK_EQUAL((*slice3)(2), 7); delete slice3; delete slice2; delete slice1; } TEST(ArrayND_IO) { ArrayShape shape(3); shape.at(0) = 7; shape.at(1) = 3; shape.at(2) = 19; ArrayND a1(shape); const unsigned long len = a1.length(); for (unsigned long i=0; i arr; ArrayND::restore(id, is, &arr); CHECK(a1 == arr); } TEST(ArrayND_coarseSum) { int a1[2][4] = {{1, 4, 2, 5}, {2, -10, 13, 11}}; int a3[1][4] = {{3, -6, 15, 16}}; int a2[2][2] = {{5, 7}, {-8, 24}}; int a4[2][1] = {{12}, {16}}; ArrayND m1(2, 4); m1.setData(&a1[0][0], m1.length()); ArrayND m2(2, 2); m2.setData(&a2[0][0], m2.length()); ArrayND m3(1, 4); m3.setData(&a3[0][0], m3.length()); ArrayND m4(2, 1); m4.setData(&a4[0][0], m4.length()); ArrayND a; m1.coarseSum(0, 1, &a); CHECK(a == m1); m1.coarseSum(0, 2, &a); CHECK(a == m3); m1.coarseSum(1, 2, &a); CHECK(a == m2); m1.coarseSum(1, 4, &a); CHECK(a == m4); } #ifdef CPP11_STD_AVAILABLE TEST(externalMemArrayND_1) { int data1[] = {0, 1, 2, 3}; const unsigned sz1 = sizeof(data1)/sizeof(data1[0]); ArrayND a1 = externalMemArrayND(data1, sz1); a1(1) = 17; CHECK_EQUAL(17, data1[1]); externalMemArrayND(data1, sz1)(2) = 23; CHECK_EQUAL(23, data1[2]); ArrayND a2; a2 = externalMemArrayND(data1, sz1); a2(0) = -10; CHECK_EQUAL(-10, data1[0]); } #endif // CPP11_STD_AVAILABLE } Index: trunk/autom4te.cache/requests =================================================================== --- trunk/autom4te.cache/requests (revision 643) +++ trunk/autom4te.cache/requests (revision 644) @@ -1,509 +1,509 @@ # This file was generated by Autom4te Sun Aug 20 23:09:08 UTC 2017. # It contains the lists of macros which have been traced. # It can be safely removed. @request = ( bless( [ '0', 1, [ '/usr/share/autoconf' ], [ '/usr/share/autoconf/autoconf/autoconf.m4f', '-', '/usr/share/aclocal-1.15/internal/ac-config-macro-dirs.m4', '/usr/share/aclocal/pkg.m4', '/usr/share/aclocal-1.15/amversion.m4', '/usr/share/aclocal-1.15/auxdir.m4', '/usr/share/aclocal-1.15/cond.m4', '/usr/share/aclocal-1.15/depend.m4', '/usr/share/aclocal-1.15/depout.m4', '/usr/share/aclocal-1.15/init.m4', '/usr/share/aclocal-1.15/install-sh.m4', '/usr/share/aclocal-1.15/lead-dot.m4', '/usr/share/aclocal-1.15/make.m4', '/usr/share/aclocal-1.15/missing.m4', '/usr/share/aclocal-1.15/options.m4', '/usr/share/aclocal-1.15/prog-cc-c-o.m4', '/usr/share/aclocal-1.15/runlog.m4', '/usr/share/aclocal-1.15/sanity.m4', '/usr/share/aclocal-1.15/silent.m4', '/usr/share/aclocal-1.15/strip.m4', '/usr/share/aclocal-1.15/substnot.m4', '/usr/share/aclocal-1.15/tar.m4', 'm4/libtool.m4', 'm4/ltoptions.m4', 'm4/ltsugar.m4', 'm4/ltversion.m4', 'm4/lt~obsolete.m4', 'configure.ac' ], { - 'AM_PROG_NM' => 1, - 'AC_CONFIG_MACRO_DIR_TRACE' => 1, - 'LT_PROG_RC' => 1, - 'AC_LIBTOOL_LANG_CXX_CONFIG' => 1, - 'PKG_CHECK_MODULES_STATIC' => 1, - 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, - 'LT_LIB_M' => 1, - 'AM_MISSING_PROG' => 1, - 'm4_include' => 1, - 'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1, - 'AM_SET_LEADING_DOT' => 1, - 'AC_LIBTOOL_PROG_CC_C_O' => 1, - 'PKG_CHECK_VAR' => 1, + '_LT_AC_SYS_COMPILER' => 1, + '_AM_AUTOCONF_VERSION' => 1, + 'AC_CONFIG_MACRO_DIR' => 1, + '_AM_SET_OPTION' => 1, '_LT_CC_BASENAME' => 1, - 'AC_ENABLE_FAST_INSTALL' => 1, - 'AC_ENABLE_STATIC' => 1, - 'AC_CHECK_LIBM' => 1, - 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, - 'AC_PROG_LIBTOOL' => 1, + '_PKG_SHORT_ERRORS_SUPPORTED' => 1, + '_LT_AC_LANG_F77_CONFIG' => 1, + '_LT_PROG_ECHO_BACKSLASH' => 1, + 'AC_PROG_NM' => 1, + 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, + '_LT_AC_LANG_RC_CONFIG' => 1, + 'AC_PROG_EGREP' => 1, 'AC_DEFUN' => 1, - 'LT_AC_PROG_GCJ' => 1, - '_LT_PROG_CXX' => 1, - 'AM_PROG_LD' => 1, - '_AM_PROG_TAR' => 1, - 'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1, - 'AC_DISABLE_SHARED' => 1, - 'AC_LIBTOOL_CONFIG' => 1, + 'AC_LIBTOOL_OBJDIR' => 1, + 'AC_DISABLE_STATIC' => 1, + 'LTVERSION_VERSION' => 1, + 'AU_DEFUN' => 1, + 'LT_PROG_RC' => 1, + '_LT_AC_PROG_ECHO_BACKSLASH' => 1, + '_LT_PROG_FC' => 1, + 'PKG_INSTALLDIR' => 1, '_LT_DLL_DEF_P' => 1, + 'AC_LIBTOOL_PROG_CC_C_O' => 1, + 'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1, 'AM_INIT_AUTOMAKE' => 1, - 'LTOPTIONS_VERSION' => 1, - 'AM_SILENT_RULES' => 1, - 'AC_LIBTOOL_RC' => 1, - 'AC_LIBTOOL_POSTDEP_PREDEP' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AM_CONDITIONAL' => 1, 'AC_LIBTOOL_LANG_RC_CONFIG' => 1, - 'LT_AC_PROG_SED' => 1, - 'AC_DEFUN_ONCE' => 1, - 'LT_INIT' => 1, - '_LT_AC_LANG_F77' => 1, - 'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1, - 'LT_PATH_LD' => 1, - 'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1, - '_LT_PATH_TOOL_PREFIX' => 1, - 'm4_pattern_forbid' => 1, - '_LT_LINKER_OPTION' => 1, - 'LTVERSION_VERSION' => 1, - 'PKG_CHECK_MODULES' => 1, - '_LT_AC_TAGVAR' => 1, - '_AM_IF_OPTION' => 1, - 'AC_CONFIG_MACRO_DIR' => 1, - 'include' => 1, - 'AM_MAKE_INCLUDE' => 1, + '_LT_PROG_CXX' => 1, + 'm4_pattern_allow' => 1, + 'PKG_CHECK_MODULES_STATIC' => 1, + 'AM_MISSING_HAS_RUN' => 1, '_LT_WITH_SYSROOT' => 1, + 'AM_SILENT_RULES' => 1, '_LT_AC_LANG_GCJ' => 1, - 'AC_LIBTOOL_OBJDIR' => 1, - 'AC_LIBTOOL_DLOPEN' => 1, - '_LT_PROG_F77' => 1, + 'AC_LIBTOOL_GCJ' => 1, + 'LT_AC_PROG_EGREP' => 1, + 'AC_LIBTOOL_DLOPEN_SELF' => 1, + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, + '_LT_AC_TAGVAR' => 1, + 'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'AC_DEFUN_ONCE' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AM_PROG_LD' => 1, + 'm4_pattern_forbid' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AM_RUN_LOG' => 1, + 'LT_OUTPUT' => 1, + '_AM_MANGLE_OPTION' => 1, + '_AM_PROG_TAR' => 1, + '_LT_PREPARE_SED_QUOTE_VARS' => 1, + '_LT_AC_FILE_LTDLL_C' => 1, + 'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + 'AC_LIBTOOL_F77' => 1, + '_LT_COMPILER_BOILERPLATE' => 1, + 'LT_AC_PROG_GCJ' => 1, + 'AC_ENABLE_STATIC' => 1, + 'AC_LIBTOOL_COMPILER_OPTION' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + 'PKG_CHECK_VAR' => 1, + '_LT_AC_SYS_LIBPATH_AIX' => 1, + '_AM_CONFIG_MACRO_DIRS' => 1, + 'AC_LIBTOOL_LANG_CXX_CONFIG' => 1, + 'AC_LIBTOOL_SYS_LIB_STRIP' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, + 'AC_LIBTOOL_CONFIG' => 1, + 'AC_LIBTOOL_WIN32_DLL' => 1, + '_LT_REQUIRED_DARWIN_CHECKS' => 1, + 'AC_LIBTOOL_PROG_COMPILER_PIC' => 1, + 'AM_SET_DEPDIR' => 1, 'AM_DISABLE_STATIC' => 1, - 'LT_PATH_NM' => 1, - '_AM_SUBST_NOTMAKE' => 1, + 'LTSUGAR_VERSION' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'LT_PROG_GCJ' => 1, 'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1, - 'PKG_INSTALLDIR' => 1, - 'AC_PROG_LD' => 1, 'AC_LIBTOOL_LANG_C_CONFIG' => 1, - 'AM_CONDITIONAL' => 1, - '_LT_AC_LANG_C_CONFIG' => 1, - 'PKG_NOARCH_INSTALLDIR' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'AC_ENABLE_SHARED' => 1, + 'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AC_LTDL_OBJDIR' => 1, + 'LT_LIB_M' => 1, + 'AC_LIBTOOL_SETUP' => 1, + '_LT_PROG_LTMAIN' => 1, + 'LT_PATH_LD' => 1, + 'AC_PATH_TOOL_PREFIX' => 1, + 'AC_LIBTOOL_POSTDEP_PREDEP' => 1, + 'AC_PATH_MAGIC' => 1, + 'AM_PROG_NM' => 1, + 'AC_LIBTOOL_PROG_LD_SHLIBS' => 1, + 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, + '_m4_warn' => 1, 'AC_LTDL_ENABLE_INSTALL' => 1, + '_LT_PROG_F77' => 1, 'LTOBSOLETE_VERSION' => 1, - '_LT_AC_SYS_COMPILER' => 1, - 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - 'AC_LIBTOOL_GCJ' => 1, - '_AM_CONFIG_MACRO_DIRS' => 1, - 'AM_AUX_DIR_EXPAND' => 1, - 'AC_LIBTOOL_PICMODE' => 1, - 'LT_LANG' => 1, - '_LT_AC_TRY_DLOPEN_SELF' => 1, - '_LT_REQUIRED_DARWIN_CHECKS' => 1, - '_LT_AC_PROG_ECHO_BACKSLASH' => 1, - '_LT_AC_SYS_LIBPATH_AIX' => 1, - 'AM_PROG_CC_C_O' => 1, - '_LT_AC_TAGCONFIG' => 1, - 'AC_LIBTOOL_SETUP' => 1, + 'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1, 'AC_LTDL_PREOPEN' => 1, - '_AM_DEPENDENCIES' => 1, - 'AC_LTDL_OBJDIR' => 1, - 'LT_AC_PROG_EGREP' => 1, - '_LT_AC_PROG_CXXCPP' => 1, - 'AM_PROG_INSTALL_STRIP' => 1, - 'LT_SYS_DLOPEN_SELF' => 1, - '_LT_PROG_ECHO_BACKSLASH' => 1, - '_LT_AC_FILE_LTDLL_C' => 1, - 'LT_SUPPORTED_TAG' => 1, - 'AC_PROG_NM' => 1, - 'LT_PROG_GO' => 1, - 'AC_LIBTOOL_COMPILER_OPTION' => 1, - '_AM_AUTOCONF_VERSION' => 1, - 'LT_AC_PROG_RC' => 1, + 'LT_LANG' => 1, + 'AC_LIBTOOL_CXX' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'LT_INIT' => 1, 'AC_PROG_LD_RELOAD_FLAG' => 1, - '_PKG_SHORT_ERRORS_SUPPORTED' => 1, '_LT_AC_LANG_CXX_CONFIG' => 1, - 'AM_SANITY_CHECK' => 1, - '_LT_AC_LANG_RC_CONFIG' => 1, - '_LT_AC_CHECK_DLFCN' => 1, - '_LT_AC_LANG_CXX' => 1, - 'AC_LIBTOOL_LINKER_OPTION' => 1, - '_AM_PROG_CC_C_O' => 1, - 'AC_LIBTOOL_FC' => 1, + 'PKG_CHECK_MODULES' => 1, + 'AC_ENABLE_SHARED' => 1, + '_LT_AC_LANG_F77' => 1, 'PKG_PROG_PKG_CONFIG' => 1, - 'LT_CMD_MAX_LEN' => 1, - '_AM_SET_OPTIONS' => 1, - '_LT_PREPARE_SED_QUOTE_VARS' => 1, - 'AC_LIBTOOL_WIN32_DLL' => 1, - 'AC_PATH_MAGIC' => 1, - 'LT_PROG_GCJ' => 1, - 'LTSUGAR_VERSION' => 1, - '_AM_MANGLE_OPTION' => 1, - 'AC_PROG_EGREP' => 1, - 'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1, - '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - 'LT_OUTPUT' => 1, - 'AM_SUBST_NOTMAKE' => 1, - 'AC_LIBTOOL_SYS_LIB_STRIP' => 1, - 'AC_PATH_TOOL_PREFIX' => 1, - 'AM_MISSING_HAS_RUN' => 1, - '_m4_warn' => 1, - 'PKG_CHECK_EXISTS' => 1, - 'AC_LIBTOOL_DLOPEN_SELF' => 1, - '_AC_PROG_LIBTOOL' => 1, - '_LT_AC_LANG_F77_CONFIG' => 1, - '_AM_SET_OPTION' => 1, + 'AC_DISABLE_SHARED' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AC_PROG_LD' => 1, + '_AM_PROG_CC_C_O' => 1, + 'AC_DISABLE_FAST_INSTALL' => 1, + 'AM_ENABLE_STATIC' => 1, 'AM_DEP_TRACK' => 1, - 'm4_pattern_allow' => 1, - 'AC_DEPLIBS_CHECK_METHOD' => 1, - 'AM_SET_DEPDIR' => 1, - '_LT_PROG_LTMAIN' => 1, + '_LT_AC_LANG_GCJ_CONFIG' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + '_LT_AC_LANG_C_CONFIG' => 1, + 'LTOPTIONS_VERSION' => 1, + 'AM_SANITY_CHECK' => 1, + 'AC_LIBTOOL_PICMODE' => 1, '_LT_COMPILER_OPTION' => 1, - '_AC_AM_CONFIG_HEADER_HOOK' => 1, - '_LT_COMPILER_BOILERPLATE' => 1, + '_AM_IF_OPTION' => 1, + '_AC_PROG_LIBTOOL' => 1, + 'LT_SYS_DLOPEN_SELF' => 1, + '_LT_PATH_TOOL_PREFIX' => 1, + 'AM_PROG_INSTALL_SH' => 1, + '_LT_AC_TRY_DLOPEN_SELF' => 1, + 'PKG_NOARCH_INSTALLDIR' => 1, '_LT_LINKER_BOILERPLATE' => 1, - 'AC_PROG_LD_GNU' => 1, - 'AC_LIBTOOL_F77' => 1, - 'AC_LIBTOOL_PROG_LD_SHLIBS' => 1, - 'AC_DISABLE_FAST_INSTALL' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AM_MISSING_PROG' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'include' => 1, + 'AC_LIBTOOL_RC' => 1, + 'LT_CMD_MAX_LEN' => 1, + '_LT_LINKER_OPTION' => 1, + '_AM_SET_OPTIONS' => 1, '_LT_AC_SHELL_INIT' => 1, - 'AM_RUN_LOG' => 1, - 'AM_PROG_INSTALL_SH' => 1, - 'AC_DISABLE_STATIC' => 1, - 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, - 'AC_LIBTOOL_CXX' => 1, - 'AU_DEFUN' => 1, - 'AM_ENABLE_STATIC' => 1, - 'AC_LIBTOOL_PROG_COMPILER_PIC' => 1, - 'AM_ENABLE_SHARED' => 1, - 'AM_PROG_LIBTOOL' => 1, + 'AC_LIBTOOL_DLOPEN' => 1, + 'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1, 'AM_DISABLE_SHARED' => 1, - 'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1, - '_LT_PROG_FC' => 1, + 'AM_ENABLE_SHARED' => 1, + 'AC_DEPLIBS_CHECK_METHOD' => 1, + 'LT_PROG_GO' => 1, + 'AC_LIBTOOL_FC' => 1, + 'PKG_CHECK_EXISTS' => 1, + 'AC_CHECK_LIBM' => 1, + 'AM_SET_LEADING_DOT' => 1, + '_LT_AC_CHECK_DLFCN' => 1, + 'AC_ENABLE_FAST_INSTALL' => 1, + '_AM_DEPENDENCIES' => 1, '_LT_AC_LOCK' => 1, - '_LT_AC_LANG_GCJ_CONFIG' => 1 + 'AC_LIBTOOL_LINKER_OPTION' => 1, + '_LT_AC_PROG_CXXCPP' => 1, + 'LT_PATH_NM' => 1, + 'AM_MAKE_INCLUDE' => 1, + '_LT_AC_LANG_CXX' => 1, + 'm4_include' => 1, + 'LT_AC_PROG_RC' => 1, + 'AC_PROG_LD_GNU' => 1, + 'LT_AC_PROG_SED' => 1 } ], 'Autom4te::Request' ), bless( [ '1', 1, [ '/usr/share/autoconf' ], [ '/usr/share/autoconf/autoconf/autoconf.m4f', 'aclocal.m4', 'configure.ac' ], { - 'sinclude' => 1, - 'LT_SUPPORTED_TAG' => 1, - 'LT_INIT' => 1, - 'm4_include' => 1, - 'AC_CANONICAL_TARGET' => 1, - 'm4_pattern_allow' => 1, - 'AC_FC_PP_DEFINE' => 1, - 'm4_pattern_forbid' => 1, - 'AC_LIBSOURCE' => 1, - 'AC_FC_FREEFORM' => 1, - 'AC_FC_PP_SRCEXT' => 1, - 'AC_FC_SRCEXT' => 1, 'AM_ENABLE_MULTILIB' => 1, - 'AC_REQUIRE_AUX_FILE' => 1, - 'AC_SUBST_TRACE' => 1, - '_AM_COND_ELSE' => 1, - 'AM_PATH_GUILE' => 1, - 'AC_CONFIG_AUX_DIR' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + '_AM_COND_IF' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'AM_PROG_FC_C_O' => 1, + 'include' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AC_CONFIG_HEADERS' => 1, + 'm4_pattern_forbid' => 1, + 'm4_sinclude' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AC_FC_FREEFORM' => 1, + 'AM_PROG_MOC' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + '_AM_MAKEFILE_INCLUDE' => 1, 'AC_CONFIG_LIBOBJ_DIR' => 1, - '_AM_SUBST_NOTMAKE' => 1, + '_m4_warn' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + '_AM_COND_ENDIF' => 1, 'AM_GNU_GETTEXT' => 1, - 'include' => 1, - 'AM_PROG_CXX_C_O' => 1, - 'AM_POT_TOOLS' => 1, - 'AM_XGETTEXT_OPTION' => 1, + '_AM_SUBST_NOTMAKE' => 1, 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, - 'AM_PROG_MOC' => 1, - 'AM_EXTRA_RECURSIVE_TARGETS' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - '_AM_COND_ENDIF' => 1, - 'AM_PROG_AR' => 1, + 'LT_INIT' => 1, + 'AM_PATH_GUILE' => 1, + 'AM_PROG_F77_C_O' => 1, + 'AC_FC_PP_DEFINE' => 1, + 'AM_PROG_CXX_C_O' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AC_CANONICAL_BUILD' => 1, 'AC_CONFIG_LINKS' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + 'AM_PROG_AR' => 1, 'AC_CANONICAL_HOST' => 1, - 'AM_MAINTAINER_MODE' => 1, - '_AM_COND_IF' => 1, + 'AM_PROG_CC_C_O' => 1, 'AC_CONFIG_FILES' => 1, - 'LT_CONFIG_LTDL_DIR' => 1, - 'AC_PROG_LIBTOOL' => 1, - '_AM_MAKEFILE_INCLUDE' => 1, - 'AC_INIT' => 1, - 'm4_sinclude' => 1, - 'AM_PROG_MKDIR_P' => 1, - 'AC_SUBST' => 1, - 'AM_MAKEFILE_INCLUDE' => 1, + 'AM_NLS' => 1, + 'AC_CONFIG_AUX_DIR' => 1, 'AM_CONDITIONAL' => 1, - 'AM_PROG_FC_C_O' => 1, - 'AH_OUTPUT' => 1, - 'AC_CONFIG_SUBDIRS' => 1, - '_LT_AC_TAGCONFIG' => 1, - 'AM_PROG_CC_C_O' => 1, - 'AC_CANONICAL_SYSTEM' => 1, - '_m4_warn' => 1, - 'AM_PROG_LIBTOOL' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + 'AM_POT_TOOLS' => 1, 'AM_INIT_AUTOMAKE' => 1, - 'AC_CANONICAL_BUILD' => 1, + 'sinclude' => 1, + 'AM_EXTRA_RECURSIVE_TARGETS' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AC_FC_PP_SRCEXT' => 1, + 'AC_SUBST' => 1, 'AM_SILENT_RULES' => 1, - 'AM_PROG_F77_C_O' => 1, - 'AM_NLS' => 1 + 'm4_pattern_allow' => 1, + '_AM_COND_ELSE' => 1, + 'AC_SUBST_TRACE' => 1, + 'AH_OUTPUT' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'AC_LIBSOURCE' => 1, + 'AC_FC_SRCEXT' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'm4_include' => 1, + 'AC_INIT' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AC_CONFIG_HEADERS' => 1 } ], 'Autom4te::Request' ), bless( [ '2', 1, [ '/usr/share/autoconf' ], [ '/usr/share/autoconf/autoconf/autoconf.m4f', '-', '/usr/share/aclocal-1.15/internal/ac-config-macro-dirs.m4', '/usr/share/aclocal/ltargz.m4', '/usr/share/aclocal/ltdl.m4', '/usr/share/aclocal/pkg.m4', '/usr/share/aclocal-1.15/amversion.m4', '/usr/share/aclocal-1.15/auxdir.m4', '/usr/share/aclocal-1.15/cond.m4', '/usr/share/aclocal-1.15/depend.m4', '/usr/share/aclocal-1.15/depout.m4', '/usr/share/aclocal-1.15/init.m4', '/usr/share/aclocal-1.15/install-sh.m4', '/usr/share/aclocal-1.15/lead-dot.m4', '/usr/share/aclocal-1.15/make.m4', '/usr/share/aclocal-1.15/missing.m4', '/usr/share/aclocal-1.15/options.m4', '/usr/share/aclocal-1.15/prog-cc-c-o.m4', '/usr/share/aclocal-1.15/runlog.m4', '/usr/share/aclocal-1.15/sanity.m4', '/usr/share/aclocal-1.15/silent.m4', '/usr/share/aclocal-1.15/strip.m4', '/usr/share/aclocal-1.15/substnot.m4', '/usr/share/aclocal-1.15/tar.m4', 'm4/libtool.m4', 'm4/ltoptions.m4', 'm4/ltsugar.m4', 'm4/ltversion.m4', 'm4/lt~obsolete.m4', 'configure.ac' ], { + 'AC_CONFIG_MACRO_DIR' => 1, + '_LT_AC_SYS_COMPILER' => 1, + '_AM_AUTOCONF_VERSION' => 1, + '_LT_PROG_ECHO_BACKSLASH' => 1, + '_LT_AC_LANG_F77_CONFIG' => 1, + 'LT_WITH_LTDL' => 1, + '_PKG_SHORT_ERRORS_SUPPORTED' => 1, + '_LT_CC_BASENAME' => 1, + '_AM_SET_OPTION' => 1, + 'AC_DISABLE_STATIC' => 1, + 'AC_LIBTOOL_OBJDIR' => 1, 'AC_DEFUN' => 1, - 'AC_PROG_LIBTOOL' => 1, - 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, - '_LT_PROG_CXX' => 1, - 'LT_AC_PROG_GCJ' => 1, - 'AM_PROG_LD' => 1, - 'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1, - 'AC_DISABLE_SHARED' => 1, - '_AM_PROG_TAR' => 1, - 'LTDL_INIT' => 1, - 'AC_LIBTOOL_CONFIG' => 1, + '_LT_AC_LANG_RC_CONFIG' => 1, + 'AC_PROG_EGREP' => 1, + 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, + 'AC_PROG_NM' => 1, + 'AU_DEFUN' => 1, + 'AC_LIBLTDL_INSTALLABLE' => 1, + 'LTVERSION_VERSION' => 1, + 'LT_LIB_DLLOAD' => 1, + 'AC_LTDL_DLSYM_USCORE' => 1, '_LT_DLL_DEF_P' => 1, + '_LT_PROG_FC' => 1, + 'PKG_INSTALLDIR' => 1, + '_LT_AC_PROG_ECHO_BACKSLASH' => 1, + 'LT_PROG_RC' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_PROG_CC_C_O' => 1, 'AM_INIT_AUTOMAKE' => 1, - 'LTOPTIONS_VERSION' => 1, + 'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1, + 'LT_SYS_MODULE_PATH' => 1, + 'AC_LIBTOOL_PROG_CC_C_O' => 1, + '_LT_AC_LANG_GCJ' => 1, 'AM_SILENT_RULES' => 1, - 'AC_LIBTOOL_POSTDEP_PREDEP' => 1, - 'AC_LIBTOOL_RC' => 1, + '_LT_WITH_SYSROOT' => 1, + 'PKG_CHECK_MODULES_STATIC' => 1, + 'AM_MISSING_HAS_RUN' => 1, + 'm4_pattern_allow' => 1, + 'AC_LIB_LTDL' => 1, + '_LT_PROG_CXX' => 1, 'AC_LIBTOOL_LANG_RC_CONFIG' => 1, - 'AM_PROG_NM' => 1, - 'LT_PROG_RC' => 1, - 'AC_LIBTOOL_LANG_CXX_CONFIG' => 1, + 'AC_LIBTOOL_DLOPEN_SELF' => 1, 'AC_CONFIG_MACRO_DIR_TRACE' => 1, - 'AC_WITH_LTDL' => 1, - 'LT_SYS_DLOPEN_DEPLIBS' => 1, - 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, - 'PKG_CHECK_MODULES_STATIC' => 1, - 'LT_LIB_M' => 1, - 'AM_MISSING_PROG' => 1, - 'm4_include' => 1, - 'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1, - 'AM_SET_LEADING_DOT' => 1, - 'AC_LIBTOOL_PROG_CC_C_O' => 1, - 'AC_LIBLTDL_CONVENIENCE' => 1, - '_LT_CC_BASENAME' => 1, - 'PKG_CHECK_VAR' => 1, - 'LT_FUNC_ARGZ' => 1, - 'AC_LIBLTDL_INSTALLABLE' => 1, - 'AC_ENABLE_FAST_INSTALL' => 1, - 'AC_ENABLE_STATIC' => 1, - 'AC_CHECK_LIBM' => 1, - 'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1, - 'AC_PROG_LD' => 1, - 'PKG_INSTALLDIR' => 1, - 'AM_CONDITIONAL' => 1, - 'AC_LIBTOOL_LANG_C_CONFIG' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'AC_ENABLE_SHARED' => 1, - 'PKG_NOARCH_INSTALLDIR' => 1, - '_LT_AC_LANG_C_CONFIG' => 1, - 'AC_LTDL_ENABLE_INSTALL' => 1, - 'LTOBSOLETE_VERSION' => 1, - 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - '_LT_AC_SYS_COMPILER' => 1, - 'LT_SYS_SYMBOL_USCORE' => 1, - 'AC_LIBTOOL_PICMODE' => 1, - '_AM_CONFIG_MACRO_DIRS' => 1, - 'AM_AUX_DIR_EXPAND' => 1, + 'LT_AC_PROG_EGREP' => 1, 'AC_LIBTOOL_GCJ' => 1, - '_LT_REQUIRED_DARWIN_CHECKS' => 1, - '_LT_AC_TRY_DLOPEN_SELF' => 1, - 'LT_LANG' => 1, - '_LT_AC_PROG_ECHO_BACKSLASH' => 1, - '_LT_AC_SYS_LIBPATH_AIX' => 1, - '_LT_AC_TAGCONFIG' => 1, - 'AM_PROG_CC_C_O' => 1, - '_AM_DEPENDENCIES' => 1, - 'AC_LTDL_PREOPEN' => 1, - 'AC_LTDL_OBJDIR' => 1, - 'AC_LIBTOOL_SETUP' => 1, - 'LT_AC_PROG_SED' => 1, - 'AC_LTDL_SYSSEARCHPATH' => 1, - 'LT_SYS_DLSEARCH_PATH' => 1, + 'AC_LTDL_DLLIB' => 1, + 'AM_SUBST_NOTMAKE' => 1, 'AC_DEFUN_ONCE' => 1, - '_LT_AC_LANG_F77' => 1, - 'LT_INIT' => 1, - '_LT_PATH_TOOL_PREFIX' => 1, - 'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1, - 'LT_PATH_LD' => 1, - 'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1, - 'm4_pattern_forbid' => 1, - 'LTDL_CONVENIENCE' => 1, - 'PKG_CHECK_MODULES' => 1, - '_LT_LINKER_OPTION' => 1, - 'LTVERSION_VERSION' => 1, - '_AM_IF_OPTION' => 1, + 'AC_LTDL_SYSSEARCHPATH' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1, '_LT_AC_TAGVAR' => 1, - 'include' => 1, - 'AC_CONFIG_MACRO_DIR' => 1, - 'LT_FUNC_DLSYM_USCORE' => 1, - 'AM_MAKE_INCLUDE' => 1, - '_LT_WITH_SYSROOT' => 1, - '_LT_AC_LANG_GCJ' => 1, - 'AC_LIBTOOL_OBJDIR' => 1, - '_LTDL_SETUP' => 1, - '_LT_PROG_F77' => 1, - 'LT_LIB_DLLOAD' => 1, - 'AC_LIBTOOL_DLOPEN' => 1, - 'LT_PATH_NM' => 1, - 'AM_DISABLE_STATIC' => 1, - '_AM_SUBST_NOTMAKE' => 1, - 'LT_CMD_MAX_LEN' => 1, - 'PKG_PROG_PKG_CONFIG' => 1, - '_AM_SET_OPTIONS' => 1, + '_AM_PROG_TAR' => 1, + 'AM_RUN_LOG' => 1, + '_AM_MANGLE_OPTION' => 1, + 'LT_OUTPUT' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AM_PROG_LD' => 1, + 'm4_pattern_forbid' => 1, + '_LT_COMPILER_BOILERPLATE' => 1, + 'AC_LIBTOOL_F77' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + 'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1, + '_LT_AC_FILE_LTDLL_C' => 1, '_LT_PREPARE_SED_QUOTE_VARS' => 1, + '_LT_AC_SYS_LIBPATH_AIX' => 1, + 'PKG_CHECK_VAR' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + 'AC_LIBTOOL_COMPILER_OPTION' => 1, + 'AC_ENABLE_STATIC' => 1, + 'LT_AC_PROG_GCJ' => 1, + 'AC_LIBTOOL_SYS_LIB_STRIP' => 1, + 'AC_LIBTOOL_LANG_CXX_CONFIG' => 1, + '_AM_CONFIG_MACRO_DIRS' => 1, + '_LT_REQUIRED_DARWIN_CHECKS' => 1, 'AC_LIBTOOL_WIN32_DLL' => 1, - '_LT_LIBOBJ' => 1, - 'AC_LIB_LTDL' => 1, + 'AC_LIBTOOL_CONFIG' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, + 'LT_SYS_DLOPEN_DEPLIBS' => 1, + 'AC_LTDL_SYMBOL_USCORE' => 1, 'LT_PROG_GCJ' => 1, - 'AC_PATH_MAGIC' => 1, - '_AM_MANGLE_OPTION' => 1, - 'AC_PROG_EGREP' => 1, + 'AM_AUX_DIR_EXPAND' => 1, 'LTSUGAR_VERSION' => 1, - '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - 'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1, - 'LT_OUTPUT' => 1, + 'AM_DISABLE_STATIC' => 1, + 'LTDL_INIT' => 1, + 'AM_SET_DEPDIR' => 1, + 'AC_LIBTOOL_PROG_COMPILER_PIC' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1, + 'AC_LIBTOOL_LANG_C_CONFIG' => 1, + 'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1, + 'LT_PATH_LD' => 1, + '_LT_PROG_LTMAIN' => 1, + 'LT_LIB_M' => 1, + 'AC_LIBTOOL_SETUP' => 1, + 'AC_LTDL_OBJDIR' => 1, + 'LT_FUNC_DLSYM_USCORE' => 1, + 'AM_PROG_NM' => 1, + 'AC_PATH_MAGIC' => 1, + 'AC_LIBTOOL_POSTDEP_PREDEP' => 1, 'AC_PATH_TOOL_PREFIX' => 1, - 'AM_SUBST_NOTMAKE' => 1, - 'AC_LIBTOOL_SYS_LIB_STRIP' => 1, - 'LT_WITH_LTDL' => 1, - 'PKG_CHECK_EXISTS' => 1, - 'AM_MISSING_HAS_RUN' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + '_LT_PROG_F77' => 1, + 'AC_LTDL_ENABLE_INSTALL' => 1, '_m4_warn' => 1, - 'LT_AC_PROG_EGREP' => 1, - 'AM_PROG_INSTALL_STRIP' => 1, - '_LT_AC_PROG_CXXCPP' => 1, - 'LT_SYS_DLOPEN_SELF' => 1, - '_LT_PROG_ECHO_BACKSLASH' => 1, - 'LT_SUPPORTED_TAG' => 1, - '_LT_AC_FILE_LTDLL_C' => 1, - 'AC_PROG_NM' => 1, + 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, + 'AC_LIBTOOL_PROG_LD_SHLIBS' => 1, + 'LT_INIT' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AC_LIBTOOL_CXX' => 1, + 'AC_LTDL_PREOPEN' => 1, + 'LT_LANG' => 1, + '_LTDL_SETUP' => 1, + 'LTOBSOLETE_VERSION' => 1, + 'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1, + 'LT_SYS_DLSEARCH_PATH' => 1, + 'PKG_PROG_PKG_CONFIG' => 1, + '_LT_AC_LANG_F77' => 1, + 'AC_LTDL_SHLIBPATH' => 1, + 'LTDL_INSTALLABLE' => 1, + 'LT_SYS_SYMBOL_USCORE' => 1, + 'PKG_CHECK_MODULES' => 1, + 'AC_ENABLE_SHARED' => 1, 'AC_PROG_LD_RELOAD_FLAG' => 1, - 'LT_AC_PROG_RC' => 1, - '_AM_AUTOCONF_VERSION' => 1, - 'LT_PROG_GO' => 1, - 'AC_LIBTOOL_COMPILER_OPTION' => 1, - '_PKG_SHORT_ERRORS_SUPPORTED' => 1, '_LT_AC_LANG_CXX_CONFIG' => 1, - 'AM_SANITY_CHECK' => 1, - '_LT_AC_LANG_RC_CONFIG' => 1, - 'AC_LTDL_SHLIBEXT' => 1, - '_LT_AC_CHECK_DLFCN' => 1, - '_LT_AC_LANG_CXX' => 1, - 'AC_LIBTOOL_FC' => 1, - '_AM_PROG_CC_C_O' => 1, - 'AC_LIBTOOL_LINKER_OPTION' => 1, - 'AC_LIBTOOL_PROG_LD_SHLIBS' => 1, 'AC_DISABLE_FAST_INSTALL' => 1, - 'LT_CONFIG_LTDL_DIR' => 1, - 'AM_RUN_LOG' => 1, + '_AM_PROG_CC_C_O' => 1, + 'AC_PROG_LD' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1, + 'AC_DISABLE_SHARED' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + '_LT_AC_LANG_GCJ_CONFIG' => 1, + 'AM_DEP_TRACK' => 1, + 'AM_ENABLE_STATIC' => 1, + 'AC_LIBTOOL_PICMODE' => 1, + 'AM_SANITY_CHECK' => 1, + 'LTOPTIONS_VERSION' => 1, + '_LT_AC_LANG_C_CONFIG' => 1, + '_LT_PATH_TOOL_PREFIX' => 1, + 'LT_SYS_DLOPEN_SELF' => 1, + 'AC_WITH_LTDL' => 1, + '_AM_IF_OPTION' => 1, + '_AC_PROG_LIBTOOL' => 1, + '_LT_COMPILER_OPTION' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'include' => 1, + 'AM_MISSING_PROG' => 1, + 'LT_SUPPORTED_TAG' => 1, + '_LT_LINKER_BOILERPLATE' => 1, + 'PKG_NOARCH_INSTALLDIR' => 1, + '_LT_AC_TRY_DLOPEN_SELF' => 1, 'AM_PROG_INSTALL_SH' => 1, - '_LT_AC_SHELL_INIT' => 1, - 'AC_DISABLE_STATIC' => 1, - 'LTDL_INSTALLABLE' => 1, - 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, - 'AC_LIBTOOL_CXX' => 1, - 'AC_LTDL_SHLIBPATH' => 1, - 'LT_SYS_MODULE_PATH' => 1, - 'AU_DEFUN' => 1, - 'AM_PROG_LIBTOOL' => 1, + 'LT_CMD_MAX_LEN' => 1, + 'AC_LIBTOOL_RC' => 1, 'AM_ENABLE_SHARED' => 1, - 'AC_LIBTOOL_PROG_COMPILER_PIC' => 1, - 'AM_ENABLE_STATIC' => 1, 'AM_DISABLE_SHARED' => 1, - 'AC_LTDL_DLSYM_USCORE' => 1, - 'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1, - '_LT_PROG_FC' => 1, - '_LT_AC_LANG_GCJ_CONFIG' => 1, - '_LT_AC_LOCK' => 1, - 'AC_LTDL_SYMBOL_USCORE' => 1, - 'AC_LIBTOOL_DLOPEN_SELF' => 1, - '_AC_PROG_LIBTOOL' => 1, + 'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1, + '_LT_AC_SHELL_INIT' => 1, + 'AC_LIBTOOL_DLOPEN' => 1, + '_AM_SET_OPTIONS' => 1, 'LT_SYS_MODULE_EXT' => 1, - '_LT_AC_LANG_F77_CONFIG' => 1, - 'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1, - '_AM_SET_OPTION' => 1, - 'AM_DEP_TRACK' => 1, - 'm4_pattern_allow' => 1, + '_LT_LINKER_OPTION' => 1, + 'PKG_CHECK_EXISTS' => 1, + 'AC_LIBLTDL_CONVENIENCE' => 1, + 'AC_LIBTOOL_FC' => 1, + 'LT_PROG_GO' => 1, + 'AC_LTDL_SHLIBEXT' => 1, 'AC_DEPLIBS_CHECK_METHOD' => 1, - 'AM_SET_DEPDIR' => 1, - '_LT_PROG_LTMAIN' => 1, - '_LT_COMPILER_OPTION' => 1, - '_AC_AM_CONFIG_HEADER_HOOK' => 1, - 'AC_LTDL_DLLIB' => 1, - '_LT_LINKER_BOILERPLATE' => 1, - '_LT_COMPILER_BOILERPLATE' => 1, + 'LT_FUNC_ARGZ' => 1, + '_LT_AC_LOCK' => 1, + '_AM_DEPENDENCIES' => 1, + 'AC_ENABLE_FAST_INSTALL' => 1, + '_LT_AC_CHECK_DLFCN' => 1, + 'AC_CHECK_LIBM' => 1, + 'AM_SET_LEADING_DOT' => 1, + '_LT_LIBOBJ' => 1, + 'LT_PATH_NM' => 1, + 'AC_LIBTOOL_LINKER_OPTION' => 1, + '_LT_AC_PROG_CXXCPP' => 1, + 'LT_AC_PROG_SED' => 1, + 'LTDL_CONVENIENCE' => 1, 'AC_PROG_LD_GNU' => 1, - 'AC_LIBTOOL_F77' => 1 + 'LT_AC_PROG_RC' => 1, + 'm4_include' => 1, + '_LT_AC_LANG_CXX' => 1, + 'AM_MAKE_INCLUDE' => 1 } ], 'Autom4te::Request' ) ); Index: trunk/npstat/nm/ArrayND.icc =================================================================== --- trunk/npstat/nm/ArrayND.icc (revision 643) +++ trunk/npstat/nm/ArrayND.icc (revision 644) @@ -1,5877 +1,5972 @@ #include #include #include #include #include #include #include "geners/GenericIO.hh" #include "geners/IOIsUnsigned.hh" #include "npstat/nm/allocators.hh" #include "npstat/nm/interpolate.hh" #include "npstat/nm/absDifference.hh" #include "npstat/nm/ComplexComparesFalse.hh" #include "npstat/nm/ComplexComparesAbs.hh" #include "npstat/nm/LinearMapper1d.hh" #define me_macro_check_loop_prerequisites(METHOD, INNERLOOP) /**/ \ template \ template \ void ArrayND:: METHOD ( \ ArrayND& other, \ const unsigned* thisCorner, \ const unsigned* range, \ const unsigned* otherCorner, \ const unsigned arrLen, \ Functor binaryFunct) \ { \ if (!shapeIsKnown_) throw std::invalid_argument( \ "Initialize npstat::ArrayND before calling method \"" \ #METHOD "\""); \ if (!other.shapeIsKnown_) throw std::invalid_argument( \ "In npstat::ArrayND::" #METHOD ": uninitialized argument array");\ if (dim_ != other.dim_) throw std::invalid_argument( \ "In npstat::ArrayND::" #METHOD ": incompatible argument array rank");\ if (arrLen != dim_) throw std::invalid_argument( \ "In npstat::ArrayND::" #METHOD ": incompatible index length"); \ if (dim_) \ { \ assert(thisCorner); \ assert(range); \ assert(otherCorner); \ INNERLOOP (0U, 0UL, 0UL, thisCorner, range, \ otherCorner, other, binaryFunct); \ } \ else \ binaryFunct(localData_[0], other.localData_[0]); \ } namespace npstat { template template void ArrayND::commonSubrangeLoop( unsigned level, unsigned long idx0, unsigned long idx1, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, ArrayND& r, Functor binaryFunct) { const unsigned imax = range[level]; if (level == dim_ - 1) { Numeric* left = data_ + (idx0 + thisCorner[level]); Numeric* const lMax = data_ + (idx0 + shape_[level]); Num2* right = r.data_ + (idx1 + otherCorner[level]); Num2* const rMax = r.data_ + (idx1 + r.shape_[level]); for (unsigned i=0; i template void ArrayND::dualCircularLoop( unsigned level, unsigned long idx0, unsigned long idx1, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, ArrayND& r, Functor binaryFunct) { const unsigned imax = range[level]; const unsigned leftShift = thisCorner[level]; const unsigned leftPeriod = shape_[level]; const unsigned rightShift = otherCorner[level]; const unsigned rightPeriod = r.shape_[level]; if (level == dim_ - 1) { Numeric* left = data_ + idx0; Num2* right = r.data_ + idx1; for (unsigned i=0; i template void ArrayND::flatCircularLoop( unsigned level, unsigned long idx0, unsigned long idx1, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, ArrayND& r, Functor binaryFunct) { const unsigned imax = range[level]; const unsigned rightShift = otherCorner[level]; const unsigned rightPeriod = r.shape_[level]; if (level == dim_ - 1) { Numeric* left = data_ + (idx0 + thisCorner[level]); Numeric* const lMax = data_ + (idx0 + shape_[level]); Num2* right = r.data_ + idx1; for (unsigned i=0; i template void ArrayND::circularFlatLoop( unsigned level, unsigned long idx0, unsigned long idx1, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, ArrayND& r, Functor binaryFunct) { const unsigned imax = range[level]; const unsigned leftShift = thisCorner[level]; const unsigned leftPeriod = shape_[level]; if (level == dim_ - 1) { Numeric* left = data_ + idx0; Num2* right = r.data_ + (idx1 + otherCorner[level]); Num2* const rMax = r.data_ + (idx1 + r.shape_[level]); for (unsigned i=0; i template Numeric ArrayND::marginalizeInnerLoop( unsigned long idx, const unsigned levelPr, unsigned long idxPr, const ArrayND& prior, const unsigned* indexMap) const { Numeric sum = Numeric(); const unsigned long myStride = strides_[indexMap[levelPr]]; const unsigned imax = prior.shape_[levelPr]; assert(imax == shape_[indexMap[levelPr]]); if (levelPr == prior.dim_ - 1) { for (unsigned i=0; i template void ArrayND::marginalizeLoop( const unsigned level, unsigned long idx, const unsigned levelRes, unsigned long idxRes, const ArrayND& prior, const unsigned* indexMap, ArrayND& result) const { if (level == dim_) { const Numeric res = marginalizeInnerLoop( idx, 0U, 0UL, prior, indexMap); if (result.dim_) result.data_[idxRes] = res; else result.localData_[0] = res; } else { // Check if this level is mapped or not bool mapped = false; for (unsigned i=0; i template ArrayND ArrayND::marginalize( const ArrayND& prior, const unsigned* indexMap, const unsigned mapLen) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"marginalize\""); if (!(prior.dim_ && prior.dim_ <= dim_)) throw std::invalid_argument( "In npstat::ArrayND::marginalize: incompatible argument array rank"); const unsigned resultDim = dim_ - prior.dim_; // Check that the index map is reasonable if (mapLen != prior.dim_) throw std::invalid_argument( "In npstat::ArrayND::marginalize: incompatible index map length"); assert(indexMap); for (unsigned i=0; i= dim_) throw std::out_of_range( "In npstat::ArrayND::marginalize: index map entry out of range"); for (unsigned j=0; j void ArrayND::buildFromShapePtr( const unsigned* sizes, const unsigned dim) { dim_ = dim; if (dim_) { assert(sizes); for (unsigned i=0; i void ArrayND::buildExtFromShapePtr( const unsigned* sizes, const unsigned dim, Numeric* extdata) { if (dim) { assert(sizes); len_ = 1UL; shapeIsKnown_ = true; dataIsExternal_ = true; dim_ = dim; for (unsigned i=0; i template ArrayND::ArrayND( const ArrayND& slicedArray, const unsigned *fixedIndices, const unsigned nFixedIndices) : data_(0), strides_(0), shape_(0), len_(1UL), dim_(slicedArray.dim_ - nFixedIndices), shapeIsKnown_(true), dataIsExternal_(false) { if (nFixedIndices) { assert(fixedIndices); if (nFixedIndices > slicedArray.dim_) throw std::invalid_argument( "In npstat::ArrayND slicing constructor: too many fixed indices"); if (!slicedArray.shapeIsKnown_) throw std::invalid_argument( "In npstat::ArrayND slicing constructor: " "uninitialized argument array"); // Check that the fixed indices are within range for (unsigned j=0; j= slicedArray.dim_) throw std::out_of_range("In npstat::ArrayND slicing " "constructor: fixed index out of range"); // Build the shape for the slice shape_ = makeBuffer(dim_, localShape_, StackDim); unsigned idim = 0; for (unsigned i=0; i ArrayShape ArrayND::sliceShape( const unsigned *fixedIndices, const unsigned nFixedIndices) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"sliceShape\""); if (nFixedIndices) { assert(fixedIndices); if (nFixedIndices > dim_) throw std::invalid_argument( "In npstat::ArrayND::sliceShape: too many fixed indices"); for (unsigned j=0; j= dim_) throw std::out_of_range("In npstat::ArrayND::sliceShape: " "fixed index out of range"); ArrayShape sh; sh.reserve(dim_ - nFixedIndices); for (unsigned i=0; i template unsigned long ArrayND::verifySliceCompatibility( const ArrayND& slice, const unsigned *fixedIndices, const unsigned *fixedIndexValues, const unsigned nFixedIndices) const { if (!(nFixedIndices && nFixedIndices <= dim_)) throw std::invalid_argument( "In npstat::ArrayND::verifySliceCompatibility: " "invalid number of fixed indices"); if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling " "method \"verifySliceCompatibility\""); if (!slice.shapeIsKnown_) throw std::invalid_argument( "In npstat::ArrayND::verifySliceCompatibility: " "uninitialized argument array"); if (slice.dim_ != dim_ - nFixedIndices) throw std::invalid_argument( "In npstat::ArrayND::verifySliceCompatibility: " "incompatible argument array rank"); assert(fixedIndices); assert(fixedIndexValues); for (unsigned j=0; j= dim_) throw std::out_of_range( "In npstat::ArrayND::verifySliceCompatibility: " "fixed index out of range"); // Check slice shape compatibility unsigned long idx = 0UL; unsigned sliceDim = 0U; for (unsigned i=0; i= shape_[i]) throw std::out_of_range( "In npstat::ArrayND::verifySliceCompatibility: " "fixed index value out of range"); idx += fixedIndexValues[j]*strides_[i]; break; } if (!fixed) { if (shape_[i] != slice.shape_[sliceDim]) throw std::invalid_argument( "In npstat::ArrayND::verifySliceCompatibility: " "incompatible argument array dimensions"); ++sliceDim; } } assert(sliceDim == slice.dim_); return idx; } template unsigned long ArrayND::verifyBufferSliceCompatibility( const unsigned long bufLen, const unsigned *fixedIndices, const unsigned *fixedIndexValues, const unsigned nFixedIndices, unsigned long* sliceStrides) const { if (!(nFixedIndices && nFixedIndices <= dim_)) throw std::invalid_argument( "In npstat::ArrayND::verifyBufferSliceCompatibility: " "invalid number of fixed indices"); if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling " "method \"verifyBufferSliceCompatibility\""); assert(fixedIndices); assert(fixedIndexValues); for (unsigned j=0; j= dim_) throw std::out_of_range( "In npstat::ArrayND::verifyBufferSliceCompatibility: " "fixed index out of range"); // Figure out slice shape. Store it, temporarily, in sliceStrides. unsigned long idx = 0UL; unsigned sliceDim = 0U; for (unsigned i=0; i= shape_[i]) throw std::out_of_range( "In npstat::ArrayND::verifyBufferSliceCompatibility:" " fixed index value out of range"); idx += fixedIndexValues[j]*strides_[i]; break; } if (!fixed) sliceStrides[sliceDim++] = shape_[i]; } assert(sliceDim + nFixedIndices == dim_); // Convert the slice shape into slice strides unsigned long expectedBufLen = 1UL; if (sliceDim) { unsigned long shapeJ = sliceStrides[sliceDim - 1]; sliceStrides[sliceDim - 1] = 1UL; for (unsigned j=sliceDim - 1; j>0; --j) { const unsigned long nextStride = sliceStrides[j]*shapeJ; shapeJ = sliceStrides[j - 1]; sliceStrides[j - 1] = nextStride; } expectedBufLen = sliceStrides[0]*shapeJ; } if (expectedBufLen != bufLen) throw std::invalid_argument( "In npstat::ArrayND::verifyBufferSliceCompatibility: " "invalid memory buffer length"); return idx; } template template void ArrayND::jointSliceLoop( const unsigned level, const unsigned long idx0, const unsigned level1, const unsigned long idx1, Num2* sliceData, const unsigned long* sliceStrides, const unsigned *fixedIndices, const unsigned *fixedIndexValues, const unsigned nFixedIndices, Op fcn) { bool fixed = false; for (unsigned j=0; j template void ArrayND::jointSliceScan( ArrayND& slice, const unsigned *fixedIndices, const unsigned *fixedIndexValues, const unsigned nFixedIndices, Functor binaryFunct) { const unsigned long idx = verifySliceCompatibility( slice, fixedIndices, fixedIndexValues, nFixedIndices); if (slice.dim_) jointSliceLoop(0U, idx, 0U, 0UL, slice.data_, slice.strides_, fixedIndices, fixedIndexValues, nFixedIndices, binaryFunct); else binaryFunct(data_[idx], slice.localData_[0]); } template template void ArrayND::jointMemSliceScan( Num2* slice, const unsigned long len, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedIndices, Functor binaryFunct) { assert(slice); if (dim_ > CHAR_BIT*sizeof(unsigned long)) throw std::invalid_argument( "In npstat::ArrayND::jointMemSliceScan: " "rank of this array is too large"); unsigned long sliceStrides[CHAR_BIT*sizeof(unsigned long)]; const unsigned long idx = verifyBufferSliceCompatibility( len, fixedIndices, fixedIndexValues, nFixedIndices, sliceStrides); if (dim_ > nFixedIndices) jointSliceLoop(0U, idx, 0U, 0UL, slice, sliceStrides, fixedIndices, fixedIndexValues, nFixedIndices, binaryFunct); else binaryFunct(data_[idx], *slice); } template template void ArrayND::projectInnerLoop( const unsigned level, unsigned long idx0, unsigned* currentIndex, AbsArrayProjector& projector, const unsigned *projectedIndices, const unsigned nProjectedIndices) const { // level : dimension number among indices which are being iterated const unsigned idx = projectedIndices[level]; const unsigned imax = shape_[idx]; const unsigned long stride = strides_[idx]; const bool last = (level == nProjectedIndices - 1); for (unsigned i = 0; i template void ArrayND::projectLoop( const unsigned level, const unsigned long idx0, const unsigned level1, const unsigned long idx1, unsigned* currentIndex, ArrayND* projection, AbsArrayProjector& projector, const unsigned *projectedIndices, const unsigned nProjectedIndices, Op fcn) const { // level : dimension number in this array // level1 : dimension number in the projection // idx0 : linear index in this array // idx1 : linear index in the projection // currentIndex : cycled over in this loop with the exception of the // dimensions which are iterated over to build the // projection if (level == dim_) { assert(level1 == projection->dim_); projector.clear(); projectInnerLoop(0U, idx0, currentIndex, projector, projectedIndices, nProjectedIndices); if (projection->dim_) fcn(projection->data_[idx1], projector.result()); else fcn(projection->localData_[0], projector.result()); } else { bool iterated = false; for (unsigned j=0; jdim_ is 0. // Therefore, it is safe to access projection->strides_. const unsigned long stride2 = projection->strides_[level1]; for (unsigned i = 0; i template void ArrayND::verifyProjectionCompatibility( const ArrayND& projection, const unsigned *projectedIndices, const unsigned nProjectedIndices) const { if (!(nProjectedIndices && nProjectedIndices <= dim_)) throw std::invalid_argument( "In npstat::ArrayND::verifyProjectionCompatibility: " "invalid number of projected indices"); if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling " "method \"verifyProjectionCompatibility\""); if (!projection.shapeIsKnown_) throw std::invalid_argument( "In npstat::ArrayND::verifyProjectionCompatibility: " "uninitialized argument array"); if (projection.dim_ != dim_ - nProjectedIndices) throw std::invalid_argument( "In npstat::ArrayND::verifyProjectionCompatibility: " "incompatible argument array rank"); assert(projectedIndices); for (unsigned j=0; j= dim_) throw std::out_of_range( "In npstat::ArrayND::verifyProjectionCompatibility: " "projected index out of range"); // Check projection shape compatibility unsigned sliceDim = 0U; for (unsigned i=0; i template void ArrayND::project( ArrayND* projection, AbsArrayProjector& projector, const unsigned *projectedIndices, const unsigned nProjectedIndices) const { assert(projection); verifyProjectionCompatibility(*projection, projectedIndices, nProjectedIndices); unsigned ibuf[StackDim]; unsigned* buf = makeBuffer(dim_, ibuf, StackDim); for (unsigned i=0; i()); destroyBuffer(buf, ibuf); } template template void ArrayND::addToProjection( ArrayND* projection, AbsArrayProjector& projector, const unsigned *projectedIndices, const unsigned nProjectedIndices) const { assert(projection); verifyProjectionCompatibility(*projection, projectedIndices, nProjectedIndices); unsigned ibuf[StackDim]; unsigned* buf = makeBuffer(dim_, ibuf, StackDim); for (unsigned i=0; i()); destroyBuffer(buf, ibuf); } template template void ArrayND::subtractFromProjection( ArrayND* projection, AbsArrayProjector& projector, const unsigned *projectedIndices, const unsigned nProjectedIndices) const { assert(projection); verifyProjectionCompatibility(*projection, projectedIndices, nProjectedIndices); unsigned ibuf[StackDim]; unsigned* buf = makeBuffer(dim_, ibuf, StackDim); for (unsigned i=0; i()); destroyBuffer(buf, ibuf); } template template void ArrayND::projectInnerLoop2( const unsigned level, const unsigned long idx0, AbsVisitor& projector, const unsigned *projectedIndices, const unsigned nProjectedIndices) const { const unsigned idx = projectedIndices[level]; const unsigned imax = shape_[idx]; const unsigned long stride = strides_[idx]; const bool last = (level == nProjectedIndices - 1); for (unsigned i = 0; i template void ArrayND::projectLoop2( const unsigned level, const unsigned long idx0, const unsigned level1, const unsigned long idx1, ArrayND* projection, AbsVisitor& projector, const unsigned *projectedIndices, const unsigned nProjectedIndices, Op fcn) const { if (level == dim_) { assert(level1 == projection->dim_); projector.clear(); projectInnerLoop2(0U, idx0, projector, projectedIndices, nProjectedIndices); if (projection->dim_) fcn(projection->data_[idx1], projector.result()); else fcn(projection->localData_[0], projector.result()); } else { bool fixed = false; for (unsigned j=0; jstrides_[level1]; for (unsigned i = 0; i template void ArrayND::project( ArrayND* projection, AbsVisitor& projector, const unsigned *projectedIndices, const unsigned nProjectedIndices) const { assert(projection); verifyProjectionCompatibility(*projection, projectedIndices, nProjectedIndices); projectLoop2(0U, 0UL, 0U, 0UL, projection, projector, projectedIndices, nProjectedIndices, scast_assign_left()); } template template void ArrayND::addToProjection( ArrayND* projection, AbsVisitor& projector, const unsigned *projectedIndices, const unsigned nProjectedIndices) const { assert(projection); verifyProjectionCompatibility(*projection, projectedIndices, nProjectedIndices); projectLoop2(0U, 0UL, 0U, 0UL, projection, projector, projectedIndices, nProjectedIndices, scast_pluseq_left()); } template template void ArrayND::subtractFromProjection( ArrayND* projection, AbsVisitor& projector, const unsigned *projectedIndices, const unsigned nProjectedIndices) const { assert(projection); verifyProjectionCompatibility(*projection, projectedIndices, nProjectedIndices); projectLoop2(0U, 0UL, 0U, 0UL, projection, projector, projectedIndices, nProjectedIndices, scast_minuseq_left()); } template template void ArrayND::scaleBySliceInnerLoop( const unsigned level, const unsigned long idx0, Num2& scale, const unsigned *projectedIndices, const unsigned nProjectedIndices, Functor binaryFunct) { const unsigned idx = projectedIndices[level]; const unsigned imax = shape_[idx]; const unsigned long stride = strides_[idx]; if (level == nProjectedIndices - 1) { Numeric* data = data_ + idx0; for (unsigned i = 0; i template void ArrayND::scaleBySliceLoop( unsigned level, unsigned long idx0, unsigned level1, unsigned long idx1, ArrayND& slice, const unsigned *projectedIndices, const unsigned nProjectedIndices, Functor binaryFunct) { if (level == dim_) { assert(level1 == slice.dim_); Num2& scaleFactor = slice.dim_ ? slice.data_[idx1] : slice.localData_[0]; scaleBySliceInnerLoop(0U, idx0, scaleFactor, projectedIndices, nProjectedIndices, binaryFunct); } else { bool fixed = false; for (unsigned j=0; j template void ArrayND::jointScan( ArrayND& r, Functor binaryFunct) { if (!isShapeCompatible(r)) throw std::invalid_argument( "In npstat::ArrayND::jointScan: incompatible argument array shape"); if (dim_) for (unsigned long i=0; i template void ArrayND::applySlice( ArrayND& slice, const unsigned *fixedIndices, const unsigned nFixedIndices, Functor binaryFunct) { if (nFixedIndices) { verifyProjectionCompatibility(slice, fixedIndices, nFixedIndices); if (slice.dim_ == 0U) for (unsigned long i=0; i inline bool ArrayND::isCompatible( const unsigned* shape, unsigned dim) const { if (dim) assert(shape); if (!shapeIsKnown_) return false; if (dim_ != dim) return false; if (dim_) { for (unsigned i=0; i inline bool ArrayND::isCompatible( const ArrayShape& shape) const { const unsigned sz = shape.size(); return isCompatible(sz ? &shape[0] : 0, sz); } template template inline bool ArrayND::isShapeCompatible( const ArrayND& r) const { if (!shapeIsKnown_) return false; if (!r.shapeIsKnown_) return false; if (dim_ != r.dim_) return false; if (len_ != r.len_) return false; if (dim_) { assert(shape_); assert(r.shape_); for (unsigned i=0; i template void ArrayND::processSubrangeLoop( const unsigned level, unsigned long idx0, unsigned* currentIndex, AbsArrayProjector& f, const BoxND& subrange) const { // Deal with possible negative limits first const Interval& levelRange(subrange[level]); long long int iminl = static_cast(levelRange.min()); if (iminl < 0LL) iminl = 0LL; long long int imaxl = static_cast(levelRange.max()); if (imaxl < 0LL) imaxl = 0LL; // Now deal with possible out-of-range limits const unsigned imin = static_cast(iminl); unsigned imax = static_cast(imaxl); if (imax > shape_[level]) imax = shape_[level]; if (level == dim_ - 1) { idx0 += imin; for (unsigned i=imin; i template void ArrayND::processSubrange( AbsArrayProjector& f, const BoxND& subrange) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"processSubrange\""); if (!dim_) throw std::invalid_argument( "npstat::ArrayND::processSubrange method " "can not be used with array of 0 rank"); if (dim_ != subrange.dim()) throw std::invalid_argument( "In npstat::ArrayND::processSubrange: incompatible subrange rank"); unsigned ibuf[StackDim]; unsigned* buf = makeBuffer(dim_, ibuf, StackDim); for (unsigned i=0; i template inline ArrayND& ArrayND::setData( const Num2* data, const unsigned long dataLength) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"setData\""); if (dataLength != len_) throw std::invalid_argument( "In npstat::ArrayND::setData: incompatible input data length"); copyBuffer(data_, data, dataLength); return *this; } template void ArrayND::buildStrides() { assert(dim_); if (strides_ == 0) strides_ = makeBuffer(dim_, localStrides_, Dim); strides_[dim_ - 1] = 1UL; for (unsigned j=dim_ - 1; j>0; --j) strides_[j - 1] = strides_[j]*shape_[j]; } template inline ArrayND::ArrayND() : data_(0), strides_(0), shape_(0), len_(0UL), dim_(0U), shapeIsKnown_(false), dataIsExternal_(false) { localData_[0] = Numeric(); data_ = localData_; } template ArrayND::ArrayND(const ArrayND& r) : data_(0), strides_(0), shape_(0), len_(r.len_), dim_(r.dim_), shapeIsKnown_(r.shapeIsKnown_), dataIsExternal_(false) { if (dim_) { // Copy the shape shape_ = makeBuffer(dim_, localShape_, Dim); copyBuffer(shape_, r.shape_, dim_); // Copy the strides strides_ = makeBuffer(dim_, localStrides_, Dim); copyBuffer(strides_, r.strides_, dim_); // Copy the data data_ = makeBuffer(len_, localData_, Len); copyBuffer(data_, r.data_, len_); } else { assert(len_ == 1UL); localData_[0] = r.localData_[0]; data_ = localData_; } } #ifdef CPP11_STD_AVAILABLE template ArrayND::ArrayND(ArrayND&& r) : data_(0), strides_(0), shape_(0), len_(r.len_), dim_(r.dim_), shapeIsKnown_(r.shapeIsKnown_), dataIsExternal_(r.dataIsExternal_) { if (dim_) { // Copy the shape if (r.shape_ == r.localShape_) { shape_ = makeBuffer(dim_, localShape_, Dim); copyBuffer(shape_, r.shape_, dim_); } else { shape_ = r.shape_; r.shape_ = 0; } // Copy the strides if (r.strides_ == r.localStrides_) { strides_ = makeBuffer(dim_, localStrides_, Dim); copyBuffer(strides_, r.strides_, dim_); } else { strides_ = r.strides_; r.strides_ = 0; } // Copy the data if (dataIsExternal_) data_ = r.data_; else { if (r.data_ == r.localData_) { data_ = makeBuffer(len_, localData_, Len); copyBuffer(data_, r.data_, len_); } else { data_ = r.data_; r.data_ = 0; } } } else { assert(len_ == 1UL); assert(!dataIsExternal_); localData_[0] = r.localData_[0]; data_ = localData_; } } #endif template template ArrayND::ArrayND(const ArrayND& r) : data_(0), strides_(0), shape_(0), len_(r.len_), dim_(r.dim_), shapeIsKnown_(r.shapeIsKnown_), dataIsExternal_(false) { if (dim_) { // Copy the shape shape_ = makeBuffer(dim_, localShape_, Dim); copyBuffer(shape_, r.shape_, dim_); // Copy the strides strides_ = makeBuffer(dim_, localStrides_, Dim); copyBuffer(strides_, r.strides_, dim_); // Copy the data data_ = makeBuffer(len_, localData_, Len); copyBuffer(data_, r.data_, len_); } else { assert(len_ == 1UL); localData_[0] = static_cast(r.localData_[0]); data_ = localData_; } } template template ArrayND::ArrayND(const ArrayND& r, Functor f) : data_(0), strides_(0), shape_(0), len_(r.len_), dim_(r.dim_), shapeIsKnown_(r.shapeIsKnown_), dataIsExternal_(false) { if (dim_) { // Copy the shape shape_ = makeBuffer(dim_, localShape_, Dim); copyBuffer(shape_, r.shape_, dim_); // Copy the strides strides_ = makeBuffer(dim_, localStrides_, Dim); copyBuffer(strides_, r.strides_, dim_); // Copy the data data_ = makeBuffer(len_, localData_, Len); for (unsigned long i=0; i(f(r.data_[i])); } else { assert(len_ == 1UL); localData_[0] = static_cast(f(r.localData_[0])); data_ = localData_; } } template template void ArrayND::copyRangeLoopFunct( const unsigned level, unsigned long idx0, unsigned long idx1, const ArrayND& r, const ArrayRange& range, Functor f) { const unsigned imax = shape_[level]; if (level == dim_ - 1) { Numeric* to = data_ + idx0; const Num2* from = r.data_ + (idx1 + range[level].min()); for (unsigned i=0; i(f(*from++)); } else { const unsigned long fromstride = r.strides_[level]; const unsigned long tostride = strides_[level]; idx1 += range[level].min()*fromstride; for (unsigned i=0; i template ArrayND::ArrayND( const ArrayND& r, const ArrayRange& range) : data_(0), strides_(0), shape_(0), len_(r.len_), dim_(r.dim_), shapeIsKnown_(r.shapeIsKnown_), dataIsExternal_(false) { if (!range.isCompatible(r.shape_, r.dim_)) throw std::invalid_argument( "In npstat::ArrayND subrange constructor: invalid subrange"); if (dim_) { len_ = range.rangeSize(); if (!len_) throw std::invalid_argument( "In npstat::ArrayND subrange constructor: empty subrange"); // Figure out the shape shape_ = makeBuffer(dim_, localShape_, Dim); range.rangeLength(shape_, dim_); // Figure out the strides buildStrides(); // Allocate the data array data_ = makeBuffer(len_, localData_, Len); // Copy the data if (dim_ > CHAR_BIT*sizeof(unsigned long)) throw std::invalid_argument( "In npstat::ArrayND subrange constructor: " "input array rank is too large"); unsigned lolim[CHAR_BIT*sizeof(unsigned long)]; range.lowerLimits(lolim, dim_); unsigned toBuf[CHAR_BIT*sizeof(unsigned long)]; clearBuffer(toBuf, dim_); (const_cast&>(r)).commonSubrangeLoop( 0U, 0UL, 0UL, lolim, shape_, toBuf, *this, scast_assign_right()); } else { assert(len_ == 1UL); localData_[0] = static_cast(r.localData_[0]); data_ = localData_; } } template template ArrayND::ArrayND( const ArrayND& r, const ArrayRange& range, Functor f) : data_(0), strides_(0), shape_(0), len_(r.len_), dim_(r.dim_), shapeIsKnown_(r.shapeIsKnown_), dataIsExternal_(false) { if (!range.isCompatible(r.shape_, r.dim_)) throw std::invalid_argument( "In npstat::ArrayND transforming subrange constructor: " "incompatible subrange"); if (dim_) { len_ = range.rangeSize(); if (!len_) throw std::invalid_argument( "In npstat::ArrayND transforming subrange constructor: " "empty subrange"); // Figure out the shape shape_ = makeBuffer(dim_, localShape_, Dim); for (unsigned i=0; i(f(r.localData_[0])); data_ = localData_; } } template ArrayND::ArrayND(const ArrayShape& sh) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { const unsigned sz = sh.size(); buildFromShapePtr(sz ? &sh[0] : 0, sz); } template ArrayND::ArrayND(const unsigned* sizes, const unsigned dim) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { buildFromShapePtr(sizes, dim); } template ArrayND& ArrayND::reshape( const unsigned* newShape, const unsigned dim) { if (!isCompatible(newShape, dim) || dataIsExternal_) { uninitialize(); shapeIsKnown_ = true; len_ = 1UL; buildFromShapePtr(newShape, dim); } return *this; } template template ArrayND& ArrayND::reshape( const ArrayND& r) { if (!r.shapeIsKnown_) throw std::invalid_argument( "In npstat::ArrayND::reshape: uninitialized argument array"); return reshape(r.shape_, r.dim_); } template ArrayND& ArrayND::reshape( const ArrayShape& newShape) { const unsigned sz = newShape.size(); return reshape(sz ? &newShape[0] : 0, sz); } template ArrayND& ArrayND::reshape( unsigned n0) { unsigned buf[1]; buf[0] = n0; return reshape(buf, 1U); } template ArrayND& ArrayND::reshape( unsigned n0, unsigned n1) { unsigned buf[2]; buf[0] = n0; buf[1] = n1; return reshape(buf, 2U); } template ArrayND& ArrayND::reshape( unsigned n0, unsigned n1, unsigned n2) { unsigned buf[3]; buf[0] = n0; buf[1] = n1; buf[2] = n2; return reshape(buf, 3U); } template ArrayND& ArrayND::reshape( unsigned n0, unsigned n1, unsigned n2, unsigned n3) { unsigned buf[4]; buf[0] = n0; buf[1] = n1; buf[2] = n2; buf[3] = n3; return reshape(buf, 4U); } template ArrayND& ArrayND::reshape( unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4) { unsigned buf[5]; buf[0] = n0; buf[1] = n1; buf[2] = n2; buf[3] = n3; buf[4] = n4; return reshape(buf, 5U); } template ArrayND& ArrayND::reshape( unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5) { unsigned buf[6]; buf[0] = n0; buf[1] = n1; buf[2] = n2; buf[3] = n3; buf[4] = n4; buf[5] = n5; return reshape(buf, 6U); } template ArrayND& ArrayND::reshape( unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6) { unsigned buf[7]; buf[0] = n0; buf[1] = n1; buf[2] = n2; buf[3] = n3; buf[4] = n4; buf[5] = n5; buf[6] = n6; return reshape(buf, 7U); } template ArrayND& ArrayND::reshape( unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7) { unsigned buf[8]; buf[0] = n0; buf[1] = n1; buf[2] = n2; buf[3] = n3; buf[4] = n4; buf[5] = n5; buf[6] = n6; buf[7] = n7; return reshape(buf, 8U); } template ArrayND& ArrayND::reshape( unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7, unsigned n8) { unsigned buf[9]; buf[0] = n0; buf[1] = n1; buf[2] = n2; buf[3] = n3; buf[4] = n4; buf[5] = n5; buf[6] = n6; buf[7] = n7; buf[8] = n8; return reshape(buf, 9U); } template ArrayND& ArrayND::reshape( unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7, unsigned n8, unsigned n9) { unsigned buf[10]; buf[0] = n0; buf[1] = n1; buf[2] = n2; buf[3] = n3; buf[4] = n4; buf[5] = n5; buf[6] = n6; buf[7] = n7; buf[8] = n8; buf[9] = n9; return reshape(buf, 10U); } template ArrayND::ArrayND(const unsigned n0) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { const unsigned dim = 1U; unsigned sizes[dim]; sizes[0] = n0; buildFromShapePtr(sizes, dim); } template ArrayND::ArrayND(const unsigned n0, const unsigned n1) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { const unsigned dim = 2U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; buildFromShapePtr(sizes, dim); } template ArrayND::ArrayND(const unsigned n0, const unsigned n1, const unsigned n2) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { const unsigned dim = 3U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; buildFromShapePtr(sizes, dim); } template ArrayND::ArrayND(const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { const unsigned dim = 4U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; buildFromShapePtr(sizes, dim); } template ArrayND::ArrayND(const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { const unsigned dim = 5U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; buildFromShapePtr(sizes, dim); } template ArrayND::ArrayND(const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { const unsigned dim = 6U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; sizes[5] = n5; buildFromShapePtr(sizes, dim); } template ArrayND::ArrayND(const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { const unsigned dim = 7U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; sizes[5] = n5; sizes[6] = n6; buildFromShapePtr(sizes, dim); } template ArrayND::ArrayND(const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6, const unsigned n7) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { const unsigned dim = 8U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; sizes[5] = n5; sizes[6] = n6; sizes[7] = n7; buildFromShapePtr(sizes, dim); } template ArrayND::ArrayND(const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6, const unsigned n7, const unsigned n8) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { const unsigned dim = 9U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; sizes[5] = n5; sizes[6] = n6; sizes[7] = n7; sizes[8] = n8; buildFromShapePtr(sizes, dim); } template ArrayND::ArrayND(const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6, const unsigned n7, const unsigned n8, const unsigned n9) : data_(0), strides_(0), shape_(0), len_(1UL), shapeIsKnown_(true), dataIsExternal_(false) { const unsigned dim = 10U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; sizes[5] = n5; sizes[6] = n6; sizes[7] = n7; sizes[8] = n8; sizes[9] = n9; buildFromShapePtr(sizes, dim); } template template void ArrayND::outerProductLoop( const unsigned level, unsigned long idx0, unsigned long idx1, unsigned long idx2, const ArrayND& a1, const ArrayND& a2) { const unsigned imax = shape_[level]; if (level == dim_ - 1) { for (unsigned i=0; i template ArrayND::ArrayND(const ArrayND& a1, const ArrayND& a2) : data_(0), strides_(0), shape_(0), len_(1UL), dim_(a1.dim_ + a2.dim_), shapeIsKnown_(true), dataIsExternal_(false) { if (!(a1.shapeIsKnown_ && a2.shapeIsKnown_)) throw std::invalid_argument( "In npstat::ArrayND outer product constructor: " "uninitialized argument array"); if (dim_) { shape_ = makeBuffer(dim_, localShape_, Dim); copyBuffer(shape_, a1.shape_, a1.dim_); copyBuffer(shape_+a1.dim_, a2.shape_, a2.dim_); for (unsigned i=0; i inline ArrayND::~ArrayND() { if (!dataIsExternal_) destroyBuffer(data_, localData_); destroyBuffer(strides_, localStrides_); destroyBuffer(shape_, localShape_); } template ArrayND& ArrayND::operator=(const ArrayND& r) { if (this == &r) return *this; if (shapeIsKnown_) { if (!r.shapeIsKnown_) throw std::invalid_argument( "In npstat::ArrayND assignment operator: " "uninitialized argument array"); if (!isShapeCompatible(r)) throw std::invalid_argument( "In npstat::ArrayND assignment operator: " "incompatible argument array shape"); if (dim_) { // It is possible that both arrays manage the same // external memory. This is the reason for the "if" below. if (data_ != r.data_) copyBuffer(data_, r.data_, len_); } else localData_[0] = r.localData_[0]; } else { // This object is uninitialized. If the object on the // right is itself initialized, make an in-place copy. if (r.shapeIsKnown_) new (this) ArrayND(r); } return *this; } #ifdef CPP11_STD_AVAILABLE template ArrayND& ArrayND::operator=(ArrayND&& r) { if (this == &r) return *this; if (shapeIsKnown_) { if (!r.shapeIsKnown_) throw std::invalid_argument( "In npstat::ArrayND assignment operator: " "uninitialized argument array"); if (!isShapeCompatible(r)) throw std::invalid_argument( "In npstat::ArrayND assignment operator: " "incompatible argument array shape"); if (dim_) { if (!dataIsExternal_) { destroyBuffer(data_, localData_); data_ = 0; } dataIsExternal_ = r.dataIsExternal_; if (dataIsExternal_) data_ = r.data_; else { if (r.data_ == r.localData_) { data_ = makeBuffer(len_, localData_, Len); copyBuffer(data_, r.data_, len_); } else { data_ = r.data_; r.data_ = 0; } } } else localData_[0] = r.localData_[0]; } else { // This is where the move assignment is really useful if (r.shapeIsKnown_) { len_ = r.len_; dim_ = r.dim_; shapeIsKnown_ = true; dataIsExternal_ = r.dataIsExternal_; // Copy the shape if (r.shape_ == r.localShape_) { shape_ = makeBuffer(dim_, localShape_, Dim); copyBuffer(shape_, r.shape_, dim_); } else { shape_ = r.shape_; r.shape_ = 0; } // Copy the strides if (r.strides_ == r.localStrides_) { strides_ = makeBuffer(dim_, localStrides_, Dim); copyBuffer(strides_, r.strides_, dim_); } else { strides_ = r.strides_; r.strides_ = 0; } // Copy the data if (dataIsExternal_) data_ = r.data_; else { if (r.data_ == r.localData_) { data_ = makeBuffer(len_, localData_, Len); copyBuffer(data_, r.data_, len_); } else { data_ = r.data_; r.data_ = 0; } } } } return *this; } #endif template template ArrayND& ArrayND::operator=(const ArrayND& r) { if ((void*)this == (void*)(&r)) return *this; if (shapeIsKnown_) { if (!r.shapeIsKnown_) throw std::invalid_argument( "In npstat::ArrayND assignment operator: " "uninitialized argument array"); if (!isShapeCompatible(r)) throw std::invalid_argument( "In npstat::ArrayND assignment operator: " "incompatible argument array shape"); if (dim_) copyBuffer(data_, r.data_, len_); else localData_[0] = static_cast(r.localData_[0]); } else { // This object is uninitialized. If the object on the // right is itself initialized, make an in-place copy. if (r.shapeIsKnown_) new (this) ArrayND(r); } return *this; } template template ArrayND& ArrayND::assign(const ArrayND& r, Functor f) { if (shapeIsKnown_) { if (!r.shapeIsKnown_) throw std::invalid_argument( "In npstat::ArrayND::assign: uninitialized argument array"); if (!isShapeCompatible(r)) throw std::invalid_argument( "In npstat::ArrayND::assign: incompatible argument array shape"); if (dim_) for (unsigned long i=0; i(f(r.data_[i])); else localData_[0] = static_cast(f(r.localData_[0])); } else { // This object is uninitialized. If the object on the // right is itself initialized, build new array in place. if (r.shapeIsKnown_) new (this) ArrayND(r, f); } return *this; } template inline ArrayShape ArrayND::shape() const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"shape\""); return ArrayShape(shape_, shape_+dim_); } template inline ArrayRange ArrayND::fullRange() const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"fullRange\""); ArrayRange range; if (dim_) { range.reserve(dim_); for (unsigned i=0; i(0U, shape_[i])); } return range; } template bool arrayIsDensity(const Arr& arr) { typedef typename Arr::value_type Numeric; if (!arr.isShapeKnown()) throw std::invalid_argument( "In npstat::arrayIsDensity: uninitialized array argument"); const unsigned dim = arr.rank(); const Numeric zero = Numeric(); bool hasPositive = false; if (dim) { const unsigned long len = arr.length(); for (unsigned long i=0; i::less(zero, v)) hasPositive = true; else return false; } } else { const Numeric& v = arr(); hasPositive = ComplexComparesFalse::less(zero, v); } return hasPositive; } template bool arrayIsNonNegative(const Arr& arr) { typedef typename Arr::value_type Numeric; if (!arr.isShapeKnown()) throw std::invalid_argument( "In npstat::arrayIsNonNegative: uninitialized array argument"); const unsigned dim = arr.rank(); const Numeric zero = Numeric(); if (dim) { const unsigned long len = arr.length(); for (unsigned long i=0; i::less(zero, v)) return false; } } else { const Numeric& v = arr(); if (v == zero) return true; if (!ComplexComparesFalse::less(zero, v)) return false; } return true; } template bool ArrayND::isZero() const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"isZero\""); const Numeric zero = Numeric(); if (dim_) { for (unsigned long i=0; i + bool ArrayND::isNonZero() const + { + if (!shapeIsKnown_) throw std::invalid_argument( + "Initialize npstat::ArrayND before calling method \"isNonZero\""); + const Numeric zero = Numeric(); + if (dim_) + { + for (unsigned long i=0; i ArrayRange ArrayND::nonZeroRange() const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling " "method \"nonZeroRange\""); ArrayRange range(dim_); if (dim_) { unsigned lolim[CHAR_BIT*sizeof(unsigned)]; unsigned uplim[CHAR_BIT*sizeof(unsigned)]; unsigned idx[CHAR_BIT*sizeof(unsigned)]; for (unsigned i=0; i= uplim[i]) uplim[i] = idx[i] + 1U; } } } if (!haveNon0) for (unsigned i=0; i(lolim[i], uplim[i]); } return range; } template void ArrayND::convertLinearIndex( unsigned long l, unsigned* idx, const unsigned idxLen) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling " "method \"convertLinearIndex\""); if (!dim_) throw std::invalid_argument( "npstat::ArrayND::convertLinearIndex method " "can not be used with array of 0 rank"); if (idxLen != dim_) throw std::invalid_argument( "In npstat::ArrayND::convertLinearIndex: incompatible index length"); if (l >= len_) throw std::out_of_range( "In npstat::ArrayND::convertLinearIndex: linear index out of range"); assert(idx); for (unsigned i=0; i unsigned long ArrayND::linearIndex( const unsigned* index, unsigned idxLen) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"linearIndex\""); if (!dim_) throw std::invalid_argument( "npstat::ArrayND::linearIndex method " "can not be used with array of 0 rank"); if (idxLen != dim_) throw std::invalid_argument( "In npstat::ArrayND::linearIndex: incompatible index length"); assert(index); unsigned long idx = 0UL; for (unsigned i=0; i= shape_[i]) throw std::out_of_range( "In npstat::ArrayND::linearIndex: index out of range"); idx += index[i]*strides_[i]; } return idx; } template inline Numeric& ArrayND::value( const unsigned *index, const unsigned dim) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"value\""); if (dim != dim_) throw std::invalid_argument( "In npstat::ArrayND::value: incompatible index length"); if (dim) { assert(index); unsigned long idx = 0UL; for (unsigned i=0; i inline const Numeric& ArrayND::value( const unsigned *index, const unsigned dim) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"value\""); if (dim != dim_) throw std::invalid_argument( "In npstat::ArrayND::value: incompatible index length"); if (dim) { assert(index); unsigned long idx = 0UL; for (unsigned i=0; i inline Numeric& ArrayND::linearValue( const unsigned long index) { return data_[index]; } template inline const Numeric& ArrayND::linearValue( const unsigned long index) const { return data_[index]; } template inline Numeric& ArrayND::linearValueAt( const unsigned long index) { if (index >= len_) throw std::out_of_range( "In npstat::ArrayND::linearValueAt: linear index out of range"); return data_[index]; } template inline const Numeric& ArrayND::linearValueAt( const unsigned long index) const { if (index >= len_) throw std::out_of_range( "In npstat::ArrayND::linearValueAt: linear index out of range"); return data_[index]; } template inline unsigned ArrayND::coordToIndex( const double x, const unsigned idim) const { if (x <= 0.0) return 0; else if (x >= static_cast(shape_[idim] - 1)) return shape_[idim] - 1; else return static_cast(std::floor(x + 0.5)); } template inline const Numeric& ArrayND::closest( const double *x, const unsigned dim) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"closest\""); if (dim != dim_) throw std::invalid_argument( "In npstat::ArrayND::closest: incompatible data length"); if (dim) { assert(x); unsigned long idx = 0UL; for (unsigned i=0; i inline Numeric& ArrayND::closest( const double *x, const unsigned dim) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"closest\""); if (dim != dim_) throw std::invalid_argument( "In npstat::ArrayND::closest: incompatible data length"); if (dim) { assert(x); unsigned long idx = 0UL; for (unsigned i=0; i inline const Numeric& ArrayND::valueAt( const unsigned *index, const unsigned dim) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"valueAt\""); if (dim != dim_) throw std::invalid_argument( "In npstat::ArrayND::valueAt: incompatible index length"); if (dim) { assert(index); unsigned long idx = 0UL; for (unsigned i=0; i= shape_[i]) throw std::out_of_range( "In npstat::ArrayND::valueAt: index out of range"); idx += index[i]*strides_[i]; } return data_[idx]; } else return localData_[0]; } template inline Numeric& ArrayND::valueAt( const unsigned *index, const unsigned dim) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"valueAt\""); if (dim != dim_) throw std::invalid_argument( "In npstat::ArrayND::valueAt: incompatible index length"); if (dim) { assert(index); unsigned long idx = 0UL; for (unsigned i=0; i= shape_[i]) throw std::out_of_range( "In npstat::ArrayND::valueAt: index out of range"); idx += index[i]*strides_[i]; } return data_[idx]; } else return localData_[0]; } template inline Numeric& ArrayND::operator()() { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"operator()\""); if (dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 0 array)"); return localData_[0]; } template inline const Numeric& ArrayND::operator()() const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"operator()\""); if (dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 0 array)"); return localData_[0]; } template inline Numeric& ArrayND::operator()( const unsigned i) { if (1U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 1 array)"); return data_[i]; } template inline const Numeric& ArrayND::operator()( const unsigned i) const { if (1U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 1 array)"); return data_[i]; } template const Numeric& ArrayND::at() const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"at\""); if (dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 0 array)"); return localData_[0]; } template Numeric& ArrayND::at() { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"at\""); if (dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 0 array)"); return localData_[0]; } template const Numeric& ArrayND::at( const unsigned i0) const { if (1U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 1 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 1)"); return data_[i0]; } template Numeric& ArrayND::at( const unsigned i0) { if (1U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 1 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 1)"); return data_[i0]; } template inline Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1) { if (2U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 2 array)"); return data_[i0*strides_[0] + i1]; } template inline const Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1) const { if (2U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 2 array)"); return data_[i0*strides_[0] + i1]; } template const Numeric& ArrayND::at( const unsigned i0, const unsigned i1) const { if (2U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 2 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 2)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 2)"); return data_[i0*strides_[0] + i1]; } template Numeric& ArrayND::at( const unsigned i0, const unsigned i1) { if (2U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 2 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 2)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 2)"); return data_[i0*strides_[0] + i1]; } template inline const Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2) const { if (3U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 3 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2]; } template inline const Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3) const { if (4U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 4 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3]; } template inline const Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4) const { if (5U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 5 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4]; } template inline const Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5) const { if (6U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 6 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5]; } template inline const Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6) const { if (7U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 7 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6]; } template inline const Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7) const { if (8U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 8 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7]; } template inline const Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7, const unsigned i8) const { if (9U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 9 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7*strides_[7] + i8]; } template inline const Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7, const unsigned i8, const unsigned i9) const { if (10U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 10 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7*strides_[7] + i8*strides_[8] + i9]; } template inline Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2) { if (3U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 3 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2]; } template inline Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3) { if (4U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 4 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3]; } template inline Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4) { if (5U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 5 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4]; } template inline Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5) { if (6U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 6 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5]; } template inline Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6) { if (7U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 7 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6]; } template inline Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7) { if (8U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 8 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7]; } template inline Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7, const unsigned i8) { if (9U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 9 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7*strides_[7] + i8]; } template inline Numeric& ArrayND::operator()( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7, const unsigned i8, const unsigned i9) { if (10U != dim_) throw std::invalid_argument( "In npstat::ArrayND::operator(): wrong # of args (not rank 10 array)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7*strides_[7] + i8*strides_[8] + i9]; } template const Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2) const { if (3U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 3 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 3)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 3)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 3)"); return data_[i0*strides_[0] + i1*strides_[1] + i2]; } template const Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3) const { if (4U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 4 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 4)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 4)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 4)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 4)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3]; } template const Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4) const { if (5U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 5 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 5)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 5)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 5)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 5)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 5)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4]; } template const Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5) const { if (6U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 6 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 6)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 6)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 6)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 6)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 6)"); if (i5 >= shape_[5]) throw std::out_of_range( "In npstat::ArrayND::at: index 5 out of range (rank 6)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5]; } template const Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6) const { if (7U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 7 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 7)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 7)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 7)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 7)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 7)"); if (i5 >= shape_[5]) throw std::out_of_range( "In npstat::ArrayND::at: index 5 out of range (rank 7)"); if (i6 >= shape_[6]) throw std::out_of_range( "In npstat::ArrayND::at: index 6 out of range (rank 7)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6]; } template const Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7) const { if (8U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 8 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 8)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 8)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 8)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 8)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 8)"); if (i5 >= shape_[5]) throw std::out_of_range( "In npstat::ArrayND::at: index 5 out of range (rank 8)"); if (i6 >= shape_[6]) throw std::out_of_range( "In npstat::ArrayND::at: index 6 out of range (rank 8)"); if (i7 >= shape_[7]) throw std::out_of_range( "In npstat::ArrayND::at: index 7 out of range (rank 8)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7]; } template const Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7, const unsigned i8) const { if (9U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 9 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 9)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 9)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 9)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 9)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 9)"); if (i5 >= shape_[5]) throw std::out_of_range( "In npstat::ArrayND::at: index 5 out of range (rank 9)"); if (i6 >= shape_[6]) throw std::out_of_range( "In npstat::ArrayND::at: index 6 out of range (rank 9)"); if (i7 >= shape_[7]) throw std::out_of_range( "In npstat::ArrayND::at: index 7 out of range (rank 9)"); if (i8 >= shape_[8]) throw std::out_of_range( "In npstat::ArrayND::at: index 8 out of range (rank 9)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7*strides_[7] + i8]; } template const Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7, const unsigned i8, const unsigned i9) const { if (10U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 10 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 10)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 10)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 10)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 10)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 10)"); if (i5 >= shape_[5]) throw std::out_of_range( "In npstat::ArrayND::at: index 5 out of range (rank 10)"); if (i6 >= shape_[6]) throw std::out_of_range( "In npstat::ArrayND::at: index 6 out of range (rank 10)"); if (i7 >= shape_[7]) throw std::out_of_range( "In npstat::ArrayND::at: index 7 out of range (rank 10)"); if (i8 >= shape_[8]) throw std::out_of_range( "In npstat::ArrayND::at: index 8 out of range (rank 10)"); if (i9 >= shape_[9]) throw std::out_of_range( "In npstat::ArrayND::at: index 9 out of range (rank 10)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7*strides_[7] + i8*strides_[8] + i9]; } template Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2) { if (3U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 3 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 3)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 3)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 3)"); return data_[i0*strides_[0] + i1*strides_[1] + i2]; } template Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3) { if (4U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 4 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 4)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 4)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 4)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 4)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3]; } template Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4) { if (5U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 5 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 5)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 5)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 5)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 5)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 5)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4]; } template Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5) { if (6U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 6 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 6)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 6)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 6)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 6)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 6)"); if (i5 >= shape_[5]) throw std::out_of_range( "In npstat::ArrayND::at: index 5 out of range (rank 6)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5]; } template Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6) { if (7U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 7 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 7)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 7)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 7)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 7)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 7)"); if (i5 >= shape_[5]) throw std::out_of_range( "In npstat::ArrayND::at: index 5 out of range (rank 7)"); if (i6 >= shape_[6]) throw std::out_of_range( "In npstat::ArrayND::at: index 6 out of range (rank 7)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6]; } template Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7) { if (8U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 8 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 8)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 8)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 8)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 8)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 8)"); if (i5 >= shape_[5]) throw std::out_of_range( "In npstat::ArrayND::at: index 5 out of range (rank 8)"); if (i6 >= shape_[6]) throw std::out_of_range( "In npstat::ArrayND::at: index 6 out of range (rank 8)"); if (i7 >= shape_[7]) throw std::out_of_range( "In npstat::ArrayND::at: index 7 out of range (rank 8)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7]; } template Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7, const unsigned i8) { if (9U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 9 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 9)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 9)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 9)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 9)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 9)"); if (i5 >= shape_[5]) throw std::out_of_range( "In npstat::ArrayND::at: index 5 out of range (rank 9)"); if (i6 >= shape_[6]) throw std::out_of_range( "In npstat::ArrayND::at: index 6 out of range (rank 9)"); if (i7 >= shape_[7]) throw std::out_of_range( "In npstat::ArrayND::at: index 7 out of range (rank 9)"); if (i8 >= shape_[8]) throw std::out_of_range( "In npstat::ArrayND::at: index 8 out of range (rank 9)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7*strides_[7] + i8]; } template Numeric& ArrayND::at( const unsigned i0, const unsigned i1, const unsigned i2, const unsigned i3, const unsigned i4, const unsigned i5, const unsigned i6, const unsigned i7, const unsigned i8, const unsigned i9) { if (10U != dim_) throw std::invalid_argument( "In npstat::ArrayND::at: wrong # of args (not rank 10 array)"); if (i0 >= shape_[0]) throw std::out_of_range( "In npstat::ArrayND::at: index 0 out of range (rank 10)"); if (i1 >= shape_[1]) throw std::out_of_range( "In npstat::ArrayND::at: index 1 out of range (rank 10)"); if (i2 >= shape_[2]) throw std::out_of_range( "In npstat::ArrayND::at: index 2 out of range (rank 10)"); if (i3 >= shape_[3]) throw std::out_of_range( "In npstat::ArrayND::at: index 3 out of range (rank 10)"); if (i4 >= shape_[4]) throw std::out_of_range( "In npstat::ArrayND::at: index 4 out of range (rank 10)"); if (i5 >= shape_[5]) throw std::out_of_range( "In npstat::ArrayND::at: index 5 out of range (rank 10)"); if (i6 >= shape_[6]) throw std::out_of_range( "In npstat::ArrayND::at: index 6 out of range (rank 10)"); if (i7 >= shape_[7]) throw std::out_of_range( "In npstat::ArrayND::at: index 7 out of range (rank 10)"); if (i8 >= shape_[8]) throw std::out_of_range( "In npstat::ArrayND::at: index 8 out of range (rank 10)"); if (i9 >= shape_[9]) throw std::out_of_range( "In npstat::ArrayND::at: index 9 out of range (rank 10)"); return data_[i0*strides_[0] + i1*strides_[1] + i2*strides_[2] + i3*strides_[3] + i4*strides_[4] + i5*strides_[5] + i6*strides_[6] + i7*strides_[7] + i8*strides_[8] + i9]; } template template double ArrayND::maxAbsDifference( const ArrayND& r) const { if (!isShapeCompatible(r)) throw std::invalid_argument( "In npstat::ArrayND::maxAbsDifference: " "incompatible argument array shape"); if (dim_) { double maxd = 0.0; for (unsigned long i=0; i maxd) maxd = d; } return maxd; } else { const Numeric rval = r.localData_[0]; return absDifference(localData_[0], rval); } } template template bool ArrayND::operator==( const ArrayND& r) const { if (shapeIsKnown_ != r.shapeIsKnown_) return false; if (r.dim_ != dim_) return false; if (r.len_ != len_) return false; for (unsigned i=0; i template inline bool ArrayND::operator!=( const ArrayND& r) const { return !(*this == r); } template template ArrayND ArrayND::operator*(const Num2& r) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"operator*\""); ArrayND result(shape_, dim_); for (unsigned long i=0; i template ArrayND ArrayND::operator/(const Num2& r) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"operator/\""); if (r == Num2()) throw std::runtime_error( "In npstat::ArrayND::operator/: division by zero"); ArrayND result(shape_, dim_); for (unsigned long i=0; i - template - ArrayND - ArrayND::operator+( - const ArrayND& r) const - { - if (!isShapeCompatible(r)) throw std::invalid_argument( - "In npstat::ArrayND::operator+: " - "incompatible argument array shape"); - ArrayND result(shape_, dim_); - for (unsigned long i=0; i - template - ArrayND - ArrayND::operator-( - const ArrayND& r) const - { - if (!isShapeCompatible(r)) throw std::invalid_argument( - "In npstat::ArrayND::operator-: " - "incompatible argument array shape"); - ArrayND result(shape_, dim_); - for (unsigned long i=0; i inline ArrayND ArrayND::operator+() const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"operator+\""); return *this; } // template // ArrayND ArrayND::operator-() const // { // if (!shapeIsKnown_) throw std::invalid_argument( // "Initialize npstat::ArrayND before calling method \"operator-\""); // ArrayND result(shape_, dim_); // for (unsigned long i=0; i template ArrayND& ArrayND::operator*=(const Num2& r) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"operator*=\""); for (unsigned long i=0; i ArrayND& ArrayND::makeNonNegative() { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"makeNonNegative\""); const Numeric zero = Numeric(); if (dim_) { for (unsigned long i=0; i::more(data_[i], zero))) data_[i] = zero; } else if (!(ComplexComparesAbs::more(localData_[0], zero))) localData_[0] = zero; return *this; } template unsigned ArrayND::makeCopulaSteps( const double tolerance, const unsigned nCycles) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"makeCopulaSteps\""); if (nCycles == 0U) return 0U; if (!dim_) throw std::invalid_argument( "npstat::ArrayND::makeCopulaSteps method " "can not be used with array of 0 rank"); const Numeric zero = Numeric(); for (unsigned long i=0; i::more(data_[i], zero))) data_[i] = zero; std::vector axesPtrBuf(dim_); Numeric** axes = &axesPtrBuf[0]; const Numeric one = static_cast(1); // Memory for the axis accumulators unsigned idxSum = 0; for (unsigned i=0; i axesBuf(idxSum); axes[0] = &axesBuf[0]; for (unsigned i=1; i(amax); for (unsigned a=0; a tolerance) withinTolerance = false; } } if (withinTolerance) break; const Numeric totalAverage = totalSum/ static_cast(len_)/static_cast(dim_); // Run over all points again and divide by // the product of marginals for (unsigned long idat=0; idat template ArrayND& ArrayND::operator/=(const Num2& r) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"operator/=\""); if (r == Num2()) throw std::runtime_error( "In npstat::ArrayND::operator/=: division by zero"); for (unsigned long i=0; i template ArrayND& ArrayND::operator+=(const ArrayND& r) { if (!isShapeCompatible(r)) throw std::invalid_argument( "In npstat::ArrayND::operator+=: " "incompatible argument array shape"); for (unsigned long i=0; i + template + ArrayND& + ArrayND::operator*=(const ArrayND& r) + { + if (!isShapeCompatible(r)) throw std::invalid_argument( + "In npstat::ArrayND::operator*=: " + "incompatible argument array shape"); + for (unsigned long i=0; i + template + ArrayND& + ArrayND::operator/=(const ArrayND& r) + { + if (!isShapeCompatible(r)) throw std::invalid_argument( + "In npstat::ArrayND::operator/=: " + "incompatible argument array shape"); + if (!r.isNonZero()) throw std::invalid_argument( + "In npstat::ArrayND::operator/=: " + "division by zero encountered"); + for (unsigned long i=0; i template ArrayND& ArrayND::addmul(const ArrayND& r, const Num3& c) { if (!isShapeCompatible(r)) throw std::invalid_argument( "In npstat::ArrayND::addmul: " "incompatible argument array shape"); for (unsigned long i=0; i template ArrayND& ArrayND::operator-=(const ArrayND& r) { if (!isShapeCompatible(r)) throw std::invalid_argument( "In npstat::ArrayND::operator-=: " "incompatible argument array shape"); for (unsigned long i=0; i Numeric ArrayND::interpolate1( const double *coords, const unsigned dim) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"interpolate1\""); if (dim != dim_) throw std::invalid_argument( "In npstat::ArrayND::interpolate1: incompatible coordinate length"); if (dim) { const unsigned maxdim = CHAR_BIT*sizeof(unsigned long); if (dim_ >= maxdim) throw std::invalid_argument( "In npstat::ArrayND::interpolate1: array rank is too large"); double dx[maxdim]; unsigned ix[maxdim]; for (unsigned i=0; i= static_cast(shape_[i] - 1)) { ix[i] = shape_[i] - 1; dx[i] = 0.0; } else { ix[i] = static_cast(std::floor(x)); dx[i] = x - ix[i]; } } Numeric sum = Numeric(); const unsigned long maxcycle = 1UL << dim; for (unsigned long icycle=0UL; icycle 0.0) sum += data_[icell]*static_cast(w); } return sum; } else return localData_[0]; } template Numeric ArrayND::interpolateLoop( const unsigned level, const double* coords, const Numeric* base) const { const unsigned npoints = shape_[level]; const double x = coords[level]; unsigned ix, npt = 1; double dx = 0.0; if (x < 0.0) ix = 0; else if (x > static_cast(npoints - 1)) ix = npoints - 1; else { ix = static_cast(std::floor(x)); if (ix) --ix; unsigned imax = ix + 3; while (imax >= npoints) { if (ix) --ix; --imax; } dx = x - ix; npt = imax + 1 - ix; } assert(npt >= 1 && npt <= 4); Numeric fit[4]; if (level < dim_ - 1) for (unsigned ipt=0; ipt inline Numeric ArrayND::interpolate3( const double* coords, const unsigned dim) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"interpolate3\""); if (dim != dim_) throw std::invalid_argument( "In npstat::ArrayND::interpolate3: incompatible coordinate length"); if (dim) { assert(coords); return interpolateLoop(0, coords, data_); } else return localData_[0]; } template template ArrayND& ArrayND::apply(Functor f) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"apply\""); for (unsigned long i=0; i(f(data_[i])); return *this; } template template ArrayND& ArrayND::scanInPlace( Functor f) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"scanInPlace\""); for (unsigned long i=0; i ArrayND& ArrayND::constFill( const Numeric c) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"constFill\""); for (unsigned long i=0; i inline ArrayND& ArrayND::clear() { return constFill(Numeric()); } template ArrayND& ArrayND::uninitialize() { if (!dataIsExternal_) destroyBuffer(data_, localData_); destroyBuffer(strides_, localStrides_); destroyBuffer(shape_, localShape_); localData_[0] = Numeric(); data_ = localData_; strides_ = 0; shape_ = 0; len_ = 0; dim_ = 0; shapeIsKnown_ = false; dataIsExternal_ = false; return *this; } template ArrayND& ArrayND::makeUnit() { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"makeUnit\""); if (dim_ < 2) throw std::invalid_argument( "npstat::ArrayND::makeUnit method " "can not be used with arrays of rank less than 2"); constFill(Numeric()); unsigned long stride = 0UL; const unsigned dimlen = shape_[0]; for (unsigned i=0; i(1)); for (unsigned i=0; i void ArrayND::linearFillLoop( const unsigned level, const double s0, const unsigned long idx, const double shift, const double* coeffs) { const unsigned imax = shape_[level]; const double c = coeffs[level]; if (level == dim_ - 1) { Numeric* d = &data_[idx]; for (unsigned i=0; i(sum); } } else { const unsigned long stride = strides_[level]; for (unsigned i=0; i ArrayND& ArrayND::linearFill( const double* coeffs, const unsigned dimCoeffs, const double shift) { // Make sure the object has been initialized if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"linearFill\""); if (dim_ != dimCoeffs) throw std::invalid_argument( "In npstat::ArrayND::linearFill: incompatible number of coefficients"); if (dim_) { assert(coeffs); linearFillLoop(0U, 0.0, 0UL, shift, coeffs); } else localData_[0] = static_cast(shift); return *this; } template template void ArrayND::functorFillLoop( const unsigned level, const unsigned long idx, Functor f, unsigned* farg) { const unsigned imax = shape_[level]; if (level == dim_ - 1) { Numeric* d = &data_[idx]; const unsigned* myarg = farg; for (unsigned i = 0; i(f(myarg, dim_)); } } else { const unsigned long stride = strides_[level]; for (unsigned i = 0; i template void ArrayND::convertToLastDimCdfLoop( ArrayND* sumSlice, const unsigned level, unsigned long idx0, unsigned long idxSlice, const bool useTrapezoids) { static const proper_double half = 0.5; const unsigned imax = shape_[level]; if (level == dim_ - 1) { Accumulator acc = Accumulator(); Numeric* data = data_ + idx0; if (useTrapezoids) { Numeric oldval = Numeric(); for (unsigned i = 0; i(acc); } acc += oldval*half; } else for (unsigned i = 0; i(acc); } if (sumSlice->dim_) sumSlice->data_[idxSlice] = static_cast(acc); else sumSlice->localData_[0] = static_cast(acc); } else { const unsigned long stride = strides_[level]; unsigned long sumStride = 0UL; if (sumSlice->dim_) sumStride = sumSlice->strides_[level]; for (unsigned i = 0; i( sumSlice, level+1, idx0, idxSlice, useTrapezoids); idx0 += stride; idxSlice += sumStride; } } } template template inline void ArrayND::convertToLastDimCdf( ArrayND* sumSlice, const bool useTrapezoids) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling " "method \"convertToLastDimCdf\""); if (!dim_) throw std::invalid_argument( "npstat::ArrayND::convertToLastDimCdf method " "can not be used with array of 0 rank"); assert(sumSlice); if (!sumSlice->shapeIsKnown_) throw std::invalid_argument( "In npstat::ArrayND::convertToLastDimCdf: " "uninitialized argument array"); convertToLastDimCdfLoop(sumSlice, 0U, 0UL, 0UL, useTrapezoids); } template template void ArrayND::coarseSum( const unsigned idim, const unsigned n, ArrayND* r) const { // Check that the input arguments make sense if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"coarseSum\""); if (idim >= dim_) throw std::invalid_argument( "In npstat::ArrayND::coarseSum: dimension number is out of range"); if (!n) throw std::invalid_argument( "In npstat::ArrayND::coarseSum: number of divisions must be positive"); assert(shape_); if (shape_[idim] % n) throw std::invalid_argument( "In npstat::ArrayND::coarseSum: dimension is not exactly divisible"); assert(r); bool reinitResult = false; if (!r->shapeIsKnown_) reinitResult = true; else if (r->dim_ != dim_) reinitResult = true; else { assert(r->shape_); for (unsigned i=0; ishape_[i]; else reinitResult = shape_[i] != r->shape_[i]; } if (reinitResult) { r->uninitialize(); r->len_ = len_ / n; r->dim_ = dim_; r->shapeIsKnown_ = true; r->shape_ = makeBuffer(dim_, r->localShape_, Dim2); copyBuffer(r->shape_, shape_, dim_); r->shape_[idim] /= n; r->buildStrides(); r->data_ = makeBuffer(len_, r->localData_, Len2); } switch (n) { case 1U: copyBuffer(r->data_, data_, len_); break; case 2U: coarseSum2(idim, r); break; case 3U: coarseSum3(idim, r); break; default: coarseSumN(idim, n, r); break; } } template template void ArrayND::coarseAverage( const unsigned idim, const unsigned n, ArrayND* r) const { coarseSum(idim, n, r); if (n > 1U) *r /= static_cast(n); } template template void ArrayND::coarseSum2( const unsigned idim, ArrayND* r) const { Num2* result = r->data_; const unsigned long *rstrides = r->strides_; const unsigned long resultLen = r->length(); // Cycle over result elements for (unsigned long ir=0; ir template void ArrayND::coarseSum3( const unsigned idim, ArrayND* r) const { Num2* result = r->data_; const unsigned long *rstrides = r->strides_; const unsigned long resultLen = r->length(); // Cycle over result elements for (unsigned long ir=0; ir template void ArrayND::coarseSumN( const unsigned idim, const unsigned n, ArrayND* r) const { const Num2 zero = Num2(); Num2* result = r->data_; const unsigned long *rstrides = r->strides_; const unsigned long resultLen = r->length(); unsigned long localidx[64]; unsigned long* idxb = makeBuffer(n, localidx, 64); // Cycle over result elements for (unsigned long ir=0; ir template ArrayND& ArrayND::functorFill(Functor f) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"functorFill\""); if (dim_) { unsigned localIndex[Dim]; unsigned* index = makeBuffer(dim_, localIndex, Dim); functorFillLoop(0U, 0UL, f, index); destroyBuffer(index, localIndex); } else localData_[0] = static_cast( f(static_cast(0), 0U)); return *this; } template template bool ArrayND::isClose( const ArrayND& r, const double eps) const { if (eps < 0.0) throw std::domain_error( "In npstat::ArrayND::isClose: tolerance must not be negative"); if (!isShapeCompatible(r)) throw std::invalid_argument( "In npstat::ArrayND::isClose: incompatible argument array shape"); if (dim_) { for (unsigned long i=0; i(absDifference(data_[i], rval)) > eps) return false; } } else { const Numeric rval = r.localData_[0]; if (static_cast(absDifference(localData_[0], rval)) > eps) return false; } return true; } template template ArrayND ArrayND::outer( const ArrayND& r) const { return ArrayND(*this, r); } template void ArrayND::contractLoop( unsigned thisLevel, const unsigned resLevel, const unsigned pos1, const unsigned pos2, unsigned long idxThis, unsigned long idxRes, ArrayND& result) const { while (thisLevel == pos1 || thisLevel == pos2) ++thisLevel; assert(thisLevel < dim_); if (resLevel == result.dim_ - 1) { const unsigned ncontract = shape_[pos1]; const unsigned imax = result.shape_[resLevel]; const unsigned long stride = strides_[pos1] + strides_[pos2]; for (unsigned i=0; i ArrayND ArrayND::contract( const unsigned pos1, const unsigned pos2) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"contract\""); if (!(pos1 < dim_ && pos2 < dim_ && pos1 != pos2)) throw std::invalid_argument("In npstat::ArrayND::contract: " "incompatible contraction indices"); if (shape_[pos1] != shape_[pos2]) throw std::invalid_argument( "In npstat::ArrayND::contract: incompatible " "length of contracted dimensions"); // Construct the new shape unsigned newshapeBuf[Dim]; unsigned* newshape = makeBuffer(dim_ - 2, newshapeBuf, Dim); unsigned ishap = 0; for (unsigned i=0; i result(newshape, ishap); if (ishap) contractLoop(0, 0, pos1, pos2, 0UL, 0UL, result); else { // We are just calculating the trace Numeric sum = Numeric(); const unsigned imax = shape_[0]; const unsigned long stride = strides_[0] + strides_[1]; for (unsigned i=0; i void ArrayND::transposeLoop( const unsigned level, const unsigned pos1, const unsigned pos2, unsigned long idxThis, unsigned long idxRes, ArrayND& result) const { const unsigned imax = shape_[level]; const unsigned long mystride = strides_[level]; const unsigned relevel = level == pos1 ? pos2 : (level == pos2 ? pos1 : level); const unsigned long restride = result.strides_[relevel]; const bool ready = (level == dim_ - 1); for (unsigned i=0; i template Num2 ArrayND::sum() const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"sum\""); Num2 sum = Num2(); for (unsigned long i=0; i template Num2 ArrayND::sumsq() const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"sumsq\""); Num2 sum = Num2(); for (unsigned long i=0; i typename Arr::value_type arrayMin(const Arr& arr) { typedef typename Arr::value_type Numeric; if (!arr.isShapeKnown()) throw std::invalid_argument( "In npstat::arrayMin: uninitialized array argument"); if (arr.rank()) { const unsigned long len = arr.length(); const Numeric* minValue = &arr.linearValue(0); for (unsigned long i=1; i::less(v, *minValue)) minValue = &v; } return *minValue; } else return arr(); } template ArrayShape arrayArgmin(const Arr& arr) { typedef typename Arr::value_type Numeric; if (!arr.isShapeKnown()) throw std::invalid_argument( "In npstat::arrayMin: uninitialized array argument"); ArrayShape sh(arr.rank()); if (arr.rank()) { const unsigned long len = arr.length(); const Numeric* minValue = &arr.linearValue(0); unsigned long imin = 0; for (unsigned long i=1; i::less(v, *minValue)) { minValue = &v; imin = i; } } arr.convertLinearIndex(imin, &sh[0], arr.rank()); } return sh; } template typename Arr::value_type arrayMax(const Arr& arr) { typedef typename Arr::value_type Numeric; if (!arr.isShapeKnown()) throw std::invalid_argument( "In npstat::arrayMax: uninitialized array argument"); if (arr.rank()) { const unsigned long len = arr.length(); const Numeric* maxValue = &arr.linearValue(0); for (unsigned long i=1; i::less(*maxValue, v)) maxValue = &v; } return *maxValue; } else return arr(); } template ArrayShape arrayArgmax(const Arr& arr) { typedef typename Arr::value_type Numeric; if (!arr.isShapeKnown()) throw std::invalid_argument( "In npstat::arrayMax: uninitialized array argument"); ArrayShape sh(arr.rank()); if (arr.rank()) { const unsigned long len = arr.length(); const Numeric* maxValue = &arr.linearValue(0); unsigned long imax = 0; for (unsigned long i=1; i::less(*maxValue, v)) { maxValue = &v; imax = i; } } arr.convertLinearIndex(imax, &sh[0], arr.rank()); } return sh; } template std::pair arrayMinMax(const Arr& arr) { typedef typename Arr::value_type Numeric; if (!arr.isShapeKnown()) throw std::invalid_argument( "In npstat::arrayMinMax: uninitialized array argument"); if (arr.rank()) { const unsigned long len = arr.length(); const Numeric* maxValue = &arr.linearValue(0); const Numeric* minValue = maxValue; for (unsigned long i=1; i::less(*maxValue, v)) maxValue = &v; if (ComplexComparesAbs::less(v, *minValue)) minValue = &v; } return std::pair(*minValue, *maxValue); } else return std::pair(arr(), arr()); } // Faster function for 2d transpose template ArrayND ArrayND::transpose() const { if (dim_ != 2) throw std::invalid_argument( "npstat::ArrayND::transpose method " "can not be used with arrays of rank other than 2"); unsigned newshape[2]; newshape[0] = shape_[1]; newshape[1] = shape_[0]; ArrayND result(newshape, dim_); const unsigned imax = shape_[0]; const unsigned jmax = shape_[1]; for (unsigned i=0; i template ArrayND ArrayND::derivative( const double inscale) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"derivative\""); if (!dim_) throw std::invalid_argument( "npstat::ArrayND::derivative method " "can not be used with array of 0 rank"); const typename ProperDblFromCmpl::type scale = inscale; const unsigned maxdim = CHAR_BIT*sizeof(unsigned long); if (dim_ >= maxdim) throw std::invalid_argument( "In npstat::ArrayND::derivative: array rank is too large"); const unsigned long maxcycle = 1UL << dim_; ArrayShape sh; sh.reserve(dim_); for (unsigned i=0; i(deriv*scale); } return result; } template template Accumulator ArrayND::sumBelowLoop( const unsigned level, unsigned long idx0, const unsigned* limit) const { Accumulator cdf = Accumulator(); const unsigned imax = limit[level] + 1U; if (level == dim_ - 1) { Numeric* base = data_ + idx0; for (unsigned i=0; i(level+1, idx0, limit); } return cdf; } template template Accumulator ArrayND::cdfValue( const unsigned *index, const unsigned indexLen) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"cdfValue\""); if (!dim_) throw std::invalid_argument( "npstat::ArrayND::cdfValue method " "can not be used with array of 0 rank"); if (indexLen != dim_) throw std::invalid_argument( "In npstat::ArrayND::cdfValue: incompatible index length"); for (unsigned i=0; i= shape_[i]) throw std::out_of_range( "In npstat::ArrayND::cdfValue: index out of range"); return sumBelowLoop(0, 0U, index); } template template ArrayND ArrayND::cdfArray( const double inscale) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"cdfArray\""); if (!dim_) throw std::invalid_argument( "npstat::ArrayND::cdfArray method " "can not be used with array of 0 rank"); const proper_double scale = inscale; const unsigned maxdim = CHAR_BIT*sizeof(unsigned long); if (dim_ >= maxdim) throw std::invalid_argument( "In npstat::ArrayND::cdfArray: array rank is too large"); const unsigned long maxcycle = 1UL << dim_; ArrayShape sh; sh.reserve(dim_); for (unsigned i=0; i result(sh); unsigned* psh = &sh[0]; const unsigned long len = result.length(); for (unsigned long ipre=0; ipre(value(psh, dim_)*scale); } result.data_[ipre] = deriv; } // The "return" will convert Accumulator type into Numeric return result; } template ArrayND ArrayND::transpose( const unsigned pos1, const unsigned pos2) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"transpose\""); if (!(pos1 < dim_ && pos2 < dim_ && pos1 != pos2)) throw std::invalid_argument("In npstat::ArrayND::transpose: " "incompatible transposition indices"); if (dim_ == 2) return transpose(); else { // Construct the new shape unsigned newshapeBuf[Dim]; unsigned *newshape = makeBuffer(dim_, newshapeBuf, Dim); copyBuffer(newshape, shape_, dim_); std::swap(newshape[pos1], newshape[pos2]); // Form the result array ArrayND result(newshape, dim_); // Fill the result array transposeLoop(0, pos1, pos2, 0UL, 0UL, result); destroyBuffer(newshape, newshapeBuf); return result; } } template template void ArrayND::mirror( const unsigned* mirrorDims, unsigned mirrorLen, ArrayND* out) const { assert(out); if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"mirror\""); if (mirrorLen > CHAR_BIT*sizeof(unsigned long)) throw std::invalid_argument( "In npstat::ArrayND::mirror: too many directions to mirror"); if (!out->shapeIsKnown_) *out = ArrayND(shape_, dim_); if (!isShapeCompatible(*out)) throw std::invalid_argument( "In npstat::ArrayND::mirror: incompatible output array shape"); unsigned nMirror = 0; unsigned toMirror[CHAR_BIT*sizeof(unsigned long)]; if (mirrorLen > 0U) { assert(mirrorDims); std::set dimset(mirrorDims, mirrorDims+mirrorLen); for (std::set::const_iterator it = dimset.begin(); it != dimset.end(); ++it) if (*it < dim_) toMirror[nMirror++] = *it; } if (!nMirror) { *out = *this; return; } unsigned idx[CHAR_BIT*sizeof(unsigned long)]; for (unsigned long el=0; elvalue(&idx[0], dim_) = data_[el]; } } template template void ArrayND::multiMirror( ArrayND* out) const { assert(out); if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"multiMirror\""); if (!out->shapeIsKnown_) *out = ArrayND(doubleShape(shape())); if (dim_ != out->dim_) throw std::invalid_argument( "In npstat::ArrayND::multiMirror: incompatible argument array rank"); if (dim_) { const unsigned *dshape = out->shape_; for (unsigned i=0; i= CHAR_BIT*sizeof(unsigned long)) throw std::invalid_argument( "In npstat::ArrayND::multiMirror: " "array rank is too large"); const unsigned long maxcycle = 1UL << dim_; std::vector indexbuf(dim_*2U); unsigned* idx = &indexbuf[0]; unsigned* mirror = idx + dim_; for (unsigned long ipt=0; iptvalue(mirror, dim_) = data_[ipt]; } } } else out->localData_[0] = static_cast(localData_[0]); } template template void ArrayND::rotate( const unsigned* shifts, const unsigned lenShifts, ArrayND* rotated) const { assert(rotated); if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"rotate\""); // Can't rotate into itself -- it will be a mess if ((void*)rotated == (void*)this) throw std::invalid_argument( "In npstat::ArrayND::rotate: can not rotate array into itself"); if (!rotated->shapeIsKnown_) *rotated = *this; if (dim_ != rotated->dim_) throw std::invalid_argument( "In npstat::ArrayND::rotate: incompatible argument array rank"); if (lenShifts != dim_) throw std::invalid_argument( "In npstat::ArrayND::rotate: incompatible dimensionality of shifts"); if (dim_) { assert(shifts); if (dim_ > CHAR_BIT*sizeof(unsigned long)) throw std::invalid_argument( "In npstat::ArrayND::rotate: array rank is too large"); unsigned buf[CHAR_BIT*sizeof(unsigned long)]; clearBuffer(buf, dim_); (const_cast(this))->flatCircularLoop( 0U, 0UL, 0UL, buf, shape_, shifts, *rotated, scast_assign_right()); } else rotated->localData_[0] = static_cast(localData_[0]); } template template void ArrayND::dotProductLoop( const unsigned level, unsigned long idx0, unsigned long idx1, unsigned long idx2, const ArrayND& r, ArrayND& result) const { // idx0 -- this object // idx1 -- dot product argument // idx2 -- result if (level == result.dim_) { Numeric sum = Numeric(); const unsigned imax = r.shape_[0]; const unsigned rstride = r.strides_[0]; const Numeric* l = data_ + idx0; const Num2* ri = r.data_ + idx1; for (unsigned i=0; i template ArrayND ArrayND::dot( const ArrayND& r) const { if (!dim_) throw std::invalid_argument( "npstat::ArrayND::dot method " "can not be used with array of 0 rank"); if (!r.dim_) throw std::invalid_argument( "npstat::ArrayND::dot method " "can not be used with argument array of 0 rank"); if (shape_[dim_ - 1] != r.shape_[0]) throw std::invalid_argument( "In npstat::ArrayND::dot: incompatible argument array shape"); if (dim_ == 1 && r.dim_ == 1) { // Special case: the result is of 0 rank ArrayND result(static_cast(0), 0U); Numeric sum = Numeric(); const unsigned imax = shape_[0]; for (unsigned i=0; i result(newshape, dim_+r.dim_-2); dotProductLoop(0U, 0UL, 0UL, 0UL, r, result); destroyBuffer(newshape, newshapeBuf); return result; } } template inline unsigned ArrayND::span(const unsigned dim) const { if (dim >= dim_) throw std::out_of_range( "In npstat::ArrayND::span: dimension number is out of range"); return shape_[dim]; } template unsigned ArrayND::maximumSpan() const { unsigned maxspan = 0; for (unsigned i=0; i maxspan) maxspan = shape_[i]; return maxspan; } template unsigned ArrayND::minimumSpan() const { if (dim_ == 0) return 0U; unsigned minspan = shape_[0]; for (unsigned i=1; i inline const Numeric& ArrayND::cl() const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"cl\""); if (dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 0 array)"); return localData_[0]; } template inline const Numeric& ArrayND::cl( const double i0) const { if (1U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 1 array)"); return data_[coordToIndex(i0, 0)]; } template inline const Numeric& ArrayND::cl( const double i0, const double i1) const { if (2U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 2 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)]; } template inline const Numeric& ArrayND::cl( const double i0, const double i1, const double i2) const { if (3U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 3 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)]; } template inline const Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3) const { if (4U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 4 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)]; } template inline const Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4) const { if (5U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 5 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)]; } template inline const Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4, const double i5) const { if (6U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 6 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)*strides_[4] + coordToIndex(i5, 5)]; } template inline const Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4, const double i5, const double i6) const { if (7U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 7 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)*strides_[4] + coordToIndex(i5, 5)*strides_[5] + coordToIndex(i6, 6)]; } template inline const Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4, const double i5, const double i6, const double i7) const { if (8U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 8 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)*strides_[4] + coordToIndex(i5, 5)*strides_[5] + coordToIndex(i6, 6)*strides_[6] + coordToIndex(i7, 7)]; } template inline const Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4, const double i5, const double i6, const double i7, const double i8) const { if (9U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 9 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)*strides_[4] + coordToIndex(i5, 5)*strides_[5] + coordToIndex(i6, 6)*strides_[6] + coordToIndex(i7, 7)*strides_[7] + coordToIndex(i8, 8)]; } template inline const Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4, const double i5, const double i6, const double i7, const double i8, const double i9) const { if (10U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 10 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)*strides_[4] + coordToIndex(i5, 5)*strides_[5] + coordToIndex(i6, 6)*strides_[6] + coordToIndex(i7, 7)*strides_[7] + coordToIndex(i8, 8)*strides_[8] + coordToIndex(i9, 9)]; } template inline Numeric& ArrayND::cl() { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"cl\""); if (dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 0 array)"); return localData_[0]; } template inline Numeric& ArrayND::cl( const double i0) { if (1U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 1 array)"); return data_[coordToIndex(i0, 0)]; } template inline Numeric& ArrayND::cl( const double i0, const double i1) { if (2U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 2 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)]; } template inline Numeric& ArrayND::cl( const double i0, const double i1, const double i2) { if (3U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 3 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)]; } template inline Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3) { if (4U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 4 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)]; } template inline Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4) { if (5U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 5 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)]; } template inline Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4, const double i5) { if (6U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 6 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)*strides_[4] + coordToIndex(i5, 5)]; } template inline Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4, const double i5, const double i6) { if (7U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 7 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)*strides_[4] + coordToIndex(i5, 5)*strides_[5] + coordToIndex(i6, 6)]; } template inline Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4, const double i5, const double i6, const double i7) { if (8U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 8 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)*strides_[4] + coordToIndex(i5, 5)*strides_[5] + coordToIndex(i6, 6)*strides_[6] + coordToIndex(i7, 7)]; } template inline Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4, const double i5, const double i6, const double i7, const double i8) { if (9U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 9 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)*strides_[4] + coordToIndex(i5, 5)*strides_[5] + coordToIndex(i6, 6)*strides_[6] + coordToIndex(i7, 7)*strides_[7] + coordToIndex(i8, 8)]; } template inline Numeric& ArrayND::cl( const double i0, const double i1, const double i2, const double i3, const double i4, const double i5, const double i6, const double i7, const double i8, const double i9) { if (10U != dim_) throw std::invalid_argument( "In npstat::ArrayND::cl: wrong # of args (not rank 10 array)"); return data_[coordToIndex(i0, 0)*strides_[0] + coordToIndex(i1, 1)*strides_[1] + coordToIndex(i2, 2)*strides_[2] + coordToIndex(i3, 3)*strides_[3] + coordToIndex(i4, 4)*strides_[4] + coordToIndex(i5, 5)*strides_[5] + coordToIndex(i6, 6)*strides_[6] + coordToIndex(i7, 7)*strides_[7] + coordToIndex(i8, 8)*strides_[8] + coordToIndex(i9, 9)]; } template const char* ArrayND::classname() { static const std::string name( gs::template_class_name("npstat::ArrayND")); return name.c_str(); } template bool ArrayND::write(std::ostream& os) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"write\""); gs::write_pod_vector(os, shape()); return !os.fail() && (dim_ ? gs::write_array(os, data_, len_) : gs::write_item(os, localData_[0], false)); } template void ArrayND::restore( const gs::ClassId& id, std::istream& in, ArrayND* array) { static const gs::ClassId current(gs::ClassId::makeId >()); current.ensureSameId(id); ArrayShape rshape; gs::read_pod_vector(in, &rshape); if (in.fail()) throw gs::IOReadFailure( "In npstat::ArrayND::restore: input stream failure (checkpoint 0)"); assert(array); array->uninitialize(); array->dim_ = rshape.size(); array->shapeIsKnown_ = true; array->len_ = 1UL; if (array->dim_) { array->shape_ = makeBuffer(array->dim_, array->localShape_, Dim); for (unsigned i=0; idim_; ++i) { array->shape_[i] = rshape[i]; assert(array->shape_[i]); array->len_ *= array->shape_[i]; } array->buildStrides(); array->data_ = makeBuffer(array->len_, array->localData_, Len); gs::read_array(in, array->data_, array->len_); } else gs::restore_item(in, array->localData_, false); if (in.fail()) throw gs::IOReadFailure( "In npstat::ArrayND::restore: input stream failure (checkpoint 1)"); } template template void ArrayND::exportSubrange( const unsigned* corner, const unsigned lenCorner, ArrayND* out) const { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"exportSubrange\""); if (dim_ != lenCorner) throw std::invalid_argument( "In npstat::ArrayND::exportSubrange: incompatible corner index length"); assert(out); if (!out->shapeIsKnown_) throw std::invalid_argument( "In npstat::ArrayND::exportSubrange: uninitialized argument array"); if (out->dim_ != dim_) throw std::invalid_argument( "In npstat::ArrayND::exportSubrange: incompatible argument array rank"); if (dim_) { assert(corner); if (dim_ > CHAR_BIT*sizeof(unsigned long)) throw std::invalid_argument( "In npstat::ArrayND::exportSubrange: " "array rank is too large"); unsigned toBuf[CHAR_BIT*sizeof(unsigned long)]; clearBuffer(toBuf, dim_); (const_cast(this))->commonSubrangeLoop( 0U, 0UL, 0UL, corner, out->shape_, toBuf, *out, scast_assign_right()); } else out->localData_[0] = static_cast(localData_[0]); } template template void ArrayND::importSubrange( const unsigned* corner, const unsigned lenCorner, const ArrayND& from) { if (!shapeIsKnown_) throw std::invalid_argument( "Initialize npstat::ArrayND before calling method \"importSubrange\""); if (dim_ != lenCorner) throw std::invalid_argument( "In npstat::ArrayND::importSubrange: incompatible corner index length"); if (!from.shapeIsKnown_) throw std::invalid_argument( "In npstat::ArrayND::importSubrange: uninitialized argument array"); if (from.dim_ != dim_) throw std::invalid_argument( "In npstat::ArrayND::importSubrange: incompatible argument array rank"); if (dim_) { assert(corner); if (dim_ > CHAR_BIT*sizeof(unsigned long)) throw std::invalid_argument( "In npstat::ArrayND::importSubrange: " "array rank is too large"); unsigned toBuf[CHAR_BIT*sizeof(unsigned long)]; clearBuffer(toBuf, dim_); commonSubrangeLoop(0U, 0UL, 0UL, corner, from.shape_, toBuf, const_cast&>(from), scast_assign_left()); } else localData_[0] = static_cast(from.localData_[0]); } #ifdef CPP11_STD_AVAILABLE template inline ArrayND externalMemArrayND(Numeric* data, const unsigned* shape, const unsigned dim) { ArrayND arr; arr.buildExtFromShapePtr(shape, dim, data); return arr; } template inline ArrayND externalMemArrayND(Numeric* data, const ArrayShape& shape) { const unsigned dim = shape.size(); const unsigned* sh = dim ? &shape[0] : (unsigned*)0; ArrayND arr; arr.buildExtFromShapePtr(sh, dim, data); return arr; } template inline ArrayND externalMemArrayND(Numeric* data, const unsigned n0) { const unsigned dim = 1U; unsigned sizes[dim]; sizes[0] = n0; ArrayND arr; arr.buildExtFromShapePtr(sizes, dim, data); return arr; } template inline ArrayND externalMemArrayND(Numeric* data, const unsigned n0, const unsigned n1) { const unsigned dim = 2U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; ArrayND arr; arr.buildExtFromShapePtr(sizes, dim, data); return arr; } template inline ArrayND externalMemArrayND(Numeric* data, const unsigned n0, const unsigned n1, const unsigned n2) { const unsigned dim = 3U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; ArrayND arr; arr.buildExtFromShapePtr(sizes, dim, data); return arr; } template inline ArrayND externalMemArrayND(Numeric* data, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3) { const unsigned dim = 4U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; ArrayND arr; arr.buildExtFromShapePtr(sizes, dim, data); return arr; } template inline ArrayND externalMemArrayND(Numeric* data, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4) { const unsigned dim = 5U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; ArrayND arr; arr.buildExtFromShapePtr(sizes, dim, data); return arr; } template inline ArrayND externalMemArrayND(Numeric* data, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5) { const unsigned dim = 6U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; sizes[5] = n5; ArrayND arr; arr.buildExtFromShapePtr(sizes, dim, data); return arr; } template inline ArrayND externalMemArrayND(Numeric* data, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6) { const unsigned dim = 7U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; sizes[5] = n5; sizes[6] = n6; ArrayND arr; arr.buildExtFromShapePtr(sizes, dim, data); return arr; } template inline ArrayND externalMemArrayND(Numeric* data, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6, const unsigned n7) { const unsigned dim = 8U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; sizes[5] = n5; sizes[6] = n6; sizes[7] = n7; ArrayND arr; arr.buildExtFromShapePtr(sizes, dim, data); return arr; } template inline ArrayND externalMemArrayND(Numeric* data, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6, const unsigned n7, const unsigned n8) { const unsigned dim = 9U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; sizes[5] = n5; sizes[6] = n6; sizes[7] = n7; sizes[8] = n8; ArrayND arr; arr.buildExtFromShapePtr(sizes, dim, data); return arr; } template inline ArrayND externalMemArrayND(Numeric* data, const unsigned n0, const unsigned n1, const unsigned n2, const unsigned n3, const unsigned n4, const unsigned n5, const unsigned n6, const unsigned n7, const unsigned n8, const unsigned n9) { const unsigned dim = 10U; unsigned sizes[dim]; sizes[0] = n0; sizes[1] = n1; sizes[2] = n2; sizes[3] = n3; sizes[4] = n4; sizes[5] = n5; sizes[6] = n6; sizes[7] = n7; sizes[8] = n8; sizes[9] = n9; ArrayND arr; arr.buildExtFromShapePtr(sizes, dim, data); return arr; } template inline CPP11_auto_ptr > allocExternalMemArrayND( Numeric* data, const unsigned* shape, const unsigned dim) { CPP11_auto_ptr > arr(new ArrayND()); arr->buildExtFromShapePtr(shape, dim, data); return arr; } template inline CPP11_auto_ptr > allocExternalMemArrayND( Numeric* data, const ArrayShape& shape) { const unsigned dim = shape.size(); const unsigned* sh = dim ? &shape[0] : (unsigned*)0; CPP11_auto_ptr > arr(new ArrayND()); arr->buildExtFromShapePtr(sh, dim, data); return arr; } #endif // CPP11_STD_AVAILABLE } + +template +npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> +operator+(const npstat::ArrayND& l, + const npstat::ArrayND& r) +{ + if (!l.isShapeCompatible(r)) throw std::invalid_argument( + "In ::operator+: incompatible shapes of ArrayND arguments"); + npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> result(l.shape_, l.dim_); + const unsigned long len = result.length(); + for (unsigned long i=0; i +npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> +operator-(const npstat::ArrayND& l, + const npstat::ArrayND& r) +{ + if (!l.isShapeCompatible(r)) throw std::invalid_argument( + "In ::operator-: incompatible shapes of ArrayND arguments"); + npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> result(l.shape_, l.dim_); + const unsigned long len = result.length(); + for (unsigned long i=0; i +npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> +operator*(const npstat::ArrayND& l, + const npstat::ArrayND& r) +{ + if (!l.isShapeCompatible(r)) throw std::invalid_argument( + "In ::operator*: incompatible shapes of ArrayND arguments"); + npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> result(l.shape_, l.dim_); + const unsigned long len = result.length(); + for (unsigned long i=0; i +npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> +operator/(const npstat::ArrayND& l, + const npstat::ArrayND& r) +{ + if (!l.isShapeCompatible(r)) throw std::invalid_argument( + "In ::operator/: incompatible shapes of ArrayND arguments"); + if (!r.isNonZero()) throw std::invalid_argument( + "In ::operator/ for ArrayND: division by zero"); + npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> result(l.shape_, l.dim_); + const unsigned long len = result.length(); + for (unsigned long i=0; i #include #include "geners/ClassId.hh" #include "geners/CPP11_config.hh" #include "geners/CPP11_auto_ptr.hh" #include "npstat/nm/SimpleFunctors.hh" #include "npstat/nm/ArrayRange.hh" #include "npstat/nm/AbsArrayProjector.hh" #include "npstat/nm/AbsVisitor.hh" +#include "npstat/nm/LongerType.hh" #include "npstat/nm/PreciseType.hh" #include "npstat/nm/ProperDblFromCmpl.hh" namespace npstat { + template + class ArrayND; +} + +//@{ +/** Element-wise arithmetic operator */ +template +npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> +operator+(const npstat::ArrayND& l, + const npstat::ArrayND& r); + +template +npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> +operator-(const npstat::ArrayND& l, + const npstat::ArrayND& r); + +template +npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> +operator*(const npstat::ArrayND& l, + const npstat::ArrayND& r); + +template +npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> +operator/(const npstat::ArrayND& l, + const npstat::ArrayND& r); +//@} + +namespace npstat { /** // A class for multidimensional array manipulation. A number of methods // of this class will work only if dimensionality is limited by // CHAR_BIT*sizeof(unsigned long)-1 (which is 31 and 63 on 32- and 64-bit // architectures, respectively). // // Depending on how much space is provided with the "StackLen" template // parameter, the array data will be placed either on the stack or on the // heap. By default, array data leaves on the heap unless the array has // rank 0. // // Depending on how much space is provided with the "StackDim" template // parameter, the array strides will be placed either on the stack or // on the heap. By default, strides will be placed on the stack in case // the array dimensionality is ten or less. // // The "Numeric" type must have a default constructor (of course, // pointers to arbitrary types can be used as well). // // Both StackLen and StackDim parameters must be positive. */ template class ArrayND { template friend class ArrayND; public: typedef Numeric value_type; typedef typename ProperDblFromCmpl::type proper_double; /** // Default constructor creates an uninitialized array. The // following things can be done safely with such an array: // // 1) Assigning it from another array (initialized or not). // // 2) Passing it as an argument to the class static method "restore". // // 3) Calling the "uninitialize" method. // // 4) Calling the "isShapeKnown" method. // // 5) Calling the "reshape" method. // // Any other operation results in an undefined behavior (often, // an exception is thrown). Note that initialized array can not // be assigned from uninitialized one. */ ArrayND(); /** // Constructor which creates arrays with the given shape. // The array data remains undefined. Simple inilitalization // of the data can be performed using methods clear() or // constFill(SomeValue). More complicated initialization // can be done by "linearFill", "functorFill", or by setting // every array element to a desired value. */ explicit ArrayND(const ArrayShape& shape); ArrayND(const unsigned* shape, unsigned dim); /** The copy constructor */ ArrayND(const ArrayND&); #ifdef CPP11_STD_AVAILABLE /** The move constructor */ ArrayND(ArrayND&&); #endif /** // Converting constructor. It looks more general than the copy // constructor, but the actual copy constructor has to be created // anyway -- otherwise the compiler will generate an incorrect // default copy constructor. Note that existence of this // constructor essentially disables data type safety for copying // arrays -- but the code significantly gains in convenience. */ template ArrayND(const ArrayND&); /** // Converting constructor where the array values are filled // by a functor using values of another array as arguments */ template ArrayND(const ArrayND&, Functor f); /** Constructor from a subrange of another array */ template ArrayND(const ArrayND& from, const ArrayRange& fromRange); /** Similar constructor with a transforming functor */ template ArrayND(const ArrayND& from, const ArrayRange& fromRange, Functor f); /** // Constructor from a slice of another array. The data of the // constructed array remains undefined. The argument "indices" // lists either the array indices whose numbers will be fixed // when slicing is performed or the indices which will be iterated // over during projections (for example, array values may be // summed over these indices). These indices will be excluded // from the constructed array. The created array can be subsequently // used with methods "exportSlice", "importSlice", "project", etc. // of the parent array "slicedArray". */ template ArrayND(const ArrayND& slicedArray, const unsigned *indices, unsigned nIndices); /** Outer product constructor */ template ArrayND(const ArrayND& a1, const ArrayND& a2); //@{ /** // Constructor in which the spans are explicitly provided // for each dimension. The array data remains undefined. */ explicit ArrayND(unsigned n0); ArrayND(unsigned n0, unsigned n1); ArrayND(unsigned n0, unsigned n1, unsigned n2); ArrayND(unsigned n0, unsigned n1, unsigned n2, unsigned n3); ArrayND(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4); ArrayND(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5); ArrayND(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6); ArrayND(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7); ArrayND(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7, unsigned n8); ArrayND(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7, unsigned n8, unsigned n9); //@} /** Destructor */ ~ArrayND(); /** // Assignment operator. The shape of the array on the right // must be compatible with the shape of the array on the left. // The only exception is when the array on the left has no shape // at all (i.e., it was created by the default constructor or // its "uninitialize" method was called). In this case the array // on the left will assume the shape of the array on the right. */ ArrayND& operator=(const ArrayND&); #ifdef CPP11_STD_AVAILABLE /** The move assignment operator */ ArrayND& operator=(ArrayND&&); #endif /** Converting assignment operator */ template ArrayND& operator=(const ArrayND&); /** Converting assignment method with a transforming functor */ template ArrayND& assign(const ArrayND&, Functor f); /** // The function which can "uninitialize" the array to the same // state as produced by the default constructor. Can be applied // in order to force the assignment operators to work. */ ArrayND& uninitialize(); //@{ /** Change the array shape. All data is lost in the process. */ ArrayND& reshape(const ArrayShape& newShape); ArrayND& reshape(const unsigned* newShape, unsigned dim); ArrayND& reshape(unsigned n0); ArrayND& reshape(unsigned n0, unsigned n1); ArrayND& reshape(unsigned n0, unsigned n1, unsigned n2); ArrayND& reshape(unsigned n0, unsigned n1, unsigned n2, unsigned n3); ArrayND& reshape(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4); ArrayND& reshape(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5); ArrayND& reshape(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6); ArrayND& reshape(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7); ArrayND& reshape(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7, unsigned n8); ArrayND& reshape(unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7, unsigned n8, unsigned n9); //@} /** // Change the shape of this array to be identical to the shape of // the argument array. The shape of the argument array must be known. // All data is lost in the process. */ template ArrayND& reshape(const ArrayND& r); /** // Element access using multidimensional array index // (no bounds checking). The length of the index array // must be equal to the rank of this object. */ Numeric& value(const unsigned *index, unsigned indexLen); const Numeric& value(const unsigned *index, unsigned indexLen) const; /** // Element access using multidimensional array index // (with bounds checking) */ Numeric& valueAt(const unsigned *index, unsigned indexLen); const Numeric& valueAt(const unsigned *index, unsigned indexLen) const; /** Element access using linear index (no bounds checking) */ Numeric& linearValue(unsigned long index); const Numeric& linearValue(unsigned long index) const; /** Element access using linear index (with bounds checking) */ Numeric& linearValueAt(unsigned long index); const Numeric& linearValueAt(unsigned long index) const; /** Convert linear index into multidimensional index */ void convertLinearIndex(unsigned long l, unsigned* index, unsigned indexLen) const; inline ArrayShape convertLinearIndex(unsigned long l) const { ArrayShape sh(dim_); if (dim_) this->convertLinearIndex(l, &sh[0], dim_); return sh; } /** The range which encloses all non-zero values of the array */ ArrayRange nonZeroRange() const; /** Convert multidimensional index into linear index */ unsigned long linearIndex(const unsigned* idx, unsigned idxLen) const; inline unsigned long linearIndex(const ArrayShape& sh) const {return linearIndex(sh.empty() ? (unsigned*)0 : &sh[0], sh.size());} // Some inspectors /** Total number of data array elements */ inline unsigned long length() const {return len_;} /** Linearized data */ inline const Numeric* data() const {return data_;} /** Check whether the array has been initialized */ inline bool isShapeKnown() const {return shapeIsKnown_;} /** The number of array dimensions */ inline unsigned rank() const {return dim_;} /** Get the complete shape */ ArrayShape shape() const; /** Shape data as a C-style array */ inline const unsigned *shapeData() const {return shape_;} /** Get the complete range */ ArrayRange fullRange() const; /** Get the number of elements in some particular dimension */ unsigned span(unsigned dim) const; /** Maximum span among all dimensions */ unsigned maximumSpan() const; /** Minimum span among all dimensions */ unsigned minimumSpan() const; /** Get the strides */ inline const unsigned long* strides() const {return strides_;} /** Check if all array elements are zero */ bool isZero() const; + /** Check if all array elements are non-zero */ + bool isNonZero() const; + /** This method modifies all the data in one statement */ template ArrayND& setData(const Num2* data, unsigned long dataLength); /** Compare two arrays for equality */ template bool operator==(const ArrayND&) const; /** Logical negation of operator== */ template bool operator!=(const ArrayND&) const; /** Largest absolute difference with another bin-compatible array */ template double maxAbsDifference(const ArrayND&) const; - /** operator+ returns a copy of this array */ + /** Unary operator+ returns a copy of this array */ ArrayND operator+() const; - /** addition of two arrays */ - template - ArrayND operator+(const ArrayND& r) const; - - /** subtraction of two arrays */ - template - ArrayND operator-(const ArrayND& r) const; - /** multiplication by a scalar */ template ArrayND operator*(const Num2& r) const; /** division by a scalar */ template ArrayND operator/(const Num2& r) const; //@{ /** // In-place operator. Note that it works faster than the binary - // version, i.e., A += B is much faster than A = A + B. + // version with assignment, i.e., A += B is faster than A = A + B. */ template ArrayND& operator*=(const Num2& r); template ArrayND& operator/=(const Num2& r); template ArrayND& operator+=(const ArrayND& r); template ArrayND& operator-=(const ArrayND& r); + + template + ArrayND& operator*=(const ArrayND& r); + + template + ArrayND& operator/=(const ArrayND& r); //@} /** This method is equivalent to (but faster than) += r*c */ template ArrayND& addmul(const ArrayND& r, const Num3& c); /** Outer product as a method (see also the outer product constructor) */ template ArrayND outer(const ArrayND& r) const; /** // Contraction of a pair of indices. Note that the array length // must be the same in both dimensions. */ ArrayND contract(unsigned pos1, unsigned pos2) const; /** // Here, dot product corresponds to outer product followed // by the contraction over two indices -- the last index // of this object and the first index of the argument. */ template ArrayND dot(const ArrayND& r) const; /** // The intent of this method is to marginalize // over a set of indices with a prior. Essentially, we are // calculating integrals akin to p(y) = Integral f(y|x) g(x) dx // in which all functions are represented on an equidistant grid. // If needed, multiplication of the result by the grid cell size // should be performed after this function. "indexMap" specifies // how the indices of the prior array (which is like g(x)) are // mapped into the indices of this array (which is like f(y|x)). // The number of elements in the map, "mapLen", must be equal to // the rank of the prior. Dimension 0 of the prior corresponds // to the dimension indexMap[0] of this array, dimension 1 // corresponds to indexMap[1], etc. */ template ArrayND marginalize(const ArrayND& prior, const unsigned* indexMap, unsigned mapLen) const; /** Transposed array */ ArrayND transpose(unsigned pos1, unsigned pos2) const; /** Transpose without arguments can be invoked for 2-d arrays only */ ArrayND transpose() const; /** // Sum of all array elements which uses Num2 type as accumulator. // Typically, the precision and dynamic range of Num2 should be // suitably larger than the precision and dynamic range of Numeric. // For example, if Numeric is float then Num2 should be double, etc. */ template ::type> Num2 sum() const; /** // Sum of absolute values squared which uses Num2 as accumulator. // Function std::abs(Numeric) must exist. */ template ::type> Num2 sumsq() const; /** // Mixed derivative over all directions. Useful for generating // densities from distribution functions. The resulting array // will have one less point in each dimension. Class Num2 is // used as accumulator for calculations. static_cast from // Num2 to Numeric must exist. The result is multiplied by the // scale factor provided. */ template ::type> ArrayND derivative(double scale=1.0) const; /** // The operation inverse to "derivative". Constructs multivariate // cumulative density function. */ template ::type> ArrayND cdfArray(double scale=1.0) const; /** // Calculate just one multivariate cumulative density function // value. Point with given index will be included in the sum. */ template ::type> Num2 cdfValue(const unsigned *index, unsigned indexLen) const; /** // The next function turns the array data into the conditional // cumulative density function for the last dimension. "Num2" // is the type of accumulator class used. The cdf is stored // in such a way that the cdf value of 0 is skipped (the first // stored value is the sum which includes the 0th bin). The slice // is filled with the sum of values. The "useTrapezoids" parameter // specifies whether trapezoidal integration formula should be // utilized (rectangular integration is used in case // "useTrapezoids" value is "false"). */ template ::type> void convertToLastDimCdf(ArrayND* sumSlice, bool useTrapezoids); /** // Coarsen this array by summing n nearby elements along // the given dimension. The "result" array will have n // times less elements along that dimension. */ template void coarseSum(unsigned idim, unsigned n, ArrayND* result) const; /** // Coarsen this array by averaging n nearby elements along // the given dimension. The "result" array will have n // times less elements along that dimension. */ template void coarseAverage(unsigned idim, unsigned n, ArrayND* result) const; /** // Closest value accessor (works as if the array allows access // with non-integer indices). For example, the second point // in some dimension will be accessed in case the coordinate // in that dimension is between 0.5 and 1.5. This function can be // used, for example, for implementing simple N-D histogramming // or for closest value interpolation and extrapolation. */ Numeric& closest(const double *x, unsigned xDim); const Numeric& closest(const double *x, unsigned xDim) const; /** // Multilinear interpolation. Closest value extrapolation is used // in case some index is outside of the array bounds. Note that // this function works only if the array dimensionality is less // than CHAR_BIT*sizeof(unsigned long). x is the "coordinate" // which coincides with array index for x equal to unsigned // integers. */ Numeric interpolate1(const double *x, unsigned xDim) const; /** // Multicubic interpolation. Closest value extrapolation is used // in case some index is outside of the array bounds. This // function is much slower than "interpolate1" (in the current // implementation, a recursive algorithm is used). */ Numeric interpolate3(const double *x, unsigned xDim) const; /** // This method applies a single-argument functor to each // element of the array (in-place). The result returned // by the functor becomes the new value of the element. There // must be a conversion (static cast) from the functor result to // the "Numeric" type. The method returns *this which allows // for chaining of such methods. Use the transforming constructor // if you want a new array instead. */ template ArrayND& apply(Functor f); /** // This method applies a single-argument functor to each // element of the array. The result returned by the functor // is ignored inside the scan. Depending on what the functor does, // the array values may or may not be modified (they can be modified // if the functor takes its argument via a non-const reference). */ template ArrayND& scanInPlace(Functor f); /** This method fills the array data with a constant value */ ArrayND& constFill(Numeric c); /** Zero the array out (every datum becomes Numeric()) */ ArrayND& clear(); /** // This method fills the array with a linear combination // of the index values. For example, a 2-d array element with indices // i, k will be set to (coeff[0]*i + coeff[1]*k + c). There must be // a conversion (static cast) from double into "Numeric". */ ArrayND& linearFill(const double* coeff, unsigned coeffLen, double c); /** // This method fills the array from a functor // which takes (const unsigned* index, unsigned indexLen) // arguments. There must be a conversion (static cast) from // the functor result to the "Numeric" type. */ template ArrayND& functorFill(Functor f); /** // This method can be used for arrays with rank // of at least 2 whose length is the same in all dimensions. // It puts static_cast(1) on the main diagonal and // Numeric() everywhere else. */ ArrayND& makeUnit(); /** This method turns all negative elements into zeros */ ArrayND& makeNonNegative(); /** // This method accumulates marginals and divides // the array (treated as a distribution) by the product of the // marginals. Several iterations like this turn the distribution // into a copula. If the array contains negative elements, they // are turned into zeros before the iterations are performed. // The function returns the actual number of iteration performed // when the given tolerance was reached for all marginals. */ unsigned makeCopulaSteps(double tolerance, unsigned maxIterations); /** // Loop over all elements of two compatible arrays and apply // a binary functor */ template void jointScan(ArrayND& other, Functor binaryFunct); /** Convenience method for element-by-element in-place multiplication */ template inline ArrayND& inPlaceMul(const ArrayND& r) { jointScan(const_cast&>(r), multeq_left()); return *this; } /** // Loop over subranges in two arrays in such a way that the functor // is called only if the indices on both sides are valid. The topology // of both arrays is assumed to be box-like (flat). The starting // corner in this object (where cycling begins) is provided by the // argument "thisCorner". The "range" argument specifies the width // of the processed patch in each dimension. The corner of the "other" // array where cycling begins is provided by the "otherCorner" // argument. The "arrLen" argument specifies the number of elements // in "thisCorner", "range", and "otherCorner" arrays. It should be // equal to the rank of either of the two ArrayND arrays. // // Note that there is no good way for this method to assume constness // of this or "other" array: this becomes apparent only after the // functor has been specified. Apply const_cast judiciously as needed, // other solutions of this problem are not any better. */ template void jointSubrangeScan(ArrayND& other, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, unsigned arrLen, Functor binaryFunct); /** // Method similar to "jointSubrangeScan" in which the topology of // both arrays is assumed to be hypertoroidal (circular buffer in // every dimension) */ template void dualCircularScan(ArrayND& other, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, unsigned arrLen, Functor binaryFunct); /** // Method similar to "jointSubrangeScan" in which the topology of // this array is assumed to be flat and the other array hypertoroidal */ template void flatCircularScan(ArrayND& other, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, unsigned arrLen, Functor binaryFunct); /** // Method similar to "jointSubrangeScan" in which the topology of // this array is assumed to be hypertoroidal and the other array flat */ template void circularFlatScan(ArrayND& other, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, unsigned arrLen, Functor binaryFunct); /** // This method runs over a subrange of the array // and calls the argument functor on every point. This // method will not call "clear" or "result" functions of // the argument functor. */ template void processSubrange(AbsArrayProjector& f, const BoxND& subrange) const; /** // Copy a hyperrectangular subrange of this array potentially // completely overwriting the destination array. The starting // corner in this object where copying begins is provided by // the first two arguments. The subrange size is defined by // the shape of the destination array. */ template void exportSubrange(const unsigned* fromCorner, unsigned lenCorner, ArrayND* dest) const; /** The inverse operation to "exportSubrange" */ template void importSubrange(const unsigned* fromCorner, unsigned lenCorner, const ArrayND& from); /** // Check that all elements of this array differ from the // corresponding elements of another array by at most "eps". // Equivalent to maxAbsDifference(r) <= eps (but usually faster). */ template bool isClose(const ArrayND& r, double eps) const; //@{ /** Check compatibility with another shape */ bool isCompatible(const ArrayShape& shape) const; bool isCompatible(const unsigned* shape, unsigned dim) const; //@} /** // Check shape compatibility with another array. Equivalent to // but faster than isCompatible(r.shape()). */ template bool isShapeCompatible(const ArrayND& r) const; /** // Joint cycle over the data of this array and the slice. // The array to which the "slice" argument refers should normally // be created by the slicing constructor using this array as // the argument. The "fixedIndices" argument should be the same // as the "indices" argument in that constructor. This method // is to be used for import/export of slice data and in-place // operations (addition, multiplication, etc). */ template void jointSliceScan(ArrayND& slice, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedIndices, Functor binaryFunct); /** // Joint cycle over a slice this array and some memory buffer. // The length of the buffer must be equal to the length of the // slice, as in "jointSliceScan". This method is to be used // for import/export of slice data and in-place operations // (addition, multiplication, etc) with memory managed not // by ArrayND but in some other manner. */ template void jointMemSliceScan(Num2* buffer, unsigned long bufLen, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedIndices, Functor binaryFunct); /** Figure out the slice shape without actually making the slice */ ArrayShape sliceShape(const unsigned *fixedIndices, unsigned nFixedIndices) const; /** Convenience method for exporting a slice of this array */ template inline void exportSlice(ArrayND* slice, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedIndices) const { assert(slice); (const_cast(this))->jointSliceScan( *slice, fixedIndices, fixedIndexValues, nFixedIndices, scast_assign_right()); } /** // Convenience method for exporting a slice of this array // into a memory buffer */ template inline void exportMemSlice(Num2* buffer, unsigned long bufLen, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedIndices) const { (const_cast(this))->jointMemSliceScan( buffer, bufLen, fixedIndices, fixedIndexValues, nFixedIndices, scast_assign_right()); } /** Convenience method for importing a slice into this array */ template inline void importSlice(const ArrayND& slice, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedIndices) { jointSliceScan(const_cast&>(slice), fixedIndices, fixedIndexValues, nFixedIndices, scast_assign_left()); } /** // Convenience method for importing a slice into this array // from a memory buffer */ template inline void importMemSlice(const Num2* buffer, unsigned long bufLen, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedIndices) { jointMemSliceScan(const_cast(buffer), bufLen, fixedIndices, fixedIndexValues, nFixedIndices, scast_assign_left()); } /** // This method applies the values in the slice to all other // coresponding values in the array. This can be used, for example, // to multiply/divide by some factor which varies across the slice. // The slice values will be used as the right functor argument. */ template void applySlice(ArrayND& slice, const unsigned *fixedIndices, unsigned nFixedIndices, Functor binaryFunct); /** // Convenience method which multiplies the array by a scale factor // which varies across the slice */ template inline ArrayND& multiplyBySlice(const ArrayND& slice, const unsigned *fixedIndices, unsigned nFixedIndices) { applySlice(const_cast&>(slice), fixedIndices, nFixedIndices, multeq_left()); return *this; } //@{ /** // This method fills a projection. The array to which // "projection" argument points should normally be created by // the slicing constructor using this array as an argument. // "projectedIndices" should be the same as "indices" specified // during the slice creation. */ template void project(ArrayND* projection, AbsArrayProjector& projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const; template void project(ArrayND* projection, AbsVisitor& projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const; //@} //@{ /** // Similar method to "project", but projections are added to // (or subtracted from) the existing projection data instead of // replacing them */ template void addToProjection(ArrayND* projection, AbsArrayProjector& projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const; template void subtractFromProjection(ArrayND* projection, AbsArrayProjector& projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const; template void addToProjection(ArrayND* projection, AbsVisitor& projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const; template void subtractFromProjection(ArrayND* projection, AbsVisitor& projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const; //@} /** // Rotation. Place the result into another array. The elements // with indices 0 in the current array will become elements with // indices "shifts" in the rotated array. */ template void rotate(const unsigned* shifts, unsigned lenShifts, ArrayND* rotated) const; /** // Mirror this array into another array w.r.t. the dimensions // provided by the arguments. The other array must have the // same spans as this one. */ template void mirror(const unsigned* mirrorDims, unsigned mirrorLen, ArrayND* out) const; /** // Fill another array with all possible mirror images // of this one. This other array must have twice the span // in each dimension. */ template void multiMirror(ArrayND* out) const; //@{ /** // Fortran-style subscripting without bounds checking (of course, // with indices starting at 0). */ Numeric& operator()(); const Numeric& operator()() const; Numeric& operator()(unsigned i0); const Numeric& operator()(unsigned i0) const; Numeric& operator()(unsigned i0, unsigned i1); const Numeric& operator()(unsigned i0, unsigned i1) const; Numeric& operator()(unsigned i0, unsigned i1, unsigned i2); const Numeric& operator()(unsigned i0, unsigned i1, unsigned i2) const; Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3); const Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3) const; Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4); const Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4) const; Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5); const Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5) const; Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6); const Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6) const; Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7); const Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7) const; Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8); const Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8) const; Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, unsigned i9); const Numeric& operator()(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, unsigned i9) const; //@} //@{ /** // Fortran-style subscripting with bounds checking (of course, // with indices starting at 0). */ Numeric& at(); const Numeric& at() const; Numeric& at(unsigned i0); const Numeric& at(unsigned i0) const; Numeric& at(unsigned i0, unsigned i1); const Numeric& at(unsigned i0, unsigned i1) const; Numeric& at(unsigned i0, unsigned i1, unsigned i2); const Numeric& at(unsigned i0, unsigned i1, unsigned i2) const; Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3); const Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3) const; Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4); const Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4) const; Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5); const Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5) const; Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6); const Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6) const; Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7); const Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7) const; Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8); const Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8) const; Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, unsigned i9); const Numeric& at(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, unsigned i9) const; //@} //@{ /** // Subscripting by continuous coordinate. // Works similar to the "closest" method. */ Numeric& cl(); const Numeric& cl() const; Numeric& cl(double x0); const Numeric& cl(double x0) const; Numeric& cl(double x0, double x1); const Numeric& cl(double x0, double x1) const; Numeric& cl(double x0, double x1, double x2); const Numeric& cl(double x0, double x1, double x2) const; Numeric& cl(double x0, double x1, double x2, double x3); const Numeric& cl(double x0, double x1, double x2, double x3) const; Numeric& cl(double x0, double x1, double x2, double x3, double x4); const Numeric& cl(double x0, double x1, double x2, double x3, double x4) const; Numeric& cl(double x0, double x1, double x2, double x3, double x4, double x5); const Numeric& cl(double x0, double x1, double x2, double x3, double x4, double x5) const; Numeric& cl(double x0, double x1, double x2, double x3, double x4, double x5, double x6); const Numeric& cl(double x0, double x1, double x2, double x3, double x4, double x5, double x6) const; Numeric& cl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7); const Numeric& cl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7) const; Numeric& cl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8); const Numeric& cl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8) const; Numeric& cl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9); const Numeric& cl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9) const; //@} //@{ /** Method related to "geners" I/O */ inline gs::ClassId classId() const {return gs::ClassId(*this);} bool write(std::ostream& of) const; //@} static const char* classname(); static inline unsigned version() {return 1;} static void restore(const gs::ClassId& id, std::istream& in, ArrayND* array); private: Numeric localData_[StackLen]; Numeric* data_; unsigned long localStrides_[StackDim]; unsigned long *strides_; unsigned localShape_[StackDim]; unsigned *shape_; unsigned long len_; unsigned dim_; bool shapeIsKnown_; bool dataIsExternal_; // Basic initialization from unsigned* shape and dimensionality void buildFromShapePtr(const unsigned*, unsigned); // Basic initialization from unsigned* shape, dimensionality, // and external data buffer which we will manage but will not own void buildExtFromShapePtr(const unsigned*, unsigned, Numeric*); // Build strides_ array out of the shape_ array void buildStrides(); // Recursive implementation of nested loops for "linearFill" void linearFillLoop(unsigned level, double s0, unsigned long idx, double shift, const double* coeffs); // Recursive implementation of nested loops for "functorFill" template void functorFillLoop(unsigned level, unsigned long idx, Functor f, unsigned* farg); // Recursive implementation of nested loops for "interpolate3" Numeric interpolateLoop(unsigned level, const double *x, const Numeric* base) const; // Recursive implementation of nested loops for the outer product template void outerProductLoop(unsigned level, unsigned long idx0, unsigned long idx1, unsigned long idx2, const ArrayND& a1, const ArrayND& a2); // Recursive implementation of nested loops for contraction void contractLoop(unsigned thisLevel, unsigned resLevel, unsigned pos1, unsigned pos2, unsigned long idxThis, unsigned long idxRes, ArrayND& result) const; // Recursive implementation of nested loops for transposition void transposeLoop(unsigned level, unsigned pos1, unsigned pos2, unsigned long idxThis, unsigned long idxRes, ArrayND& result) const; // Recursive implementation of nested loops for the dot product template void dotProductLoop(unsigned level, unsigned long idx0, unsigned long idx1, unsigned long idx2, const ArrayND& r, ArrayND& result) const; // Recursive implementation of nested loops for marginalization template Numeric marginalizeInnerLoop(unsigned long idx, unsigned levelPr, unsigned long idxPr, const ArrayND& prior, const unsigned* indexMap) const; template void marginalizeLoop(unsigned level, unsigned long idx, unsigned levelRes, unsigned long idxRes, const ArrayND& prior, const unsigned* indexMap, ArrayND& res) const; // Recursive implementation of nested loops for range copy // with functor modification of elements template void copyRangeLoopFunct(unsigned level, unsigned long idx0, unsigned long idx1, const ArrayND& r, const ArrayRange& range, Functor f); // Loop over subrange in such a way that the functor is called // only if indices on both sides are valid. The topology of both // arrays is that of the hyperplane (flat). template void commonSubrangeLoop(unsigned level, unsigned long idx0, unsigned long idx1, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, ArrayND& other, Functor binaryFunct); // Similar loop with the topology of the hypertorus for both // arrays (all indices of both arrays are wrapped around) template void dualCircularLoop(unsigned level, unsigned long idx0, unsigned long idx1, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, ArrayND& other, Functor binaryFunct); // Similar loop in which the topology of this array is assumed // to be flat and the topology of the destination array is that // of the hypertorus. Due to the asymmetry of the topologies, // "const" function is not provided (use const_cast as appropriate). template void flatCircularLoop(unsigned level, unsigned long idx0, unsigned long idx1, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, ArrayND& other, Functor binaryFunct); // Similar loop in which the topology of this array is assumed // to be hypertoroidal and the topology of the destination array // is flat. template void circularFlatLoop(unsigned level, unsigned long idx0, unsigned long idx1, const unsigned* thisCorner, const unsigned* range, const unsigned* otherCorner, ArrayND& other, Functor binaryFunct); // Slice compatibility verification template unsigned long verifySliceCompatibility( const ArrayND& slice, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedIndices) const; // Buffer compatibility verification with a slice unsigned long verifyBufferSliceCompatibility( unsigned long bufLen, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedIndices, unsigned long* sliceStrides) const; // Recursive implementation of nested loops for slice operations template void jointSliceLoop(unsigned level, unsigned long idx0, unsigned level1, unsigned long idx1, Num2* sliceData, const unsigned long* sliceStrides, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedIndices, Functor binaryFunctor); // Recursive implementation of nested loops for "applySlice" template void scaleBySliceInnerLoop(unsigned level, unsigned long idx0, Num2& scale, const unsigned* projectedIndices, unsigned nProjectedIndices, Functor binaryFunct); template void scaleBySliceLoop(unsigned level, unsigned long idx0, unsigned level1, unsigned long idx1, ArrayND& slice, const unsigned *fixedIndices, unsigned nFixedIndices, Functor binaryFunct); // Recursive implementation of nested loops for projections template void projectInnerLoop(unsigned level, unsigned long idx0, unsigned* currentIndex, AbsArrayProjector& projector, const unsigned* projectedIndices, unsigned nProjectedIndices) const; template void projectLoop(unsigned level, unsigned long idx0, unsigned level1, unsigned long idx1, unsigned* currentIndex, ArrayND* projection, AbsArrayProjector& projector, const unsigned* projectedIndices, unsigned nProjectedIndices, Op fcn) const; // Note that "projectLoop2" is almost identical to "projectLoop" // while "projectInnerLoop2" is almost identical to "projectInnerLoop". // It would make a lot of sense to combine these functions into // the same code and then partially specialize the little piece // where the "AbsVisitor" or "AbsArrayProjector" is actually called. // Unfortunately, "AbsVisitor" and "AbsArrayProjector" are // templates themselves, and it is not possible in C++ to partially // specialize a function template (that is, even if we can specialize // on "AbsVisitor" vs. "AbsArrayProjector", there is no way to // specialize on their parameter types). template void projectLoop2(unsigned level, unsigned long idx0, unsigned level1, unsigned long idx1, ArrayND* projection, AbsVisitor& projector, const unsigned* projectedIndices, unsigned nProjectedIndices, Op fcn) const; template void projectInnerLoop2(unsigned level, unsigned long idx0, AbsVisitor& projector, const unsigned* projectedIndices, unsigned nProjectedIndices) const; template void processSubrangeLoop(unsigned level, unsigned long idx0, unsigned* currentIndex, AbsArrayProjector& f, const BoxND& subrange) const; // Sum of all points with the given index and below template Accumulator sumBelowLoop(unsigned level, unsigned long idx0, const unsigned* limit) const; // Loop for "convertToLastDimCdf" template void convertToLastDimCdfLoop(ArrayND* sumSlice, unsigned level, unsigned long idx0, unsigned long idxSlice, bool useTrapezoids); // Convert a coordinate into index. // No checking whether "idim" is within limits. unsigned coordToIndex(double coord, unsigned idim) const; // Verify that projection array is compatible with this one template void verifyProjectionCompatibility( const ArrayND& projection, const unsigned *projectedIndices, unsigned nProjectedIndices) const; template void coarseSum2(unsigned idim, ArrayND* result) const; template void coarseSum3(unsigned idim, ArrayND* result) const; template void coarseSumN(unsigned idim, unsigned n, ArrayND* result) const; #ifdef CPP11_STD_AVAILABLE template friend ArrayND externalMemArrayND(Num2* data, const unsigned* shape, unsigned dim); template friend ArrayND externalMemArrayND(Num2* data, const ArrayShape& shape); template friend ArrayND externalMemArrayND(Num2* data, unsigned n0); template friend ArrayND externalMemArrayND(Num2* data, unsigned n0, unsigned n1); template friend ArrayND externalMemArrayND(Num2* data, unsigned n0, unsigned n1, unsigned n2); template friend ArrayND externalMemArrayND(Num2* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3); template friend ArrayND externalMemArrayND(Num2* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4); template friend ArrayND externalMemArrayND(Num2* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5); template friend ArrayND externalMemArrayND(Num2* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6); template friend ArrayND externalMemArrayND(Num2* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7); template friend ArrayND externalMemArrayND(Num2* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7, unsigned n8); template friend ArrayND externalMemArrayND(Num2* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7, unsigned n8, unsigned n9); template friend CPP11_auto_ptr > allocExternalMemArrayND( Num2* data, const unsigned* shape, unsigned dim); template friend CPP11_auto_ptr > allocExternalMemArrayND( Num2* data, const ArrayShape& shape); #endif // CPP11_STD_AVAILABLE + template + npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> + friend + ::operator+(const npstat::ArrayND& l, + const npstat::ArrayND& r); + + template + npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> + friend + ::operator-(const npstat::ArrayND& l, + const npstat::ArrayND& r); + + template + npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> + friend + ::operator*(const npstat::ArrayND& l, + const npstat::ArrayND& r); + + template + npstat::ArrayND::type, + npstat::BiggerUInt::value, + npstat::BiggerUInt::value> + friend + ::operator/(const npstat::ArrayND& l, + const npstat::ArrayND& r); + #ifdef SWIG // Additional ArrayND methods necessary to construct a reasonable // python interface. SWIG has a major problem we have to address // here: it converts all access by reference into access by pointer. // However, in python we can't use pointers explicitly. Of course, // additional methods like "dereference" or "assign" can be written // for pointers, but the interface becomes ugly. Therefore, methods // below access array elements by value. Another problem we have to // consider is that SWIG support for wrapping template methods in // template classes is weak. // // Note that various "get" methods introduced below are renamed by // SWIG so that in python they end up named just like the original // C++ methods which return references. The "set" methods are // unchanged. // // Do not use these methods in pure C++ programs. // public: inline void setValue(const unsigned *indexS, unsigned indexLenS, Numeric v) {valueAt(indexS, indexLenS) = v;} inline Numeric getValue(const unsigned *indexS, unsigned indexLenS) const {return valueAt(indexS, indexLenS);} inline void setLinearValue(unsigned long index, Numeric v) {linearValueAt(index) = v;} inline Numeric getLinearValue(unsigned long index) const {return linearValueAt(index);} inline void setClosest(const double *x, unsigned xDim, Numeric v) {closest(x, xDim) = v;} const Numeric getClosest(const double *x, unsigned xDim) const {return closest(x, xDim);} inline void set(Numeric v) {at() = v;} inline Numeric get() const {return at();} inline void set(unsigned i0, Numeric v) {at(i0) = v;} inline Numeric get(unsigned i0) const {return at(i0);} inline void set(unsigned i0, unsigned i1, Numeric v) {at(i0,i1) = v;} inline Numeric get(unsigned i0, unsigned i1) const {return at(i0,i1);} inline void set(unsigned i0, unsigned i1, unsigned i2, Numeric v) {at(i0,i1,i2) = v;} inline Numeric get(unsigned i0, unsigned i1, unsigned i2) const {return at(i0,i1,i2);} inline void set(unsigned i0, unsigned i1, unsigned i2, unsigned i3, Numeric v) {at(i0,i1,i2,i3) = v;} inline Numeric get(unsigned i0, unsigned i1, unsigned i2, unsigned i3) const {return at(i0,i1,i2,i3);} inline void set(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, Numeric v) {at(i0,i1,i2,i3,i4) = v;} inline Numeric get(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4) const {return at(i0,i1,i2,i3,i4);} inline void set(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, Numeric v) {at(i0,i1,i2,i3,i4,i5) = v;} inline Numeric get(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5) const {return at(i0,i1,i2,i3,i4,i5);} inline void set(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, Numeric v) {at(i0,i1,i2,i3,i4,i5,i6) = v;} inline Numeric get(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6) const {return at(i0,i1,i2,i3,i4,i5,i6);} inline void set(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, Numeric v) {at(i0,i1,i2,i3,i4,i5,i6,i7) = v;} inline Numeric get(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7) const {return at(i0,i1,i2,i3,i4,i5,i6,i7);} inline void set(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, Numeric v) {at(i0,i1,i2,i3,i4,i5,i6,i7,i8) = v;} inline Numeric get(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8) const {return at(i0,i1,i2,i3,i4,i5,i6,i7,i8);} inline void set(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, unsigned i9, Numeric v) {at(i0,i1,i2,i3,i4,i5,i6,i7,i8,i9) = v;} inline Numeric get(unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, unsigned i9) const {return at(i0,i1,i2,i3,i4,i5,i6,i7,i8,i9);} inline void setCl(Numeric v) {cl() = v;} inline Numeric getCl() const {return cl();} inline void setCl(double x0, Numeric v) {cl(x0) = v;} inline Numeric getCl(double x0) const {return cl(x0);} inline void setCl(double x0, double x1, Numeric v) {cl(x0, x1) = v;} inline Numeric getCl(double x0, double x1) const {return cl(x0, x1);} inline void setCl(double x0, double x1, double x2, Numeric v) {cl(x0, x1, x2) = v;} inline Numeric getCl(double x0, double x1, double x2) const {return cl(x0, x1, x2);} inline void setCl(double x0, double x1, double x2, double x3, Numeric v) {cl(x0, x1, x2, x3) = v;} inline Numeric getCl(double x0, double x1, double x2, double x3) const {return cl(x0, x1, x2, x3);} inline void setCl(double x0, double x1, double x2, double x3, double x4, Numeric v) {cl(x0, x1, x2, x3, x4) = v;} inline Numeric getCl(double x0, double x1, double x2, double x3, double x4) const {return cl(x0, x1, x2, x3, x4);} inline void setCl(double x0, double x1, double x2, double x3, double x4, double x5, Numeric v) {cl(x0, x1, x2, x3, x4, x5) = v;} inline Numeric getCl(double x0, double x1, double x2, double x3, double x4, double x5) const {return cl(x0, x1, x2, x3, x4, x5);} inline void setCl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, Numeric v) {cl(x0, x1, x2, x3, x4, x5, x6) = v;} inline Numeric getCl(double x0, double x1, double x2, double x3, double x4, double x5, double x6) const {return cl(x0, x1, x2, x3, x4, x5, x6);} inline void setCl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, Numeric v) {cl(x0, x1, x2, x3, x4, x5, x6, x7) = v;} inline Numeric getCl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7) const {return cl(x0, x1, x2, x3, x4, x5, x6, x7);} inline void setCl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, Numeric v) {cl(x0, x1, x2, x3, x4, x5, x6, x7, x8) = v;} inline Numeric getCl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8) const {return cl(x0, x1, x2, x3, x4, x5, x6, x7, x8);} inline void setCl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9, Numeric v) {cl(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = v;} inline Numeric getCl(double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9) const {return cl(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9);} inline void setData2(const Numeric* data, unsigned long dataLength) {setData(data, dataLength);} inline double maxAbsDifference2(const ArrayND& r) const {return maxAbsDifference(r);} inline bool isEqual2(const ArrayND& r) const {return *this == r;} inline bool notEqual2(const ArrayND& r) const {return !(*this == r);} inline ArrayND plus2(const ArrayND& r) const {return *this + r;} inline ArrayND minus2(const ArrayND& r) const {return *this - r;} inline ArrayND mul2(const double r) const {return *this * static_cast(r);} inline ArrayND div2(const double r) const {return *this / static_cast(r);} inline ArrayND& imul2(const double r) {*this *= static_cast(r); return *this;} inline ArrayND& idiv2(const double r) {*this /= static_cast(r); return *this;} inline ArrayND& iadd2(const ArrayND& r) {*this += r; return *this;} inline ArrayND& isub2(const ArrayND& r) {*this -= r; return *this;} inline ArrayND& addmul2(const ArrayND& r, const double c) {return addmul(r, static_cast(c));} inline ArrayND& inPlaceMul2(const ArrayND& r) {return inPlaceMul(r);} inline ArrayND outer2(const ArrayND& r) const {return outer(r);} inline ArrayND dot2(const ArrayND& r) const {return dot(r);} inline ArrayND marginalize2(const ArrayND& r, const unsigned* indexMap, const unsigned mapLen) const {return marginalize(r, indexMap, mapLen);} inline Numeric sum2() const {return static_cast((*this).template sum< typename PreciseType::type>());} inline double sumsq2() const {return (*this).template sumsq();} inline ArrayND derivative2(double scale=1.0) const {return (*this).template derivative< typename PreciseType::type>(scale);} inline ArrayND cdfArray2(double scale=1.0) const {return (*this).template cdfArray< typename PreciseType::type>(scale);} inline Numeric cdfValue2(const unsigned *index, unsigned indexLen) const {return static_cast((*this).template cdfValue< typename PreciseType::type>(index, indexLen));} inline void convertToLastDimCdf2(ArrayND* sumSlice, bool b) {(*this).template convertToLastDimCdf< typename PreciseType::type>(sumSlice, b);} inline bool isClose2(const ArrayND& r, double eps) const {return isClose(r, eps);} inline bool isShapeCompatible2(const ArrayND& r) const {return isShapeCompatible(r);} inline void exportSlice2(ArrayND* slice, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedInd) const {exportSlice(slice, fixedIndices, fixedIndexValues, nFixedInd);} inline void exportMemSlice2(Numeric* slice, unsigned long len, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedInd) const {exportMemSlice(slice, len, fixedIndices, fixedIndexValues, nFixedInd);} inline void importSlice2(const ArrayND& slice, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedInd) {importSlice(slice, fixedIndices, fixedIndexValues, nFixedInd);} inline void importMemSlice2(const Numeric* slice, unsigned long len, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedInd) {importMemSlice(slice, len, fixedIndices, fixedIndexValues, nFixedInd);} inline ArrayND& multiplyBySlice2(const ArrayND& slice, const unsigned *fixedIndices, unsigned nFixedIndices) {return multiplyBySlice(slice, fixedIndices, nFixedIndices);} inline ArrayND subrange(const ArrayRange& range) {return ArrayND(*this, range);} inline ArrayND slice(const unsigned *index, unsigned indexLen) {return ArrayND(*this, index, indexLen);} inline void rotate2(const unsigned* shifts, unsigned lenShifts, ArrayND* rotated) const {rotate(shifts, lenShifts, rotated);} inline void mirror2(const unsigned* mirrorDims, unsigned mirrorLen, ArrayND* mirrored) const {mirror(mirrorDims, mirrorLen, mirrored);} inline void exportSubrange2(const unsigned* corner, unsigned lenCorner, ArrayND* to) const {exportSubrange(corner, lenCorner, to);} inline void importSubrange2(const unsigned* corner, unsigned lenCorner, const ArrayND& from) {importSubrange(corner, lenCorner, from);} inline void multiMirror2(ArrayND* out) const {multiMirror(out);} #endif // SWIG }; #ifdef CPP11_STD_AVAILABLE //@{ /** // This function allows you to manage external data memory // using ArrayND objects. It can be used, for example, to create // arrays which live completely on the stack and still manage // sizeable chunks of already allocated memory. It is up to the // user of this function to ensure that the size of the memory // buffer is consistent with the shape of the array. // // Note that the responsibility to manage external data passes // to another ArrayND through a move constructor or through // a move assignment operator but not through a normal copy // constructor or assignment operator. Because of this feature, // this function works only with compilers supporting C++11. */ template ArrayND externalMemArrayND(Numeric* data, const unsigned* shape, unsigned dim); template ArrayND externalMemArrayND(Numeric* data, const ArrayShape& shape); template ArrayND externalMemArrayND(Numeric* data, unsigned n0); template ArrayND externalMemArrayND(Numeric* data, unsigned n0, unsigned n1); template ArrayND externalMemArrayND(Numeric* data, unsigned n0, unsigned n1, unsigned n2); template ArrayND externalMemArrayND(Numeric* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3); template ArrayND externalMemArrayND(Numeric* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4); template ArrayND externalMemArrayND(Numeric* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5); template ArrayND externalMemArrayND(Numeric* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6); template ArrayND externalMemArrayND(Numeric* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7); template ArrayND externalMemArrayND(Numeric* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7, unsigned n8); template ArrayND externalMemArrayND(Numeric* data, unsigned n0, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7, unsigned n8, unsigned n9); template CPP11_auto_ptr > allocExternalMemArrayND( Numeric* data, const unsigned* shape, unsigned dim); template CPP11_auto_ptr > allocExternalMemArrayND( Numeric* data, const ArrayShape& shape); //@} #endif // CPP11_STD_AVAILABLE // These functions are external because they are not // necessarily meaningful for all array element types /** Minimum array element */ template typename Arr::value_type arrayMin(const Arr& arr); /** Index of the minimum array element */ template ArrayShape arrayArgmin(const Arr& arr); /** Maximum array element */ template typename Arr::value_type arrayMax(const Arr& arr); /** Index of the maximum array element */ template ArrayShape arrayArgmax(const Arr& arr); /** Minimum and maximum array element */ template std::pair arrayMinMax(const Arr& arr); /** Check if all array elements are non-negative */ template bool arrayIsNonNegative(const Arr& arr); /** // Check whether all array elements are non-negative and, // in addition, there is at least one positive element */ template bool arrayIsDensity(const Arr& arr); } template -npstat::ArrayND +inline npstat::ArrayND operator*(const Num2& l, const npstat::ArrayND& r) { return r*l; } #include "npstat/nm/ArrayND.icc" #endif // NPSTAT_ARRAYND_HH_ Index: trunk/npstat/nm/Makefile.am =================================================================== --- trunk/npstat/nm/Makefile.am (revision 643) +++ trunk/npstat/nm/Makefile.am (revision 644) @@ -1,128 +1,129 @@ AM_CPPFLAGS = -I@top_srcdir@/ $(DEPS_CFLAGS) noinst_LTLIBRARIES = libnm.la libnm_la_SOURCES = ArrayShape.cc ArrayRange.cc SpecialFunctions.cc \ ConvolutionEngine1D.cc EquidistantSequence.cc GaussHermiteQuadrature.cc \ GaussLegendreQuadrature.cc MathUtils.cc OrthoPoly1D.cc GridAxis.cc \ rectangleQuadrature.cc LinInterpolatedTable1D.cc findPeak2D.cc \ bilinearSection.cc ConvolutionEngineND.cc FourierImage.cc SvdMethod.cc \ binomialCoefficient.cc UniformAxis.cc ArrayNDScanner.cc DualAxis.cc \ DiscreteBernsteinPoly1D.cc definiteIntegrals.cc EigenMethod.cc \ goldenSectionSearch.cc timestamp.cc OrthoPolyMethod.cc ContOrthoPoly1D.cc \ lapack_interface.cc AbsClassicalOrthoPoly1D.cc ClassicalOrthoPolys1D.cc \ matrixIndexPairs.cc truncatedInverseSqrt.cc FejerQuadrature.cc \ StorablePolySeries1D.cc SemiInfGaussianQuadrature.cc includedir = ${prefix}/include/npstat/nm include_HEADERS = AbsArrayProjector.hh \ AbsClassicalOrthoPoly1D.hh \ AbsClassicalOrthoPoly1D.icc \ absDifference.hh \ AbsMultivariateFunctor.hh \ AbsVisitor.hh \ allocators.hh \ areAllElementsUnique.hh \ ArrayND.hh \ ArrayND.icc \ ArrayNDScanner.hh \ ArrayRange.hh \ ArrayShape.hh \ bilinearSection.hh \ binomialCoefficient.hh \ BoxND.hh \ BoxND.icc \ BoxNDScanner.hh \ BoxNDScanner.icc \ CircularMapper1d.hh \ ClassicalOrthoPolys1D.hh \ closeWithinTolerance.hh \ CompareByIndex.hh \ ComplexComparesAbs.hh \ ComplexComparesFalse.hh \ ConstSubscriptMap.hh \ ContOrthoPoly1D.hh \ ContOrthoPoly1D.icc \ ConvolutionEngine1D.hh \ ConvolutionEngine1D.icc \ ConvolutionEngineND.hh \ ConvolutionEngineND.icc \ CoordinateSelector.hh \ definiteIntegrals.hh \ DiscreteBernsteinPoly1D.hh \ discretizedDistance.hh \ discretizedDistance.icc \ DualAxis.hh \ EigenMethod.hh \ EquidistantSequence.hh \ ExpMapper1d.hh \ FejerQuadrature.hh \ FejerQuadrature.icc \ fillArrayCentersPreservingAreas.hh \ findPeak2D.hh \ findRootInLogSpace.hh \ findRootInLogSpace.icc \ findRootNewtonRaphson.hh \ findRootNewtonRaphson.icc \ findRootUsingBisections.hh \ findRootUsingBisections.icc \ FourierImage.hh \ GaussHermiteQuadrature.hh \ GaussHermiteQuadrature.icc \ GaussLegendreQuadrature.hh \ GaussLegendreQuadrature.icc \ GeneralizedComplex.hh \ goldenSectionSearch.hh \ goldenSectionSearch.icc \ GridAxis.hh \ interpolate.hh \ interpolate.icc \ Interval.hh \ Interval.icc \ isMonotonous.hh \ KDTree.hh \ KDTree.icc \ lapack.h \ lapack_interface.hh \ lapack_interface.icc \ lapack_interface_double.icc \ lapack_interface_float.icc \ LinearMapper1d.hh \ LinInterpolatedTable1D.hh \ LinInterpolatedTable1D.icc \ LinInterpolatedTableND.hh \ LinInterpolatedTableND.icc \ LogMapper1d.hh \ + LongerType.hh \ MathUtils.hh \ MathUtils.icc \ Matrix.hh \ matrixIndexPairs.hh \ Matrix.icc \ MinSearchStatus1D.hh \ MultivariateFunctorScanner.hh \ OrthoPoly1D.hh \ OrthoPoly1D.icc \ OrthoPolyMethod.hh \ OrthoPolyND.hh \ OrthoPolyND.icc \ PairCompare.hh \ PointDimensionality.hh \ PreciseType.hh \ ProperDblFromCmpl.hh \ PtrBufferHandle.hh \ rectangleQuadrature.hh \ rescanArray.hh \ rescanArray.icc \ SemiInfGaussianQuadrature.hh \ SemiInfGaussianQuadrature.icc \ SimpleFunctors.hh \ SpecialFunctions.hh \ StorablePolySeries1D.hh \ SvdMethod.hh \ timestamp.hh \ Triple.hh \ truncatedInverseSqrt.hh \ UniformAxis.hh EXTRA_DIST = 00README.txt Index: trunk/npstat/nm/Makefile =================================================================== --- trunk/npstat/nm/Makefile (revision 643) +++ trunk/npstat/nm/Makefile (revision 644) @@ -1,821 +1,822 @@ # Makefile.in generated by automake 1.15.1 from Makefile.am. # npstat/nm/Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/npstat pkgincludedir = $(includedir)/npstat pkglibdir = $(libdir)/npstat pkglibexecdir = $(libexecdir)/npstat am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = x86_64-pc-linux-gnu host_triplet = x86_64-pc-linux-gnu subdir = npstat/nm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libnm_la_LIBADD = am_libnm_la_OBJECTS = ArrayShape.lo ArrayRange.lo SpecialFunctions.lo \ ConvolutionEngine1D.lo EquidistantSequence.lo \ GaussHermiteQuadrature.lo GaussLegendreQuadrature.lo \ MathUtils.lo OrthoPoly1D.lo GridAxis.lo rectangleQuadrature.lo \ LinInterpolatedTable1D.lo findPeak2D.lo bilinearSection.lo \ ConvolutionEngineND.lo FourierImage.lo SvdMethod.lo \ binomialCoefficient.lo UniformAxis.lo ArrayNDScanner.lo \ DualAxis.lo DiscreteBernsteinPoly1D.lo definiteIntegrals.lo \ EigenMethod.lo goldenSectionSearch.lo timestamp.lo \ OrthoPolyMethod.lo ContOrthoPoly1D.lo lapack_interface.lo \ AbsClassicalOrthoPoly1D.lo ClassicalOrthoPolys1D.lo \ matrixIndexPairs.lo truncatedInverseSqrt.lo FejerQuadrature.lo \ StorablePolySeries1D.lo SemiInfGaussianQuadrature.lo libnm_la_OBJECTS = $(am_libnm_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_$(V)) am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_$(V)) am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_$(V)) am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY)) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_$(V)) am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY)) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libnm_la_SOURCES) DIST_SOURCES = $(libnm_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = ${SHELL} /home/igv/Hepforge/npstat/trunk/missing aclocal-1.15 AMTAR = $${TAR-tar} AM_DEFAULT_VERBOSITY = 1 AR = ar AUTOCONF = ${SHELL} /home/igv/Hepforge/npstat/trunk/missing autoconf AUTOHEADER = ${SHELL} /home/igv/Hepforge/npstat/trunk/missing autoheader AUTOMAKE = ${SHELL} /home/igv/Hepforge/npstat/trunk/missing automake-1.15 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = gcc -E CPPFLAGS = CXX = g++ CXXCPP = g++ -E CXXDEPMODE = depmode=gcc3 CXXFLAGS = -std=c++11 -O3 -Wall -W -Werror CYGPATH_W = echo DEFS = -DPACKAGE_NAME=\"npstat\" -DPACKAGE_TARNAME=\"npstat\" -DPACKAGE_VERSION=\"5.0.0\" -DPACKAGE_STRING=\"npstat\ 5.0.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"npstat\" -DVERSION=\"5.0.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" DEPDIR = .deps DEPS_CFLAGS = -I/usr/local/include DEPS_LIBS = -L/usr/local/lib -lfftw3 -lgeners -lkstest DLLTOOL = false DSYMUTIL = DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E EXEEXT = F77 = g77 FFLAGS = -g -O2 FGREP = /bin/grep -F FLIBS = -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lgfortran -lm -lquadmath GREP = /bin/grep INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LD = /usr/bin/ld -m elf_x86_64 LDFLAGS = LIBOBJS = LIBS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LIPO = LN_S = ln -s LTLIBOBJS = LT_SYS_LIBRARY_PATH = MAKEINFO = ${SHELL} /home/igv/Hepforge/npstat/trunk/missing makeinfo MANIFEST_TOOL = : MKDIR_P = /bin/mkdir -p NM = /usr/bin/nm -B NMEDIT = OBJDUMP = objdump OBJEXT = o OTOOL = OTOOL64 = PACKAGE = npstat PACKAGE_BUGREPORT = PACKAGE_NAME = npstat PACKAGE_STRING = npstat 5.0.0 PACKAGE_TARNAME = npstat PACKAGE_URL = PACKAGE_VERSION = 5.0.0 PATH_SEPARATOR = : PKG_CONFIG = /usr/bin/pkg-config PKG_CONFIG_LIBDIR = PKG_CONFIG_PATH = /usr/local/lib/pkgconfig RANLIB = ranlib SED = /bin/sed SET_MAKE = SHELL = /bin/bash STRIP = strip VERSION = 5.0.0 abs_builddir = /home/igv/Hepforge/npstat/trunk/npstat/nm abs_srcdir = /home/igv/Hepforge/npstat/trunk/npstat/nm abs_top_builddir = /home/igv/Hepforge/npstat/trunk abs_top_srcdir = /home/igv/Hepforge/npstat/trunk ac_ct_AR = ar ac_ct_CC = gcc ac_ct_CXX = g++ ac_ct_DUMPBIN = ac_ct_F77 = g77 am__include = include am__leading_dot = . am__quote = am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - bindir = ${exec_prefix}/bin build = x86_64-pc-linux-gnu build_alias = build_cpu = x86_64 build_os = linux-gnu build_vendor = pc builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} host = x86_64-pc-linux-gnu host_alias = host_cpu = x86_64 host_os = linux-gnu host_vendor = pc htmldir = ${docdir} includedir = ${prefix}/include/npstat/nm infodir = ${datarootdir}/info install_sh = ${SHELL} /home/igv/Hepforge/npstat/trunk/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var mandir = ${datarootdir}/man mkdir_p = $(MKDIR_P) oldincludedir = /usr/include pdfdir = ${docdir} prefix = /usr/local program_transform_name = s,x,x, psdir = ${docdir} runstatedir = ${localstatedir}/run sbindir = ${exec_prefix}/sbin sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = top_build_prefix = ../../ top_builddir = ../.. top_srcdir = ../.. AM_CPPFLAGS = -I../../ $(DEPS_CFLAGS) noinst_LTLIBRARIES = libnm.la libnm_la_SOURCES = ArrayShape.cc ArrayRange.cc SpecialFunctions.cc \ ConvolutionEngine1D.cc EquidistantSequence.cc GaussHermiteQuadrature.cc \ GaussLegendreQuadrature.cc MathUtils.cc OrthoPoly1D.cc GridAxis.cc \ rectangleQuadrature.cc LinInterpolatedTable1D.cc findPeak2D.cc \ bilinearSection.cc ConvolutionEngineND.cc FourierImage.cc SvdMethod.cc \ binomialCoefficient.cc UniformAxis.cc ArrayNDScanner.cc DualAxis.cc \ DiscreteBernsteinPoly1D.cc definiteIntegrals.cc EigenMethod.cc \ goldenSectionSearch.cc timestamp.cc OrthoPolyMethod.cc ContOrthoPoly1D.cc \ lapack_interface.cc AbsClassicalOrthoPoly1D.cc ClassicalOrthoPolys1D.cc \ matrixIndexPairs.cc truncatedInverseSqrt.cc FejerQuadrature.cc \ StorablePolySeries1D.cc SemiInfGaussianQuadrature.cc include_HEADERS = AbsArrayProjector.hh \ AbsClassicalOrthoPoly1D.hh \ AbsClassicalOrthoPoly1D.icc \ absDifference.hh \ AbsMultivariateFunctor.hh \ AbsVisitor.hh \ allocators.hh \ areAllElementsUnique.hh \ ArrayND.hh \ ArrayND.icc \ ArrayNDScanner.hh \ ArrayRange.hh \ ArrayShape.hh \ bilinearSection.hh \ binomialCoefficient.hh \ BoxND.hh \ BoxND.icc \ BoxNDScanner.hh \ BoxNDScanner.icc \ CircularMapper1d.hh \ ClassicalOrthoPolys1D.hh \ closeWithinTolerance.hh \ CompareByIndex.hh \ ComplexComparesAbs.hh \ ComplexComparesFalse.hh \ ConstSubscriptMap.hh \ ContOrthoPoly1D.hh \ ContOrthoPoly1D.icc \ ConvolutionEngine1D.hh \ ConvolutionEngine1D.icc \ ConvolutionEngineND.hh \ ConvolutionEngineND.icc \ CoordinateSelector.hh \ definiteIntegrals.hh \ DiscreteBernsteinPoly1D.hh \ discretizedDistance.hh \ discretizedDistance.icc \ DualAxis.hh \ EigenMethod.hh \ EquidistantSequence.hh \ ExpMapper1d.hh \ FejerQuadrature.hh \ FejerQuadrature.icc \ fillArrayCentersPreservingAreas.hh \ findPeak2D.hh \ findRootInLogSpace.hh \ findRootInLogSpace.icc \ findRootNewtonRaphson.hh \ findRootNewtonRaphson.icc \ findRootUsingBisections.hh \ findRootUsingBisections.icc \ FourierImage.hh \ GaussHermiteQuadrature.hh \ GaussHermiteQuadrature.icc \ GaussLegendreQuadrature.hh \ GaussLegendreQuadrature.icc \ GeneralizedComplex.hh \ goldenSectionSearch.hh \ goldenSectionSearch.icc \ GridAxis.hh \ interpolate.hh \ interpolate.icc \ Interval.hh \ Interval.icc \ isMonotonous.hh \ KDTree.hh \ KDTree.icc \ lapack.h \ lapack_interface.hh \ lapack_interface.icc \ lapack_interface_double.icc \ lapack_interface_float.icc \ LinearMapper1d.hh \ LinInterpolatedTable1D.hh \ LinInterpolatedTable1D.icc \ LinInterpolatedTableND.hh \ LinInterpolatedTableND.icc \ LogMapper1d.hh \ + LongerType.hh \ MathUtils.hh \ MathUtils.icc \ Matrix.hh \ matrixIndexPairs.hh \ Matrix.icc \ MinSearchStatus1D.hh \ MultivariateFunctorScanner.hh \ OrthoPoly1D.hh \ OrthoPoly1D.icc \ OrthoPolyMethod.hh \ OrthoPolyND.hh \ OrthoPolyND.icc \ PairCompare.hh \ PointDimensionality.hh \ PreciseType.hh \ ProperDblFromCmpl.hh \ PtrBufferHandle.hh \ rectangleQuadrature.hh \ rescanArray.hh \ rescanArray.icc \ SemiInfGaussianQuadrature.hh \ SemiInfGaussianQuadrature.icc \ SimpleFunctors.hh \ SpecialFunctions.hh \ StorablePolySeries1D.hh \ SvdMethod.hh \ timestamp.hh \ Triple.hh \ truncatedInverseSqrt.hh \ UniformAxis.hh EXTRA_DIST = 00README.txt all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign npstat/nm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign npstat/nm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libnm.la: $(libnm_la_OBJECTS) $(libnm_la_DEPENDENCIES) $(EXTRA_libnm_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libnm_la_OBJECTS) $(libnm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c include ./$(DEPDIR)/AbsClassicalOrthoPoly1D.Plo include ./$(DEPDIR)/ArrayNDScanner.Plo include ./$(DEPDIR)/ArrayRange.Plo include ./$(DEPDIR)/ArrayShape.Plo include ./$(DEPDIR)/ClassicalOrthoPolys1D.Plo include ./$(DEPDIR)/ContOrthoPoly1D.Plo include ./$(DEPDIR)/ConvolutionEngine1D.Plo include ./$(DEPDIR)/ConvolutionEngineND.Plo include ./$(DEPDIR)/DiscreteBernsteinPoly1D.Plo include ./$(DEPDIR)/DualAxis.Plo include ./$(DEPDIR)/EigenMethod.Plo include ./$(DEPDIR)/EquidistantSequence.Plo include ./$(DEPDIR)/FejerQuadrature.Plo include ./$(DEPDIR)/FourierImage.Plo include ./$(DEPDIR)/GaussHermiteQuadrature.Plo include ./$(DEPDIR)/GaussLegendreQuadrature.Plo include ./$(DEPDIR)/GridAxis.Plo include ./$(DEPDIR)/LinInterpolatedTable1D.Plo include ./$(DEPDIR)/MathUtils.Plo include ./$(DEPDIR)/OrthoPoly1D.Plo include ./$(DEPDIR)/OrthoPolyMethod.Plo include ./$(DEPDIR)/SemiInfGaussianQuadrature.Plo include ./$(DEPDIR)/SpecialFunctions.Plo include ./$(DEPDIR)/StorablePolySeries1D.Plo include ./$(DEPDIR)/SvdMethod.Plo include ./$(DEPDIR)/UniformAxis.Plo include ./$(DEPDIR)/bilinearSection.Plo include ./$(DEPDIR)/binomialCoefficient.Plo include ./$(DEPDIR)/definiteIntegrals.Plo include ./$(DEPDIR)/findPeak2D.Plo include ./$(DEPDIR)/goldenSectionSearch.Plo include ./$(DEPDIR)/lapack_interface.Plo include ./$(DEPDIR)/matrixIndexPairs.Plo include ./$(DEPDIR)/rectangleQuadrature.Plo include ./$(DEPDIR)/timestamp.Plo include ./$(DEPDIR)/truncatedInverseSqrt.Plo .cc.o: $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # $(AM_V_CXX)source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(AM_V_CXX_no)$(CXXCOMPILE) -c -o $@ $< .cc.obj: $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # $(AM_V_CXX)source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(AM_V_CXX_no)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo # $(AM_V_CXX)source='$<' object='$@' libtool=yes \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(AM_V_CXX_no)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-includeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Index: trunk/npstat/nm/Makefile.in =================================================================== --- trunk/npstat/nm/Makefile.in (revision 643) +++ trunk/npstat/nm/Makefile.in (revision 644) @@ -1,821 +1,822 @@ # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = npstat/nm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libnm_la_LIBADD = am_libnm_la_OBJECTS = ArrayShape.lo ArrayRange.lo SpecialFunctions.lo \ ConvolutionEngine1D.lo EquidistantSequence.lo \ GaussHermiteQuadrature.lo GaussLegendreQuadrature.lo \ MathUtils.lo OrthoPoly1D.lo GridAxis.lo rectangleQuadrature.lo \ LinInterpolatedTable1D.lo findPeak2D.lo bilinearSection.lo \ ConvolutionEngineND.lo FourierImage.lo SvdMethod.lo \ binomialCoefficient.lo UniformAxis.lo ArrayNDScanner.lo \ DualAxis.lo DiscreteBernsteinPoly1D.lo definiteIntegrals.lo \ EigenMethod.lo goldenSectionSearch.lo timestamp.lo \ OrthoPolyMethod.lo ContOrthoPoly1D.lo lapack_interface.lo \ AbsClassicalOrthoPoly1D.lo ClassicalOrthoPolys1D.lo \ matrixIndexPairs.lo truncatedInverseSqrt.lo FejerQuadrature.lo \ StorablePolySeries1D.lo SemiInfGaussianQuadrature.lo libnm_la_OBJECTS = $(am_libnm_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libnm_la_SOURCES) DIST_SOURCES = $(libnm_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FLIBS = @FLIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = ${prefix}/include/npstat/nm infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I@top_srcdir@/ $(DEPS_CFLAGS) noinst_LTLIBRARIES = libnm.la libnm_la_SOURCES = ArrayShape.cc ArrayRange.cc SpecialFunctions.cc \ ConvolutionEngine1D.cc EquidistantSequence.cc GaussHermiteQuadrature.cc \ GaussLegendreQuadrature.cc MathUtils.cc OrthoPoly1D.cc GridAxis.cc \ rectangleQuadrature.cc LinInterpolatedTable1D.cc findPeak2D.cc \ bilinearSection.cc ConvolutionEngineND.cc FourierImage.cc SvdMethod.cc \ binomialCoefficient.cc UniformAxis.cc ArrayNDScanner.cc DualAxis.cc \ DiscreteBernsteinPoly1D.cc definiteIntegrals.cc EigenMethod.cc \ goldenSectionSearch.cc timestamp.cc OrthoPolyMethod.cc ContOrthoPoly1D.cc \ lapack_interface.cc AbsClassicalOrthoPoly1D.cc ClassicalOrthoPolys1D.cc \ matrixIndexPairs.cc truncatedInverseSqrt.cc FejerQuadrature.cc \ StorablePolySeries1D.cc SemiInfGaussianQuadrature.cc include_HEADERS = AbsArrayProjector.hh \ AbsClassicalOrthoPoly1D.hh \ AbsClassicalOrthoPoly1D.icc \ absDifference.hh \ AbsMultivariateFunctor.hh \ AbsVisitor.hh \ allocators.hh \ areAllElementsUnique.hh \ ArrayND.hh \ ArrayND.icc \ ArrayNDScanner.hh \ ArrayRange.hh \ ArrayShape.hh \ bilinearSection.hh \ binomialCoefficient.hh \ BoxND.hh \ BoxND.icc \ BoxNDScanner.hh \ BoxNDScanner.icc \ CircularMapper1d.hh \ ClassicalOrthoPolys1D.hh \ closeWithinTolerance.hh \ CompareByIndex.hh \ ComplexComparesAbs.hh \ ComplexComparesFalse.hh \ ConstSubscriptMap.hh \ ContOrthoPoly1D.hh \ ContOrthoPoly1D.icc \ ConvolutionEngine1D.hh \ ConvolutionEngine1D.icc \ ConvolutionEngineND.hh \ ConvolutionEngineND.icc \ CoordinateSelector.hh \ definiteIntegrals.hh \ DiscreteBernsteinPoly1D.hh \ discretizedDistance.hh \ discretizedDistance.icc \ DualAxis.hh \ EigenMethod.hh \ EquidistantSequence.hh \ ExpMapper1d.hh \ FejerQuadrature.hh \ FejerQuadrature.icc \ fillArrayCentersPreservingAreas.hh \ findPeak2D.hh \ findRootInLogSpace.hh \ findRootInLogSpace.icc \ findRootNewtonRaphson.hh \ findRootNewtonRaphson.icc \ findRootUsingBisections.hh \ findRootUsingBisections.icc \ FourierImage.hh \ GaussHermiteQuadrature.hh \ GaussHermiteQuadrature.icc \ GaussLegendreQuadrature.hh \ GaussLegendreQuadrature.icc \ GeneralizedComplex.hh \ goldenSectionSearch.hh \ goldenSectionSearch.icc \ GridAxis.hh \ interpolate.hh \ interpolate.icc \ Interval.hh \ Interval.icc \ isMonotonous.hh \ KDTree.hh \ KDTree.icc \ lapack.h \ lapack_interface.hh \ lapack_interface.icc \ lapack_interface_double.icc \ lapack_interface_float.icc \ LinearMapper1d.hh \ LinInterpolatedTable1D.hh \ LinInterpolatedTable1D.icc \ LinInterpolatedTableND.hh \ LinInterpolatedTableND.icc \ LogMapper1d.hh \ + LongerType.hh \ MathUtils.hh \ MathUtils.icc \ Matrix.hh \ matrixIndexPairs.hh \ Matrix.icc \ MinSearchStatus1D.hh \ MultivariateFunctorScanner.hh \ OrthoPoly1D.hh \ OrthoPoly1D.icc \ OrthoPolyMethod.hh \ OrthoPolyND.hh \ OrthoPolyND.icc \ PairCompare.hh \ PointDimensionality.hh \ PreciseType.hh \ ProperDblFromCmpl.hh \ PtrBufferHandle.hh \ rectangleQuadrature.hh \ rescanArray.hh \ rescanArray.icc \ SemiInfGaussianQuadrature.hh \ SemiInfGaussianQuadrature.icc \ SimpleFunctors.hh \ SpecialFunctions.hh \ StorablePolySeries1D.hh \ SvdMethod.hh \ timestamp.hh \ Triple.hh \ truncatedInverseSqrt.hh \ UniformAxis.hh EXTRA_DIST = 00README.txt all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign npstat/nm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign npstat/nm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libnm.la: $(libnm_la_OBJECTS) $(libnm_la_DEPENDENCIES) $(EXTRA_libnm_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libnm_la_OBJECTS) $(libnm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AbsClassicalOrthoPoly1D.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArrayNDScanner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArrayRange.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArrayShape.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ClassicalOrthoPolys1D.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ContOrthoPoly1D.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConvolutionEngine1D.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConvolutionEngineND.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DiscreteBernsteinPoly1D.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DualAxis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EigenMethod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EquidistantSequence.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FejerQuadrature.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FourierImage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GaussHermiteQuadrature.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GaussLegendreQuadrature.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GridAxis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LinInterpolatedTable1D.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MathUtils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OrthoPoly1D.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OrthoPolyMethod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SemiInfGaussianQuadrature.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SpecialFunctions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StorablePolySeries1D.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SvdMethod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UniformAxis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bilinearSection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binomialCoefficient.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/definiteIntegrals.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findPeak2D.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goldenSectionSearch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lapack_interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrixIndexPairs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rectangleQuadrature.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timestamp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncatedInverseSqrt.Plo@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-includeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Index: trunk/npstat/nm/LongerType.hh =================================================================== --- trunk/npstat/nm/LongerType.hh (revision 0) +++ trunk/npstat/nm/LongerType.hh (revision 644) @@ -0,0 +1,37 @@ +#ifndef NPSTAT_LONGERTYPE_HH_ +#define NPSTAT_LONGERTYPE_HH_ + +/*! +// \file LongerType.hh +// +// \brief Compile-time deduction of an appropriate numeric type for +// simple algebraic operations +// +// Author: I. Volobouev +// +// September 2019 +*/ + +#include + +namespace npstat { + template + struct LongerType + { + typedef typename std::common_type::type type; + }; + + template + struct LongerType + { + typedef T1 type; + }; + + template + struct BiggerUInt + { + enum {value = I1 > I2 ? I1 : I2}; + }; +} + +#endif // NPSTAT_LONGERTYPE_HH_ Index: trunk/config.log =================================================================== --- trunk/config.log (revision 643) +++ trunk/config.log (revision 644) @@ -1,942 +1,942 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by npstat configure 5.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ ./configure --with-pic ## --------- ## ## Platform. ## ## --------- ## hostname = dawn uname -m = x86_64 uname -r = 4.15.0-64-generic uname -s = Linux uname -v = #73-Ubuntu SMP Thu Sep 12 13:16:13 UTC 2019 /usr/bin/uname -p = unknown /bin/uname -X = unknown /bin/arch = unknown /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /home/igv/bin PATH: /home/igv/local/bin PATH: /usr/local/anaconda3/bin PATH: /usr/local/bin PATH: /usr/local/root/bin PATH: /usr/local/bin PATH: /bin PATH: /usr/bin PATH: /sbin PATH: /usr/sbin PATH: . ## ----------- ## ## Core tests. ## ## ----------- ## configure:2421: checking for a BSD-compatible install configure:2489: result: /usr/bin/install -c configure:2500: checking whether build environment is sane configure:2555: result: yes configure:2706: checking for a thread-safe mkdir -p configure:2745: result: /bin/mkdir -p configure:2752: checking for gawk configure:2768: found /usr/bin/gawk configure:2779: result: gawk configure:2790: checking whether make sets $(MAKE) configure:2812: result: yes configure:2841: checking whether make supports nested variables configure:2858: result: yes configure:3041: checking for pkg-config configure:3059: found /usr/bin/pkg-config configure:3071: result: /usr/bin/pkg-config configure:3096: checking pkg-config is at least version 0.9.0 configure:3099: result: yes configure:3109: checking for DEPS configure:3116: $PKG_CONFIG --exists --print-errors "fftw3 >= 3.1.2 geners >= 1.3.0 kstest >= 2.0.0" configure:3119: $? = 0 configure:3133: $PKG_CONFIG --exists --print-errors "fftw3 >= 3.1.2 geners >= 1.3.0 kstest >= 2.0.0" configure:3136: $? = 0 configure:3194: result: yes configure:3257: checking for g++ configure:3273: found /usr/bin/g++ configure:3284: result: g++ configure:3311: checking for C++ compiler version configure:3320: g++ --version >&5 g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:3331: $? = 0 configure:3320: g++ -v >&5 Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) configure:3331: $? = 0 configure:3320: g++ -V >&5 g++: error: unrecognized command line option '-V' g++: fatal error: no input files compilation terminated. configure:3331: $? = 1 configure:3320: g++ -qversion >&5 g++: error: unrecognized command line option '-qversion'; did you mean '--version'? g++: fatal error: no input files compilation terminated. configure:3331: $? = 1 configure:3351: checking whether the C++ compiler works configure:3373: g++ -std=c++11 -O3 -Wall -W -Werror conftest.cpp >&5 configure:3377: $? = 0 configure:3425: result: yes configure:3428: checking for C++ compiler default output file name configure:3430: result: a.out configure:3436: checking for suffix of executables configure:3443: g++ -o conftest -std=c++11 -O3 -Wall -W -Werror conftest.cpp >&5 configure:3447: $? = 0 configure:3469: result: configure:3491: checking whether we are cross compiling configure:3499: g++ -o conftest -std=c++11 -O3 -Wall -W -Werror conftest.cpp >&5 configure:3503: $? = 0 configure:3510: ./conftest configure:3514: $? = 0 configure:3529: result: no configure:3534: checking for suffix of object files configure:3556: g++ -c -std=c++11 -O3 -Wall -W -Werror conftest.cpp >&5 configure:3560: $? = 0 configure:3581: result: o configure:3585: checking whether we are using the GNU C++ compiler configure:3604: g++ -c -std=c++11 -O3 -Wall -W -Werror conftest.cpp >&5 configure:3604: $? = 0 configure:3613: result: yes configure:3622: checking whether g++ accepts -g configure:3642: g++ -c -g conftest.cpp >&5 configure:3642: $? = 0 configure:3683: result: yes configure:3717: checking for style of include used by make configure:3745: result: GNU configure:3771: checking dependency style of g++ configure:3882: result: gcc3 configure:3951: checking for g77 configure:3967: found /home/igv/bin/g77 configure:3978: result: g77 configure:4004: checking for Fortran 77 compiler version configure:4013: g77 --version >&5 GNU Fortran (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:4024: $? = 0 configure:4013: g77 -v >&5 Using built-in specs. COLLECT_GCC=g77 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) configure:4024: $? = 0 configure:4013: g77 -V >&5 g77: error: unrecognized command line option '-V' g77: fatal error: no input files compilation terminated. configure:4024: $? = 1 configure:4013: g77 -qversion >&5 g77: error: unrecognized command line option '-qversion'; did you mean '--version'? g77: fatal error: no input files compilation terminated. configure:4024: $? = 1 configure:4033: checking whether we are using the GNU Fortran 77 compiler configure:4046: g77 -c conftest.F >&5 configure:4046: $? = 0 configure:4055: result: yes configure:4061: checking whether g77 accepts -g configure:4072: g77 -c -g conftest.f >&5 configure:4072: $? = 0 configure:4080: result: yes configure:4113: checking build system type configure:4127: result: x86_64-pc-linux-gnu configure:4147: checking host system type configure:4160: result: x86_64-pc-linux-gnu configure:4185: checking how to get verbose linking output from g77 configure:4195: g77 -c -g -O2 conftest.f >&5 configure:4195: $? = 0 configure:4213: g77 -o conftest -g -O2 -v conftest.f Using built-in specs. Target: x86_64-linux-gnu Thread model: posix gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) - /usr/lib/gcc/x86_64-linux-gnu/7/f951 conftest.f -ffixed-form -quiet -dumpbase conftest.f -mtune=generic -march=x86-64 -auxbase conftest -g -O2 -version -fintrinsic-modules-path /usr/lib/gcc/x86_64-linux-gnu/7/finclude -o /tmp/ccTtArp9.s + /usr/lib/gcc/x86_64-linux-gnu/7/f951 conftest.f -ffixed-form -quiet -dumpbase conftest.f -mtune=generic -march=x86-64 -auxbase conftest -g -O2 -version -fintrinsic-modules-path /usr/lib/gcc/x86_64-linux-gnu/7/finclude -o /tmp/cccUQAj2.s GNU Fortran (Ubuntu 7.4.0-1ubuntu1~18.04.1) version 7.4.0 (x86_64-linux-gnu) compiled by GNU C version 7.4.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU Fortran2008 (Ubuntu 7.4.0-1ubuntu1~18.04.1) version 7.4.0 (x86_64-linux-gnu) compiled by GNU C version 7.4.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 - as -v --64 -o /tmp/cceyZvv3.o /tmp/ccTtArp9.s + as -v --64 -o /tmp/ccNldMZV.o /tmp/cccUQAj2.s GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30 Reading specs from /usr/lib/gcc/x86_64-linux-gnu/7/libgfortran.spec rename spec lib to liborig - /usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccpDBnCX.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o conftest /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. /tmp/cceyZvv3.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o + /usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccajrMGP.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o conftest /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. /tmp/ccNldMZV.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o configure:4296: result: -v configure:4298: checking for Fortran 77 libraries of g77 configure:4321: g77 -o conftest -g -O2 -v conftest.f Using built-in specs. Target: x86_64-linux-gnu Thread model: posix gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) - /usr/lib/gcc/x86_64-linux-gnu/7/f951 conftest.f -ffixed-form -quiet -dumpbase conftest.f -mtune=generic -march=x86-64 -auxbase conftest -g -O2 -version -fintrinsic-modules-path /usr/lib/gcc/x86_64-linux-gnu/7/finclude -o /tmp/cc5Liv9b.s + /usr/lib/gcc/x86_64-linux-gnu/7/f951 conftest.f -ffixed-form -quiet -dumpbase conftest.f -mtune=generic -march=x86-64 -auxbase conftest -g -O2 -version -fintrinsic-modules-path /usr/lib/gcc/x86_64-linux-gnu/7/finclude -o /tmp/ccpoVGT2.s GNU Fortran (Ubuntu 7.4.0-1ubuntu1~18.04.1) version 7.4.0 (x86_64-linux-gnu) compiled by GNU C version 7.4.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU Fortran2008 (Ubuntu 7.4.0-1ubuntu1~18.04.1) version 7.4.0 (x86_64-linux-gnu) compiled by GNU C version 7.4.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 - as -v --64 -o /tmp/ccRn1Do6.o /tmp/cc5Liv9b.s + as -v --64 -o /tmp/ccnOa0HW.o /tmp/ccpoVGT2.s GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30 Reading specs from /usr/lib/gcc/x86_64-linux-gnu/7/libgfortran.spec rename spec lib to liborig - /usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/cc29OAE0.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o conftest /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. /tmp/ccRn1Do6.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o + /usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccyeV3wQ.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o conftest /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. /tmp/ccnOa0HW.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o configure:4517: result: -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lgfortran -lm -lquadmath configure:4579: checking how to print strings configure:4606: result: printf configure:4675: checking for gcc configure:4691: found /usr/bin/gcc configure:4702: result: gcc configure:4931: checking for C compiler version configure:4940: gcc --version >&5 gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:4951: $? = 0 configure:4940: gcc -v >&5 Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) configure:4951: $? = 0 configure:4940: gcc -V >&5 gcc: error: unrecognized command line option '-V' gcc: fatal error: no input files compilation terminated. configure:4951: $? = 1 configure:4940: gcc -qversion >&5 gcc: error: unrecognized command line option '-qversion'; did you mean '--version'? gcc: fatal error: no input files compilation terminated. configure:4951: $? = 1 configure:4955: checking whether we are using the GNU C compiler configure:4974: gcc -c conftest.c >&5 configure:4974: $? = 0 configure:4983: result: yes configure:4992: checking whether gcc accepts -g configure:5012: gcc -c -g conftest.c >&5 configure:5012: $? = 0 configure:5053: result: yes configure:5070: checking for gcc option to accept ISO C89 configure:5133: gcc -c -g -O2 conftest.c >&5 configure:5133: $? = 0 configure:5146: result: none needed configure:5171: checking whether gcc understands -c and -o together configure:5193: gcc -c conftest.c -o conftest2.o configure:5196: $? = 0 configure:5193: gcc -c conftest.c -o conftest2.o configure:5196: $? = 0 configure:5208: result: yes configure:5227: checking dependency style of gcc configure:5338: result: gcc3 configure:5353: checking for a sed that does not truncate output configure:5417: result: /bin/sed configure:5435: checking for grep that handles long lines and -e configure:5493: result: /bin/grep configure:5498: checking for egrep configure:5560: result: /bin/grep -E configure:5565: checking for fgrep configure:5627: result: /bin/grep -F configure:5662: checking for ld used by gcc configure:5729: result: /usr/bin/ld configure:5736: checking if the linker (/usr/bin/ld) is GNU ld configure:5751: result: yes configure:5763: checking for BSD- or MS-compatible name lister (nm) configure:5817: result: /usr/bin/nm -B configure:5947: checking the name lister (/usr/bin/nm -B) interface configure:5954: gcc -c -g -O2 conftest.c >&5 configure:5957: /usr/bin/nm -B "conftest.o" configure:5960: output 0000000000000000 B some_variable configure:5967: result: BSD nm configure:5970: checking whether ln -s works configure:5974: result: yes configure:5982: checking the maximum length of command line arguments configure:6113: result: 1572864 configure:6161: checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format configure:6201: result: func_convert_file_noop configure:6208: checking how to convert x86_64-pc-linux-gnu file names to toolchain format configure:6228: result: func_convert_file_noop configure:6235: checking for /usr/bin/ld option to reload object files configure:6242: result: -r configure:6316: checking for objdump configure:6332: found /usr/bin/objdump configure:6343: result: objdump configure:6375: checking how to recognize dependent libraries configure:6575: result: pass_all configure:6660: checking for dlltool configure:6690: result: no configure:6720: checking how to associate runtime and link libraries configure:6747: result: printf %s\n configure:6808: checking for ar configure:6824: found /usr/bin/ar configure:6835: result: ar configure:6872: checking for archiver @FILE support configure:6889: gcc -c -g -O2 conftest.c >&5 configure:6889: $? = 0 configure:6892: ar cru libconftest.a @conftest.lst >&5 ar: `u' modifier ignored since `D' is the default (see `U') configure:6895: $? = 0 configure:6900: ar cru libconftest.a @conftest.lst >&5 ar: `u' modifier ignored since `D' is the default (see `U') ar: conftest.o: No such file or directory configure:6903: $? = 1 configure:6915: result: @ configure:6973: checking for strip configure:6989: found /usr/bin/strip configure:7000: result: strip configure:7072: checking for ranlib configure:7088: found /usr/bin/ranlib configure:7099: result: ranlib configure:7201: checking command to parse /usr/bin/nm -B output from gcc object configure:7354: gcc -c -g -O2 conftest.c >&5 configure:7357: $? = 0 configure:7361: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm configure:7364: $? = 0 configure:7430: gcc -o conftest -g -O2 conftest.c conftstm.o >&5 configure:7433: $? = 0 configure:7471: result: ok configure:7518: checking for sysroot configure:7548: result: no configure:7555: checking for a working dd configure:7593: result: /bin/dd configure:7597: checking how to truncate binary pipes configure:7612: result: /bin/dd bs=4096 count=1 configure:7748: gcc -c -g -O2 conftest.c >&5 configure:7751: $? = 0 configure:7941: checking for mt configure:7957: found /bin/mt configure:7968: result: mt configure:7991: checking if mt is a manifest tool configure:7997: mt '-?' configure:8005: result: no configure:8682: checking how to run the C preprocessor configure:8713: gcc -E conftest.c configure:8713: $? = 0 configure:8727: gcc -E conftest.c conftest.c:11:10: fatal error: ac_nonexistent.h: No such file or directory #include ^~~~~~~~~~~~~~~~~~ compilation terminated. configure:8727: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "npstat" | #define PACKAGE_TARNAME "npstat" | #define PACKAGE_VERSION "5.0.0" | #define PACKAGE_STRING "npstat 5.0.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "npstat" | #define VERSION "5.0.0" | /* end confdefs.h. */ | #include configure:8752: result: gcc -E configure:8772: gcc -E conftest.c configure:8772: $? = 0 configure:8786: gcc -E conftest.c conftest.c:11:10: fatal error: ac_nonexistent.h: No such file or directory #include ^~~~~~~~~~~~~~~~~~ compilation terminated. configure:8786: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "npstat" | #define PACKAGE_TARNAME "npstat" | #define PACKAGE_VERSION "5.0.0" | #define PACKAGE_STRING "npstat 5.0.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "npstat" | #define VERSION "5.0.0" | /* end confdefs.h. */ | #include configure:8815: checking for ANSI C header files configure:8835: gcc -c -g -O2 conftest.c >&5 configure:8835: $? = 0 configure:8908: gcc -o conftest -g -O2 conftest.c >&5 configure:8908: $? = 0 configure:8908: ./conftest configure:8908: $? = 0 configure:8919: result: yes configure:8932: checking for sys/types.h configure:8932: gcc -c -g -O2 conftest.c >&5 configure:8932: $? = 0 configure:8932: result: yes configure:8932: checking for sys/stat.h configure:8932: gcc -c -g -O2 conftest.c >&5 configure:8932: $? = 0 configure:8932: result: yes configure:8932: checking for stdlib.h configure:8932: gcc -c -g -O2 conftest.c >&5 configure:8932: $? = 0 configure:8932: result: yes configure:8932: checking for string.h configure:8932: gcc -c -g -O2 conftest.c >&5 configure:8932: $? = 0 configure:8932: result: yes configure:8932: checking for memory.h configure:8932: gcc -c -g -O2 conftest.c >&5 configure:8932: $? = 0 configure:8932: result: yes configure:8932: checking for strings.h configure:8932: gcc -c -g -O2 conftest.c >&5 configure:8932: $? = 0 configure:8932: result: yes configure:8932: checking for inttypes.h configure:8932: gcc -c -g -O2 conftest.c >&5 configure:8932: $? = 0 configure:8932: result: yes configure:8932: checking for stdint.h configure:8932: gcc -c -g -O2 conftest.c >&5 configure:8932: $? = 0 configure:8932: result: yes configure:8932: checking for unistd.h configure:8932: gcc -c -g -O2 conftest.c >&5 configure:8932: $? = 0 configure:8932: result: yes configure:8946: checking for dlfcn.h configure:8946: gcc -c -g -O2 conftest.c >&5 configure:8946: $? = 0 configure:8946: result: yes configure:9213: checking for objdir configure:9228: result: .libs configure:9492: checking if gcc supports -fno-rtti -fno-exceptions configure:9510: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5 cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C configure:9514: $? = 0 configure:9527: result: no configure:9885: checking for gcc option to produce PIC configure:9892: result: -fPIC -DPIC configure:9900: checking if gcc PIC flag -fPIC -DPIC works configure:9918: gcc -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5 configure:9922: $? = 0 configure:9935: result: yes configure:9964: checking if gcc static flag -static works configure:9992: result: yes configure:10007: checking if gcc supports -c -o file.o configure:10028: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5 configure:10032: $? = 0 configure:10054: result: yes configure:10062: checking if gcc supports -c -o file.o configure:10109: result: yes configure:10142: checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries configure:11401: result: yes configure:11438: checking whether -lc should be explicitly linked in configure:11446: gcc -c -g -O2 conftest.c >&5 configure:11449: $? = 0 configure:11464: gcc -shared -fPIC -DPIC conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /bin/grep -lc \>/dev/null 2\>\&1 configure:11467: $? = 0 configure:11481: result: no configure:11641: checking dynamic linker characteristics configure:12222: gcc -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c >&5 configure:12222: $? = 0 configure:12459: result: GNU/Linux ld.so configure:12581: checking how to hardcode library paths into programs configure:12606: result: immediate configure:13154: checking whether stripping libraries is possible configure:13159: result: yes configure:13194: checking if libtool supports shared libraries configure:13196: result: yes configure:13199: checking whether to build shared libraries configure:13224: result: yes configure:13227: checking whether to build static libraries configure:13231: result: yes configure:13254: checking how to run the C++ preprocessor configure:13281: g++ -E conftest.cpp configure:13281: $? = 0 configure:13295: g++ -E conftest.cpp conftest.cpp:23:10: fatal error: ac_nonexistent.h: No such file or directory #include ^~~~~~~~~~~~~~~~~~ compilation terminated. configure:13295: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "npstat" | #define PACKAGE_TARNAME "npstat" | #define PACKAGE_VERSION "5.0.0" | #define PACKAGE_STRING "npstat 5.0.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "npstat" | #define VERSION "5.0.0" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | /* end confdefs.h. */ | #include configure:13320: result: g++ -E configure:13340: g++ -E conftest.cpp configure:13340: $? = 0 configure:13354: g++ -E conftest.cpp conftest.cpp:23:10: fatal error: ac_nonexistent.h: No such file or directory #include ^~~~~~~~~~~~~~~~~~ compilation terminated. configure:13354: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "npstat" | #define PACKAGE_TARNAME "npstat" | #define PACKAGE_VERSION "5.0.0" | #define PACKAGE_STRING "npstat 5.0.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "npstat" | #define VERSION "5.0.0" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | /* end confdefs.h. */ | #include configure:13516: checking for ld used by g++ configure:13583: result: /usr/bin/ld -m elf_x86_64 configure:13590: checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld configure:13605: result: yes configure:13660: checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries configure:14733: result: yes configure:14769: g++ -c -std=c++11 -O3 -Wall -W -Werror conftest.cpp >&5 configure:14772: $? = 0 configure:15253: checking for g++ option to produce PIC configure:15260: result: -fPIC -DPIC configure:15268: checking if g++ PIC flag -fPIC -DPIC works configure:15286: g++ -c -std=c++11 -O3 -Wall -W -Werror -fPIC -DPIC -DPIC conftest.cpp >&5 configure:15290: $? = 0 configure:15303: result: yes configure:15326: checking if g++ static flag -static works configure:15354: result: yes configure:15366: checking if g++ supports -c -o file.o configure:15387: g++ -c -std=c++11 -O3 -Wall -W -Werror -o out/conftest2.o conftest.cpp >&5 configure:15391: $? = 0 configure:15413: result: yes configure:15418: checking if g++ supports -c -o file.o configure:15465: result: yes configure:15495: checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries configure:15535: result: yes configure:15676: checking dynamic linker characteristics configure:16421: result: GNU/Linux ld.so configure:16486: checking how to hardcode library paths into programs configure:16511: result: immediate configure:16652: checking if libtool supports shared libraries configure:16654: result: yes configure:16657: checking whether to build shared libraries configure:16681: result: yes configure:16684: checking whether to build static libraries configure:16688: result: yes configure:17040: checking for g77 option to produce PIC configure:17047: result: -fPIC configure:17055: checking if g77 PIC flag -fPIC works configure:17073: g77 -c -g -O2 -fPIC conftest.f >&5 configure:17077: $? = 0 configure:17090: result: yes configure:17113: checking if g77 static flag -static works configure:17141: result: yes configure:17153: checking if g77 supports -c -o file.o configure:17174: g77 -c -g -O2 -o out/conftest2.o conftest.f >&5 configure:17178: $? = 0 configure:17200: result: yes configure:17205: checking if g77 supports -c -o file.o configure:17252: result: yes configure:17282: checking whether the g77 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries configure:18491: result: yes configure:18632: checking dynamic linker characteristics configure:19371: result: GNU/Linux ld.so configure:19436: checking how to hardcode library paths into programs configure:19461: result: immediate configure:19661: checking that generated files are newer than configure configure:19667: result: done configure:19694: creating ./config.status ## ---------------------- ## ## Running config.status. ## ## ---------------------- ## This file was extended by npstat config.status 5.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = CONFIG_HEADERS = CONFIG_LINKS = CONFIG_COMMANDS = $ ./config.status on dawn config.status:1142: creating Makefile config.status:1142: creating npstat/nm/Makefile config.status:1142: creating npstat/rng/Makefile config.status:1142: creating npstat/stat/Makefile config.status:1142: creating npstat/wrap/Makefile config.status:1142: creating npstat/interfaces/Makefile config.status:1142: creating npstat/emsunfold/Makefile config.status:1142: creating npstat/Makefile config.status:1142: creating examples/C++/Makefile config.status:1142: creating npstat.pc config.status:1314: executing depfiles commands config.status:1314: executing libtool commands ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_build=x86_64-pc-linux-gnu ac_cv_c_compiler_gnu=yes ac_cv_cxx_compiler_gnu=yes ac_cv_env_CCC_set= ac_cv_env_CCC_value= ac_cv_env_CC_set= ac_cv_env_CC_value= ac_cv_env_CFLAGS_set= ac_cv_env_CFLAGS_value= ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_set= ac_cv_env_CPP_value= ac_cv_env_CXXCPP_set= ac_cv_env_CXXCPP_value= ac_cv_env_CXXFLAGS_set=set ac_cv_env_CXXFLAGS_value='-std=c++11 -O3 -Wall -W -Werror' ac_cv_env_CXX_set= ac_cv_env_CXX_value= ac_cv_env_DEPS_CFLAGS_set= ac_cv_env_DEPS_CFLAGS_value= ac_cv_env_DEPS_LIBS_set= ac_cv_env_DEPS_LIBS_value= ac_cv_env_F77_set= ac_cv_env_F77_value= ac_cv_env_FFLAGS_set= ac_cv_env_FFLAGS_value= ac_cv_env_LDFLAGS_set= ac_cv_env_LDFLAGS_value= ac_cv_env_LIBS_set= ac_cv_env_LIBS_value= ac_cv_env_LT_SYS_LIBRARY_PATH_set= ac_cv_env_LT_SYS_LIBRARY_PATH_value= ac_cv_env_PKG_CONFIG_LIBDIR_set= ac_cv_env_PKG_CONFIG_LIBDIR_value= ac_cv_env_PKG_CONFIG_PATH_set=set ac_cv_env_PKG_CONFIG_PATH_value=/usr/local/lib/pkgconfig ac_cv_env_PKG_CONFIG_set= ac_cv_env_PKG_CONFIG_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_f77_compiler_gnu=yes ac_cv_f77_libs=' -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lgfortran -lm -lquadmath' ac_cv_header_dlfcn_h=yes ac_cv_header_inttypes_h=yes ac_cv_header_memory_h=yes ac_cv_header_stdc=yes ac_cv_header_stdint_h=yes ac_cv_header_stdlib_h=yes ac_cv_header_string_h=yes ac_cv_header_strings_h=yes ac_cv_header_sys_stat_h=yes ac_cv_header_sys_types_h=yes ac_cv_header_unistd_h=yes ac_cv_host=x86_64-pc-linux-gnu ac_cv_objext=o ac_cv_path_EGREP='/bin/grep -E' ac_cv_path_FGREP='/bin/grep -F' ac_cv_path_GREP=/bin/grep ac_cv_path_SED=/bin/sed ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config ac_cv_path_install='/usr/bin/install -c' ac_cv_path_lt_DD=/bin/dd ac_cv_path_mkdir=/bin/mkdir ac_cv_prog_AWK=gawk ac_cv_prog_CPP='gcc -E' ac_cv_prog_CXXCPP='g++ -E' ac_cv_prog_ac_ct_AR=ar ac_cv_prog_ac_ct_CC=gcc ac_cv_prog_ac_ct_CXX=g++ ac_cv_prog_ac_ct_F77=g77 ac_cv_prog_ac_ct_MANIFEST_TOOL=mt ac_cv_prog_ac_ct_OBJDUMP=objdump ac_cv_prog_ac_ct_RANLIB=ranlib ac_cv_prog_ac_ct_STRIP=strip ac_cv_prog_cc_c89= ac_cv_prog_cc_g=yes ac_cv_prog_cxx_g=yes ac_cv_prog_f77_g=yes ac_cv_prog_f77_v=-v ac_cv_prog_make_make_set=yes am_cv_CC_dependencies_compiler_type=gcc3 am_cv_CXX_dependencies_compiler_type=gcc3 am_cv_make_support_nested_variables=yes am_cv_prog_cc_c_o=yes lt_cv_ar_at_file=@ lt_cv_archive_cmds_need_lc=no lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_ld_reload_flag=-r lt_cv_nm_interface='BSD nm' lt_cv_objdir=.libs lt_cv_path_LD=/usr/bin/ld lt_cv_path_LDCXX='/usr/bin/ld -m elf_x86_64' lt_cv_path_NM='/usr/bin/nm -B' lt_cv_path_mainfest_tool=no lt_cv_prog_compiler_c_o=yes lt_cv_prog_compiler_c_o_CXX=yes lt_cv_prog_compiler_c_o_F77=yes lt_cv_prog_compiler_pic='-fPIC -DPIC' lt_cv_prog_compiler_pic_CXX='-fPIC -DPIC' lt_cv_prog_compiler_pic_F77=-fPIC lt_cv_prog_compiler_pic_works=yes lt_cv_prog_compiler_pic_works_CXX=yes lt_cv_prog_compiler_pic_works_F77=yes lt_cv_prog_compiler_rtti_exceptions=no lt_cv_prog_compiler_static_works=yes lt_cv_prog_compiler_static_works_CXX=yes lt_cv_prog_compiler_static_works_F77=yes lt_cv_prog_gnu_ld=yes lt_cv_prog_gnu_ldcxx=yes lt_cv_sharedlib_from_linklib_cmd='printf %s\n' lt_cv_shlibpath_overrides_runpath=yes lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"\1", (void *) \&\1},/p'\''' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(lib.*\)$/ {"\1", (void *) \&\1},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"lib\1", (void *) \&\1},/p'\''' lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' lt_cv_sys_global_symbol_to_import= lt_cv_sys_max_cmd_len=1572864 lt_cv_to_host_file_cmd=func_convert_file_noop lt_cv_to_tool_file_cmd=func_convert_file_noop lt_cv_truncate_bin='/bin/dd bs=4096 count=1' pkg_cv_DEPS_CFLAGS=-I/usr/local/include pkg_cv_DEPS_LIBS='-L/usr/local/lib -lfftw3 -lgeners -lkstest' ## ----------------- ## ## Output variables. ## ## ----------------- ## ACLOCAL='${SHELL} /home/igv/Hepforge/npstat/trunk/missing aclocal-1.15' AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' AMTAR='$${TAR-tar}' AM_BACKSLASH='\' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' AM_DEFAULT_VERBOSITY='1' AM_V='$(V)' AR='ar' AUTOCONF='${SHELL} /home/igv/Hepforge/npstat/trunk/missing autoconf' AUTOHEADER='${SHELL} /home/igv/Hepforge/npstat/trunk/missing autoheader' AUTOMAKE='${SHELL} /home/igv/Hepforge/npstat/trunk/missing automake-1.15' AWK='gawk' CC='gcc' CCDEPMODE='depmode=gcc3' CFLAGS='-g -O2' CPP='gcc -E' CPPFLAGS='' CXX='g++' CXXCPP='g++ -E' CXXDEPMODE='depmode=gcc3' CXXFLAGS='-std=c++11 -O3 -Wall -W -Werror' CYGPATH_W='echo' DEFS='-DPACKAGE_NAME=\"npstat\" -DPACKAGE_TARNAME=\"npstat\" -DPACKAGE_VERSION=\"5.0.0\" -DPACKAGE_STRING=\"npstat\ 5.0.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"npstat\" -DVERSION=\"5.0.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\"' DEPDIR='.deps' DEPS_CFLAGS='-I/usr/local/include' DEPS_LIBS='-L/usr/local/lib -lfftw3 -lgeners -lkstest' DLLTOOL='false' DSYMUTIL='' DUMPBIN='' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='/bin/grep -E' EXEEXT='' F77='g77' FFLAGS='-g -O2' FGREP='/bin/grep -F' FLIBS=' -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lgfortran -lm -lquadmath' GREP='/bin/grep' INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' LD='/usr/bin/ld -m elf_x86_64' LDFLAGS='' LIBOBJS='' LIBS='' LIBTOOL='$(SHELL) $(top_builddir)/libtool' LIPO='' LN_S='ln -s' LTLIBOBJS='' LT_SYS_LIBRARY_PATH='' MAKEINFO='${SHELL} /home/igv/Hepforge/npstat/trunk/missing makeinfo' MANIFEST_TOOL=':' MKDIR_P='/bin/mkdir -p' NM='/usr/bin/nm -B' NMEDIT='' OBJDUMP='objdump' OBJEXT='o' OTOOL64='' OTOOL='' PACKAGE='npstat' PACKAGE_BUGREPORT='' PACKAGE_NAME='npstat' PACKAGE_STRING='npstat 5.0.0' PACKAGE_TARNAME='npstat' PACKAGE_URL='' PACKAGE_VERSION='5.0.0' PATH_SEPARATOR=':' PKG_CONFIG='/usr/bin/pkg-config' PKG_CONFIG_LIBDIR='' PKG_CONFIG_PATH='/usr/local/lib/pkgconfig' RANLIB='ranlib' SED='/bin/sed' SET_MAKE='' SHELL='/bin/bash' STRIP='strip' VERSION='5.0.0' ac_ct_AR='ar' ac_ct_CC='gcc' ac_ct_CXX='g++' ac_ct_DUMPBIN='' ac_ct_F77='g77' am__EXEEXT_FALSE='' am__EXEEXT_TRUE='#' am__fastdepCC_FALSE='#' am__fastdepCC_TRUE='' am__fastdepCXX_FALSE='#' am__fastdepCXX_TRUE='' am__include='include' am__isrc='' am__leading_dot='.' am__nodep='_no' am__quote='' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' bindir='${exec_prefix}/bin' build='x86_64-pc-linux-gnu' build_alias='' build_cpu='x86_64' build_os='linux-gnu' build_vendor='pc' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' dvidir='${docdir}' exec_prefix='${prefix}' host='x86_64-pc-linux-gnu' host_alias='' host_cpu='x86_64' host_os='linux-gnu' host_vendor='pc' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' install_sh='${SHELL} /home/igv/Hepforge/npstat/trunk/install-sh' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localedir='${datarootdir}/locale' localstatedir='${prefix}/var' mandir='${datarootdir}/man' mkdir_p='$(MKDIR_P)' oldincludedir='/usr/include' pdfdir='${docdir}' prefix='/usr/local' program_transform_name='s,x,x,' psdir='${docdir}' runstatedir='${localstatedir}/run' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target_alias='' ## ----------- ## ## confdefs.h. ## ## ----------- ## /* confdefs.h */ #define PACKAGE_NAME "npstat" #define PACKAGE_TARNAME "npstat" #define PACKAGE_VERSION "5.0.0" #define PACKAGE_STRING "npstat 5.0.0" #define PACKAGE_BUGREPORT "" #define PACKAGE_URL "" #define PACKAGE "npstat" #define VERSION "5.0.0" #define STDC_HEADERS 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_STDLIB_H 1 #define HAVE_STRING_H 1 #define HAVE_MEMORY_H 1 #define HAVE_STRINGS_H 1 #define HAVE_INTTYPES_H 1 #define HAVE_STDINT_H 1 #define HAVE_UNISTD_H 1 #define HAVE_DLFCN_H 1 #define LT_OBJDIR ".libs/" configure: exit 0