- Timestamp:
- 06/19/09 17:57:53 (16 years ago)
- Location:
- library/bdm
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.h
r390 r392 570 570 public: 571 571 //!Default constructor 572 mepdf ( epdf* em, bool owning_ep0=false ) :mpdf ( ) {ep= em ;owning_ep=owning_ep0; };572 mepdf ( epdf* em, bool owning_ep0=false ) :mpdf ( ) {ep= em ;owning_ep=owning_ep0;dimc=0;}; 573 573 mepdf (const epdf* em ) :mpdf ( ) {ep=const_cast<epdf*>( em );}; 574 574 void condition ( const vec &cond ) {} -
library/bdm/base/user_info.cpp
r390 r392 229 229 { 230 230 ASSERT_UITYPE(link.result[0],TypeString); 231 if( link.result[0] != "matrix" ) 231 const char* elem1=(const char*)link.result[0]; 232 if( (strcmp(elem1, "matrix") )) 232 233 ui_error( "the setting supposed to represent a matrix element has wrong syntax", link.result ); 233 234 … … 280 281 if ( link.result.isNumber() ) 281 282 { 282 ASSERT_UITYPE(link.result,TypeInt);283 // ASSERT_UITYPE(link.result,TypeInt); 283 284 vector.set_length( 1 ); 284 285 vector(0) = link.result; … … 299 300 300 301 Setting &elements = link.result[2]; 301 ASSERT_UITYPE(elements[0],TypeInt);302 // ASSERT_UITYPE(elements[0],TypeInt); -- spolehame an autoconvert 302 303 303 304 304 305 if ( matrix.cols() == 1 ) 305 306 for ( int i=0; i<len; i++ ) 306 vector(i) = matrix(i, 1);307 vector(i) = matrix(i,0); 307 308 else 308 309 for ( int i=0; i<len; i++ ) 309 vector(i) = matrix( 1,i);310 vector(i) = matrix(0,i); 310 311 return; 311 312 … … 353 354 if ( matrix.cols() == 1 ) 354 355 for ( int i=0; i<len; i++ ) 355 vector(i) = matrix(i, 1);356 vector(i) = matrix(i,0); 356 357 else 357 358 for ( int i=0; i<len; i++ ) 358 vector(i) = matrix( 1,i);359 vector(i) = matrix(0,i); 359 360 return; 360 361 } -
library/bdm/base/user_info.h
r390 r392 11 11 #include "itpp/itbase.h" 12 12 13 #include <stdexcept> 13 14 14 15 using std::string; … … 27 28 namespace bdm 28 29 { 30 31 //! exception used in UI::build if it fails it can be caught and handled - see merger_mex.h 32 class UIbuildException : public std::invalid_argument { 33 public: 34 UIbuildException() : std::invalid_argument("class name") { } 35 }; 36 29 37 class UI_File : public Config 30 38 { … … 153 161 154 162 instance = NULL; 155 try 156 { 157 instance = (T*) typeless_instance ; 163 //try catch does not work!!! 164 instance = dynamic_cast<T*>(typeless_instance); 165 if (!instance){ 166 throw UIbuildException(); 158 167 } 159 catch(...)160 {161 it_error ( "UI error: class " + class_name + " is not a descendant of the desired output class. Try to call the UI::build function with a different type parameter." );162 }163 168 // catch(...) 169 // { 170 // it_error ( "UI error: class " + class_name + " is not a descendant of the desired output class. Try to call the UI::build function with a different type parameter." ); 171 // } 172 // 164 173 try 165 174 { -
library/bdm/mex/mex_parser.h
r391 r392 24 24 Setting & child = setting.add(name,Setting::TypeList); 25 25 fillList(child,mxarray); 26 } 27 void addGroup(const mxArray *mxarray, const char* name){ 28 Setting & setting = this->getRoot(); //setting is a group 29 Setting & child = setting.add(name,Setting::TypeGroup); 30 fillGroup(child,mxarray); 31 } 32 operator Setting&() 33 { 34 return getRoot(); 26 35 } 27 36 private: -
library/bdm/stat/merger.h
r388 r392 81 81 void set_sources (const Array<mpdf*> &Sources, bool own) { 82 82 compositepdf::set_elements (Sources,own); 83 Nsources=mpdfs.length(); 83 84 //set sizes 84 85 dls.set_size (Sources.length()); … … 128 129 smpi (j) = XYZ (j) (0); /* beginning of the interval*/ 129 130 it_assert(gridsize(j)!=0.0,"Zeros in gridsize!"); 130 steps (j) = ( smpi(j) - XYZ(j)(1))/gridsize(j);131 steps (j) = ( XYZ(j)(1)-smpi(j) )/gridsize(j); 131 132 } 132 133 // fill samples … … 138 139 for (int j = 0;j < dim;j++) { 139 140 if (ind (j) == gridsize (j) - 1) { //j-th index is full 140 ind (j) = 0; //shift back141 // ind (j) = 0; //shift back 141 142 smpi(j) = XYZ(j)(0); 142 143 143 ind (j + 1) ++; //increase the next dimension;144 // ind (j + 1) ++; //increase the next dimension; 144 145 smpi(j+1) += steps(j+1); 145 146 146 147 if (ind (j + 1) < gridsize (j + 1) - 1) break; 147 148 } else { 148 ind (j) ++;149 // ind (j) ++; 149 150 smpi(j) +=steps(j); 150 151 break; … … 272 273 set_method (GEOMETRIC); 273 274 else if (!strcmp (meth_str.c_str(), "lognormal")) { 274 set_method ( GEOMETRIC);275 set_method (LOGNORMAL); 275 276 set.lookupValue( "beta",beta); 276 277 } 277 278 } 278 validate();279 279 } 280 280