Changeset 557 for library/bdm/stat/discrete.h
- Timestamp:
- 08/19/09 01:41:23 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/stat/discrete.h
r556 r557 59 59 60 60 //precompute steps 61 steps.set_size(dim); 61 62 for ( int j = 0; j < dim; j++ ) { 62 63 steps ( j ) = ( ranges ( j ) ( 1 ) - ranges(j)(0) ) / gridsizes ( j ); … … 80 81 if ( actvec_ind ( j ) == gridsizes ( j ) - 1 ) { //j-th index is full 81 82 actvec_ind ( j ) = 0; //shift back 82 actvec ( j ) = ranges ( j ) ( 0 ) ;83 actvec ( j ) = ranges ( j ) ( 0 ) + 0.5*steps(j); 83 84 84 if ( j+1<dim) { 85 actvec_ind ( j + 1 ) ++; //increase the next dimension; 86 actvec ( j + 1 ) += steps ( j + 1 ); 87 break; 88 } 85 //! 86 if ( j+1<dim) 87 if (actvec_ind ( j + 1 )<gridsizes(j+1)-1){ 88 actvec_ind ( j + 1 ) ++; //increase the next dimension; 89 actvec ( j + 1 ) += steps ( j + 1 ); 90 break; 91 } 89 92 90 93 } else { … … 95 98 } 96 99 return actvec; 97 } 98 100 } 101 //! Access function 99 102 int points() const {return Npoints;} 103 104 //! access function 105 const vec& _steps() const {return steps;} 100 106 101 107 void from_setting (const Setting &set) {