Show
Ignore:
Timestamp:
01/11/10 22:55:57 (14 years ago)
Author:
mido
Message:

abstract methods restored wherever they are meaningful
macros NOT_IMPLEMENTED and NOT_IMPLEMENTED_VOID defined to make sources shorter
emix::set_parameters and mmix::set_parameters removed, corresponding acces methods created and the corresponding validate methods improved appropriately
some compilator warnings were avoided
and also a few other things cleaned up

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/stat/exp_family.h

    r763 r766  
    4444 
    4545        //!Evaluate normalized log-probability 
    46         virtual double evallog_nn ( const vec &val ) const { 
    47                 bdm_error ( "Not implemented" ); 
    48                 return 0.0; 
    49         } 
     46        virtual double evallog_nn ( const vec &val ) const NOT_IMPLEMENTED(0); 
    5047 
    5148        //!Evaluate normalized log-probability 
     
    7370 
    7471        //!Power of the density, used e.g. to flatten the density 
    75         virtual void pow ( double p ) { 
    76                 bdm_error ( "Not implemented" ); 
    77         } 
     72        virtual void pow ( double p ) NOT_IMPLEMENTED_VOID; 
    7873}; 
    7974 
     
    9287        BMEF ( const BMEF &B ) : BM ( B ), frg ( B.frg ), last_lognc ( B.last_lognc ) {} 
    9388        //!get statistics from another model 
    94         virtual void set_statistics ( const BMEF* BM0 ) { 
    95                 bdm_error ( "Not implemented" ); 
    96         } 
     89        virtual void set_statistics ( const BMEF* BM0 ) NOT_IMPLEMENTED_VOID; 
    9790 
    9891        //! Weighted update of sufficient statistics (Bayes rule) 
     
    10295 
    10396        //!Flatten the posterior according to the given BMEF (of the same type!) 
    104         virtual void flatten ( const BMEF * B ) { 
    105                 bdm_error ( "Not implemented" ); 
    106         } 
    107  
    108         BMEF* _copy_ () const { 
    109                 bdm_error ( "function _copy_ not implemented for this BM" ); 
    110                 return NULL; 
    111         } 
     97        virtual void flatten ( const BMEF * B ) NOT_IMPLEMENTED_VOID; 
     98 
     99        double logpred ( const vec &yt ) const NOT_IMPLEMENTED(0); 
     100         
     101        virtual epdf* epredictor() const NOT_IMPLEMENTED(NULL); 
     102 
     103        virtual pdf* predictor() const NOT_IMPLEMENTED(NULL); 
    112104 
    113105        void to_setting ( Setting &set ) const 
    114106        {                        
    115107                BM::to_setting( set ); 
    116                 // TODO DOPLNIT? CHYBI FROM_SETTING PRO INSPIRACI 
     108                // TODO DOPLNIT? ALE MOMENTALNE CHYBI FROM_SETTING PRO INSPIRACI 
    117109        }  
    118110}; 
     
    11121104        //! Constructor 
    11131105        migamma_ref () : migamma (), refl () {}; 
     1106         
    11141107        //! Set value of \c k 
    11151108        void set_parameters ( double k0 , vec ref0, double l0 ) { 
     
    12661259                return X*Y._Ch();// return upper triangular part of the decomposition 
    12671260        } 
     1261 
    12681262        vec sample () const { 
    12691263                return vec ( sample_mat()._data(), p*p ); 
    12701264        } 
     1265 
     1266        virtual vec mean() const NOT_IMPLEMENTED(0); 
     1267 
     1268        //! return expected variance (not covariance!) 
     1269        virtual vec variance() const NOT_IMPLEMENTED(0); 
     1270 
     1271        virtual double evallog ( const vec &val ) const NOT_IMPLEMENTED(0); 
     1272 
    12711273        //! fast access function y0 will be copied into Y.Ch. 
    12721274        void setY ( const mat &Ch0 ) { 
    12731275                copy_vector ( dim, Ch0._data(), Y._Ch()._data() ); 
    12741276        } 
     1277 
    12751278        //! fast access function y0 will be copied into Y.Ch. 
    12761279        void _setY ( const vec &ch0 ) { 
    12771280                copy_vector ( dim, ch0._data(), Y._Ch()._data() ); 
    12781281        } 
     1282 
    12791283        //! access function 
    12801284        const chmat& getY() const { 
     
    13211325                W.setY ( iCh ); 
    13221326        } 
     1327 
    13231328        virtual double evallog ( const vec &val ) const { 
    13241329                chmat X ( p ); 
     
    13451350        }; 
    13461351 
     1352        virtual vec mean() const NOT_IMPLEMENTED(0); 
     1353 
     1354        //! return expected variance (not covariance!) 
     1355        virtual vec variance() const NOT_IMPLEMENTED(0); 
    13471356}; 
    13481357 
     
    14641473 
    14651474        //! inherited operation : NOT implemented 
    1466         vec sample() const { 
    1467                 bdm_error ( "Not implemented" ); 
    1468                 return vec(); 
    1469         } 
     1475        vec sample() const NOT_IMPLEMENTED(0); 
    14701476 
    14711477        //! inherited operation : NOT implemented 
    1472         double evallog ( const vec &val ) const { 
    1473                 bdm_error ( "Not implemented" ); 
    1474                 return 0.0; 
    1475         } 
     1478        double evallog ( const vec &val ) const NOT_IMPLEMENTED(0); 
    14761479 
    14771480        vec mean() const {