44 #include "ConstrainedOptPack_vector_change_stats.hpp"
45 #include "DenseLinAlgPack_DVectorClass.hpp"
46 #include "DenseLinAlgPack_AssertOp.hpp"
49 void ConstrainedOptPack::vector_change_stats(
50 const DVectorSlice& x,
const DVectorSlice& d
53 , value_type* av_term )
56 DenseLinAlgPack::VopV_assert_sizes( x.dim(), d.dim() );
58 min_num = std::numeric_limits<value_type>::min(),
59 inf = std::numeric_limits<value_type>::max();
67 DVectorSlice::const_iterator
70 for(
size_type i = 1; x_itr != x.end(); ++i, ++d_itr, ++x_itr ) {
76 term = ST::magnitude(*d_itr) / ( 1 + ST::magnitude(*x_itr) );
77 if( term > *max_term ) {
81 if( term < *min_term ) {
87 *av_term = *av_term / x.dim();