Show
Ignore:
Timestamp:
09/16/09 14:47:36 (15 years ago)
Author:
smidl
Message:

replace assert_debug by assert in classes interacting with users (from_setting, set_parameters, validate)

Files:
1 modified

Legend:

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

    r613 r620  
    136136                void from_setting (const Setting &root); 
    137137                void validate() { 
    138                         bdm_assert_debug (mu.length() == R.rows(), "parameters mismatch"); 
     138                        bdm_assert (mu.length() == R.rows(), "mu and R parameters do not match"); 
    139139                        dim = mu.length(); 
    140140                } 
     
    416416                } 
    417417                void validate() { 
    418                         bdm_assert_debug (alpha.length() == beta.length(), "parameters do not match"); 
     418                        bdm_assert (alpha.length() == beta.length(), "parameters do not match"); 
    419419                        dim = alpha.length(); 
    420420                } 
     
    530530                        bdm_assert(high.length()==low.length(), "Incompatible high and low vectors"); 
    531531                        dim = high.length(); 
    532                         bdm_assert_debug (min (distance) > 0.0, "bad support"); 
     532                        bdm_assert (min (distance) > 0.0, "bad support"); 
    533533                } 
    534534}; 
     
    558558 
    559559                //! Set \c A and \c R 
    560                 void set_parameters (const  mat &A0, const vec &mu0, const sq_T &R0) { 
    561                         bdm_assert_debug (A0.rows() == mu0.length(), "mlnorm: A vs. mu mismatch"); 
    562                         bdm_assert_debug (A0.rows() == R0.rows(), "mlnorm: A vs. R mismatch"); 
    563                          
     560                void set_parameters (const  mat &A0, const vec &mu0, const sq_T &R0) {   
    564561                        this->iepdf.set_parameters (zeros (A0.rows()), R0); 
    565562                        A = A0; 
     
    593590                        UI::get (R0, set, "R", UI::compulsory); 
    594591                        set_parameters (A, mu_const, R0); 
     592                        validate(); 
    595593                }; 
     594                void validate() { 
     595                        bdm_assert (A.rows() == mu_const.length(), "mlnorm: A vs. mu mismatch"); 
     596                        bdm_assert (A.rows() == _R().rows(), "mlnorm: A vs. R mismatch"); 
     597                         
     598                } 
    596599}; 
    597600UIREGISTER2 (mlnorm,ldmat); 
     
    704707 
    705708                void validate() { 
    706                         bdm_assert_debug (A.rows() == mu_const.length(), "mlstudent: A vs. mu mismatch"); 
    707                         bdm_assert_debug (_R.rows() == A.rows(), "mlstudent: A vs. R mismatch"); 
     709                        bdm_assert (A.rows() == mu_const.length(), "mlstudent: A vs. mu mismatch"); 
     710                        bdm_assert (_R.rows() == A.rows(), "mlstudent: A vs. R mismatch"); 
    708711                         
    709712                } 
     
    11561159                //! Set samples 
    11571160                void set_parameters (const Array<vec> &Av) { 
    1158                         bdm_assert_debug(Av.size()>0,"Empty samples");  
     1161                        bdm_assert(Av.size()>0,"Empty samples");  
    11591162                        n = Av.size();  
    11601163                        epdf::set_parameters(Av(0).length()); 
     
    13221325void enorm<sq_T>::marginal ( const RV &rvn, enorm<sq_T> &target ) const 
    13231326{ 
    1324         bdm_assert_debug (isnamed(), "rv description is not assigned"); 
     1327        bdm_assert (isnamed(), "rv description is not assigned"); 
    13251328        ivec irvn = rvn.dataind (rv); 
    13261329 
     
    13451348        typedef mlnorm<sq_T> TMlnorm; 
    13461349 
    1347         bdm_assert_debug (isnamed(), "rvs are not assigned"); 
     1350        bdm_assert (isnamed(), "rvs are not assigned"); 
    13481351        TMlnorm &uptarget = dynamic_cast<TMlnorm &>(target); 
    13491352 
    13501353        RV rvc = rv.subt (rvn); 
    1351         bdm_assert_debug ( (rvc._dsize() + rvn._dsize() == rv._dsize()), "wrong rvn"); 
     1354        bdm_assert ( (rvc._dsize() + rvn._dsize() == rv._dsize()), "wrong rvn"); 
    13521355        //Permutation vector of the new R 
    13531356        ivec irvn = rvn.dataind (rv);