174 double* matr_row_max;
176 if ( larger < 0 || larger > _nrrows || smaller < 0 || smaller > _nrrows )
180 std::cout <<
"EmcLSSMatrix::ERROR"
181 <<
"!!! ERROR in bound check of EmcLSSMatrix !!!"
182 <<
"!!! Return zero !!!" << endl;
188 col_p = ( _columns + ( larger * _nrcol ) );
189 row_p = ( _rows + ( larger * _nrcol ) );
190 matr_p = ( _matrix + ( larger * _nrcol ) );
191 matr_row_max = ( matr_p + _nrcol );
193 while ( matr_p < matr_row_max )
198 std::cout <<
"EmcLSSMatrix::VERBOSE"
199 <<
"C: " << larger <<
" " << smaller <<
" " << col_p <<
" " << *col_p <<
" "
200 << matr_p <<
" " << *matr_p <<
" " << ( _matrix + ( matr_p - _matrix ) )
201 <<
" " << *( _matrix + ( matr_p - _matrix ) ) << endl;
210 if ( matr_p == ( matr_row_max - 1 ) )
214 std::cout <<
"EmcLSSMatrix::WARNING "
215 <<
"!! WARNING: Reached maximum number of columns "
216 <<
"in LSSMatrix when searching for row " << larger <<
" column "
217 << smaller <<
" !!" << endl
218 <<
"!! Return zero pointer !! " << endl;
225 if ( *col_p == smaller ) {
break; }
228 if ( ( *matr_p == 0. ) )
249 long int diff = matr_p - _matrix;
251 if ( matr_p == 0 ) { diff = -1; }
343 bool successful =
true;
348 long int _newIndx = 0;
350 for (
long int _arrayIndx = 0; _arrayIndx < _size; _arrayIndx++ )
356 if ( _matrix[_arrayIndx] > 0. )
359 if ( ( xRef_list[( _rows[_arrayIndx] )] ) >= 0 &&
360 ( xRef_list[( _columns[_arrayIndx] )] ) >= 0 )
362 _matrix[_newIndx] = _matrix[_arrayIndx];
363 _rows[_newIndx] = ( ( xRef_list[( _rows[_arrayIndx] )] ) + 1 );
364 _columns[_newIndx] = ( ( xRef_list[( _columns[_arrayIndx] )] ) + 1 );
371 if ( xRef_list[( _rows[_arrayIndx] )] < 0 )
375 std::cout <<
"EmcLSSMatrix::ERROR "
376 <<
"EmcLSSMatrix: Xtal index " << _rows[_arrayIndx]
377 <<
" appears in matrix, "
378 <<
"but not in vector !!! " << _rows[_arrayIndx] <<
" "
379 << _columns[_arrayIndx] << endl;
387 std::cout <<
"EmcLSSMatrix::ERROR "
388 <<
"EmcLSSMatrix: Xtal index " << _columns[_arrayIndx]
389 <<
" appears in matrix, "
390 <<
"but not in vector !!! " << _rows[_arrayIndx] <<
" "
391 << _columns[_arrayIndx] << endl;
403 std::cout <<
"EmcLSSMatrix::DEBUG "
404 <<
"Reduced LSSMatrix !!! Number of non zeros: " << _newIndx << endl;