Changeset 390

Show
Ignore:
Timestamp:
06/19/09 12:41:37 (15 years ago)
Author:
mido
Message:

class bdmroot renamed to root, ui matrix patched (possibility of a "matrix" string at first place of the matrix list was allowed)

Location:
library
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/bdmbase.h

    r388 r390  
    8484*/ 
    8585 
    86 class RV : public bdmroot 
     86class RV : public root 
    8787{ 
    8888protected: 
     
    207207//! Class representing function \f$f(x)\f$ of variable \f$x\f$ represented by \c rv 
    208208 
    209 class fnc : public bdmroot 
     209class fnc : public root 
    210210{ 
    211211protected: 
     
    231231//! Probability density function with numerical statistics, e.g. posterior density. 
    232232 
    233 class epdf : public bdmroot 
     233class epdf : public root 
    234234{ 
    235235protected: 
     
    319319//TODO Samplecond can be generalized 
    320320 
    321 class mpdf : public bdmroot 
     321class mpdf : public root 
    322322{ 
    323323protected: 
     
    522522This class abstracts logging of results from implementation. This class replaces direct logging of results (e.g. to files or to global variables) by calling methods of a logger. Specializations of this abstract class for specific storage method are designed. 
    523523 */ 
    524 class logger : public bdmroot 
     524class logger : public root 
    525525{ 
    526526protected: 
     
    602602*/ 
    603603 
    604 class DS : public bdmroot 
     604class DS : public root 
    605605{ 
    606606protected: 
     
    674674*/ 
    675675 
    676 class BM : public bdmroot 
     676class BM : public root 
    677677{ 
    678678protected: 
  • library/bdm/base/user_info.cpp

    r384 r390  
    222222    if ( link.result.isList() ) 
    223223    { 
    224         if ( link.result.getLength() != 3 ) 
    225             ui_error( "the setting supposed to represent a matrix element has wrong syntax", link.result ); 
    226  
    227         Setting &rows_setting = link.result[0]; 
    228         Setting &cols_setting = link.result[1]; 
    229         Setting &elements = link.result[2]; 
     224                int data_offset; 
     225 
     226                if ( link.result.getLength() == 3 ) 
     227                        data_offset = 0; 
     228                else if ( link.result.getLength() == 4 ) 
     229                { 
     230                ASSERT_UITYPE(link.result[0],TypeString); 
     231                        if( link.result[0] != "matrix" ) 
     232                                ui_error( "the setting supposed to represent a matrix element has wrong syntax", link.result ); 
     233 
     234                        data_offset = 1; 
     235                } 
     236                else 
     237                        ui_error( "the setting supposed to represent a matrix element has wrong syntax", link.result ); 
     238 
     239        Setting &rows_setting = link.result[0 + data_offset]; 
     240        Setting &cols_setting = link.result[1 + data_offset]; 
     241        Setting &elements = link.result[2 + data_offset]; 
    230242 
    231243        ASSERT_UITYPE(cols_setting,TypeInt); 
  • library/bdm/base/user_info.h

    r388 r390  
    113113 
    114114        //! internal method assembling a typeless instance from components obtained by the 'AssemblyComponentsFromSetting()' method 
    115         virtual bdmroot* new_instance() const = 0; 
     115        virtual root* new_instance() const = 0; 
    116116         
    117117        //! This methods tries to save an instance of type T (or some of its descendant types) 
     
    150150                const UI& related_UI = Mapped_UI::retrieve_ui( class_name ); 
    151151                 
    152                 bdmroot* typeless_instance = related_UI.new_instance(); 
     152                root* typeless_instance = related_UI.new_instance(); 
    153153 
    154154                instance = NULL; 
     
    339339        static const Particular_UI<T>& ui;       
    340340 
    341         bdmroot* new_instance() const 
     341        root* new_instance() const 
    342342        { 
    343343                return new T(); 
  • library/bdm/bdmroot.h

    r387 r390  
    1111*/ 
    1212 
    13 #ifndef BDMROOT_H 
    14 #define BDMROOT_H 
     13#ifndef root_H 
     14#define root_H 
    1515 
    1616#include <string> 
     
    2626 
    2727//! Root class of BDM objects 
    28 class bdmroot { 
     28class root { 
    2929public: 
    3030        //! make sure this is a virtual object 
    31         virtual ~bdmroot()  
     31        virtual ~root()  
    3232        { 
    3333        } 
     
    5656 
    5757}; //namespace 
    58 #endif // BDMROOT_H 
     58#endif // root_H 
  • library/tests/test_user_info.cpp

    r386 r390  
    77using namespace bdm; 
    88 
    9 class Passenger : public bdmroot 
     9class Passenger : public root 
    1010{ 
    1111public: 
     
    7474UIREGISTER(Robot); 
    7575 
    76 class Transport : public bdmroot 
     76class Transport : public root 
    7777{ 
    7878public: