20#include "EvtGenBase/EvtPatches.hh"
27#include "EvtGenBase/EvtOrthogVector.hh"
35 std::vector<int> temp;
39 _orthogVector.push_back(0.);
43 findOrthog(_dimen,temp, vectors);
50void EvtOrthogVector::findOrthog(
int dim, std::vector<int> invect,
51 std::vector<double> *vectors) {
57 int sign=findEvenOddSwaps();
61 for (i=1; i<_dimen; i++){
62 addition*=vectors[i-1][_holder[i]];
65 _orthogVector[_holder[0]]+=addition;
74 for (i=1; i<_dimen; i++){
75 addition*=vectors[i-1][_holder[i]];
78 _orthogVector[_holder[0]]-=addition;
84 std::vector<int> temp((2*dim));
87 for (i=0; i<dim; i++) temp[i]=invect[i];
88 for (i=0; i<dim; i++) temp[i+dim]=invect[i];
90 for (i=0; i<dim; i++) {
91 _holder[dim-1]=temp[dim-1+i];
92 std::vector<int> tempDim((dim-1));
95 for (j=0; j<(dim-1); j++) tempDim[j]=temp[j+i];
96 findOrthog(dim-1, tempDim, vectors);
103int EvtOrthogVector::findEvenOddSwaps() {
105 std::vector<int> temp(_dimen);
108 for (i=0; i<_dimen; i++) temp[i]=_holder[i];
111 for (i=0; i<(_dimen-1); i++) {
112 for (j=i+1; j<_dimen; j++) {
114 if ( temp[i]>temp[j] ) {
124 if ( nSwap )
return -1;
EvtOrthogVector(int n, std::vector< double > *vectors)