Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::SDBWithStats Class Reference

#include <SDBWithStats.h>

Inheritance diagram for PLearn::SDBWithStats:

Inheritance graph
[legend]
Collaboration diagram for PLearn::SDBWithStats:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int nfields ()
string fieldname (int i)
 SDBWithStats (string basename, string path=".", AccessType access=readwrite, bool verbose=true)
void forgetStats ()
void computeStats (unsigned int nrows)
void computeStats ()
bool hasStats ()
 returns true if the stats files exist

void saveStats ()
void loadStats ()
FieldStatgetStat (int i)
const FieldStatgetStat (int i) const
FieldStatgetStat (const string &fieldname)
const FieldStatgetStat (const string &fieldname) const

Public Attributes

vector< FieldStatfieldstat

Constructor & Destructor Documentation

PLearn::SDBWithStats::SDBWithStats string  basename,
string  path = ".",
AccessType  access = readwrite,
bool  verbose = true
 

Definition at line 98 of file SDBWithStats.cc.

References fieldstat, PLearn::SimpleDB< KeyType, QueryResult >::getSchema(), hasStats(), loadStats(), PLearn::SDB, and PLearn::SimpleDB< KeyType, QueryResult >::size().


Member Function Documentation

void PLearn::SDBWithStats::computeStats  )  [inline]
 

Definition at line 119 of file SDBWithStats.h.

References PLearn::SimpleDB< KeyType, QueryResult >::size().

void PLearn::SDBWithStats::computeStats unsigned int  nrows  ) 
 

Definition at line 112 of file SDBWithStats.cc.

References PLearn::Row::begin(), PLearn::CharacterType, PLearn::Row::const_iterator, PLearn::DateType, PLearn::DoubleType, PLearn::endl(), fieldstat, PLearn::FloatType, forgetStats(), PLearn::RowIterator::getFieldType(), PLearn::SimpleDB< KeyType, QueryResult >::getSchema(), PLearn::IntType, PLearn::RowIterator::isMissing(), nfields(), PLERROR, PLearn::SimpleDB< KeyType, QueryResult >::RowNumber, PLearn::ShortType, PLearn::SignedCharType, PLearn::StringType, PLearn::todouble(), and PLearn::tostring().

Referenced by PLearn::SDBVMatrix::SDBVMatrix().

string PLearn::SDBWithStats::fieldname int  i  )  [inline]
 

Definition at line 111 of file SDBWithStats.h.

References fieldname(), and PLearn::SimpleDB< KeyType, QueryResult >::getSchema().

Referenced by fieldname(), loadStats(), and saveStats().

void PLearn::SDBWithStats::forgetStats  ) 
 

Definition at line 106 of file SDBWithStats.cc.

References PLearn::FieldStat::clear(), getStat(), and PLearn::SimpleDB< KeyType, QueryResult >::width().

Referenced by computeStats(), and loadStats().

const FieldStat & PLearn::SDBWithStats::getStat const string fieldname  )  const
 

Definition at line 276 of file SDBWithStats.cc.

References getStat(), and PLERROR.

FieldStat & PLearn::SDBWithStats::getStat const string fieldname  ) 
 

Definition at line 268 of file SDBWithStats.cc.

References getStat(), and PLERROR.

const FieldStat & PLearn::SDBWithStats::getStat int  i  )  const
 

Definition at line 261 of file SDBWithStats.cc.

References fieldstat, PLERROR, and PLearn::SimpleDB< KeyType, QueryResult >::width().

FieldStat & PLearn::SDBWithStats::getStat int  i  ) 
 

Definition at line 254 of file SDBWithStats.cc.

References fieldstat, PLERROR, and PLearn::SimpleDB< KeyType, QueryResult >::width().

Referenced by forgetStats(), PLearn::SDBVMSource::getFieldStat(), and getStat().

bool PLearn::SDBWithStats::hasStats  ) 
 

returns true if the stats files exist

Definition at line 157 of file SDBWithStats.cc.

References PLearn::file_exists(), PLearn::SimpleDB< KeyType, QueryResult >::getName(), and PLearn::SimpleDB< KeyType, QueryResult >::getPath().

Referenced by PLearn::SDBVMatrix::SDBVMatrix(), and SDBWithStats().

void PLearn::SDBWithStats::loadStats  ) 
 

Definition at line 195 of file SDBWithStats.cc.

References fieldname(), fieldstat, forgetStats(), PLearn::SimpleDB< KeyType, QueryResult >::getName(), PLearn::SimpleDB< KeyType, QueryResult >::getPath(), k, PLearn::FieldStat::max_, PLearn::FieldStat::mean_, PLearn::FieldStat::min_, PLearn::FieldStat::missing_, PLearn::FieldStat::nonmissing_, PLERROR, PLearn::FieldStat::stddev_, PLearn::FieldStat::symbolcount, PLearn::FieldStat::symbolid, PLearn::tofloat(), and PLearn::toint().

Referenced by PLearn::SDBVMatrix::SDBVMatrix(), and SDBWithStats().

int PLearn::SDBWithStats::nfields  )  [inline]
 

Definition at line 110 of file SDBWithStats.h.

References PLearn::SimpleDB< KeyType, QueryResult >::getSchema().

Referenced by computeStats().

void PLearn::SDBWithStats::saveStats  ) 
 

Definition at line 164 of file SDBWithStats.cc.

References PLearn::endl(), fieldname(), fieldstat, PLearn::SimpleDB< KeyType, QueryResult >::getName(), PLearn::SimpleDB< KeyType, QueryResult >::getPath(), PLearn::FieldStat::max(), PLearn::FieldStat::mean(), PLearn::FieldStat::min(), PLearn::FieldStat::missing(), PLearn::FieldStat::nonmissing(), PLearn::FieldStat::nsymbols(), PLERROR, PLearn::FieldStat::stddev(), and PLearn::FieldStat::symbolcount.

Referenced by PLearn::SDBVMatrix::SDBVMatrix().


Member Data Documentation

vector<FieldStat> PLearn::SDBWithStats::fieldstat
 

Definition at line 109 of file SDBWithStats.h.

Referenced by computeStats(), getStat(), loadStats(), saveStats(), and SDBWithStats().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:23:02 2004 for PLearn by doxygen 1.3.7