131 OutM.setf( ios::scientific, ios::floatfield );
132 OutV.setf( ios::scientific, ios::floatfield );
133 OutV.precision( 12 );
134 OutM.precision( 12 );
136 _matrixM->writeOut( OutM );
140 double* vect_ele = _vectorR;
141 double* vect_end = _vectorR + _nXtals;
142 int* xtal_ind = _xtalInd;
144 int* hits = _xtalHits;
146 while ( vect_ele < vect_end )
148 if ( *vect_ele != 0. ) { _nXtalsHit++; }
152 OutV << _nXtalsHit <<
" ";
156 while ( vect_ele < vect_end )
158 if ( *vect_ele != 0. )
159 { OutV << *xtal_ind <<
" " << *hits <<
" " << *
hits_max <<
" " << *vect_ele <<
" "; }
169 _matrixM->readIn( InM );
171 _matrixM->print_NonZeros();
186 for (
int i = 0; i < nr_ele; i++ )
189 InV >> xtal_ind >> hits >>
hits_max >> vect_ele;
191 if ( _vectorR[xtal_ind] == 0. ) { _nXtalsHit++; }
193 _vectorR[xtal_ind] += vect_ele;
194 _xtalInd[xtal_ind] = xtal_ind;
195 _xtalHits[xtal_ind] += hits;
202 bool successful =
true;
209 int* xRef =
new int[_nXtals];
210 memset( xRef, -1, ( _nXtals *
sizeof(
int ) ) );
213 for (
int _arrayIndx = 0; _arrayIndx < _nXtals; _arrayIndx++ )
216 if ( _vectorR[_arrayIndx] > 0. )
219 _vectorR[_nXtalsHit] = _vectorR[_arrayIndx];
220 _xtalInd[_nXtalsHit] = _xtalInd[_arrayIndx];
221 _xtalHits[_nXtalsHit] = _xtalHits[_arrayIndx];
222 _xtalHitsMax[_nXtalsHit] = _xtalHitsMax[_arrayIndx];
223 xRef[_arrayIndx] = _nXtalsHit;
229 successful = _matrixM->reduce_Matrix( xRef );