Changeset 383

Show
Ignore:
Timestamp:
06/17/09 23:54:11 (16 years ago)
Author:
smidl
Message:

mex for merging and fixes in UI

Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • bdm/stat/libBM.h

    r378 r383  
    566566 
    567567*/ 
    568 class mepdf : public mpdf 
    569 { 
    570 public: 
    571   //!Default constructor 
    572   mepdf(epdf* em) : mpdf() {ep = em ;}; 
    573   mepdf(const epdf* em) : mpdf() {ep = const_cast<epdf*>(em);}; 
    574   void condition(const vec &cond) {} 
     568class mepdf : public mpdf { 
     569        bool owning_ep; // flag trigers deleting ep by destructor 
     570public: 
     571        //!Default constructor 
     572        mepdf ( epdf* em, bool owning_ep0=false ) :mpdf ( ) {ep= em ;owning_ep=owning_ep0;}; 
     573        mepdf (const epdf* em ) :mpdf ( ) {ep=const_cast<epdf*>( em );}; 
     574        void condition ( const vec &cond ) {} 
     575        ~mepdf(){if (owning_ep) delete ep;} 
    575576}; 
    576577 
     
    578579//!this abstract class is common to epdf and mpdf 
    579580//!\todo Think of better design - global functions rv=get_rv(Array<mpdf*> mpdfs); ?? 
    580 class compositepdf 
    581 { 
     581class compositepdf { 
    582582protected: 
    583583  //!Number of mpdfs in the composite 
  • bdm/user_info.cpp

    r377 r383  
    106106const Setting& UI::SettingResolver::initialize_reference(UI_File *&file, const Setting &potential_link) 
    107107{ 
     108        file = NULL; 
     109 
    108110    if ( potential_link.getType() !=  Setting::TypeString ) 
    109111            return potential_link; 
     
    122124    else 
    123125        { 
    124                 file = NULL; 
    125126                result = &potential_link; 
    126127        while ( !result->isRoot() ) 
  • bdm/user_info.h

    r378 r383  
    232232        { 
    233233                T* instance; 
    234                 from_setting<T>( to_child_setting( element, index ) ); 
     234                from_setting<T>( instance, to_child_setting( element, index ) ); 
    235235                return instance; 
    236236        } 
  • library/mex/mexlog.h

    r373 r383  
    2020}; 
    2121 
     22void Arrayvec2mxArray(const Array<vec> &in, mxArray *out) 
     23{ 
     24  int rows, cols, r, c; 
     25 
     26  double* temp = (double *) mxGetPr(out); 
     27  if (temp == 0) mexErrMsgTxt("mat2mxArray: Pointer to data is NULL"); 
     28 
     29  cols = in.size(); 
     30  if (cols == 0) mexErrMsgTxt("mat2mxArray: Data has zero columns"); 
     31 
     32  rows = in(0).length(); //length of the first vec 
     33  if (rows == 0) mexErrMsgTxt("mat2mxArray: Data has zero rows"); 
     34 
     35  for (c = 0; c < cols; c++) { 
     36    for (r = 0; r < rows; r++) { 
     37      *temp++ = in(c)(r); 
     38    } 
     39  } 
     40 
     41} 
    2242class mexlog : public memlog { 
    2343        public: