contrib/rpl/rrel/rrel_m_est_obj.cxx
Go to the documentation of this file.
00001 // This is rpl/rrel/rrel_m_est_obj.cxx
00002 #include "rrel_m_est_obj.h"
00003 
00004 double
00005 rrel_m_est_obj::fcn( vect_const_iter res_begin, vect_const_iter res_end,
00006                      vect_const_iter scale_begin,
00007                      vnl_vector<double>* /*param_vector*/ ) const
00008 {
00009   double sum = 0;
00010 
00011   for ( ; res_begin != res_end; ++res_begin, ++scale_begin ) {
00012     sum += rho( *res_begin / *scale_begin );
00013   }
00014 
00015   return sum;
00016 }
00017 
00018 double
00019 rrel_m_est_obj::fcn( vect_const_iter res_begin, vect_const_iter res_end,
00020                      double scale,
00021                      vnl_vector<double>* /*param_vector*/ ) const
00022 {
00023   double sum = 0;
00024 
00025   for ( ; res_begin != res_end; ++res_begin ) {
00026     sum += rho( *res_begin, scale );
00027   }
00028 
00029   return sum;
00030 }
00031 
00032 void
00033 rrel_m_est_obj::wgt( vect_const_iter res_begin, vect_const_iter res_end,
00034                      vect_const_iter scale_begin,
00035                      vect_iter wgt_begin ) const
00036 {
00037   for ( ; res_begin != res_end; ++res_begin, ++scale_begin, ++wgt_begin ) {
00038     *wgt_begin = wgt( *res_begin, *scale_begin );
00039   }
00040 }
00041 
00042 void
00043 rrel_m_est_obj::wgt( vect_const_iter res_begin, vect_const_iter res_end,
00044                      double scale,
00045                      vect_iter wgt_begin ) const
00046 {
00047   for ( ; res_begin != res_end; ++res_begin, ++wgt_begin ) {
00048     *wgt_begin = wgt( *res_begin, scale );
00049   }
00050 }