Changeset 565

Show
Ignore:
Timestamp:
08/19/09 16:54:24 (15 years ago)
Author:
vbarta
Message:

using own error macros (basically copied from IT++, but never aborting)

Location:
library
Files:
2 added
39 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/CMakeLists.txt

    r508 r565  
    1212SET(bdm_mex mex/mex_datasource.h mex/mex_parser.h mex/mex_logger.h  ) 
    1313 
    14 SET(bdm_support bdmroot.cpp bdmroot.h itpp_ext.cpp itpp_ext.h osutils.cpp osutils.h shared_ptr.h) 
     14SET(bdm_support bdmerror.cpp bdmerror.h bdmroot.cpp bdmroot.h itpp_ext.cpp itpp_ext.h osutils.cpp osutils.h shared_ptr.h) 
    1515 
    1616IF(WIN32) 
  • library/bdm/base/bdmbase.cpp

    r545 r565  
    4242        } else { 
    4343                id = iter->second; 
    44                 it_assert ( RV_SIZES ( id ) == size, "RV " + name + " of different size already exists" ); 
     44                bdm_assert_debug ( RV_SIZES ( id ) == size, "RV " + name + " of different size already exists" ); 
    4545        } 
    4646        return id; 
     
    6767void RV::init ( const Array<std::string> &in_names, const ivec &in_sizes, const ivec &in_times ) { 
    6868        len = in_names.length(); 
    69         it_assert_debug ( in_names.length() == in_times.length(), "check \"times\" " ); 
    70         it_assert_debug ( in_names.length() == in_sizes.length(), "check \"sizes\" " ); 
     69        bdm_assert_debug ( in_names.length() == in_times.length(), "check \"times\" " ); 
     70        bdm_assert_debug ( in_names.length() == in_sizes.length(), "check \"sizes\" " ); 
    7171 
    7272        times.set_length ( len ); 
     
    135135 
    136136shared_ptr<mpdf> epdf::condition (const RV &rv) const { 
    137         it_warning ("Not implemented"); 
     137        bdm_warning ("Not implemented"); 
    138138        return shared_ptr<mpdf>(); 
    139139} 
    140140 
    141141shared_ptr<epdf> epdf::marginal (const RV &rv) const { 
    142         it_warning ("Not implemented"); 
     142        bdm_warning ("Not implemented"); 
    143143        return shared_ptr<epdf>(); 
    144144} 
     
    194194        v2v_up = rv.dataind (rv_up); 
    195195 
    196         it_assert_debug (v2v_up.length() == downsize, "rv is not fully in rv_up"); 
     196        bdm_assert_debug (v2v_up.length() == downsize, "rv is not fully in rv_up"); 
    197197} 
    198198 
     
    202202        v2v_up = upind; 
    203203 
    204         it_assert_debug (v2v_up.length() == downsize, "rv is not fully in rv_up"); 
     204        bdm_assert_debug (v2v_up.length() == downsize, "rv is not fully in rv_up"); 
    205205} 
    206206 
     
    219219 
    220220void datalink_m2e::pushup_cond (vec &val_up, const vec &val, const vec &cond) { 
    221         it_assert_debug (downsize == val.length(), "Wrong val"); 
    222         it_assert_debug (upsize == val_up.length(), "Wrong val_up"); 
     221        bdm_assert_debug (downsize == val.length(), "Wrong val"); 
     222        bdm_assert_debug (upsize == val_up.length(), "Wrong val_up"); 
    223223        set_subvector (val_up, v2v_up, val); 
    224224        set_subvector (val_up, v2c_up, cond); 
     
    259259                } 
    260260        } 
    261         it_assert_debug ( res.length() == dsize, "this rv is not fully present in crv!" ); 
     261 
     262        bdm_assert_debug ( res.length() == dsize, "this rv is not fully present in crv!" ); 
    262263        return res; 
    263264 
     
    294295                } 
    295296        } 
    296         it_assert_debug ( selfi.length() == rv2i.length(), "this should not happen!" ); 
     297        bdm_assert_debug ( selfi.length() == rv2i.length(), "this should not happen!" ); 
    297298} 
    298299 
     
    322323void RV::from_setting ( const Setting &set ) { 
    323324        Array<string> A; 
    324         it_assert ( !A.length(), "default array not empty" ); 
    325325        UI::get ( A, set, "names" ); 
    326326 
     
    356356                rvaddok = rv.add ( mpdfs ( i )->_rv() ); //add rv to common rvs. 
    357357                // If rvaddok==false, mpdfs overlap => assert error. 
    358                 it_assert_debug ( rvaddok || !checkoverlap, "mprod::mprod() input mpdfs overlap in rv!" ); 
     358                bdm_assert_debug ( rvaddok || !checkoverlap, "mprod::mprod() input mpdfs overlap in rv!" ); 
    359359        } 
    360360 
  • library/bdm/base/bdmbase.h

    r545 r565  
    4444                //!Default constructor 
    4545                str (ivec ids0, ivec times0) : ids (ids0), times (times0) { 
    46                         it_assert_debug (times0.length() == ids0.length(), "Incompatible input"); 
     46                        bdm_assert_debug (times0.length() == ids0.length(), "Incompatible input"); 
    4747                }; 
    4848}; 
     
    298298                //! Returns a sample, \f$ x \f$ from density \f$ f_x()\f$ 
    299299                virtual vec sample() const { 
    300                         it_error ("not implemented"); 
    301                         return vec (0); 
     300                        bdm_error ("not implemented"); 
     301                        return vec(); 
    302302                } 
    303303 
     
    308308                //! In case the argument is out of suport return -Infinity 
    309309                virtual double evallog (const vec &val) const { 
    310                         it_error ("not implemented"); 
     310                        bdm_error ("not implemented"); 
    311311                        return 0.0; 
    312312                } 
     
    326326                //! return expected value 
    327327                virtual vec mean() const { 
    328                         it_error ("not implemneted"); 
    329                         return vec (0); 
    330                 }; 
     328                        bdm_error ("not implemneted"); 
     329                        return vec(); 
     330                } 
    331331 
    332332                //! return expected variance (not covariance!) 
    333333                virtual vec variance() const { 
    334                         it_error ("not implemneted"); 
    335                         return vec (0); 
    336                 }; 
     334                        bdm_error ("not implemneted"); 
     335                        return vec(); 
     336                } 
     337 
    337338                //! Lower and upper bounds of \c percentage % quantile, returns mean-2*sigma as default 
    338339                virtual void qbounds (vec &lb, vec &ub, double percentage = 0.95) const { 
     
    353354                void set_rv (const RV &rv0) { 
    354355                        rv = rv0; 
    355                 }   //it_assert_debug(isnamed(),""); }; 
     356                } 
     357 
    356358                //! True if rv is assigned 
    357359                bool isnamed() const { 
     
    359361                        return b; 
    360362                } 
     363 
    361364                //! Return name (fails when isnamed is false) 
    362365                const RV& _rv() const { 
    363                         it_assert_debug (isnamed(), ""); 
     366                        bdm_assert_debug (isnamed(), ""); 
    364367                        return rv; 
    365368                } 
     
    425428 
    426429                //! Returns a sample from the density conditioned on \c cond, \f$x \sim epdf(rv|cond)\f$. \param cond is numeric value of \c rv 
    427                 virtual vec samplecond (const vec &cond) {it_error ("Not implemented");return vec (0);}; 
     430                virtual vec samplecond (const vec &cond) { 
     431                        bdm_error ("Not implemented"); 
     432                        return vec(); 
     433                } 
    428434 
    429435                //! Returns \param N samples from the density conditioned on \c cond, \f$x \sim epdf(rv|cond)\f$. \param cond is numeric value of \c rv 
     
    431437 
    432438                //! Shortcut for conditioning and evaluation of the internal epdf. In some cases,  this operation can be implemented efficiently. 
    433                 virtual double evallogcond (const vec &dt, const vec &cond) {it_error ("Not implemented");return 0.0;} 
     439                virtual double evallogcond (const vec &dt, const vec &cond) { 
     440                        bdm_error ("Not implemented"); 
     441                        return 0.0; 
     442                } 
    434443 
    435444                //! Matrix version of evallogcond 
     
    441450 
    442451                //! Array<vec> version of evallogcond 
    443                 virtual vec evallogcond_m (const Array<vec> &Dt, const vec &cond) {it_error ("Not implemented");return vec (0);} 
     452                virtual vec evallogcond_m (const Array<vec> &Dt, const vec &cond) { 
     453                        bdm_error ("Not implemented"); 
     454                        return vec(); 
     455                } 
    444456 
    445457                //! \name Access to attributes 
     
    497509                //! constructor 
    498510                mpdf_internal() : mpdf(), iepdf() {set_ep (iepdf);} 
     511 
    499512                //! Update \c iepdf so that it represents this mpdf conditioned on \c rvc = cond 
    500513                //! This function provides convenient reimplementation in offsprings 
    501514                virtual void condition (const vec &cond) { 
    502                         it_error ("Not implemented"); 
    503                 }; 
     515                        bdm_error ("Not implemented"); 
     516                } 
     517 
    504518                //!access function to iepdf 
    505519                EPDF& e() {return iepdf;} 
     
    571585                //! Get val for myself from val of "Up" 
    572586                vec pushdown (const vec &val_up) { 
    573                         it_assert_debug (upsize == val_up.length(), "Wrong val_up"); 
     587                        bdm_assert_debug (upsize == val_up.length(), "Wrong val_up"); 
    574588                        return get_vec (val_up, v2v_up); 
    575589                } 
     
    577591                //! Fill val of "Up" by my pieces 
    578592                void pushup (vec &val_up, const vec &val) { 
    579                         it_assert_debug (downsize == val.length(), "Wrong val"); 
    580                         it_assert_debug (upsize == val_up.length(), "Wrong val_up"); 
     593                        bdm_assert_debug (downsize == val.length(), "Wrong val"); 
     594                        bdm_assert_debug (upsize == val_up.length(), "Wrong val_up"); 
    581595                        set_subvector (val_up, v2v_up, val); 
    582596                } 
     
    628642                        //establish c2c connection 
    629643                        rvc.dataind (rvc_up, c2c_lo, c2c_up); 
    630                         it_assert_debug (c2c_lo.length() + v2c_lo.length() == condsize, "cond is not fully given"); 
     644                        bdm_assert_debug (c2c_lo.length() + v2c_lo.length() == condsize, "cond is not fully given"); 
    631645                } 
    632646 
     
    746760                //! default constructors 
    747761                DS() : Drv(), Urv() {}; 
     762 
    748763                //! Returns full vector of observed data=[output, input] 
    749764                virtual void getdata (vec &dt) { 
    750                         it_error ("abstract class"); 
    751                 }; 
     765                        bdm_error ("abstract class"); 
     766                } 
     767 
    752768                //! Returns data records at indeces. 
    753769                virtual void getdata (vec &dt, const ivec &indeces) { 
    754                         it_error ("abstract class"); 
    755                 }; 
     770                        bdm_error ("abstract class"); 
     771                } 
     772 
    756773                //! Accepts action variable and schedule it for application. 
    757774                virtual void write (vec &ut) { 
    758                         it_error ("abstract class"); 
    759                 }; 
     775                        bdm_error ("abstract class"); 
     776                } 
     777 
    760778                //! Accepts action variables at specific indeces 
    761779                virtual void write (vec &ut, const ivec &indeces) { 
    762                         it_error ("abstract class"); 
    763                 }; 
     780                        bdm_error ("abstract class"); 
     781                } 
    764782 
    765783                //! Moves from \f$ t \f$ to \f$ t+1 \f$, i.e. perfroms the actions and reads response of the system. 
     
    768786                //! Register DS for logging into logger L 
    769787                virtual void log_add (logger &L) { 
    770                         it_assert_debug (dtsize == Drv._dsize(), ""); 
    771                         it_assert_debug (utsize == Urv._dsize(), ""); 
     788                        bdm_assert_debug (dtsize == Drv._dsize(), "invalid DS: dtsize different from Drv"); 
     789                        bdm_assert_debug (utsize == Urv._dsize(), "invalid DS: utsize different from Urv"); 
    772790 
    773791                        L_dt = L.add (Drv, ""); 
     
    857875                //! I.e. marginal likelihood of the data with the posterior integrated out. 
    858876                virtual double logpred (const vec &dt) const { 
    859                         it_error ("Not implemented"); 
     877                        bdm_error ("Not implemented"); 
    860878                        return 0.0; 
    861879                } 
     880 
    862881                //! Matrix version of logpred 
    863882                vec logpred_m (const mat &dt) const { 
     
    871890                //!Constructs a predictive density \f$ f(d_{t+1} |d_{t}, \ldots d_{0}) \f$ 
    872891                virtual epdf* epredictor() const { 
    873                         it_error ("Not implemented"); 
     892                        bdm_error ("Not implemented"); 
    874893                        return NULL; 
    875894                }; 
    876895                //!Constructs conditional density of 1-step ahead predictor \f$ f(d_{t+1} |d_{t+h-1}, \ldots d_{t}) \f$ 
    877896                virtual mpdf* predictor() const { 
    878                         it_error ("Not implemented"); 
     897                        bdm_error ("Not implemented"); 
    879898                        return NULL; 
    880899                }; 
     
    895914                //! Substitute \c val for \c rvc. 
    896915                virtual void condition (const vec &val) { 
    897                         it_error ("Not implemented!"); 
    898                 }; 
     916                        bdm_error ("Not implemented!"); 
     917                } 
    899918 
    900919                //!@} 
     
    10021021        condition (cond); 
    10031022        tmp = iepdf.evallog (dt); 
    1004         // it_assert_debug(std::isfinite(tmp), "Infinite value"); 
    10051023        return tmp; 
    10061024} 
  • library/bdm/base/datasources.cpp

    r527 r565  
    77        int i; 
    88 
    9         it_assert_debug ( dt.length() == rowid.length(), "MemDS:getdata incompatible dt" ); 
     9        bdm_assert_debug ( dt.length() == rowid.length(), "MemDS:getdata incompatible dt" ); 
    1010        for ( i = 0; i < rowid.length(); i++ ) { 
    1111                dt ( i ) = Data ( rowid ( i ), time - delays ( i ) ); 
     
    1515void MemDS::getdata ( vec &dt, const ivec &indeces ) { 
    1616        int j, i; 
    17         it_assert_debug ( dt.length() == indeces.length(), "MemDS:getdata incompatible dt" ); 
     17        bdm_assert_debug ( dt.length() == indeces.length(), "MemDS:getdata incompatible dt" ); 
    1818        for ( i = 0; i < indeces.length(); i++ ) { 
    1919                j = indeces ( i ); 
     
    2929 
    3030void MemDS::set_rvs ( RV &drv, RV &urv ) { 
    31         it_assert_debug ( drv._dsize() == rowid.length(), "MemDS::set_rvs incompatible drv" ); 
    32         it_assert_debug ( urv._dsize() == 0, "MemDS does not support urv." ); 
     31        bdm_assert_debug ( drv._dsize() == rowid.length(), "MemDS::set_rvs incompatible drv" ); 
     32        bdm_assert_debug ( urv._dsize() == 0, "MemDS does not support urv." ); 
    3333 
    3434        Drv = drv; 
     
    3636 
    3737MemDS::MemDS ( mat &Dat, ivec &rowid0, ivec &delays0 ) : rowid ( rowid0 ), delays ( delays0 ) { 
    38         it_assert_debug ( max ( rowid ) <= Dat.rows(), "MemDS rowid is too high for given Dat." ); 
    39         it_assert_debug ( max ( delays ) < Dat.cols(), "MemDS delays are too high." ); 
     38        bdm_assert_debug ( max ( rowid ) <= Dat.rows(), "MemDS rowid is too high for given Dat." ); 
     39        bdm_assert_debug ( max ( delays ) < Dat.cols(), "MemDS delays are too high." ); 
    4040 
    4141        time = max ( delays ); 
  • library/bdm/base/datasources.h

    r529 r565  
    4242        void getdata ( vec &dt, const ivec &indeces ); 
    4343        void set_rvs ( RV &drv, RV &urv ); 
     44 
    4445        void write ( vec &ut ) { 
    45                 it_error ( "MemDS::write is not supported" ); 
    46         } 
     46                bdm_error ( "MemDS::write is not supported" ); 
     47        } 
     48 
    4749        void write ( vec &ut, ivec &indices ) { 
    48                 it_error ( "MemDS::write is not supported" ); 
    49         } 
     50                bdm_error ( "MemDS::write is not supported" ); 
     51        } 
     52 
    5053        void step(); 
    5154        //!Default constructor 
     
    6164public: 
    6265        void getdata ( vec &dt ) { 
    63                 it_assert_debug ( dt.length() == Data.rows(), "" ); 
    6466                dt = Data.get_col ( time ); 
    65         }; 
    66         void getdata ( vec &dt, const ivec &indeces ) { 
    67                 it_assert_debug ( dt.length() == indeces.length(), "" ); 
    68                 vec tmp ( indeces.length() ); 
    69                 tmp = Data.get_col ( time ); 
    70                 dt = tmp ( indeces ); 
    71         }; 
     67        } 
     68 
     69        void getdata ( vec &dt, const ivec &indices ) { 
     70                vec tmp = Data.get_col ( time ); 
     71                dt = tmp ( indices ); 
     72        } 
     73 
    7274        //! returns number of data in the file; 
    7375        int ndat() { 
     
    151153public: 
    152154        void getdata ( vec &dt ) { 
    153                 //it_assert_debug ( dt.length() ==Drv.count(),"ArxDS" ); 
    154155                dt = H; 
    155         }; 
     156        } 
     157 
    156158        void getdata ( vec &dt, const ivec &indices ) { 
    157                 it_assert_debug ( dt.length() == indices.length(), "ArxDS" ); 
    158159                dt = H ( indices ); 
    159         }; 
     160        } 
     161 
    160162        void write ( vec &ut ) { 
    161                 //it_assert_debug ( ut.length() ==Urv.count(),"ArxDS" ); 
    162163                U = ut; 
    163         }; 
     164        } 
     165 
    164166        void write ( vec &ut, const ivec &indices ) { 
    165                 it_assert_debug ( ut.length() == indices.length(), "ArxDS" ); 
     167                bdm_assert_debug ( ut.length() == indices.length(), "ArxDS" ); 
    166168                set_subvector ( U, indices, ut ); 
    167         }; 
     169        } 
     170 
    168171        void step(); 
     172 
    169173        //!Default constructor 
    170174        ArxDS ( ) {}; 
     
    288292                dt0 = dt; 
    289293        } 
    290         void getdata ( vec &dt0, const ivec &indeces ) { 
    291                 dt0 = dt ( indeces ); 
     294 
     295        void getdata ( vec &dt0, const ivec &indices ) { 
     296                dt0 = dt ( indices ); 
    292297        } 
    293298 
  • library/bdm/base/loggers.cpp

    r554 r565  
    127127        char filename[200]; 
    128128 
    129         it_assert_debug ( Len <= maxlen, "diffilelog" ); 
     129        bdm_assert_debug ( Len <= maxlen, "diffilelog::write_buffers: Len too large" ); 
    130130 
    131131        ii = 0; 
  • library/bdm/base/loggers.h

    r551 r565  
    4545        void step() { 
    4646                if ( ind < maxlen ) ind++; 
    47                 else it_error ( "memlog::ind is too high;" ); 
     47                else bdm_error ( "memlog::ind is too high;" ); 
    4848        } 
     49 
    4950        void logit ( int id, const vec &v ) { 
    50                 it_assert_debug ( id < vectors.length(), "Logger was not initialized, run init()." ); 
     51                bdm_assert_debug ( id < vectors.length(), "Logger was not initialized, run init()." ); 
    5152                if ( id >= 0 ) { 
    5253                        vectors ( id ).set_row ( ind, v ); 
     
    5455        } 
    5556        void logit ( int id, const double &d ) { 
    56                 it_assert_debug ( id < vectors.length(), "Logger was not initialized, run init()." ); 
    57                 it_assert_debug ( vectors ( id ).cols() == 1, "Vector expected" ); 
     57                bdm_assert_debug ( id < vectors.length(), "Logger was not initialized, run init()." ); 
     58                bdm_assert_debug ( vectors ( id ).cols() == 1, "Vector expected" ); 
    5859                if ( id >= 0 ) { 
    5960                        vectors ( id ) ( ind ) = d; 
  • library/bdm/base/user_info.cpp

    r540 r565  
    3333                setAutoConvert ( true ); 
    3434        } catch ( FileIOException f ) { 
    35                 it_error ( "UI error: file " + file_name + " not found." ); 
     35                string msg = "UI error: file "; 
     36                msg += file_name; 
     37                msg += " not found."; 
     38                bdm_error ( msg ); 
    3639        } catch ( ParseException& P ) { 
    3740                stringstream msg; 
    3841                msg << "UI error: parsing error """ << P.getError() << """ in file " << file_name << " on line " <<  P.getLine() << "."; 
    39                 it_error ( msg.str() ); 
     42                bdm_error ( msg.str() ); 
    4043        } 
    4144} 
     
    4649                writeFile ( file_name.c_str() ); 
    4750        } catch ( FileIOException f ) { 
    48                 it_error ( "UI error: file " + file_name + " is inacessible." ); 
     51                string msg = "UI error: file "; 
     52                msg += file_name; 
     53                msg += " is inacessible."; 
     54                bdm_error ( msg ); 
    4955        } 
    5056} 
     
    94100                msg << "There is not any registered class yet!" << endl; 
    95101 
    96         it_error ( msg.str() ); 
     102        bdm_error ( msg.str() ); 
    97103} 
    98104 
  • library/bdm/base/user_info.h

    r544 r565  
    321321 
    322322                root *typeless_instance = related_UI.new_instance(); 
    323                 it_assert_debug ( typeless_instance, "UI::new_instance failed" ); 
     323                bdm_assert_debug ( typeless_instance, "UI::new_instance failed" ); 
    324324 
    325325                instance = dynamic_cast<T*> ( typeless_instance ); 
     
    351351                T *tmp_inst = 0; 
    352352                from_setting ( tmp_inst, element ); 
    353                 it_assert_debug ( tmp_inst, "UI::from_setting failed" ); 
     353                bdm_assert_debug ( tmp_inst, "UI::from_setting failed" ); 
    354354                instance = tmp_inst; 
    355355        } 
  • library/bdm/design/ctrlbase.cpp

    r508 r565  
    88        dimu = B0.cols(); 
    99 
    10         it_assert_debug ( A0.cols() == dimx, "LQG: A is not square" ); 
    11         it_assert_debug ( B0.rows() == dimx, "LQG: B is not compatible" ); 
    12         it_assert_debug ( C0.cols() == dimx, "LQG: C is not square" ); 
     10        bdm_assert_debug ( A0.cols() == dimx, "LQG: A is not square" ); 
     11        bdm_assert_debug ( B0.rows() == dimx, "LQG: B is not compatible" ); 
     12        bdm_assert_debug ( C0.cols() == dimx, "LQG: C is not square" ); 
    1313 
    1414        A=A0; 
     
    2020 
    2121void LQG::set_control_parameters(const mat &Qy0, const mat &Qu0, const vec y_req0, int horizon0){ 
    22         it_assert_debug ( Qy0.cols() == dimy, "LQG: wrong dimensions of Qy " ); 
    23         it_assert_debug ( Qu0.cols() == dimu, "LQG: wrong dimensions of Qu " ); 
    24         it_assert_debug ( y_req0.length() == dimy, "LQG: wrong dimensions of y_req " ); 
     22        bdm_assert_debug ( Qy0.cols() == dimy, "LQG: wrong dimensions of Qy " ); 
     23        bdm_assert_debug ( Qu0.cols() == dimu, "LQG: wrong dimensions of Qu " ); 
     24        bdm_assert_debug ( y_req0.length() == dimy, "LQG: wrong dimensions of y_req " ); 
    2525 
    2626        Qy=Qy0; 
  • library/bdm/design/ctrlbase.h

    r508 r565  
    1919        public: 
    2020                //! Redesign control strategy  
    21                 virtual void redesign(){it_error("Not implemented"); }; 
     21                virtual void redesign() { 
     22                        bdm_error("Not implemented"); 
     23                } 
     24 
    2225                //! apply control strategy to obtain control input 
    23                 virtual vec apply(const vec &cond){it_error("Not implemented"); return vec(0);} 
     26                virtual vec apply(const vec &cond) { 
     27                        bdm_error("Not implemented"); 
     28                        return vec(); 
     29                } 
    2430}; 
    2531 
     
    8995                        pre_qr.set_submatrix(0,0,s*pr); 
    9096                        pre_qr.set_submatrix(dimx+dimu+dimy, dimu+dimx, -Qy*y_req); 
    91                         if (!qr(pre_qr,post_qr)) it_warning("QR in LQG unstable"); 
     97                        if (!qr(pre_qr,post_qr)) bdm_warning("QR in LQG unstable"); 
    9298                        triu(post_qr); 
    9399        // hn(m+1:2*m+n+r,m+1:2*m+n+r); 
  • library/bdm/estim/arx.cpp

    r527 r565  
    5454        const ARX* A0 = dynamic_cast<const ARX*> ( B0 ); 
    5555 
    56         it_assert_debug ( V.rows() == A0->V.rows(), "ARX::set_statistics Statistics  differ" ); 
     56        bdm_assert_debug ( V.rows() == A0->V.rows(), "ARX::set_statistics Statistics  differ" ); 
    5757        set_statistics ( A0->dimx, A0->V, A0->nu ); 
    5858} 
     
    8080        int dim = est.dimension(); 
    8181        int dif = V.rows() - dim ;///<----------- TODO 
    82         it_assert_debug ( ( dif == 0 ) || ( dif == 1 ), "Give RVs do not match" ); 
     82        bdm_assert_debug ( ( dif == 0 ) || ( dif == 1 ), "Give RVs do not match" ); 
    8383 
    8484        mat mu ( dim, V.rows() - dim ); 
     
    103103        int dim = est.dimension(); 
    104104        int dif = V.rows() - est.dimension();//-------------TODO 
    105         it_assert_debug ( ( dif == 0 ) || ( dif == 1 ), "Give RVs do not match" ); 
     105        bdm_assert_debug ( ( dif == 0 ) || ( dif == 1 ), "Give RVs do not match" ); 
    106106 
    107107        mat mu ( dim, V.rows() - dim ); 
  • library/bdm/estim/arx.h

    r536 r565  
    9898        //! Predictor for empty regressor 
    9999        enorm<ldmat>* epredictor() const { 
    100                 it_assert_debug ( dimx == V.rows() - 1, "Regressor is not only 1" ); 
     100                bdm_assert_debug ( dimx == V.rows() - 1, "Regressor is not only 1" ); 
    101101                return epredictor ( vec_1 ( 1.0 ) ); 
    102102        } 
     
    120120                drv = drv0; 
    121121        } 
     122 
    122123        RV& get_yrv() { 
    123124                //if yrv is not ready create it 
     
    130131                } 
    131132                //yrv should be ready by now 
    132                 it_assert_debug ( _yrv._dsize() == dimx, "incompatible drv" ); 
     133                bdm_assert_debug ( _yrv._dsize() == dimx, "incompatible drv" ); 
    133134                return _yrv; 
    134135        } 
  • library/bdm/estim/kalman.cpp

    r527 r565  
    1111        dimy = C0.rows(); 
    1212 
    13         it_assert_debug ( A0.cols() == dimx, "KalmanFull: A is not square" ); 
    14         it_assert_debug ( B0.rows() == dimx, "KalmanFull: B is not compatible" ); 
    15         it_assert_debug ( C0.cols() == dimx, "KalmanFull: C is not square" ); 
    16         it_assert_debug ( ( D0.rows() == dimy ) || ( D0.cols() == dimu ),       "KalmanFull: D is not compatible" ); 
    17         it_assert_debug ( ( Q0.cols() == dimx ) || ( Q0.rows() == dimx ), "KalmanFull: Q is not compatible" ); 
    18         it_assert_debug ( ( R0.cols() == dimy ) || ( R0.rows() == dimy ), "KalmanFull: R is not compatible" ); 
     13        bdm_assert_debug ( A0.cols() == dimx, "KalmanFull: A is not square" ); 
     14        bdm_assert_debug ( B0.rows() == dimx, "KalmanFull: B is not compatible" ); 
     15        bdm_assert_debug ( C0.cols() == dimx, "KalmanFull: C is not square" ); 
     16        bdm_assert_debug ( ( D0.rows() == dimy ) || ( D0.cols() == dimu ), "KalmanFull: D is not compatible" ); 
     17        bdm_assert_debug ( ( Q0.cols() == dimx ) || ( Q0.rows() == dimx ), "KalmanFull: Q is not compatible" ); 
     18        bdm_assert_debug ( ( R0.cols() == dimy ) || ( R0.rows() == dimy ), "KalmanFull: R is not compatible" ); 
    1919 
    2020        A = A0; 
     
    3232 
    3333void KalmanFull::bayes ( const vec &dt ) { 
    34         it_assert_debug ( dt.length() == ( dimy + dimu ), "KalmanFull::bayes wrong size of dt" ); 
     34        bdm_assert_debug ( dt.length() == ( dimy + dimu ), "KalmanFull::bayes wrong size of dt" ); 
    3535 
    3636        vec u = dt.get ( dimy, dimy + dimu - 1 ); 
     
    8686 
    8787void EKFfull::bayes ( const vec &dt ) { 
    88         it_assert_debug ( dt.length() == ( dimy + dimu ), "KalmanFull::bayes wrong size of dt" ); 
     88        bdm_assert_debug ( dt.length() == ( dimy + dimu ), "EKFull::bayes wrong size of dt" ); 
    8989 
    9090        vec u = dt.get ( dimy, dimy + dimu - 1 ); 
     
    142142        preA.set_submatrix ( dimy, dimy, ( _P._Ch() ) *A.T() ); 
    143143 
    144 //      if ( !qr ( preA,Q,postA ) ) it_warning ( "QR in kalman unstable!" ); 
    145144        if ( !qr ( preA, postA ) ) { 
    146                 it_warning ( "QR in kalman unstable!" ); 
     145                bdm_warning ( "QR in KalmanCh unstable!" ); 
    147146        } 
    148147 
     
    217216//      cout << "_mu:" << _mu <<endl; 
    218217 
    219 //      if ( !qr ( preA,Q,postA ) ) it_warning ( "QR in kalman unstable!" ); 
    220218        if ( !qr ( preA, postA ) ) { 
    221                 it_warning ( "QR in kalman unstable!" ); 
     219                bdm_warning ( "QR in EKFCh unstable!" ); 
    222220        } 
    223221 
  • library/bdm/estim/kalman.h

    r536 r565  
    286286public: 
    287287        void condition ( const vec &QR ) { 
    288                 it_assert_debug ( QR.length() == ( dimx + dimy ), "KFcondRQ: conditioning by incompatible vector" ); 
     288                bdm_assert_debug ( QR.length() == ( dimx + dimy ), "KFcondQR: conditioning by incompatible vector" ); 
    289289 
    290290                Q.setD ( QR ( 0, dimx - 1 ) ); 
     
    304304 
    305305        void condition ( const vec &R0 ) { 
    306                 it_assert_debug ( R0.length() == ( dimy ), "KFcondR: conditioning by incompatible vector" ); 
     306                bdm_assert_debug ( R0.length() == ( dimy ), "KFcondR: conditioning by incompatible vector" ); 
    307307 
    308308                R.setD ( R0 ); 
     
    338338        dimu = B0.cols(); 
    339339 
    340         it_assert_debug ( A0.cols() == dimx, "Kalman: A is not square" ); 
    341         it_assert_debug ( B0.rows() == dimx, "Kalman: B is not compatible" ); 
    342         it_assert_debug ( C0.cols() == dimx, "Kalman: C is not square" ); 
    343         it_assert_debug ( ( D0.rows() == dimy ) || ( D0.cols() == dimu ),       "Kalman: D is not compatible" ); 
    344         it_assert_debug ( ( R0.cols() == dimy ) || ( R0.rows() == dimy ), "Kalman: R is not compatible" ); 
    345         it_assert_debug ( ( Q0.cols() == dimx ) || ( Q0.rows() == dimx ), "Kalman: Q is not compatible" ); 
     340        bdm_assert_debug ( A0.cols() == dimx, "Kalman: A is not square" ); 
     341        bdm_assert_debug ( B0.rows() == dimx, "Kalman: B is not compatible" ); 
     342        bdm_assert_debug ( C0.cols() == dimx, "Kalman: C is not square" ); 
     343        bdm_assert_debug ( ( D0.rows() == dimy ) || ( D0.cols() == dimu ),      "Kalman: D is not compatible" ); 
     344        bdm_assert_debug ( ( R0.cols() == dimy ) || ( R0.rows() == dimy ), "Kalman: R is not compatible" ); 
     345        bdm_assert_debug ( ( Q0.cols() == dimx ) || ( Q0.rows() == dimx ), "Kalman: Q is not compatible" ); 
    346346 
    347347        A = A0; 
     
    355355template<class sq_T> 
    356356void Kalman<sq_T>::bayes ( const vec &dt ) { 
    357         it_assert_debug ( dt.length() == ( dimy + dimu ), "KalmanFull::bayes wrong size of dt" ); 
     357        bdm_assert_debug ( dt.length() == ( dimy + dimu ), "Kalman::bayes wrong size of dt" ); 
    358358 
    359359        sq_T iRy ( dimy ); 
     
    439439                break; 
    440440                default: 
    441                         it_error ( "unknown policy" ); 
     441                        bdm_error ( "unknown policy" ); 
    442442                } 
    443443                // copy result to all models 
     
    486486template<class sq_T> 
    487487void EKF<sq_T>::bayes ( const vec &dt ) { 
    488         it_assert_debug ( dt.length() == ( dimy + dimu ), "KalmanFull::bayes wrong size of dt" ); 
     488        bdm_assert_debug ( dt.length() == ( dimy + dimu ), "EKF<>::bayes wrong size of dt" ); 
    489489 
    490490        sq_T iRy ( dimy, dimy ); 
  • library/bdm/estim/mixtures.cpp

    r504 r565  
    154154void MixEF::flatten ( const BMEF* M2 ) { 
    155155        const MixEF* Mix2 = dynamic_cast<const MixEF*> ( M2 ); 
    156         it_assert_debug ( Mix2->n == n, "Different no of coms" ); 
     156        bdm_assert_debug ( Mix2->n == n, "Different no of coms" ); 
    157157        //Flatten each component 
    158158        for ( int i = 0; i < n; i++ ) { 
  • library/bdm/estim/mixtures.h

    r536 r565  
    6161                        Array<const epdf*> epdfs ( n + 1 ); 
    6262                        for ( int i = 0; i < Coms.length(); i++ ) { 
    63 //                      it_assert_debug(!x,"MixEF::MixEF : Incompatible components"); 
    6463                                epdfs ( i ) = & ( Coms ( i )->posterior() ); 
    6564                        } 
     
    7574                        BMEF ( ), n ( Coms0.length() ), Coms ( n ), 
    7675                        weights (), method ( QB ) { 
    77                 //      it_assert_debug ( n>0,"MixEF::MixEF : Empty Component list" ); 
    78  
    7976                for ( int i = 0; i < n; i++ ) { 
    8077                        Coms ( i ) = ( BMEF* ) Coms0 ( i )->_copy_(); 
    8178                } 
    8279                build_est(); 
    83         }; 
     80        } 
     81 
    8482        //! Constructor of empty mixture 
    8583        MixEF () : 
     
    9189        MixEF ( const MixEF &M2 ) : BMEF ( ), n ( M2.n ), Coms ( n ), 
    9290                        weights ( M2.weights ), method ( M2.method ) { 
    93                 //      it_assert_debug ( n>0,"MixEF::MixEF : Empty Component list" ); 
    94  
    9591                for ( int i = 0; i < n; i++ ) { 
    9692                        Coms ( i ) = M2.Coms ( i )->_copy_(); 
     
    9894                build_est(); 
    9995        } 
     96 
    10097        //! Initializing the mixture by a random pick of centroids from data 
    10198        //! \param Com0 Initial component - necessary to determine its type. 
  • library/bdm/estim/particles.h

    r536 r565  
    177177 
    178178                vec sample() const { 
    179                         it_error ( "Not implemented" ); 
    180                         return 0; 
     179                        bdm_error ( "Not implemented" ); 
     180                        return vec(); 
    181181                } 
    182182 
    183183                double evallog ( const vec &val ) const { 
    184                         it_error ( "not implemented" ); 
     184                        bdm_error ( "not implemented" ); 
    185185                        return 0.0; 
    186186                } 
  • library/bdm/math/chmat.cpp

    r495 r565  
    1616        qr ( Z, R ); 
    1717        Ch = R ( 0, Ch.rows() - 1, 0, Ch.cols() - 1 ); 
    18 }; 
     18} 
     19 
    1920mat chmat::to_mat() const { 
    2021        mat F = Ch.T() * Ch; 
    2122        return F; 
    22 }; 
     23} 
     24 
    2325void chmat::mult_sym ( const mat &C ) { 
    24         it_assert_debug ( C.rows() == dim, "Wrong dimension of U" ); 
     26        bdm_assert_debug ( C.rows() == dim, "Wrong dimension of U" ); 
    2527        if ( !qr ( Ch*C.T(), Ch ) ) { 
    26                 it_warning ( "QR unstable in chmat mult_sym" ); 
     28                bdm_warning ( "QR unstable in chmat mult_sym" ); 
    2729        } 
    28 }; 
     30} 
     31 
    2932void chmat::mult_sym ( const mat &C , chmat &U ) const { 
    30         it_assert_debug ( C.rows() == U.dim, "Wrong dimension of U" ); 
     33        bdm_assert_debug ( C.rows() == U.dim, "Wrong dimension of U" ); 
    3134        if ( !qr ( Ch*C.T(), U.Ch ) ) { 
    32                 it_warning ( "QR unstable in chmat mult_sym" ); 
     35                bdm_warning ( "QR unstable in chmat mult_sym" ); 
    3336        } 
    34 }; 
     37} 
     38 
    3539void chmat::mult_sym_t ( const mat &C ) { 
    36         it_assert_debug ( C.cols() == dim, "Wrong dimension of U" ); 
     40        bdm_assert_debug ( C.cols() == dim, "Wrong dimension of U" ); 
    3741        if ( !qr ( Ch*C, Ch ) ) { 
    38                 it_warning ( "QR unstable in chmat mult_sym" ); 
     42                bdm_warning ( "QR unstable in chmat mult_sym" ); 
    3943        } 
    40 }; 
     44} 
     45 
    4146void chmat::mult_sym_t ( const mat &C, chmat &U ) const { 
    42         it_assert_debug ( C.cols() == U.dim, "Wrong dimension of U" ); 
     47        bdm_assert_debug ( C.cols() == U.dim, "Wrong dimension of U" ); 
    4348        if ( !qr ( Ch*C, U.Ch ) ) { 
    44                 it_warning ( "QR unstable in chmat mult_sym" ); 
     49                bdm_warning ( "QR unstable in chmat mult_sym" ); 
    4550        } 
    4651} 
  • library/bdm/math/chmat.h

    r495 r565  
    1414#define CHMAT_H 
    1515 
    16  
     16#include "../bdmerror.h" 
    1717#include "square_mat.h" 
    1818 
     
    4444        //! add another chmat \c A2 with weight \c w. 
    4545        void add ( const chmat &A2, double w = 1.0 ) { 
    46                 it_assert_debug ( dim == A2.dim, "Matrices of unequal dimension" ); 
     46                bdm_assert_debug ( dim == A2.dim, "Matrices of unequal dimension" ); 
    4747                mat pre = concat_vertical ( Ch, sqrt ( w ) * A2.Ch ); 
    4848                mat post = zeros ( pre.rows(), pre.cols() ); 
    4949                if ( !qr ( pre, post ) ) { 
    50                         it_warning ( "Unstable QR in chmat add" ); 
     50                        bdm_warning ( "Unstable QR in chmat add" ); 
    5151                } 
    5252                Ch = post ( 0, dim - 1, 0, dim - 1 ); 
     
    7070        chmat ( const chmat &Ch0 ) : sqmat ( Ch0.dim ), Ch ( Ch0.dim, Ch0.dim ) { 
    7171                Ch = Ch0.Ch; 
    72         }; 
     72        } 
     73 
    7374        //! Default constructor (m3k:cholform) 
    7475        chmat ( const mat &M ) : sqmat ( M.rows() ), Ch ( M.rows(), M.cols() ) { 
    7576                mat Q; 
    76                 it_assert_debug ( M.rows() == M.cols(), "chmat:: input matrix must be square!" ); 
     77                bdm_assert_debug ( M.rows() == M.cols(), "chmat:: input matrix must be square!" ); 
    7778                Ch = chol ( M ); 
    78         }; 
    79         //! Constructor 
    80         chmat ( const chmat &M, const ivec &perm ) : sqmat ( M.rows() ) { 
    81                 it_error ( "not implemneted" ); 
    82         }; 
     79        } 
     80 
     81        /*! 
     82          Some templates require this constructor to compile, but 
     83          it shouldn't actually be called. 
     84        */ 
     85        chmat ( const chmat &M, const ivec &perm ) { 
     86                bdm_error ( "not implemented" ); 
     87        } 
     88 
    8389        //! Access function 
    8490        mat & _Ch() { 
     
    95101        //! Access functions 
    96102        void setCh ( const vec &chQ ) { 
    97                 it_assert_debug ( chQ.length() == dim*dim, "" ); 
     103                bdm_assert_debug ( chQ.length() == dim * dim, "wrong length" ); 
    98104                copy_vector ( dim*dim, chQ._data(), Ch._data() ); 
    99105        } 
     106 
    100107        //! Access functions 
    101108        void setD ( const vec &nD, int i ) { 
  • library/bdm/math/functions.h

    r477 r565  
    1313#define FN_H 
    1414 
     15#include "../bdmerror.h" 
    1516#include "../base/bdmbase.h" 
    1617 
     
    4445public : 
    4546        vec eval ( const vec &cond ) { 
    46                 it_assert_debug ( cond.length() == A.cols(), "linfn::eval Wrong cond." ); 
    47                 return A*cond + B; 
    48         }; 
     47                bdm_assert_debug ( cond.length() == A.cols(), "linfn::eval Wrong cond." ); 
     48                return A * cond + B; 
     49        } 
    4950 
    5051//              linfn evalsome ( ivec &rvind ); 
     
    8283        //! Evaluates \f$f(x0,u0)\f$ (VS: Do we really need common eval? ) 
    8384        vec eval ( const vec &cond ) { 
    84                 it_assert_debug ( cond.length() == ( dimx + dimu ), "linfn::eval Wrong cond." ); 
     85                bdm_assert_debug ( cond.length() == ( dimx + dimu ), "linfn::eval Wrong cond." ); 
    8586                return eval ( cond ( 0, dimx - 1 ), cond ( dimx, dimx + dimu - 1 ) );//-1 = end (in matlab) 
    86         }; 
     87        } 
    8788 
    8889        //! Evaluates \f$f(x0,u0)\f$ 
     
    115116        //!@{ 
    116117 
    117         bilinfn () : diffbifn () , A() , B()    {}; 
    118         bilinfn ( const mat A0, const mat B0 ) { 
     118        bilinfn () : diffbifn (), A(), B() { } 
     119 
     120        bilinfn ( const mat &A0, const mat &B0 ) { 
    119121                set_parameters ( A0, B0 ); 
    120         }; 
    121         //! Alternative constructor 
    122         void set_parameters ( const mat A0, const mat B0 ) { 
    123                 it_assert_debug ( A0.rows() == B0.rows(), "" ); 
     122        } 
     123 
     124        //! Alternative initialization 
     125        void set_parameters ( const mat &A0, const mat &B0 ) { 
     126                bdm_assert_debug ( A0.rows() == B0.rows(), "bilinfn matrices must have the same number of rows" ); 
    124127                A = A0; 
    125128                B = B0; 
     
    133136        //!@{ 
    134137        inline vec eval ( const  vec &x0, const vec &u0 ) { 
    135                 it_assert_debug ( x0.length() == dimx, "linfn::eval Wrong xcond." ); 
    136                 it_assert_debug ( u0.length() == dimu, "linfn::eval Wrong ucond." ); 
     138                bdm_assert_debug ( x0.length() == dimx, "bilinfn::eval Wrong xcond." ); 
     139                bdm_assert_debug ( u0.length() == dimu, "bilinfn::eval Wrong ucond." ); 
    137140                return A*x0 + B*u0; 
    138141        } 
    139142 
    140143        void dfdx_cond ( const vec &x0, const vec &u0, mat &F, bool full ) { 
    141                 it_assert_debug ( ( F.cols() == A.cols() ) & ( F.rows() == A.rows() ), "Allocated F is not compatible." ); 
     144                bdm_assert_debug ( ( F.cols() == A.cols() ) && ( F.rows() == A.rows() ), "Allocated F is not compatible." ); 
    142145                if ( full ) F = A;      //else : nothing has changed no need to regenerate 
    143146        } 
    144         //! 
     147 
    145148        void dfdu_cond ( const vec &x0, const vec &u0, mat &F,  bool full = true ) { 
    146                 it_assert_debug ( ( F.cols() == B.cols() ) & ( F.rows() == B.rows() ), "Allocated F is not compatible." ); 
     149                bdm_assert_debug ( ( F.cols() == B.cols() ) && ( F.rows() == B.rows() ), "Allocated F is not compatible." ); 
    147150                if ( full ) F = B;      //else : nothing has changed no need to regenerate 
    148151        } 
  • library/bdm/math/square_mat.cpp

    r536 r565  
    3535}; 
    3636fsqmat::fsqmat ( const mat &M0 ) : sqmat ( M0.cols() ) { 
    37         it_assert_debug ( ( M0.cols() == M0.rows() ), "M0 must be square" ); 
     37        bdm_assert_debug ( ( M0.cols() == M0.rows() ), "M0 must be square" ); 
    3838        M = M0; 
    3939}; 
     
    6565ldmat::ldmat ( const mat &V ) : sqmat ( V.cols() ) { 
    6666 
    67         it_assert_debug ( dim == V.rows(), "ldmat::ldmat matrix V is not square!" ); 
     67        bdm_assert_debug ( dim == V.rows(), "ldmat::ldmat matrix V is not square!" ); 
    6868 
    6969        // L and D will be allocated by ldform() 
     
    8181        double *rraw = r._data(); 
    8282 
    83         it_assert_debug ( v.length() == dim, "LD::ldupdt vector v is not compatible with this ld." ); 
     83        bdm_assert_debug ( v.length() == dim, "LD::ldupdt vector v is not compatible with this ld." ); 
    8484 
    8585        for ( int i = dim - 1; i >= 0; i-- ) { 
     
    123123        int dim = D.length(); 
    124124 
    125         it_assert_debug ( ld2.D.length() == dim, "LD.add() incompatible sizes of LDs;" ); 
     125        bdm_assert_debug ( ld2.D.length() == dim, "LD.add() incompatible sizes of LDs" ); 
    126126 
    127127        //Fixme can be done more efficiently either via dydr or ldform 
     
    231231        int mn = ( m < n ) ? m : n ; 
    232232 
    233 //      it_assert_debug( A.cols()==dim,"ldmat::ldform A is not compatible" ); 
    234         it_assert_debug ( D0.length() == A.rows(), "ldmat::ldform Vector D must have the length as row count of A" ); 
     233        bdm_assert_debug ( D0.length() == A.rows(), "ldmat::ldform Vector D must have the length as row count of A" ); 
    235234 
    236235        L = concat_vertical ( zeros ( n, n ), diag ( sqrt ( D0 ) ) * A ); 
     
    389388                *kr = 0.0; 
    390389                if ( *Df < -threshold ) { 
    391                         it_warning ( "Problem in dydr: subraction of dyad results in negative definitness. Likely mistake in calling function." ); 
     390                        bdm_warning ( "Problem in dydr: subraction of dyad results in negative definitness. Likely mistake in calling function." ); 
    392391                } 
    393392                *Df = 0.0; 
  • library/bdm/math/square_mat.h

    r495 r565  
    1616 
    1717#include "../itpp_ext.h" 
     18#include "../bdmerror.h" 
    1819 
    1920namespace bdm 
     
    138139        //! Constructor 
    139140        fsqmat ( const mat &M ); 
    140         //! Constructor 
    141         fsqmat ( const fsqmat &M, const ivec &perm ) : sqmat ( M.rows() ) { 
    142                 it_error ( "not implemneted" ); 
    143         }; 
     141 
     142        /*! 
     143          Some templates require this constructor to compile, but 
     144          it shouldn't actually be called. 
     145        */ 
     146        fsqmat ( const fsqmat &M, const ivec &perm ) { 
     147                bdm_error ( "not implemented" ); 
     148        } 
     149 
    144150        //! Constructor 
    145151        fsqmat ( const vec &d ) : sqmat ( d.length() ) { 
  • library/bdm/mex/mex_datasource.h

    r529 r565  
     1#include "../bdm/bdmerror.h" 
    12#include "../bdm/stat/datasources.h" 
    23#include "mex_parser.h" 
     
    3435                Data = mxArray2mat ( mexGetVariable ( "base", set["varname"] ) ); 
    3536                UI::get ( rowid, set, "rids" , UI::compulsory ); 
    36                 it_assert_debug ( max ( rowid ) <= Data.rows(), "MemDS rowid is too high for given Dat." ); 
     37                bdm_assert_debug ( max ( rowid ) <= Data.rows(), "MemDS rowid is too high for given Dat." ); 
    3738 
    3839                UI::get ( delays, set, "tds", UI::compulsory ); 
    3940                time = max ( delays ); 
    40                 it_assert_debug ( time < Data.cols(), "MemDS delays are too high." ); 
     41                bdm_assert_debug ( time < Data.cols(), "MemDS delays are too high." ); 
    4142 
    4243                shared_ptr<RV> r = UI::build<RV> ( set, "rv", UI::compulsory ); 
  • library/bdm/osutils.cpp

    r497 r565  
    1212 
    1313#include "osutils.h" 
     14#include "bdmerror.h" 
    1415#include <iostream> 
    1516#include <stdexcept> 
     
    4748#endif 
    4849        { 
    49                 if ( ( rewrite ) && ( errno == EEXIST ) ) it_warning ( "rewriting directory" ); 
    50                 else it_error ( "dirfilelog:: cannot create directory" ); 
     50                if ( ( rewrite ) && ( errno == EEXIST ) ) bdm_warning ( "rewriting directory" ); 
     51                else bdm_error ( "dirfilelog:: cannot create directory" ); 
    5152        } 
    5253} 
     
    7980                        std::string msg = "can't remove dir "; 
    8081                        msg += path; 
    81                         throw std::runtime_error ( msg ); 
     82                        bdm_error ( msg ); 
    8283                } 
    8384        } else { 
     
    8788                                std::string msg = "can't remove file "; 
    8889                                msg += path; 
    89                                 throw std::runtime_error ( msg ); 
     90                                bdm_error ( msg ); 
    9091                        } 
    9192                } else { 
     
    9394                                std::string msg = "can't remove "; 
    9495                                msg += path; 
    95                                 throw std::runtime_error ( msg ); 
     96                                bdm_error ( msg ); 
    9697                        } else { 
    9798                                // it wasn't there in the first place 
  • library/bdm/osutils.h

    r497 r565  
    2121 
    2222/*! 
    23 @brief Function creates a directory and raises it_error if it is not possible 
     23@brief Function creates a directory 
    2424 
    2525@param dirname name of the directory to be created 
    2626@param rewrite if true then existence of the directory is not an error 
     27 
     28Raises std::runtime_error if rewrite is false and dirname already exists. 
    2729*/ 
    2830void makedir ( string &dirname, bool rewrite = true ); 
  • library/bdm/shared_ptr.h

    r555 r565  
    1818#include <stdexcept> 
    1919#include <string> 
    20 #include "itpp_ext.h" 
     20#include "bdmerror.h" 
    2121 
    2222namespace bdm { 
     
    123123        */ 
    124124        T *operator->() { 
    125                 it_assert_debug ( payload, "dereferencing NULL" ); 
     125                bdm_assert_debug ( payload, "dereferencing NULL" ); 
    126126                return payload; 
    127127        } 
     
    131131        //! isn't NULL. 
    132132        T &operator*() { 
    133                 it_assert_debug ( payload, "dereferencing NULL" ); 
     133                bdm_assert_debug ( payload, "dereferencing NULL" ); 
    134134                return *payload; 
    135135        } 
     
    147147        //! pointer isn't NULL. 
    148148        const T *operator->() const { 
    149                 it_assert_debug ( payload, "dereferencing NULL" ); 
     149                bdm_assert_debug ( payload, "dereferencing NULL" ); 
    150150                return payload; 
    151151        } 
     
    155155        //! isn't NULL. 
    156156        const T &operator*() const { 
    157                 it_assert_debug ( payload, "dereferencing NULL" ); 
     157                bdm_assert_debug ( payload, "dereferencing NULL" ); 
    158158                return *payload; 
    159159        } 
     
    254254        */ 
    255255        object_ptr ( const shared_ptr<T> &b ) : shared_ptr<T> ( b ) { 
    256                 it_assert_debug ( this->get(), "object_ptr cannot be empty" ); 
     256                bdm_assert_debug ( this->get(), "object_ptr cannot be empty" ); 
    257257        } 
    258258 
     
    262262        */ 
    263263        object_ptr ( T *p ) : shared_ptr<T> ( p ) { 
    264                 it_assert_debug ( p, "object_ptr cannot be empty" ); 
     264                bdm_assert_debug ( p, "object_ptr cannot be empty" ); 
    265265        } 
    266266 
  • library/bdm/stat/discrete.h

    r564 r565  
    5555                        void initialize() { 
    5656                                dim = ranges.length(); 
    57                                 it_assert_debug(gridsizes.length()==dim,"Incompatible dimensions of input"); 
     57                                bdm_assert_debug(gridsizes.length() == dim, "Incompatible dimensions of input"); 
    5858                                Npoints = prod(gridsizes); 
    59                                 it_assert_debug(Npoints>0,"Wrong input parameters"); 
     59                                bdm_assert_debug(Npoints > 0, "Wrong input parameters"); 
    6060                                 
    6161                                //precompute steps 
     
    7171                                vec v ( dim ); 
    7272                                for ( int j = 0; j < dim; j++ ) { 
    73                                         it_assert_debug(inds(j)<gridsizes(j), "Index out of bounds"); 
     73                                        bdm_assert_debug(inds(j) < gridsizes(j), "Index out of bounds"); 
    7474                                        v ( j ) = ranges(j)(0) + (0.5+inds(j))*steps(j); 
    7575                                } 
     
    8080                        long linear_index (const ivec inds){ 
    8181                                long ind=0; 
    82                                 it_assert_debug(inds.length()==dim,"Improper indeces inds"); 
     82                                bdm_assert_debug(inds.length() == dim, "Improper indices inds"); 
    8383                                int dim_skips=1; // skips in active dimension, in the first dimension, the skips are 1 index per value 
    8484                                                 
  • library/bdm/stat/emix.cpp

    r507 r565  
    1212 
    1313        for ( i = 0; i < w.length(); i++ ) { 
    14                 it_assert_debug ( dim == ( Coms0 ( i )->dimension() ), "Component sizes do not match!" ); 
    15                 it_assert_debug ( !isnamed || tmp_rv.equal ( Coms0 ( i )->_rv() ), "Component RVs do not match!" ); 
     14                bdm_assert_debug ( dim == ( Coms0 ( i )->dimension() ), "Component sizes do not match!" ); 
     15                bdm_assert_debug ( !isnamed || tmp_rv.equal ( Coms0 ( i )->_rv() ), "Component RVs do not match!" ); 
    1616        } 
    1717 
     
    4444 
    4545void emix::marginal ( const RV &rv, emix &target ) const { 
    46         it_assert_debug ( isnamed(), "rvs are not assigned" ); 
     46        bdm_assert_debug ( isnamed(), "rvs are not assigned" ); 
    4747 
    4848        Array<shared_ptr<epdf> > Cn ( Coms.length() ); 
     
    5555 
    5656shared_ptr<mpdf> emix::condition ( const RV &rv ) const { 
    57         it_assert_debug ( isnamed(), "rvs are not assigned" ); 
     57        bdm_assert_debug ( isnamed(), "rvs are not assigned" ); 
    5858        mratio *tmp = new mratio ( this, rv ); 
    5959        return shared_ptr<mpdf>(tmp); 
     
    6565        int i; 
    6666        for ( i = 0; i < w.length(); i++ ) { 
    67                 it_assert_debug ( dim == ( Coms0 ( i )->dimension() ), "Component sizes do not match!" ); 
     67                bdm_assert_debug ( dim == ( Coms0 ( i )->dimension() ), "Component sizes do not match!" ); 
    6868        } 
    6969        if ( copy ) { 
    7070                Coms.set_length ( Coms0.length() ); 
    7171                for ( i = 0; i < w.length(); i++ ) { 
    72                         it_error ( "Not imp..." ); 
    73                         *Coms ( i ) = *Coms0 ( i ); 
     72                        bdm_error ( "Not implemented" ); 
     73                        // *Coms ( i ) = *Coms0 ( i ); 
    7474                } 
    7575                destroyComs = true; 
     
    124124 
    125125void egiwmix::marginal ( const RV &rv, emix &target ) const { 
    126         it_assert_debug ( isnamed(), "rvs are not assigned" ); 
     126        bdm_assert_debug ( isnamed(), "rvs are not assigned" ); 
    127127 
    128128        Array<shared_ptr<epdf> > Cn ( Coms.length() ); 
     
    247247//                      rvaddok=rv.add ( mpdfs ( i )->_rv() ); //add rv to common rvs. 
    248248//                      // If rvaddok==false, mpdfs overlap => assert error. 
    249 //                      it_assert_debug(rvaddok||overlap,"mprod::mprod() input mpdfs overlap in rv!"); 
    250249//                      epdfs ( i ) = & ( mpdfs ( i )->posterior() ); // add pointer to epdf 
    251250//              }; 
  • library/bdm/stat/emix.h

    r559 r565  
    6262                //prepare data structures 
    6363                if ( copy ) { 
    64                         it_error ( "todo" ); 
    65                         destroynom = true; 
     64                        bdm_error ( "todo" ); 
     65                        // destroynom = true; 
    6666                } else { 
    6767                        nom = nom0; 
    6868                        destroynom = false; 
    6969                } 
    70                 it_assert_debug ( rvc.length() > 0, "Makes no sense to use this object!" ); 
     70                bdm_assert_debug ( rvc.length() > 0, "Makes no sense to use this object!" ); 
    7171 
    7272                // build denominator 
     
    156156                } 
    157157                double tmp = log ( sum ); 
    158                 it_assert_debug ( std::isfinite ( tmp ), "Infinite" ); 
     158                bdm_assert_debug ( std::isfinite ( tmp ), "Infinite" ); 
    159159                return tmp; 
    160160        }; 
     
    387387                        for ( int i = 0; i < epdfs.length(); i++ ) { 
    388388                                independent = rv.add ( epdfs ( i )->_rv() ); 
    389                                 it_assert_debug ( independent == true, "eprod:: given components are not independent." ); 
     389                                bdm_assert_debug ( independent, "eprod:: given components are not independent." ); 
    390390                        } 
    391391                        dim = rv._dsize(); 
     
    441441                        tmp += epdfs ( i )->evallog ( dls ( i )->pushdown ( val ) ); 
    442442                } 
    443                 it_assert_debug ( std::isfinite ( tmp ), "Infinite" ); 
     443                bdm_assert_debug ( std::isfinite ( tmp ), "Infinite" ); 
    444444                return tmp; 
    445445        } 
    446446        //!access function 
    447447        const epdf* operator () ( int i ) const { 
    448                 it_assert_debug ( i < epdfs.length(), "wrong index" ); 
     448                bdm_assert_debug ( i < epdfs.length(), "wrong index" ); 
    449449                return epdfs ( i ); 
    450450        } 
  • library/bdm/stat/exp_family.cpp

    r488 r565  
    1919 
    2020vec egiw::sample() const { 
    21         it_warning ( "Function not implemented" ); 
     21        bdm_warning ( "Function not implemented" ); 
    2222        return vec_1 ( 0.0 ); 
    2323} 
     
    6767                     - 0.5 * dimx * ( m * log2 + 0.5 * ( dimx - 1 ) * log2pi )  - lg; 
    6868 
    69         it_assert_debug ( ( ( -nkG - nkW ) > -Inf ) && ( ( -nkG - nkW ) < Inf ), "ARX improper" ); 
     69        bdm_assert_debug ( ( ( -nkG - nkW ) > -Inf ) && ( ( -nkG - nkW ) < Inf ), "ARX improper" ); 
    7070        return -nkG - nkW; 
    7171} 
     
    8282                return iLsub * L0 ( 1, end ); 
    8383        } else { 
    84                 it_error ( "ERROR: est_theta() not implemented for dimx>1" ); 
    85                 return 0; 
     84                bdm_error ( "ERROR: est_theta() not implemented for dimx>1" ); 
     85                return vec(); 
    8686        } 
    8787} 
     
    9999 
    100100        } else { 
    101                 it_error ( "ERROR: est_theta_cov() not implemented for dimx>1" ); 
    102                 return 0; 
     101                bdm_error ( "ERROR: est_theta_cov() not implemented for dimx>1" ); 
     102                return ldmat(); 
    103103        } 
    104104 
     
    138138                return var; 
    139139        } else { 
    140                 it_error ( "not implemented" ); 
    141                 return vec ( 0 ); 
     140                bdm_error ( "not implemented" ); 
     141                return vec(); 
    142142        } 
    143143} 
     
    199199        } 
    200200        double tmp = res - lognc();; 
    201         it_assert_debug ( std::isfinite ( tmp ), "Infinite value" ); 
     201        bdm_assert_debug ( std::isfinite ( tmp ), "Infinite value" ); 
    202202        return tmp; 
    203203} 
     
    256256 
    257257        default: 
    258                 it_error ( "PF::resample(): Unknown resampling method" ); 
     258                bdm_error ( "PF::resample(): Unknown resampling method" ); 
    259259        } 
    260260 
     
    306306 
    307307void eEmp::set_statistics ( const vec &w0, const epdf &epdf0 ) { 
    308         //it_assert_debug(rv==epdf0->rv(),"Wrong epdf0"); 
    309308        dim = epdf0.dimension(); 
    310309        w = w0; 
     
    319318 
    320319void eEmp::set_samples ( const epdf* epdf0 ) { 
    321         //it_assert_debug(rv==epdf0->rv(),"Wrong epdf0"); 
    322320        w = 1; 
    323321        w /= sum ( w );//renormalize 
  • library/bdm/stat/exp_family.h

    r536 r565  
    4444                //! logarithm of the normalizing constant, \f$\mathcal{I}\f$ 
    4545                virtual double lognc() const = 0; 
     46 
    4647                //!Evaluate normalized log-probability 
    47                 virtual double evallog_nn (const vec &val) const{it_error ("Not implemented");return 0.0;}; 
     48                virtual double evallog_nn (const vec &val) const { 
     49                        bdm_error ("Not implemented"); 
     50                        return 0.0; 
     51                } 
     52 
    4853                //!Evaluate normalized log-probability 
    4954                virtual double evallog (const vec &val) const { 
    5055                        double tmp; 
    5156                        tmp = evallog_nn (val) - lognc(); 
    52 //                              it_assert_debug ( std::isfinite ( tmp ),"Infinite value" ); 
    5357                        return tmp; 
    5458                } 
     
    6569                        return x -lognc(); 
    6670                } 
     71 
    6772                //!Power of the density, used e.g. to flatten the density 
    68                 virtual void pow (double p) {it_error ("Not implemented");}; 
     73                virtual void pow (double p) { 
     74                        bdm_error ("Not implemented"); 
     75                } 
    6976}; 
    7077 
     
    8491                BMEF (const BMEF &B) : BM (B), frg (B.frg), last_lognc (B.last_lognc) {} 
    8592                //!get statistics from another model 
    86                 virtual void set_statistics (const BMEF* BM0) {it_error ("Not implemented");}; 
     93                virtual void set_statistics (const BMEF* BM0) { 
     94                        bdm_error ("Not implemented"); 
     95                } 
     96 
    8797                //! Weighted update of sufficient statistics (Bayes rule) 
    8898                virtual void bayes (const vec &data, const double w) {}; 
    8999                //original Bayes 
    90100                void bayes (const vec &dt); 
     101 
    91102                //!Flatten the posterior according to the given BMEF (of the same type!) 
    92                 virtual void flatten (const BMEF * B) {it_error ("Not implemented");} 
    93                 //!Flatten the posterior as if to keep nu0 data 
    94 //      virtual void flatten ( double nu0 ) {it_error ( "Not implemented" );} 
    95  
    96                 BMEF* _copy_ () const {it_error ("function _copy_ not implemented for this BM"); return NULL;}; 
     103                virtual void flatten (const BMEF * B) { 
     104                        bdm_error ("Not implemented"); 
     105                } 
     106 
     107                BMEF* _copy_ () const { 
     108                        bdm_error ("function _copy_ not implemented for this BM"); 
     109                        return NULL; 
     110                } 
    97111}; 
    98112 
     
    122136                void from_setting (const Setting &root); 
    123137                void validate() { 
    124                         it_assert (mu.length() == R.rows(), "parameters mismatch"); 
     138                        bdm_assert_debug (mu.length() == R.rows(), "parameters mismatch"); 
    125139                        dim = mu.length(); 
    126140                } 
     
    272286                //!@} 
    273287 
    274                 vec sample() const {it_error ("Not implemented");return vec_1 (0.0);}; 
     288                vec sample() const { 
     289                        bdm_error ("Not implemented"); 
     290                        return vec(); 
     291                } 
     292 
    275293                vec mean() const {return beta / sum (beta);}; 
    276294                vec variance() const {double gamma = sum (beta); return elem_mult (beta, (beta + 1)) / (gamma* (gamma + 1));} 
     
    278296                double evallog_nn (const vec &val) const { 
    279297                        double tmp; tmp = (beta - 1) * log (val); 
    280 //                              it_assert_debug ( std::isfinite ( tmp ),"Infinite value" ); 
    281298                        return tmp; 
    282                 }; 
     299                } 
     300 
    283301                double lognc () const { 
    284302                        double tmp; 
     
    287305                        for (int i = 0;i < beta.length();i++) {lgb += lgamma (beta (i));} 
    288306                        tmp = lgb - lgamma (gam); 
    289 //                              it_assert_debug ( std::isfinite ( tmp ),"Infinite value" ); 
    290307                        return tmp; 
    291                 }; 
     308                } 
     309 
    292310                //!access function 
    293311                vec& _beta()  {return beta;} 
     
    397415                } 
    398416                void validate() { 
    399                         it_assert (alpha.length() == beta.length(), "parameters do not match"); 
     417                        bdm_assert_debug (alpha.length() == beta.length(), "parameters do not match"); 
    400418                        dim = alpha.length(); 
    401419                } 
     
    446464        void set_parameters( int &i, double wi, epdf* ep){w(i)=wi;Coms(i)=ep;} 
    447465        vec mean(){vec pom; for(int i=0;i<n;i++){pom+=Coms(i)->mean()*w(i);} return pom;}; 
    448         vec sample() {it_error ( "Not implemented" );return 0;} 
    449466}; 
    450467*/ 
     
    472489                void set_parameters (const vec &low0, const vec &high0) { 
    473490                        distance = high0 - low0; 
    474                         it_assert_debug (min (distance) > 0.0, "bad support"); 
     491                        bdm_assert_debug (min (distance) > 0.0, "bad support"); 
    475492                        low = low0; 
    476493                        high = high0; 
     
    535552                //! Set \c A and \c R 
    536553                void set_parameters (const  mat &A0, const vec &mu0, const sq_T &R0) { 
    537                         it_assert_debug (A0.rows() == mu0.length(), ""); 
    538                         it_assert_debug (A0.rows() == R0.rows(), ""); 
     554                        bdm_assert_debug (A0.rows() == mu0.length(), "mlnorm: A vs. mu mismatch"); 
     555                        bdm_assert_debug (A0.rows() == R0.rows(), "mlnorm: A vs. R mismatch"); 
    539556 
    540557                        this->iepdf.set_parameters (zeros (A0.rows()), R0); 
     
    660677                //! constructor function 
    661678                void set_parameters (const mat &A0, const vec &mu0, const ldmat &R0, const ldmat& Lambda0) { 
    662                         it_assert_debug (A0.rows() == mu0.length(), ""); 
    663                         it_assert_debug (R0.rows() == A0.rows(), ""); 
     679                        bdm_assert_debug (A0.rows() == mu0.length(), "mlstudent: A vs. mu mismatch"); 
     680                        bdm_assert_debug (R0.rows() == A0.rows(), "mlstudent: A vs. R mismatch"); 
    664681 
    665682                        iepdf.set_parameters (mu0, Lambda);  // 
     
    11381155                //! Function performs resampling, i.e. removal of low-weight samples and duplication of high-weight samples such that the new samples represent the same density. 
    11391156                ivec resample (RESAMPLING_METHOD method = SYSTEMATIC); 
    1140                 //! inherited operation : NOT implemneted 
    1141                 vec sample() const {it_error ("Not implemented");return 0;} 
    1142                 //! inherited operation : NOT implemneted 
    1143                 double evallog (const vec &val) const {it_error ("Not implemented");return 0.0;} 
     1157 
     1158                //! inherited operation : NOT implemented 
     1159                vec sample() const { 
     1160                        bdm_error ("Not implemented"); 
     1161                        return vec(); 
     1162                } 
     1163 
     1164                //! inherited operation : NOT implemented 
     1165                double evallog (const vec &val) const { 
     1166                        bdm_error ("Not implemented"); 
     1167                        return 0.0; 
     1168                } 
     1169 
    11441170                vec mean() const { 
    11451171                        vec pom = zeros (dim); 
     
    12791305void enorm<sq_T>::marginal ( const RV &rvn, enorm<sq_T> &target ) const 
    12801306{ 
    1281         it_assert_debug (isnamed(), "rv description is not assigned"); 
     1307        bdm_assert_debug (isnamed(), "rv description is not assigned"); 
    12821308        ivec irvn = rvn.dataind (rv); 
    12831309 
     
    13021328        typedef mlnorm<sq_T> TMlnorm; 
    13031329 
    1304         it_assert_debug (isnamed(), "rvs are not assigned"); 
     1330        bdm_assert_debug (isnamed(), "rvs are not assigned"); 
    13051331        TMlnorm &uptarget = dynamic_cast<TMlnorm &>(target); 
    13061332 
    13071333        RV rvc = rv.subt (rvn); 
    1308         it_assert_debug ( (rvc._dsize() + rvn._dsize() == rv._dsize()), "wrong rvn"); 
     1334        bdm_assert_debug ( (rvc._dsize() + rvn._dsize() == rv._dsize()), "wrong rvn"); 
    13091335        //Permutation vector of the new R 
    13101336        ivec irvn = rvn.dataind (rv); 
  • library/bdm/stat/merger.cpp

    r561 r565  
    192192 
    193193                        } 
    194                         //                      it_assert_debug(std::isfinite(sum(lw_src)),"bad"); 
     194 
    195195                        lW.set_row ( i, lw_src ); // do not divide by mix 
    196196                } 
  • library/bdm/stat/merger.h

    r556 r565  
    200200                        eSmp._w() = wtmp / sum ( wtmp ); 
    201201                } else { 
    202                         it_error ( "Sources are not compatible - use merger_mix" ); 
     202                        bdm_error ( "Sources are not compatible - use merger_mix" ); 
    203203                } 
    204204        }; 
     
    277277 
    278278        void validate() { 
    279                 it_assert ( eSmp._w().length() > 0, "Empty support, use set_support()." ); 
    280                 it_assert ( dim == eSmp._samples() ( 0 ).length(), "Support points and rv are not compatible!" ); 
    281                 it_assert ( isnamed(), "mergers must be named" ); 
     279                bdm_assert ( eSmp._w().length() > 0, "Empty support, use set_support()." ); 
     280                bdm_assert ( dim == eSmp._samples() ( 0 ).length(), "Support points and rv are not compatible!" ); 
     281                bdm_assert ( isnamed(), "mergers must be named" ); 
    282282        } 
    283283        //!@} 
  • library/tests/shared_ptr_test.cpp

    r499 r565  
    11#include "shared_ptr.h" 
    22#include "UnitTest++.h" 
     3#include <stdexcept> 
    34#include <vector> 
    45 
     
    5152        CHECK_EQUAL ( 2, v[2]->get_x() ); 
    5253} 
     54 
     55TEST ( test_shared_ptr_error ) { 
     56        bdm::shared_ptr<Foo> empty; 
     57        try { 
     58                Foo x(*empty); 
     59                CHECK ( false ); 
     60        } catch ( std::runtime_error &exc ) { 
     61                CHECK ( exc.what() ); 
     62        } 
     63} 
  • library/tests/test_kalman.cpp

    r527 r565  
    2121        bool xxx = fin.seek ( "d" ); 
    2222        if ( !xxx ) { 
    23                 it_error ( "testKF.it not found" ); 
     23                bdm_error ( "testKF.it not found" ); 
    2424        } 
    2525        fin >> Dt; 
  • library/tests/test_kalman_QR.cpp

    r488 r565  
    2222        bool xxx = fin.seek ( "d" ); 
    2323        if ( !xxx ) { 
    24                 it_error ( "testKF.it not found" ); 
     24                bdm_error ( "testKF.it not found" ); 
    2525        } 
    2626        fin >> Dt; 
  • library/tests/test_kalman_QRexh.cpp

    r477 r565  
    2323 
    2424        if ( !xxx ) { 
    25                 it_error ( "testKF.it not found" ); 
     25                bdm_error ( "testKF.it not found" ); 
    2626        } 
    2727 
  • library/tests/testsuite.cpp

    r496 r565  
    22#include "TestReporterStdout.h" 
    33#include "UnitTest++.h" 
     4#include "bdmerror.h" 
    45#include "itpp_ext.h" 
     6#include <string.h> 
    57 
    68using namespace itpp; 
     
    911 
    1012bool is_selected_test( const UnitTest::Test *test ) { 
    11         it_assert_debug ( test, "NULL test" ); 
     13        bdm_assert_debug ( test, "NULL test" ); 
    1214 
    1315        if (!selected_tests.length()) { 
     
    1719        for (int i = 0; i < selected_tests.length(); ++i) { 
    1820                const char *n = test->m_details.testName; 
    19                 it_assert_debug ( n, "NULL test name" ); 
     21                bdm_assert_debug ( n, "NULL test name" ); 
    2022                const char *sname = selected_tests(i); 
    21                 it_assert_debug ( sname, "NULL selected test name" ); 
     23                bdm_assert_debug ( sname, "NULL selected test name" ); 
    2224                if ( !strcmp ( n, sname ) ) { 
    2325                        return true;