42 #ifndef SPARSE_LIN_ALG_PACK_SPARSE_BOUNDS_H
43 #define SPARSE_LIN_ALG_PACK_SPARSE_BOUNDS_H
45 #include "DenseLinAlgPack_DVectorClass.hpp"
47 namespace AbstractLinAlgPack {
57 enum EBound { LOWER, UPPER, BOTH };
62 const DVectorSlice::const_iterator &bl_begin
63 ,
const DVectorSlice::const_iterator &bl_end
64 ,
const DVectorSlice::const_iterator &bu_begin
65 ,
const DVectorSlice::const_iterator &bu_end
68 :bl_itr_(bl_begin), bl_end_(bl_end), bu_itr_(bu_begin), bu_end_(bu_end)
69 ,big_bnd_(big_bnd), index_(1)
71 if( !
at_end() && ( *bl_itr_ <= -big_bnd_ && +big_bnd_ <= *bu_itr_ ) )
81 {
return bl_itr_ == bl_end_; }
84 if(!
at_end()) { ++bl_itr_; ++bu_itr_; ++index_; }
85 for( ; !
at_end() && ( *bl_itr_ <= -big_bnd_ && +big_bnd_ <= *bu_itr_ )
86 ; ++bl_itr_, ++bu_itr_, ++index_ );
101 DVectorSlice::const_iterator
102 bl_itr_, bl_end_, bu_itr_, bu_end_;
104 big_bnd_, lbound_, ubound_;
111 if( bl_itr_ == bl_end_ ) {
114 else if( -big_bnd_ < *bl_itr_ && *bu_itr_ < +big_bnd_ ) {
119 else if( -big_bnd_ < *bl_itr_ ) {
124 else if( *bu_itr_ < +big_bnd_ ) {
138 #endif // SPARSE_LIN_ALG_PACK_SPARSE_BOUNDS_H
value_type ubound() const
Iterate through a set of sparse bounds.
value_type lbound() const
const value_type & big_bnd() const
sparse_bounds_itr(const DVectorSlice::const_iterator &bl_begin, const DVectorSlice::const_iterator &bl_end, const DVectorSlice::const_iterator &bu_begin, const DVectorSlice::const_iterator &bu_end, value_type big_bnd)
sparse_bounds_itr & operator++()