Changeset 308 for bdm/stat/libDS.cpp

Show
Ignore:
Timestamp:
04/09/09 09:13:35 (15 years ago)
Author:
dedecius
Message:

libDS.h & libDS.cpp - made 'pseudo'virtual object FileDS, which is a parent of ItppFileDS (the original FileDS) and CsvFileDS (for parsing data from CSV files).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • bdm/stat/libDS.cpp

    r278 r308  
    11 
    22#include "libDS.h" 
    3  
    43using namespace bdm; 
    54 
     
    5453} 
    5554 
     55CsvFileDS::CsvFileDS ( const string& fname, const string& orientation ) :FileDS() { 
     56        time = 0; 
     57                 
     58        vec data_line; 
     59        string line; 
     60 
     61        ifstream fs; 
     62        fs.open(fname.c_str()); 
     63        if(fs.is_open()) { 
     64             while ( getline(fs, line) ) { 
     65                 data_line.set(line); 
     66                 Data.append_row(data_line); 
     67             } 
     68        } 
     69         
     70        if(orientation == "BY_ROW") { 
     71             transpose(Data, Data); 
     72        } 
     73 
     74         
     75} 
     76 
    5677//! Auxiliary function building full history of rv0 
    5778RV fullrgr ( const RV &drv0, const RV &urv0, const RV &rrv0 ) { 
     
    6586        return T; 
    6687} 
     88