Changeset 1015 for library/bdm/base

Show
Ignore:
Timestamp:
05/27/10 23:08:07 (14 years ago)
Author:
smidl
Message:

UI for ldmat - use it in egiw

Location:
library/bdm/base
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/user_info.cpp

    r959 r1015  
    257257                        new_field = matrix ( i, j ); 
    258258                } 
     259} 
     260 
     261void UI::save ( const ldmat &matrix, Setting &element, const string &name ) { 
     262        Setting &set = ( name == "" ) ? element.add ( Setting::TypeGroup) 
     263        : element.add ( name, Setting::TypeGroup ); 
     264         
     265        save (matrix._L(), set, "L"); 
     266        save (matrix._D(), set, "D"); 
    259267} 
    260268 
     
    371379} 
    372380 
     381void UI::from_setting ( ldmat& matrix, const Setting &element ) { 
     382        if(element.exists("L")){ 
     383                UI::from_setting(matrix.__L(), element["L"]); 
     384        } 
     385        if(element.exists("D")){ 
     386                UI::from_setting(matrix.__D(), element["D"]); 
     387        } 
     388        matrix.validate(); 
     389} 
     390 
    373391void UI::from_setting ( vec &vector, const Setting &element ) { 
    374392        const SettingResolver link ( element ); 
  • library/bdm/base/user_info.h

    r959 r1015  
    2525#include "../shared_ptr.h" 
    2626#include "itpp/itbase.h" 
     27#include "../math/square_mat.h" 
     28#include "../math/chmat.h" 
    2729 
    2830using std::string; 
     
    302304        //! This method converts a Setting into a matrix 
    303305        static void from_setting ( mat& matrix, const Setting &element ); 
     306        //! This method converts a Setting into a ldmat 
     307        static void from_setting ( ldmat& matrix, const Setting &element ); 
    304308        //! This method converts a Setting into an integer vector 
    305309        static void from_setting ( ivec &vector, const Setting &element ); 
     
    550554        //! A matrix(of type mat) is stored in the new child Setting appended to the passed element 
    551555        static void save ( const mat &matrix, Setting &element, const string &name = "" ); 
    552  
     556         
     557        //! A matrix(of type mat) is stored in the new child Setting appended to the passed element 
     558        static void save ( const ldmat &matrix, Setting &element, const string &name = "" ); 
     559         
    553560        //! An integer vector (of type ivec) is stored in the new child Setting appended to the passed element 
    554561        static void save ( const ivec &vec, Setting &element, const string &name = "" );