Show
Ignore:
Timestamp:
08/11/09 15:27:34 (15 years ago)
Author:
vbarta
Message:

added tests of epdf::evallog_m methods, moved them out of line

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/bdmbase.h

    r489 r502  
    296296                //! Returns a sample, \f$ x \f$ from density \f$ f_x()\f$ 
    297297                virtual vec sample() const { 
    298                         it_error ("not implemneted"); 
     298                        it_error ("not implemented"); 
    299299                        return vec (0); 
    300                 }; 
     300                } 
     301 
    301302                //! Returns N samples, \f$ [x_1 , x_2 , \ldots \ \f$  from density \f$ f_x(rv)\f$ 
    302303                virtual mat sample_m (int N) const; 
     304 
    303305                //! Compute log-probability of argument \c val 
    304306                //! In case the argument is out of suport return -Infinity 
    305307                virtual double evallog (const vec &val) const { 
    306                         it_error ("not implemneted"); 
     308                        it_error ("not implemented"); 
    307309                        return 0.0; 
    308                 }; 
     310                } 
     311 
    309312                //! Compute log-probability of multiple values argument \c val 
    310                 virtual vec evallog_m (const mat &Val) const { 
    311                         vec x (Val.cols()); 
    312                         for (int i = 0; i < Val.cols(); i++) { 
    313                                 x (i) = evallog (Val.get_col (i)) ; 
    314                         } 
    315                         return x; 
    316                 } 
     313                virtual vec evallog_m (const mat &Val) const; 
     314 
    317315                //! Compute log-probability of multiple values argument \c val 
    318                 virtual vec evallog_m (const Array<vec> &Avec) const { 
    319                         vec x (Avec.size()); 
    320                         for (int i = 0; i < Avec.size(); i++) { 
    321                                 x (i) = evallog (Avec (i)) ; 
    322                         } 
    323                         return x; 
    324                 } 
     316                virtual vec evallog_m (const Array<vec> &Avec) const; 
     317 
    325318                //! Return conditional density on the given RV, the remaining rvs will be in conditioning 
    326319                virtual mpdf* condition (const RV &rv) const  {