| CholeskyDecomp.h | | CholeskyDecomp.h | |
| | | | |
| skipping to change at line 552 | | skipping to change at line 552 | |
| | | | |
| // element L(i,j) is at array position (i * (i+1)) / 2 + j | | // element L(i,j) is at array position (i * (i+1)) / 2 + j | |
| | | | |
| // quirk: we may need to invert L later anyway, so we can | | // quirk: we may need to invert L later anyway, so we can | |
| // invert elements on diagonale straight away (we only | | // invert elements on diagonale straight away (we only | |
| // ever need their reciprocals!) | | // ever need their reciprocals!) | |
| | | | |
| // cache starting address of rows of L for speed reasons | | // cache starting address of rows of L for speed reasons | |
| F *base1 = &dst[0]; | | F *base1 = &dst[0]; | |
| for (unsigned i = 0; i < N; base1 += ++i) { | | for (unsigned i = 0; i < N; base1 += ++i) { | |
|
| F tmpdiag = F(0); // for element on diagonale | | F tmpdiag = F(0.0); // for element on diagonale | |
| // calculate off-diagonal elements | | // calculate off-diagonal elements | |
| F *base2 = &dst[0]; | | F *base2 = &dst[0]; | |
| for (unsigned j = 0; j < i; base2 += ++j) { | | for (unsigned j = 0; j < i; base2 += ++j) { | |
| F tmp = src(i, j); | | F tmp = src(i, j); | |
| for (unsigned k = j; k--; ) | | for (unsigned k = j; k--; ) | |
| tmp -= base1[k] * base2[k]; | | tmp -= base1[k] * base2[k]; | |
| base1[j] = tmp *= base2[j]; | | base1[j] = tmp *= base2[j]; | |
| // keep track of contribution to element on diagonale | | // keep track of contribution to element on diagonale | |
| tmpdiag += tmp * tmp; | | tmpdiag += tmp * tmp; | |
| } | | } | |
| // keep truncation error small | | // keep truncation error small | |
| tmpdiag = src(i, i) - tmpdiag; | | tmpdiag = src(i, i) - tmpdiag; | |
| // check if positive definite | | // check if positive definite | |
|
| if (tmpdiag <= F(0)) return false; | | if (tmpdiag <= F(0.0)) return false; | |
| else base1[i] = std::sqrt(F(1) / tmpdiag); | | else base1[i] = std::sqrt(F(1.0) / tmpdiag); | |
| } | | } | |
| return true; | | return true; | |
| } | | } | |
| }; | | }; | |
| | | | |
| /// struct to do a Cholesky decomposition | | /// struct to do a Cholesky decomposition | |
| template<class F, unsigned N, class M> struct _decomposer | | template<class F, unsigned N, class M> struct _decomposer | |
| { | | { | |
| /// method to do the decomposition | | /// method to do the decomposition | |
| /** @returns if the decomposition was successful */ | | /** @returns if the decomposition was successful */ | |
| | | | |
| skipping to change at line 595 | | skipping to change at line 595 | |
| /// method to do the inversion | | /// method to do the inversion | |
| void operator()(M& dst, const F* src, unsigned N) const | | void operator()(M& dst, const F* src, unsigned N) const | |
| { | | { | |
| // make working copy | | // make working copy | |
| F * l = new F[N * (N + 1) / 2]; | | F * l = new F[N * (N + 1) / 2]; | |
| std::copy(src, src + ((N * (N + 1)) / 2), l); | | std::copy(src, src + ((N * (N + 1)) / 2), l); | |
| // ok, next step: invert off-diagonal part of matrix | | // ok, next step: invert off-diagonal part of matrix | |
| F* base1 = &l[1]; | | F* base1 = &l[1]; | |
| for (unsigned i = 1; i < N; base1 += ++i) { | | for (unsigned i = 1; i < N; base1 += ++i) { | |
| for (unsigned j = 0; j < i; ++j) { | | for (unsigned j = 0; j < i; ++j) { | |
|
| F tmp = F(0); | | F tmp = F(0.0); | |
| const F *base2 = &l[(i * (i - 1)) / 2]; | | const F *base2 = &l[(i * (i - 1)) / 2]; | |
| for (unsigned k = i; k-- > j; base2 -= k) | | for (unsigned k = i; k-- > j; base2 -= k) | |
| tmp -= base1[k] * base2[j]; | | tmp -= base1[k] * base2[j]; | |
| base1[j] = tmp * base1[i]; | | base1[j] = tmp * base1[i]; | |
| } | | } | |
| } | | } | |
| | | | |
| // Li = L^(-1) formed, now calculate M^(-1) = Li^T Li | | // Li = L^(-1) formed, now calculate M^(-1) = Li^T Li | |
| for (unsigned i = N; i--; ) { | | for (unsigned i = N; i--; ) { | |
| for (unsigned j = i + 1; j--; ) { | | for (unsigned j = i + 1; j--; ) { | |
|
| F tmp = F(0); | | F tmp = F(0.0); | |
| base1 = &l[(N * (N - 1)) / 2]; | | base1 = &l[(N * (N - 1)) / 2]; | |
| for (unsigned k = N; k-- > i; base1 -= k) | | for (unsigned k = N; k-- > i; base1 -= k) | |
| tmp += base1[i] * base1[j]; | | tmp += base1[i] * base1[j]; | |
| dst(i, j) = tmp; | | dst(i, j) = tmp; | |
| } | | } | |
| } | | } | |
| delete [] l; | | delete [] l; | |
| } | | } | |
| }; | | }; | |
| | | | |
| | | | |
| skipping to change at line 634 | | skipping to change at line 634 | |
| | | | |
| /// struct to solve a linear system using its Cholesky decomposition (ge
neralised dimensionality) | | /// struct to solve a linear system using its Cholesky decomposition (ge
neralised dimensionality) | |
| template<class F, class V> struct _solverGenDim | | template<class F, class V> struct _solverGenDim | |
| { | | { | |
| /// method to solve the linear system | | /// method to solve the linear system | |
| void operator()(V& rhs, const F* l, unsigned N) const | | void operator()(V& rhs, const F* l, unsigned N) const | |
| { | | { | |
| // solve Ly = rhs | | // solve Ly = rhs | |
| for (unsigned k = 0; k < N; ++k) { | | for (unsigned k = 0; k < N; ++k) { | |
| const unsigned base = (k * (k + 1)) / 2; | | const unsigned base = (k * (k + 1)) / 2; | |
|
| F sum = F(0); | | F sum = F(0.0); | |
| for (unsigned i = k; i--; ) | | for (unsigned i = k; i--; ) | |
| sum += rhs[i] * l[base + i]; | | sum += rhs[i] * l[base + i]; | |
| // elements on diagonale are pre-inverted! | | // elements on diagonale are pre-inverted! | |
| rhs[k] = (rhs[k] - sum) * l[base + k]; | | rhs[k] = (rhs[k] - sum) * l[base + k]; | |
| } | | } | |
| // solve L^Tx = y | | // solve L^Tx = y | |
| for (unsigned k = N; k--; ) { | | for (unsigned k = N; k--; ) { | |
|
| F sum = F(0); | | F sum = F(0.0); | |
| for (unsigned i = N; --i > k; ) | | for (unsigned i = N; --i > k; ) | |
| sum += rhs[i] * l[(i * (i + 1)) / 2 + k]; | | sum += rhs[i] * l[(i * (i + 1)) / 2 + k]; | |
| // elements on diagonale are pre-inverted! | | // elements on diagonale are pre-inverted! | |
| rhs[k] = (rhs[k] - sum) * l[(k * (k + 1)) / 2 + k]; | | rhs[k] = (rhs[k] - sum) * l[(k * (k + 1)) / 2 + k]; | |
| } | | } | |
| } | | } | |
| }; | | }; | |
| | | | |
| /// struct to solve a linear system using its Cholesky decomposition | | /// struct to solve a linear system using its Cholesky decomposition | |
| template<class F, unsigned N, class V> struct _solver | | template<class F, unsigned N, class V> struct _solver | |
| | | | |
| skipping to change at line 665 | | skipping to change at line 665 | |
| void operator()(V& rhs, const F* l) const | | void operator()(V& rhs, const F* l) const | |
| { _solverGenDim<F, V>()(rhs, l, N); } | | { _solverGenDim<F, V>()(rhs, l, N); } | |
| }; | | }; | |
| | | | |
| /// struct to do a Cholesky decomposition (specialized, N = 6) | | /// struct to do a Cholesky decomposition (specialized, N = 6) | |
| template<class F, class M> struct _decomposer<F, 6, M> | | template<class F, class M> struct _decomposer<F, 6, M> | |
| { | | { | |
| /// method to do the decomposition | | /// method to do the decomposition | |
| bool operator()(F* dst, const M& src) const | | bool operator()(F* dst, const M& src) const | |
| { | | { | |
|
| if (src(0,0) <= F(0)) return false; | | if (src(0,0) <= F(0.0)) return false; | |
| dst[0] = std::sqrt(F(1) / src(0,0)); | | dst[0] = std::sqrt(F(1.0) / src(0,0)); | |
| dst[1] = src(1,0) * dst[0]; | | dst[1] = src(1,0) * dst[0]; | |
| dst[2] = src(1,1) - dst[1] * dst[1]; | | dst[2] = src(1,1) - dst[1] * dst[1]; | |
|
| if (dst[2] <= F(0)) return false; | | if (dst[2] <= F(0.0)) return false; | |
| else dst[2] = std::sqrt(F(1) / dst[2]); | | else dst[2] = std::sqrt(F(1.0) / dst[2]); | |
| dst[3] = src(2,0) * dst[0]; | | dst[3] = src(2,0) * dst[0]; | |
| dst[4] = (src(2,1) - dst[1] * dst[3]) * dst[2]; | | dst[4] = (src(2,1) - dst[1] * dst[3]) * dst[2]; | |
| dst[5] = src(2,2) - (dst[3] * dst[3] + dst[4] * dst[4]); | | dst[5] = src(2,2) - (dst[3] * dst[3] + dst[4] * dst[4]); | |
|
| if (dst[5] <= F(0)) return false; | | if (dst[5] <= F(0.0)) return false; | |
| else dst[5] = std::sqrt(F(1) / dst[5]); | | else dst[5] = std::sqrt(F(1.0) / dst[5]); | |
| dst[6] = src(3,0) * dst[0]; | | dst[6] = src(3,0) * dst[0]; | |
| dst[7] = (src(3,1) - dst[1] * dst[6]) * dst[2]; | | dst[7] = (src(3,1) - dst[1] * dst[6]) * dst[2]; | |
| dst[8] = (src(3,2) - dst[3] * dst[6] - dst[4] * dst[7]) * dst[5]; | | dst[8] = (src(3,2) - dst[3] * dst[6] - dst[4] * dst[7]) * dst[5]; | |
| dst[9] = src(3,3) - (dst[6] * dst[6] + dst[7] * dst[7] + dst[8] *
dst[8]); | | dst[9] = src(3,3) - (dst[6] * dst[6] + dst[7] * dst[7] + dst[8] *
dst[8]); | |
|
| if (dst[9] <= F(0)) return false; | | if (dst[9] <= F(0.0)) return false; | |
| else dst[9] = std::sqrt(F(1) / dst[9]); | | else dst[9] = std::sqrt(F(1.0) / dst[9]); | |
| dst[10] = src(4,0) * dst[0]; | | dst[10] = src(4,0) * dst[0]; | |
| dst[11] = (src(4,1) - dst[1] * dst[10]) * dst[2]; | | dst[11] = (src(4,1) - dst[1] * dst[10]) * dst[2]; | |
| dst[12] = (src(4,2) - dst[3] * dst[10] - dst[4] * dst[11]) * dst[5
]; | | dst[12] = (src(4,2) - dst[3] * dst[10] - dst[4] * dst[11]) * dst[5
]; | |
| dst[13] = (src(4,3) - dst[6] * dst[10] - dst[7] * dst[11] - dst[8]
* dst[12]) * dst[9]; | | dst[13] = (src(4,3) - dst[6] * dst[10] - dst[7] * dst[11] - dst[8]
* dst[12]) * dst[9]; | |
| dst[14] = src(4,4) - (dst[10]*dst[10]+dst[11]*dst[11]+dst[12]*dst[
12]+dst[13]*dst[13]); | | dst[14] = src(4,4) - (dst[10]*dst[10]+dst[11]*dst[11]+dst[12]*dst[
12]+dst[13]*dst[13]); | |
|
| if (dst[14] <= F(0)) return false; | | if (dst[14] <= F(0.0)) return false; | |
| else dst[14] = std::sqrt(F(1) / dst[14]); | | else dst[14] = std::sqrt(F(1.0) / dst[14]); | |
| dst[15] = src(5,0) * dst[0]; | | dst[15] = src(5,0) * dst[0]; | |
| dst[16] = (src(5,1) - dst[1] * dst[15]) * dst[2]; | | dst[16] = (src(5,1) - dst[1] * dst[15]) * dst[2]; | |
| dst[17] = (src(5,2) - dst[3] * dst[15] - dst[4] * dst[16]) * dst[5
]; | | dst[17] = (src(5,2) - dst[3] * dst[15] - dst[4] * dst[16]) * dst[5
]; | |
| dst[18] = (src(5,3) - dst[6] * dst[15] - dst[7] * dst[16] - dst[8]
* dst[17]) * dst[9]; | | dst[18] = (src(5,3) - dst[6] * dst[15] - dst[7] * dst[16] - dst[8]
* dst[17]) * dst[9]; | |
| dst[19] = (src(5,4) - dst[10] * dst[15] - dst[11] * dst[16] - dst[
12] * dst[17] - dst[13] * dst[18]) * dst[14]; | | dst[19] = (src(5,4) - dst[10] * dst[15] - dst[11] * dst[16] - dst[
12] * dst[17] - dst[13] * dst[18]) * dst[14]; | |
| dst[20] = src(5,5) - (dst[15]*dst[15]+dst[16]*dst[16]+dst[17]*dst[
17]+dst[18]*dst[18]+dst[19]*dst[19]); | | dst[20] = src(5,5) - (dst[15]*dst[15]+dst[16]*dst[16]+dst[17]*dst[
17]+dst[18]*dst[18]+dst[19]*dst[19]); | |
|
| if (dst[20] <= F(0)) return false; | | if (dst[20] <= F(0.0)) return false; | |
| else dst[20] = std::sqrt(F(1) / dst[20]); | | else dst[20] = std::sqrt(F(1.0) / dst[20]); | |
| return true; | | return true; | |
| } | | } | |
| }; | | }; | |
| /// struct to do a Cholesky decomposition (specialized, N = 5) | | /// struct to do a Cholesky decomposition (specialized, N = 5) | |
| template<class F, class M> struct _decomposer<F, 5, M> | | template<class F, class M> struct _decomposer<F, 5, M> | |
| { | | { | |
| /// method to do the decomposition | | /// method to do the decomposition | |
| bool operator()(F* dst, const M& src) const | | bool operator()(F* dst, const M& src) const | |
| { | | { | |
|
| if (src(0,0) <= F(0)) return false; | | if (src(0,0) <= F(0.0)) return false; | |
| dst[0] = std::sqrt(F(1) / src(0,0)); | | dst[0] = std::sqrt(F(1.0) / src(0,0)); | |
| dst[1] = src(1,0) * dst[0]; | | dst[1] = src(1,0) * dst[0]; | |
| dst[2] = src(1,1) - dst[1] * dst[1]; | | dst[2] = src(1,1) - dst[1] * dst[1]; | |
|
| if (dst[2] <= F(0)) return false; | | if (dst[2] <= F(0.0)) return false; | |
| else dst[2] = std::sqrt(F(1) / dst[2]); | | else dst[2] = std::sqrt(F(1.0) / dst[2]); | |
| dst[3] = src(2,0) * dst[0]; | | dst[3] = src(2,0) * dst[0]; | |
| dst[4] = (src(2,1) - dst[1] * dst[3]) * dst[2]; | | dst[4] = (src(2,1) - dst[1] * dst[3]) * dst[2]; | |
| dst[5] = src(2,2) - (dst[3] * dst[3] + dst[4] * dst[4]); | | dst[5] = src(2,2) - (dst[3] * dst[3] + dst[4] * dst[4]); | |
|
| if (dst[5] <= F(0)) return false; | | if (dst[5] <= F(0.0)) return false; | |
| else dst[5] = std::sqrt(F(1) / dst[5]); | | else dst[5] = std::sqrt(F(1.0) / dst[5]); | |
| dst[6] = src(3,0) * dst[0]; | | dst[6] = src(3,0) * dst[0]; | |
| dst[7] = (src(3,1) - dst[1] * dst[6]) * dst[2]; | | dst[7] = (src(3,1) - dst[1] * dst[6]) * dst[2]; | |
| dst[8] = (src(3,2) - dst[3] * dst[6] - dst[4] * dst[7]) * dst[5]; | | dst[8] = (src(3,2) - dst[3] * dst[6] - dst[4] * dst[7]) * dst[5]; | |
| dst[9] = src(3,3) - (dst[6] * dst[6] + dst[7] * dst[7] + dst[8] *
dst[8]); | | dst[9] = src(3,3) - (dst[6] * dst[6] + dst[7] * dst[7] + dst[8] *
dst[8]); | |
|
| if (dst[9] <= F(0)) return false; | | if (dst[9] <= F(0.0)) return false; | |
| else dst[9] = std::sqrt(F(1) / dst[9]); | | else dst[9] = std::sqrt(F(1.0) / dst[9]); | |
| dst[10] = src(4,0) * dst[0]; | | dst[10] = src(4,0) * dst[0]; | |
| dst[11] = (src(4,1) - dst[1] * dst[10]) * dst[2]; | | dst[11] = (src(4,1) - dst[1] * dst[10]) * dst[2]; | |
| dst[12] = (src(4,2) - dst[3] * dst[10] - dst[4] * dst[11]) * dst[5
]; | | dst[12] = (src(4,2) - dst[3] * dst[10] - dst[4] * dst[11]) * dst[5
]; | |
| dst[13] = (src(4,3) - dst[6] * dst[10] - dst[7] * dst[11] - dst[8]
* dst[12]) * dst[9]; | | dst[13] = (src(4,3) - dst[6] * dst[10] - dst[7] * dst[11] - dst[8]
* dst[12]) * dst[9]; | |
| dst[14] = src(4,4) - (dst[10]*dst[10]+dst[11]*dst[11]+dst[12]*dst[
12]+dst[13]*dst[13]); | | dst[14] = src(4,4) - (dst[10]*dst[10]+dst[11]*dst[11]+dst[12]*dst[
12]+dst[13]*dst[13]); | |
|
| if (dst[14] <= F(0)) return false; | | if (dst[14] <= F(0.0)) return false; | |
| else dst[14] = std::sqrt(F(1) / dst[14]); | | else dst[14] = std::sqrt(F(1.0) / dst[14]); | |
| return true; | | return true; | |
| } | | } | |
| }; | | }; | |
| /// struct to do a Cholesky decomposition (specialized, N = 4) | | /// struct to do a Cholesky decomposition (specialized, N = 4) | |
| template<class F, class M> struct _decomposer<F, 4, M> | | template<class F, class M> struct _decomposer<F, 4, M> | |
| { | | { | |
| /// method to do the decomposition | | /// method to do the decomposition | |
| bool operator()(F* dst, const M& src) const | | bool operator()(F* dst, const M& src) const | |
| { | | { | |
|
| if (src(0,0) <= F(0)) return false; | | if (src(0,0) <= F(0.0)) return false; | |
| dst[0] = std::sqrt(F(1) / src(0,0)); | | dst[0] = std::sqrt(F(1.0) / src(0,0)); | |
| dst[1] = src(1,0) * dst[0]; | | dst[1] = src(1,0) * dst[0]; | |
| dst[2] = src(1,1) - dst[1] * dst[1]; | | dst[2] = src(1,1) - dst[1] * dst[1]; | |
|
| if (dst[2] <= F(0)) return false; | | if (dst[2] <= F(0.0)) return false; | |
| else dst[2] = std::sqrt(F(1) / dst[2]); | | else dst[2] = std::sqrt(F(1.0) / dst[2]); | |
| dst[3] = src(2,0) * dst[0]; | | dst[3] = src(2,0) * dst[0]; | |
| dst[4] = (src(2,1) - dst[1] * dst[3]) * dst[2]; | | dst[4] = (src(2,1) - dst[1] * dst[3]) * dst[2]; | |
| dst[5] = src(2,2) - (dst[3] * dst[3] + dst[4] * dst[4]); | | dst[5] = src(2,2) - (dst[3] * dst[3] + dst[4] * dst[4]); | |
|
| if (dst[5] <= F(0)) return false; | | if (dst[5] <= F(0.0)) return false; | |
| else dst[5] = std::sqrt(F(1) / dst[5]); | | else dst[5] = std::sqrt(F(1.0) / dst[5]); | |
| dst[6] = src(3,0) * dst[0]; | | dst[6] = src(3,0) * dst[0]; | |
| dst[7] = (src(3,1) - dst[1] * dst[6]) * dst[2]; | | dst[7] = (src(3,1) - dst[1] * dst[6]) * dst[2]; | |
| dst[8] = (src(3,2) - dst[3] * dst[6] - dst[4] * dst[7]) * dst[5]; | | dst[8] = (src(3,2) - dst[3] * dst[6] - dst[4] * dst[7]) * dst[5]; | |
| dst[9] = src(3,3) - (dst[6] * dst[6] + dst[7] * dst[7] + dst[8] *
dst[8]); | | dst[9] = src(3,3) - (dst[6] * dst[6] + dst[7] * dst[7] + dst[8] *
dst[8]); | |
|
| if (dst[9] <= F(0)) return false; | | if (dst[9] <= F(0.0)) return false; | |
| else dst[9] = std::sqrt(F(1) / dst[9]); | | else dst[9] = std::sqrt(F(1.0) / dst[9]); | |
| return true; | | return true; | |
| } | | } | |
| }; | | }; | |
| /// struct to do a Cholesky decomposition (specialized, N = 3) | | /// struct to do a Cholesky decomposition (specialized, N = 3) | |
| template<class F, class M> struct _decomposer<F, 3, M> | | template<class F, class M> struct _decomposer<F, 3, M> | |
| { | | { | |
| /// method to do the decomposition | | /// method to do the decomposition | |
| bool operator()(F* dst, const M& src) const | | bool operator()(F* dst, const M& src) const | |
| { | | { | |
|
| if (src(0,0) <= F(0)) return false; | | if (src(0,0) <= F(0.0)) return false; | |
| dst[0] = std::sqrt(F(1) / src(0,0)); | | dst[0] = std::sqrt(F(1.0) / src(0,0)); | |
| dst[1] = src(1,0) * dst[0]; | | dst[1] = src(1,0) * dst[0]; | |
| dst[2] = src(1,1) - dst[1] * dst[1]; | | dst[2] = src(1,1) - dst[1] * dst[1]; | |
|
| if (dst[2] <= F(0)) return false; | | if (dst[2] <= F(0.0)) return false; | |
| else dst[2] = std::sqrt(F(1) / dst[2]); | | else dst[2] = std::sqrt(F(1.0) / dst[2]); | |
| dst[3] = src(2,0) * dst[0]; | | dst[3] = src(2,0) * dst[0]; | |
| dst[4] = (src(2,1) - dst[1] * dst[3]) * dst[2]; | | dst[4] = (src(2,1) - dst[1] * dst[3]) * dst[2]; | |
| dst[5] = src(2,2) - (dst[3] * dst[3] + dst[4] * dst[4]); | | dst[5] = src(2,2) - (dst[3] * dst[3] + dst[4] * dst[4]); | |
|
| if (dst[5] <= F(0)) return false; | | if (dst[5] <= F(0.0)) return false; | |
| else dst[5] = std::sqrt(F(1) / dst[5]); | | else dst[5] = std::sqrt(F(1.0) / dst[5]); | |
| return true; | | return true; | |
| } | | } | |
| }; | | }; | |
| /// struct to do a Cholesky decomposition (specialized, N = 2) | | /// struct to do a Cholesky decomposition (specialized, N = 2) | |
| template<class F, class M> struct _decomposer<F, 2, M> | | template<class F, class M> struct _decomposer<F, 2, M> | |
| { | | { | |
| /// method to do the decomposition | | /// method to do the decomposition | |
| bool operator()(F* dst, const M& src) const | | bool operator()(F* dst, const M& src) const | |
| { | | { | |
|
| if (src(0,0) <= F(0)) return false; | | if (src(0,0) <= F(0.0)) return false; | |
| dst[0] = std::sqrt(F(1) / src(0,0)); | | dst[0] = std::sqrt(F(1.0) / src(0,0)); | |
| dst[1] = src(1,0) * dst[0]; | | dst[1] = src(1,0) * dst[0]; | |
| dst[2] = src(1,1) - dst[1] * dst[1]; | | dst[2] = src(1,1) - dst[1] * dst[1]; | |
|
| if (dst[2] <= F(0)) return false; | | if (dst[2] <= F(0.0)) return false; | |
| else dst[2] = std::sqrt(F(1) / dst[2]); | | else dst[2] = std::sqrt(F(1.0) / dst[2]); | |
| return true; | | return true; | |
| } | | } | |
| }; | | }; | |
| /// struct to do a Cholesky decomposition (specialized, N = 1) | | /// struct to do a Cholesky decomposition (specialized, N = 1) | |
| template<class F, class M> struct _decomposer<F, 1, M> | | template<class F, class M> struct _decomposer<F, 1, M> | |
| { | | { | |
| /// method to do the decomposition | | /// method to do the decomposition | |
| bool operator()(F* dst, const M& src) const | | bool operator()(F* dst, const M& src) const | |
| { | | { | |
|
| if (src(0,0) <= F(0)) return false; | | if (src(0,0) <= F(0.0)) return false; | |
| dst[0] = std::sqrt(F(1) / src(0,0)); | | dst[0] = std::sqrt(F(1.0) / src(0,0)); | |
| return true; | | return true; | |
| } | | } | |
| }; | | }; | |
| /// struct to do a Cholesky decomposition (specialized, N = 0) | | /// struct to do a Cholesky decomposition (specialized, N = 0) | |
| template<class F, class M> struct _decomposer<F, 0, M> | | template<class F, class M> struct _decomposer<F, 0, M> | |
| { | | { | |
| private: | | private: | |
| _decomposer() { }; | | _decomposer() { }; | |
| bool operator()(F* dst, const M& src) const; | | bool operator()(F* dst, const M& src) const; | |
| }; | | }; | |
| | | | |
End of changes. 27 change blocks. |
| 49 lines changed or deleted | | 49 lines changed or added | |
|
| MatrixInversion.icc | | MatrixInversion.icc | |
| // @(#)root/smatrix:$Id$ | | // @(#)root/smatrix:$Id$ | |
| // Authors: CLHEP authors, L. Moneta 2006 | | // Authors: CLHEP authors, L. Moneta 2006 | |
| | | | |
| #ifndef ROOT_Math_MatrixInversion_icc | | #ifndef ROOT_Math_MatrixInversion_icc | |
| #define ROOT_Math_MatrixInversion_icc | | #define ROOT_Math_MatrixInversion_icc | |
| | | | |
| #include "Math/SVector.h" | | #include "Math/SVector.h" | |
|
| | | #include "Math/Math.h" | |
| #include <limits> | | #include <limits> | |
| | | | |
| // inversion algorithms for matrices | | // inversion algorithms for matrices | |
| // taken from CLHEP (L. Moneta May 2006) | | // taken from CLHEP (L. Moneta May 2006) | |
| | | | |
| namespace ROOT { | | namespace ROOT { | |
| | | | |
| namespace Math { | | namespace Math { | |
| | | | |
| /** General Inversion for a symmetric matrix | | /** General Inversion for a symmetric matrix | |
| | | | |
| skipping to change at line 32 | | skipping to change at line 33 | |
| /Charles F. van Loan, "Matrix Computations" (the second edition | | /Charles F. van Loan, "Matrix Computations" (the second edition | |
| has a bug.) and implemented in "lapack" | | has a bug.) and implemented in "lapack" | |
| Mario Stanke, 09/97 | | Mario Stanke, 09/97 | |
| | | | |
| */ | | */ | |
| | | | |
| template <unsigned int idim, unsigned int N> | | template <unsigned int idim, unsigned int N> | |
| template<class T> | | template<class T> | |
| void Inverter<idim,N>::InvertBunchKaufman(MatRepSym<T,idim> & rhs, int &ifa
il) { | | void Inverter<idim,N>::InvertBunchKaufman(MatRepSym<T,idim> & rhs, int &ifa
il) { | |
| | | | |
|
| | | typedef T value_type; | |
| | | //typedef double value_type; // for making inversions in double's | |
| | | | |
| int i, j, k, s; | | int i, j, k, s; | |
| int pivrow; | | int pivrow; | |
| | | | |
| const int nrow = MatRepSym<T,idim>::kRows; | | const int nrow = MatRepSym<T,idim>::kRows; | |
| | | | |
| // Establish the two working-space arrays needed: x and piv are | | // Establish the two working-space arrays needed: x and piv are | |
| // used as pointers to arrays of doubles and ints respectively, each | | // used as pointers to arrays of doubles and ints respectively, each | |
| // of length nrow. We do not want to reallocate each time through | | // of length nrow. We do not want to reallocate each time through | |
| // unless the size needs to grow. We do not want to leak memory, even | | // unless the size needs to grow. We do not want to leak memory, even | |
| // by having a new without a delete that is only done once. | | // by having a new without a delete that is only done once. | |
| | | | |
| skipping to change at line 58 | | skipping to change at line 62 | |
| | | | |
| // Note - resize shuld do nothing if the size is already larger than nr
ow, | | // Note - resize shuld do nothing if the size is already larger than nr
ow, | |
| // but on VC++ there are indications that it does so we check. | | // but on VC++ there are indications that it does so we check. | |
| // Note - the data elements in a vector are guaranteed to be contiguous, | | // Note - the data elements in a vector are guaranteed to be contiguous, | |
| // so x[i] and piv[i] are optimally fast. | | // so x[i] and piv[i] are optimally fast. | |
| mIter x = xvec.begin(); | | mIter x = xvec.begin(); | |
| // x[i] is used as helper storage, needs to have at least size nrow. | | // x[i] is used as helper storage, needs to have at least size nrow. | |
| pivIter piv = pivv.begin(); | | pivIter piv = pivv.begin(); | |
| // piv[i] is used to store details of exchanges | | // piv[i] is used to store details of exchanges | |
| | | | |
|
| double temp1, temp2; | | value_type temp1, temp2; | |
| mIter ip, mjj, iq; | | mIter ip, mjj, iq; | |
|
| double lambda, sigma; | | value_type lambda, sigma; | |
| const double alpha = .6404; // = (1+sqrt(17))/8 | | const value_type alpha = .6404; // = (1+sqrt(17))/8 | |
| // LM (04/2009) remove this useless check (it is not in LAPACK) which fa
ils inversion of | | // LM (04/2009) remove this useless check (it is not in LAPACK) which fa
ils inversion of | |
| // a matrix with values < epsilon in the diagonal | | // a matrix with values < epsilon in the diagonal | |
| // | | // | |
| //const double epsilon = 32*std::numeric_limits<T>::epsilon(); | | //const double epsilon = 32*std::numeric_limits<T>::epsilon(); | |
| // whenever a sum of two doubles is below or equal to epsilon | | // whenever a sum of two doubles is below or equal to epsilon | |
| // it is set to zero. | | // it is set to zero. | |
| // this constant could be set to zero but then the algorithm | | // this constant could be set to zero but then the algorithm | |
| // doesn't neccessarily detect that a matrix is singular | | // doesn't neccessarily detect that a matrix is singular | |
| | | | |
| for (i = 0; i < nrow; i++) | | for (i = 0; i < nrow; i++) | |
| | | | |
| skipping to change at line 437 | | skipping to change at line 441 | |
| template <unsigned int idim, unsigned int n> | | template <unsigned int idim, unsigned int n> | |
| template<class T> | | template<class T> | |
| int Inverter<idim,n>::DfactMatrix(MatRepStd<T,idim,n> & rhs, T &det, unsign
ed int *ir) { | | int Inverter<idim,n>::DfactMatrix(MatRepStd<T,idim,n> & rhs, T &det, unsign
ed int *ir) { | |
| | | | |
| if (idim != n) return -1; | | if (idim != n) return -1; | |
| | | | |
| int ifail, jfail; | | int ifail, jfail; | |
| | | | |
| typedef T* mIter; | | typedef T* mIter; | |
| | | | |
|
| double tf; | | typedef T value_type; | |
| double g1 = 1.0e-19, g2 = 1.0e19; | | //typedef double value_type; // for making inversions in double's | |
| | | | |
| | | value_type tf; | |
| | | value_type g1 = 1.0e-19, g2 = 1.0e19; | |
| | | | |
|
| double p, q, t; | | value_type p, q, t; | |
| double s11, s12; | | value_type s11, s12; | |
| | | | |
| // LM (04.09) : remove useless check on epsilon and set it to zero | | // LM (04.09) : remove useless check on epsilon and set it to zero | |
|
| const double epsilon = 0.0; | | const value_type epsilon = 0.0; | |
| //double epsilon = 8*std::numeric_limits<T>::epsilon(); | | //double epsilon = 8*std::numeric_limits<T>::epsilon(); | |
| // could be set to zero (like it was before) | | // could be set to zero (like it was before) | |
| // but then the algorithm often doesn't detect | | // but then the algorithm often doesn't detect | |
| // that a matrix is singular | | // that a matrix is singular | |
| | | | |
| int normal = 0, imposs = -1; | | int normal = 0, imposs = -1; | |
| int jrange = 0, jover = 1, junder = -1; | | int jrange = 0, jover = 1, junder = -1; | |
| ifail = normal; | | ifail = normal; | |
| jfail = jrange; | | jfail = jrange; | |
| int nxch = 0; | | int nxch = 0; | |
| | | | |
| skipping to change at line 557 | | skipping to change at line 564 | |
| | | | |
| taken from CLHEP : L. Moneta May 2006 | | taken from CLHEP : L. Moneta May 2006 | |
| */ | | */ | |
| | | | |
| template <unsigned int idim, unsigned int n> | | template <unsigned int idim, unsigned int n> | |
| template<class T> | | template<class T> | |
| int Inverter<idim,n>::DfinvMatrix(MatRepStd<T,idim,n> & rhs,unsigned int *
ir) { | | int Inverter<idim,n>::DfinvMatrix(MatRepStd<T,idim,n> & rhs,unsigned int *
ir) { | |
| | | | |
| typedef T* mIter; | | typedef T* mIter; | |
| | | | |
|
| | | typedef T value_type; | |
| | | //typedef double value_type; // for making inversions in double's | |
| | | | |
| if (idim != n) return -1; | | if (idim != n) return -1; | |
| | | | |
|
| double s31, s32; | | value_type s31, s32; | |
| double s33, s34; | | value_type s33, s34; | |
| | | | |
| mIter m11 = rhs.Array(); | | mIter m11 = rhs.Array(); | |
| mIter m12 = m11 + 1; | | mIter m12 = m11 + 1; | |
| mIter m21 = m11 + n; | | mIter m21 = m11 + n; | |
| mIter m22 = m12 + n; | | mIter m22 = m12 + n; | |
| *m21 = -(*m22) * (*m11) * (*m21); | | *m21 = -(*m22) * (*m11) * (*m21); | |
| *m12 = -(*m12); | | *m12 = -(*m12); | |
| if (n>2) { | | if (n>2) { | |
| mIter mi = rhs.Array() + 2 * n; | | mIter mi = rhs.Array() + 2 * n; | |
| mIter mii= rhs.Array() + 2 * n + 2; | | mIter mii= rhs.Array() + 2 * n + 2; | |
| | | | |
End of changes. 9 change blocks. |
| 10 lines changed or deleted | | 20 lines changed or added | |
|
| TGLFontManager.h | | TGLFontManager.h | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| enum ETextAlignV_e { kBottom, kTop, kCenterV }; | | enum ETextAlignV_e { kBottom, kTop, kCenterV }; | |
| | | | |
| private: | | private: | |
| TGLFont& operator=(const TGLFont& o); // Not implemented. | | TGLFont& operator=(const TGLFont& o); // Not implemented. | |
| | | | |
| FTFont *fFont; // FTGL font. | | FTFont *fFont; // FTGL font. | |
| TGLFontManager *fManager; // Font manager. | | TGLFontManager *fManager; // Font manager. | |
| | | | |
| Float_t fDepth; // depth of extruded fonts, enforced at render
time. | | Float_t fDepth; // depth of extruded fonts, enforced at render
time. | |
| | | | |
|
| | | template<class Char> | |
| | | void RenderHelper(const Char *txt, Double_t x, Double_t y, Double_t angl | |
| | | e, Double_t /*mgn*/) const; | |
| | | | |
| protected: | | protected: | |
| Int_t fSize; // free-type face size | | Int_t fSize; // free-type face size | |
| Int_t fFile; // free-type file name | | Int_t fFile; // free-type file name | |
| EMode fMode; // free-type FTGL class id | | EMode fMode; // free-type FTGL class id | |
| | | | |
| mutable Int_t fTrashCount; | | mutable Int_t fTrashCount; | |
| public: | | public: | |
| TGLFont(); | | TGLFont(); | |
| TGLFont(Int_t size, Int_t font, EMode mode, FTFont *f=0, TGLFontManager
*mng=0); | | TGLFont(Int_t size, Int_t font, EMode mode, FTFont *f=0, TGLFontManager
*mng=0); | |
| TGLFont(const TGLFont& o); // Not implemented. | | TGLFont(const TGLFont& o); // Not implemented. | |
| | | | |
| skipping to change at line 84 | | skipping to change at line 87 | |
| // FTGL wrapper functions | | // FTGL wrapper functions | |
| Float_t GetAscent() const; | | Float_t GetAscent() const; | |
| Float_t GetDescent() const; | | Float_t GetDescent() const; | |
| Float_t GetLineHeight() const; | | Float_t GetLineHeight() const; | |
| void MeasureBaseLineParams(Float_t& ascent, Float_t& descent, Float_t
& line_height, | | void MeasureBaseLineParams(Float_t& ascent, Float_t& descent, Float_t
& line_height, | |
| const char* txt="Xj") const; | | const char* txt="Xj") const; | |
| | | | |
| void BBox(const char* txt, | | void BBox(const char* txt, | |
| Float_t& llx, Float_t& lly, Float_t& llz, | | Float_t& llx, Float_t& lly, Float_t& llz, | |
| Float_t& urx, Float_t& ury, Float_t& urz) const; | | Float_t& urx, Float_t& ury, Float_t& urz) const; | |
|
| | | void BBox(const wchar_t* txt, | |
| | | Float_t& llx, Float_t& lly, Float_t& llz, | |
| | | Float_t& urx, Float_t& ury, Float_t& urz) const; | |
| | | | |
| void Render(const char* txt, Double_t x, Double_t y, Double_t angle, Do
uble_t mgn) const; | | void Render(const char* txt, Double_t x, Double_t y, Double_t angle, Do
uble_t mgn) const; | |
|
| | | void Render(const wchar_t* txt, Double_t x, Double_t y, Double_t angle,
Double_t mgn) const; | |
| void Render(const TString &txt) const; | | void Render(const TString &txt) const; | |
| void Render(const TString &txt, Float_t x, Float_t y, Float_t z, ETextA
lignH_e alignH, ETextAlignV_e alignV) const; | | void Render(const TString &txt, Float_t x, Float_t y, Float_t z, ETextA
lignH_e alignH, ETextAlignV_e alignV) const; | |
| | | | |
| // helper gl draw functions | | // helper gl draw functions | |
| virtual void PreRender(Bool_t autoLight=kTRUE, Bool_t lightOn=kFALSE) co
nst; | | virtual void PreRender(Bool_t autoLight=kTRUE, Bool_t lightOn=kFALSE) co
nst; | |
| virtual void PostRender() const; | | virtual void PostRender() const; | |
| | | | |
| Bool_t operator< (const TGLFont& o) const | | Bool_t operator< (const TGLFont& o) const | |
| { | | { | |
| if (fSize == o.fSize) | | if (fSize == o.fSize) | |
| | | | |
| skipping to change at line 133 | | skipping to change at line 140 | |
| typedef std::map<TGLFont, Int_t>::iterator FontMap_i; | | typedef std::map<TGLFont, Int_t>::iterator FontMap_i; | |
| | | | |
| typedef std::list<const TGLFont*> FontList_t; | | typedef std::list<const TGLFont*> FontList_t; | |
| typedef std::list<const TGLFont*>::iterator FontList_i; | | typedef std::list<const TGLFont*>::iterator FontList_i; | |
| typedef std::list<const TGLFont*>::const_iterator FontList_ci; | | typedef std::list<const TGLFont*>::const_iterator FontList_ci; | |
| | | | |
| FontMap_t fFontMap; // map of created fonts | | FontMap_t fFontMap; // map of created fonts | |
| FontList_t fFontTrash; // fonts to purge | | FontList_t fFontTrash; // fonts to purge | |
| | | | |
| static TObjArray fgFontFileArray; // map font-id to ttf-font-fi
le | | static TObjArray fgFontFileArray; // map font-id to ttf-font-fi
le | |
|
| | | // Default fonts - for gl/eve, "extended" - for gl-pad | |
| | | static Int_t fgExtendedFontStart; | |
| | | | |
| static FontSizeVec_t fgFontSizeArray; // map of valid font-size | | static FontSizeVec_t fgFontSizeArray; // map of valid font-size | |
| static Bool_t fgStaticInitDone; // global initialization flag | | static Bool_t fgStaticInitDone; // global initialization flag | |
| static void InitStatics(); | | static void InitStatics(); | |
| | | | |
| public: | | public: | |
| TGLFontManager() : fFontMap(), fFontTrash() {} | | TGLFontManager() : fFontMap(), fFontTrash() {} | |
| virtual ~TGLFontManager(); | | virtual ~TGLFontManager(); | |
| | | | |
| void RegisterFont(Int_t size, Int_t file, TGLFont::EMode mode, TGLFont
& out); | | void RegisterFont(Int_t size, Int_t file, TGLFont::EMode mode, TGLFont
& out); | |
| void RegisterFont(Int_t size, const char* name, TGLFont::EMode mode, T
GLFont& out); | | void RegisterFont(Int_t size, const char* name, TGLFont::EMode mode, T
GLFont& out); | |
| void ReleaseFont(TGLFont& font); | | void ReleaseFont(TGLFont& font); | |
| | | | |
| static TObjArray* GetFontFileArray(); | | static TObjArray* GetFontFileArray(); | |
| static FontSizeVec_t* GetFontSizeArray(); | | static FontSizeVec_t* GetFontSizeArray(); | |
| | | | |
|
| | | static Int_t GetExtendedFontStartIndex(); | |
| static Int_t GetFontSize(Int_t ds); | | static Int_t GetFontSize(Int_t ds); | |
| static Int_t GetFontSize(Int_t ds, Int_t min, Int_t max); | | static Int_t GetFontSize(Int_t ds, Int_t min, Int_t max); | |
| static const char* GetFontNameFromId(Int_t); | | static const char* GetFontNameFromId(Int_t); | |
| | | | |
| void ClearFontTrash(); | | void ClearFontTrash(); | |
| | | | |
| ClassDef(TGLFontManager, 0); // A FreeType GL font manager. | | ClassDef(TGLFontManager, 0); // A FreeType GL font manager. | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 5 change blocks. |
| 0 lines changed or deleted | | 12 lines changed or added | |
|
| TGLPadPainter.h | | TGLPadPainter.h | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| | | | |
| TGLFontManager fFM; | | TGLFontManager fFM; | |
| TGLFont fF; | | TGLFont fF; | |
| | | | |
| Int_t fVp[4]; | | Int_t fVp[4]; | |
| | | | |
| std::vector<TPoint> fPoly; | | std::vector<TPoint> fPoly; | |
| Bool_t fIsHollowArea; | | Bool_t fIsHollowArea; | |
| | | | |
| Bool_t fLocked; | | Bool_t fLocked; | |
|
| | | | |
| | | template<class Char_t> | |
| | | void DrawTextHelper(Double_t x, Double_t y, const Char_t *text, ETextMod | |
| | | e mode); | |
| public: | | public: | |
| TGLPadPainter(); | | TGLPadPainter(); | |
| | | | |
| //Final overriders for TVirtualPadPainter pure virtual functions. | | //Final overriders for TVirtualPadPainter pure virtual functions. | |
| //1. Part, which simply delegates to TVirtualX. | | //1. Part, which simply delegates to TVirtualX. | |
| //Line attributes. | | //Line attributes. | |
| Color_t GetLineColor() const; | | Color_t GetLineColor() const; | |
| Style_t GetLineStyle() const; | | Style_t GetLineStyle() const; | |
| Width_t GetLineWidth() const; | | Width_t GetLineWidth() const; | |
| | | | |
| | | | |
| skipping to change at line 95 | | skipping to change at line 98 | |
| void SetTextSize(Float_t tsize); | | void SetTextSize(Float_t tsize); | |
| void SetTextSizePixels(Int_t npixels); | | void SetTextSizePixels(Int_t npixels); | |
| | | | |
| //2. "Off-screen management" part. | | //2. "Off-screen management" part. | |
| Int_t CreateDrawable(UInt_t w, UInt_t h); | | Int_t CreateDrawable(UInt_t w, UInt_t h); | |
| void ClearDrawable(); | | void ClearDrawable(); | |
| void CopyDrawable(Int_t id, Int_t px, Int_t py); | | void CopyDrawable(Int_t id, Int_t px, Int_t py); | |
| void DestroyDrawable(); | | void DestroyDrawable(); | |
| void SelectDrawable(Int_t device); | | void SelectDrawable(Int_t device); | |
| | | | |
|
| | | //TASImage support. | |
| | | void DrawPixels(const unsigned char *pixelData, UInt_t width, UInt_t | |
| | | height, | |
| | | Int_t dstX, Int_t dstY, Bool_t enableBlending); | |
| | | | |
| void InitPainter(); | | void InitPainter(); | |
| void InvalidateCS(); | | void InvalidateCS(); | |
| void LockPainter(); | | void LockPainter(); | |
| | | | |
| void DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2); | | void DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2); | |
| void DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2)
; | | void DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2)
; | |
| | | | |
| void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBo
xMode mode); | | void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBo
xMode mode); | |
| //TPad needs double and float versions. | | //TPad needs double and float versions. | |
| void DrawFillArea(Int_t n, const Double_t *x, const Double_t *y); | | void DrawFillArea(Int_t n, const Double_t *x, const Double_t *y); | |
| | | | |
| skipping to change at line 117 | | skipping to change at line 124 | |
| //TPad needs both double and float versions of DrawPolyLine. | | //TPad needs both double and float versions of DrawPolyLine. | |
| void DrawPolyLine(Int_t n, const Double_t *x, const Double_t *y); | | void DrawPolyLine(Int_t n, const Double_t *x, const Double_t *y); | |
| void DrawPolyLine(Int_t n, const Float_t *x, const Float_t *y); | | void DrawPolyLine(Int_t n, const Float_t *x, const Float_t *y); | |
| void DrawPolyLineNDC(Int_t n, const Double_t *u, const Double_t *v); | | void DrawPolyLineNDC(Int_t n, const Double_t *u, const Double_t *v); | |
| | | | |
| //TPad needs both versions. | | //TPad needs both versions. | |
| void DrawPolyMarker(Int_t n, const Double_t *x, const Double_t *y); | | void DrawPolyMarker(Int_t n, const Double_t *x, const Double_t *y); | |
| void DrawPolyMarker(Int_t n, const Float_t *x, const Float_t *y); | | void DrawPolyMarker(Int_t n, const Float_t *x, const Float_t *y); | |
| | | | |
| void DrawText(Double_t x, Double_t y, const char *text, ETextMode mo
de); | | void DrawText(Double_t x, Double_t y, const char *text, ETextMode mo
de); | |
|
| void DrawText(Double_t, Double_t, const wchar_t *, ETextMode){} | | void DrawText(Double_t, Double_t, const wchar_t *, ETextMode); | |
| void DrawTextNDC(Double_t x, Double_t y, const char *text, ETextMode
mode); | | void DrawTextNDC(Double_t x, Double_t y, const char *text, ETextMode
mode); | |
|
| void DrawTextNDC(Double_t, Double_t, const wchar_t *, ETextMode){} | | void DrawTextNDC(Double_t, Double_t, const wchar_t *, ETextMode); | |
| | | | |
| //jpg, png, gif and bmp output. | | //jpg, png, gif and bmp output. | |
| void SaveImage(TVirtualPad *pad, const char *fileName, Int_t type) c
onst; | | void SaveImage(TVirtualPad *pad, const char *fileName, Int_t type) c
onst; | |
| | | | |
| private: | | private: | |
| | | | |
| //Attention! GL_PROJECTION will become | | //Attention! GL_PROJECTION will become | |
| //the current matrix after these calls. | | //the current matrix after these calls. | |
| void SaveProjectionMatrix()const; | | void SaveProjectionMatrix()const; | |
| void RestoreProjectionMatrix()const; | | void RestoreProjectionMatrix()const; | |
| | | | |
End of changes. 4 change blocks. |
| 2 lines changed or deleted | | 11 lines changed or added | |
|
| TParallelCoordEditor.h | | TParallelCoordEditor.h | |
| | | | |
| skipping to change at line 40 | | skipping to change at line 40 | |
| class TGedPatternSelect; | | class TGedPatternSelect; | |
| | | | |
| class TParallelCoordEditor : public TGedFrame { | | class TParallelCoordEditor : public TGedFrame { | |
| protected: | | protected: | |
| TGCompositeFrame *fVarTab; | | TGCompositeFrame *fVarTab; | |
| TParallelCoord *fParallel; | | TParallelCoord *fParallel; | |
| TGColorSelect *fGlobalLineColor; | | TGColorSelect *fGlobalLineColor; | |
| TGLineWidthComboBox *fGlobalLineWidth; | | TGLineWidthComboBox *fGlobalLineWidth; | |
| TGHSlider *fDotsSpacing; | | TGHSlider *fDotsSpacing; | |
| TGNumberEntryField *fDotsSpacingField; | | TGNumberEntryField *fDotsSpacingField; | |
|
| | | TGHSlider *fAlpha; | |
| | | TGNumberEntryField *fAlphaField; | |
| TGButtonGroup *fLineTypeBgroup; | | TGButtonGroup *fLineTypeBgroup; | |
| TGRadioButton *fLineTypePoly; | | TGRadioButton *fLineTypePoly; | |
| TGRadioButton *fLineTypeCurves; | | TGRadioButton *fLineTypeCurves; | |
| TGCheckButton *fHideAllRanges; | | TGCheckButton *fHideAllRanges; | |
| TGComboBox *fSelectionSelect; | | TGComboBox *fSelectionSelect; | |
| TGColorSelect *fSelectLineColor; | | TGColorSelect *fSelectLineColor; | |
| TGLineWidthComboBox *fSelectLineWidth; | | TGLineWidthComboBox *fSelectLineWidth; | |
| TGCheckButton *fActivateSelection; | | TGCheckButton *fActivateSelection; | |
| TGCheckButton *fShowRanges; | | TGCheckButton *fShowRanges; | |
| TGTextButton *fDeleteSelection; | | TGTextButton *fDeleteSelection; | |
| | | | |
| skipping to change at line 94 | | skipping to change at line 96 | |
| | | | |
| virtual void DoActivateSelection(Bool_t); | | virtual void DoActivateSelection(Bool_t); | |
| virtual void DoAddSelection(); | | virtual void DoAddSelection(); | |
| virtual void DoAddVariable(); | | virtual void DoAddVariable(); | |
| virtual void DoApplySelect(); | | virtual void DoApplySelect(); | |
| virtual void DoDelayDrawing(Bool_t); | | virtual void DoDelayDrawing(Bool_t); | |
| virtual void DoDeleteSelection(); | | virtual void DoDeleteSelection(); | |
| virtual void DoDeleteVar(); | | virtual void DoDeleteVar(); | |
| virtual void DoDotsSpacing(); | | virtual void DoDotsSpacing(); | |
| virtual void DoDotsSpacingField(); | | virtual void DoDotsSpacingField(); | |
|
| | | virtual void DoAlpha(); | |
| | | virtual void DoAlphaField(); | |
| virtual void DoFirstEntry(); | | virtual void DoFirstEntry(); | |
| virtual void DoGlobalLineColor(Pixel_t); | | virtual void DoGlobalLineColor(Pixel_t); | |
| virtual void DoGlobalLineWidth(Int_t); | | virtual void DoGlobalLineWidth(Int_t); | |
| virtual void DoHideAllRanges(Bool_t); | | virtual void DoHideAllRanges(Bool_t); | |
| virtual void DoHistShowBoxes(Bool_t); | | virtual void DoHistShowBoxes(Bool_t); | |
| virtual void DoHistWidth(); | | virtual void DoHistWidth(); | |
| virtual void DoHistBinning(); | | virtual void DoHistBinning(); | |
| virtual void DoHistColorSelect(Pixel_t); | | virtual void DoHistColorSelect(Pixel_t); | |
| virtual void DoHistPatternSelect(Style_t); | | virtual void DoHistPatternSelect(Style_t); | |
| virtual void DoEntriesToDraw(); | | virtual void DoEntriesToDraw(); | |
| virtual void DoLineType(); | | virtual void DoLineType(); | |
| virtual void DoLiveDotsSpacing(Int_t a); | | virtual void DoLiveDotsSpacing(Int_t a); | |
|
| | | virtual void DoLiveAlpha(Int_t a); | |
| virtual void DoLiveEntriesToDraw(); | | virtual void DoLiveEntriesToDraw(); | |
| virtual void DoLiveWeightCut(Int_t n); | | virtual void DoLiveWeightCut(Int_t n); | |
| virtual void DoNentries(); | | virtual void DoNentries(); | |
| virtual void DoPaintEntries(Bool_t); | | virtual void DoPaintEntries(Bool_t); | |
| virtual void DoSelectionSelect(const char* title); | | virtual void DoSelectionSelect(const char* title); | |
| virtual void DoSelectLineColor(Pixel_t); | | virtual void DoSelectLineColor(Pixel_t); | |
| virtual void DoSelectLineWidth(Int_t); | | virtual void DoSelectLineWidth(Int_t); | |
| virtual void DoShowRanges(Bool_t s); | | virtual void DoShowRanges(Bool_t s); | |
| virtual void DoUnApply(); | | virtual void DoUnApply(); | |
| virtual void DoVariableSelect(const char* var); | | virtual void DoVariableSelect(const char* var); | |
| | | | |
End of changes. 3 change blocks. |
| 0 lines changed or deleted | | 5 lines changed or added | |
|
| TProofLite.h | | TProofLite.h | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 37 | |
| | | | |
| class TDSet; | | class TDSet; | |
| class TList; | | class TList; | |
| class TQueryResultManager; | | class TQueryResultManager; | |
| class TDataSetManager; | | class TDataSetManager; | |
| class TProofLockPath; | | class TProofLockPath; | |
| class TProofMgr; | | class TProofMgr; | |
| class TProofQueryResult; | | class TProofQueryResult; | |
| class TServerSocket; | | class TServerSocket; | |
| class TSelector; | | class TSelector; | |
|
| | | class TPMERegexp; | |
| | | | |
| class TProofLite : public TProof { | | class TProofLite : public TProof { | |
| | | | |
| friend class TProofPlayerLite; | | friend class TProofPlayerLite; | |
| | | | |
| private: | | private: | |
| Int_t fNWorkers; // Number of workers | | Int_t fNWorkers; // Number of workers | |
| TString fSandbox; // PROOF sandbox root dir | | TString fSandbox; // PROOF sandbox root dir | |
| TString fCacheDir; // Directory containing cache of user files | | TString fCacheDir; // Directory containing cache of user files | |
| TString fQueryDir; // Directory containing query results and status | | TString fQueryDir; // Directory containing query results and status | |
| | | | |
| skipping to change at line 60 | | skipping to change at line 61 | |
| Bool_t fForkStartup; // Startup N-1 workers forking the first worker | | Bool_t fForkStartup; // Startup N-1 workers forking the first worker | |
| | | | |
| TString fVarExp; // Internal variable to pass drawing options | | TString fVarExp; // Internal variable to pass drawing options | |
| TString fSelection; // Internal variable to pass drawing options | | TString fSelection; // Internal variable to pass drawing options | |
| | | | |
| TProofLockPath *fCacheLock; // Cache dir locker | | TProofLockPath *fCacheLock; // Cache dir locker | |
| TProofLockPath *fQueryLock; // Query dir locker | | TProofLockPath *fQueryLock; // Query dir locker | |
| TQueryResultManager *fQMgr; // Query-result manager | | TQueryResultManager *fQMgr; // Query-result manager | |
| | | | |
| TDataSetManager *fDataSetManager; // Dataset manager | | TDataSetManager *fDataSetManager; // Dataset manager | |
|
| | | TDataSetManagerFile *fDataSetStgRepo; // Dataset manager for staging req | |
| | | uests | |
| | | | |
| | | TPMERegexp *fReInvalid; // Regular expression matching invalid dataset | |
| | | URIs | |
| | | | |
| static Int_t fgWrksMax; // Max number of workers | | static Int_t fgWrksMax; // Max number of workers | |
| | | | |
| TProofLite(const TProofLite &); // not implemented | | TProofLite(const TProofLite &); // not implemented | |
| void operator=(const TProofLite &); // idem | | void operator=(const TProofLite &); // idem | |
| | | | |
| Int_t CleanupSandbox(); | | Int_t CleanupSandbox(); | |
| Int_t CreateSandbox(); | | Int_t CreateSandbox(); | |
| void FindUniqueSlaves(); | | void FindUniqueSlaves(); | |
| void NotifyStartUp(const char *action, Int_t done, Int_t tot); | | void NotifyStartUp(const char *action, Int_t done, Int_t tot); | |
| Int_t SetProofServEnv(const char *ord); | | Int_t SetProofServEnv(const char *ord); | |
| Int_t InitDataSetManager(); | | Int_t InitDataSetManager(); | |
| | | | |
|
| void ResolveKeywords(TString &s, const char *logfile); | | void ResolveKeywords(TString &s, const char *ord, const char *logfile); | |
| | | | |
| void SendInputDataFile(); | | void SendInputDataFile(); | |
| void ShowDataDir(const char *dirname); | | void ShowDataDir(const char *dirname); | |
| | | | |
| protected: | | protected: | |
| TProofLite() : TProof() { } // For derived classes to use | | TProofLite() : TProof() { } // For derived classes to use | |
| | | | |
| Int_t CreateSymLinks(TList *files); | | Int_t CreateSymLinks(TList *files); | |
| Int_t Init(const char *masterurl, const char *conffile, | | Int_t Init(const char *masterurl, const char *conffile, | |
| const char *confdir, Int_t loglevel, | | const char *confdir, Int_t loglevel, | |
| | | | |
| skipping to change at line 148 | | skipping to change at line 152 | |
| TList *GetListOfQueries(Option_t *opt = ""); | | TList *GetListOfQueries(Option_t *opt = ""); | |
| Int_t Remove(const char *ref, Bool_t all); | | Int_t Remove(const char *ref, Bool_t all); | |
| | | | |
| // Dataset handling | | // Dataset handling | |
| Bool_t RegisterDataSet(const char *dsName, TFileCollection *ds, const
char *opt = ""); | | Bool_t RegisterDataSet(const char *dsName, TFileCollection *ds, const
char *opt = ""); | |
| Bool_t ExistsDataSet(const char *uri); | | Bool_t ExistsDataSet(const char *uri); | |
| TMap *GetDataSets(const char *uri = "", const char * = 0); | | TMap *GetDataSets(const char *uri = "", const char * = 0); | |
| void ShowDataSets(const char *uri = "", const char * = 0); | | void ShowDataSets(const char *uri = "", const char * = 0); | |
| TFileCollection *GetDataSet(const char *uri, const char * = 0); | | TFileCollection *GetDataSet(const char *uri, const char * = 0); | |
| Int_t RemoveDataSet(const char *uri, const char * = 0); | | Int_t RemoveDataSet(const char *uri, const char * = 0); | |
|
| | | Bool_t RequestStagingDataSet(const char *dataset); | |
| | | Bool_t CancelStagingDataSet(const char *dataset); | |
| | | TFileCollection *GetStagingStatusDataSet(const char *dataset); | |
| Int_t VerifyDataSet(const char *uri, const char * = 0); | | Int_t VerifyDataSet(const char *uri, const char * = 0); | |
| Int_t SetDataSetTreeName( const char *dataset, const char *treename); | | Int_t SetDataSetTreeName( const char *dataset, const char *treename); | |
| void ShowDataSetCache(const char *dataset = 0); | | void ShowDataSetCache(const char *dataset = 0); | |
| void ClearDataSetCache(const char *dataset = 0); | | void ClearDataSetCache(const char *dataset = 0); | |
| | | | |
| // Browsing | | // Browsing | |
| TTree *GetTreeHeader(TDSet *tdset); | | TTree *GetTreeHeader(TDSet *tdset); | |
| | | | |
| static Int_t GetNumberOfWorkers(const char *url = 0); | | static Int_t GetNumberOfWorkers(const char *url = 0); | |
| | | | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 10 lines changed or added | |
|