- Timestamp:
- 09/16/09 14:47:36 (15 years ago)
- Location:
- library/bdm
- Files:
-
- 10 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.cpp
r604 r620 76 76 void RV::init ( const Array<std::string> &in_names, const ivec &in_sizes, const ivec &in_times ) { 77 77 len = in_names.length(); 78 bdm_assert _debug( in_names.length() == in_times.length(), "check \"times\" " );79 bdm_assert _debug( in_names.length() == in_sizes.length(), "check \"sizes\" " );78 bdm_assert ( in_names.length() == in_times.length(), "check \"times\" " ); 79 bdm_assert ( in_names.length() == in_sizes.length(), "check \"sizes\" " ); 80 80 81 81 times.set_length ( len ); -
library/bdm/base/bdmbase.h
r619 r620 35 35 //!Default constructor 36 36 str ( ivec ids0, ivec times0 ) : ids ( ids0 ), times ( times0 ) { 37 bdm_assert _debug( times0.length() == ids0.length(), "Incompatible input" );37 bdm_assert ( times0.length() == ids0.length(), "Incompatible input" ); 38 38 }; 39 39 }; … … 183 183 //! returns name of a scalar at position scalat, i.e. it can be in the middle of vector name, in that case it adds "_%d" to it 184 184 std::string scalarname ( int scalat ) const { 185 bdm_assert _debug(scalat<dsize,"Wrong input index");185 bdm_assert(scalat<dsize,"Wrong input index"); 186 186 int id=0; 187 187 int scalid=0; … … 995 995 //! Register DS for logging into logger L 996 996 virtual void log_add ( logger &L ) { 997 bdm_assert _debug( dtsize == Drv._dsize(), "invalid DS: dtsize (" + num2str ( dtsize ) + ") different from Drv " + num2str ( Drv._dsize() ) );998 bdm_assert _debug( utsize == Urv._dsize(), "invalid DS: utsize (" + num2str ( utsize ) + ") different from Urv " + num2str ( Urv._dsize() ) );997 bdm_assert ( dtsize == Drv._dsize(), "invalid DS: dtsize (" + num2str ( dtsize ) + ") different from Drv " + num2str ( Drv._dsize() ) ); 998 bdm_assert ( utsize == Urv._dsize(), "invalid DS: utsize (" + num2str ( utsize ) + ") different from Urv " + num2str ( Urv._dsize() ) ); 999 999 1000 1000 L_dt = L.add ( Drv, "" ); -
library/bdm/base/loggers.h
r611 r620 49 49 50 50 void logit ( int id, const vec &v ) { 51 bdm_assert _debug( id < vectors.length(), "Logger was not initialized, run init()." );51 bdm_assert ( id < vectors.length(), "Logger was not initialized, run init()." ); 52 52 if ( id >= 0 ) { 53 53 vectors ( id ).set_row ( ind, v ); -
library/bdm/base/user_info.h
r600 r620 321 321 322 322 root *typeless_instance = related_UI.new_instance(); 323 bdm_assert _debug( typeless_instance, "UI::new_instance failed" );323 bdm_assert ( typeless_instance, "UI::new_instance failed" ); 324 324 325 325 instance = dynamic_cast<T*> ( typeless_instance ); … … 351 351 T *tmp_inst = 0; 352 352 from_setting ( tmp_inst, element ); 353 bdm_assert _debug( tmp_inst, "UI::from_setting failed" );353 bdm_assert ( tmp_inst, "UI::from_setting failed" ); 354 354 instance = tmp_inst; 355 355 } -
library/bdm/design/ctrlbase.cpp
r586 r620 22 22 23 23 void LQG::validate() { 24 bdm_assert _debug( Qy.cols() == dimy, "LQG: wrong dimensions of Qy " );25 bdm_assert _debug( Qu.cols() == dimu, "LQG: wrong dimensions of Qu " );26 bdm_assert _debug( y_req.length() == dimy, "LQG: wrong dimensions of y_req " );24 bdm_assert ( Qy.cols() == dimy, "LQG: wrong dimensions of Qy " ); 25 bdm_assert ( Qu.cols() == dimu, "LQG: wrong dimensions of Qu " ); 26 bdm_assert ( y_req.length() == dimy, "LQG: wrong dimensions of y_req " ); 27 27 } 28 28 -
library/bdm/estim/kalman.h
r605 r620 138 138 void validate() { 139 139 StateSpace<sq_T>::validate(); 140 bdm_assert _debug(est->dimension(), "Statistics and model parameters mismatch");140 bdm_assert(est->dimension(), "Statistics and model parameters mismatch"); 141 141 } 142 142 }; … … 386 386 387 387 //We can do only 1d now... :( 388 bdm_assert _debug(yrv._dsize()==1, "Only for SISO so far..." );388 bdm_assert(yrv._dsize()==1, "Only for SISO so far..." ); 389 389 390 390 // create names for … … 463 463 template<class sq_T> 464 464 void StateSpace<sq_T>::validate(){ 465 bdm_assert _debug(A.cols() == dimx, "KalmanFull: A is not square");466 bdm_assert _debug(B.rows() == dimx, "KalmanFull: B is not compatible");467 bdm_assert _debug(C.cols() == dimx, "KalmanFull: C is not square");468 bdm_assert _debug( (D.rows() == dimy) || (D.cols() == dimu), "KalmanFull: D is not compatible");469 bdm_assert _debug( (Q.cols() == dimx) || (Q.rows() == dimx), "KalmanFull: Q is not compatible");470 bdm_assert _debug( (R.cols() == dimy) || (R.rows() == dimy), "KalmanFull: R is not compatible");465 bdm_assert (A.cols() == dimx, "KalmanFull: A is not square"); 466 bdm_assert (B.rows() == dimx, "KalmanFull: B is not compatible"); 467 bdm_assert (C.cols() == dimx, "KalmanFull: C is not square"); 468 bdm_assert ( (D.rows() == dimy) || (D.cols() == dimu), "KalmanFull: D is not compatible"); 469 bdm_assert ( (Q.cols() == dimx) || (Q.rows() == dimx), "KalmanFull: Q is not compatible"); 470 bdm_assert ( (R.cols() == dimy) || (R.rows() == dimy), "KalmanFull: R is not compatible"); 471 471 } 472 472 -
library/bdm/math/functions.h
r565 r620 124 124 //! Alternative initialization 125 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" );126 bdm_assert ( A0.rows() == B0.rows(), "bilinfn matrices must have the same number of rows" ); 127 127 A = A0; 128 128 B = B0; -
library/bdm/stat/discrete.h
r569 r620 55 55 void initialize() { 56 56 dim = ranges.length(); 57 bdm_assert _debug(gridsizes.length() == dim, "Incompatible dimensions of input");57 bdm_assert(gridsizes.length() == dim, "Incompatible dimensions of input"); 58 58 Npoints = prod(gridsizes); 59 bdm_assert _debug(Npoints > 0, "Wrong input parameters");59 bdm_assert(Npoints > 0, "Wrong input parameters"); 60 60 61 61 //precompute steps -
library/bdm/stat/emix.cpp
r601 r620 12 12 13 13 for ( i = 0; i < w.length(); i++ ) { 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!" );14 bdm_assert ( dim == ( Coms0 ( i )->dimension() ), "Component sizes do not match!" ); 15 bdm_assert ( !isnamed || tmp_rv.equal ( Coms0 ( i )->_rv() ), "Component RVs do not match!" ); 16 16 } 17 17 … … 44 44 45 45 void emix::marginal ( const RV &rv, emix &target ) const { 46 bdm_assert _debug( isnamed(), "rvs are not assigned" );46 bdm_assert ( isnamed(), "rvs are not assigned" ); 47 47 48 48 Array<shared_ptr<epdf> > Cn ( Coms.length() ); … … 55 55 56 56 shared_ptr<mpdf> emix::condition ( const RV &rv ) const { 57 bdm_assert _debug( isnamed(), "rvs are not assigned" );57 bdm_assert ( isnamed(), "rvs are not assigned" ); 58 58 mratio *tmp = new mratio ( this, rv ); 59 59 return shared_ptr<mpdf>(tmp); -
library/bdm/stat/exp_family.h
r613 r620 136 136 void from_setting (const Setting &root); 137 137 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"); 139 139 dim = mu.length(); 140 140 } … … 416 416 } 417 417 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"); 419 419 dim = alpha.length(); 420 420 } … … 530 530 bdm_assert(high.length()==low.length(), "Incompatible high and low vectors"); 531 531 dim = high.length(); 532 bdm_assert _debug(min (distance) > 0.0, "bad support");532 bdm_assert (min (distance) > 0.0, "bad support"); 533 533 } 534 534 }; … … 558 558 559 559 //! 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) { 564 561 this->iepdf.set_parameters (zeros (A0.rows()), R0); 565 562 A = A0; … … 593 590 UI::get (R0, set, "R", UI::compulsory); 594 591 set_parameters (A, mu_const, R0); 592 validate(); 595 593 }; 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 } 596 599 }; 597 600 UIREGISTER2 (mlnorm,ldmat); … … 704 707 705 708 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"); 708 711 709 712 } … … 1156 1159 //! Set samples 1157 1160 void set_parameters (const Array<vec> &Av) { 1158 bdm_assert _debug(Av.size()>0,"Empty samples");1161 bdm_assert(Av.size()>0,"Empty samples"); 1159 1162 n = Av.size(); 1160 1163 epdf::set_parameters(Av(0).length()); … … 1322 1325 void enorm<sq_T>::marginal ( const RV &rvn, enorm<sq_T> &target ) const 1323 1326 { 1324 bdm_assert _debug(isnamed(), "rv description is not assigned");1327 bdm_assert (isnamed(), "rv description is not assigned"); 1325 1328 ivec irvn = rvn.dataind (rv); 1326 1329 … … 1345 1348 typedef mlnorm<sq_T> TMlnorm; 1346 1349 1347 bdm_assert _debug(isnamed(), "rvs are not assigned");1350 bdm_assert (isnamed(), "rvs are not assigned"); 1348 1351 TMlnorm &uptarget = dynamic_cast<TMlnorm &>(target); 1349 1352 1350 1353 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"); 1352 1355 //Permutation vector of the new R 1353 1356 ivec irvn = rvn.dataind (rv);