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

PLearn::VMatrix Class Reference

#include <VMatrix.h>

Inheritance diagram for PLearn::VMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 VMatrix ()
 VMatrix (int the_length, int the_width)
virtual void build ()
 Should call simply inherited::build(), then this class's build_().

void init_map_sr () const
void defineSizes (int inputsize, int targetsize, int weightsize=0)
void copySizesFrom (VMat m)
 Copy the values of inputsize, targetsize and weightsize from the source matrix m.

bool looksTheSameAs (VMat m)
 Return true iif it looks like the same matrix, i.e. it has same sizes, width and length.

int inputsize () const
int targetsize () const
int weightsize () const
bool hasWeights () const
virtual void getExample (int i, Vec &input, Vec &target, real &weight)
 Default version calls getSubRow based on inputsize_ targetsize_ and weightsize_ But exotic subclasses may construct, input, target and weight however they please.

void setFieldInfos (const Array< VMField > &finfo)
bool hasFieldInfos () const
 returns true if fieldinfos have been set

Array< VMField > & getFieldInfos () const
 If no fieldnames have been set, will set default field names to "0", "1", "2", ... i.e. their column index.

VMFieldgetFieldInfos (int fieldindex) const
void declareField (int fieldindex, const string &fieldname, VMField::FieldType fieldtype=VMField::UnknownType)
void declareFieldNames (TVec< string > fnames)
 returns the column index corresponding to a fieldname < or -1 if the name was not found

int fieldIndex (const string &fieldname) const
 This first calls fieldIndex to try and get the index corresponding to the given string.

int getFieldIndex (const string &fieldname_or_num) const
 < conversion to int will be returned (or a PLEARNERROR issued if this fails).

string fieldName (int fieldindex) const
TVec< stringfieldNames () const
void unduplicateFieldNames ()
VMField::FieldType fieldType (int fieldindex) const
VMField::FieldType fieldType (const string &fieldname) const
const VMFieldStatfieldStat (int j) const
const VMFieldStatfieldStat (const string &fieldname) const
void printFields (ostream &out) const
void printFieldInfo (ostream &out, int fieldnum) const
void printFieldInfo (ostream &out, const string &fieldname_or_num) const
string fieldheader (int elementcharwidth=8)
void saveFieldInfos () const
void loadFieldInfos () const
void setSFIFFilename (int col, string ext, string filepath="")
void setSFIFFilename (string fieldname, string ext, string filepath="")
string getSFIFFilename (int col, string ext)
string getSFIFFilename (string fieldname, string ext)
bool isSFIFDirect (int col, string ext)
bool isSFIFDirect (string fieldname, string ext)
void saveAllStringMappings ()
void saveStringMappings (int col, string fname)
void addStringMapping (int col, string str, real val)
 adds a string<->real mapping

real addStringMapping (int col, string str)
 adds a string<->real mapping for a new string, if it doesn't already have one and returns the associated value if the string doesn'a already have an associated value, it will be associated with value -100-number_of_strings_already_in_the_map

void removeAllStringMappings ()
 remove all string mappings

void removeColumnStringMappings (int c)
 remove all string mappings of a given field

void removeStringMapping (int col, string str)
 removes a string mapping

void setStringMapping (int col, const map< string, real > &zemap)
 overwrite the string<->real mapping with this one (and build the reverse mapping)

void deleteStringMapping (int col)
 deletes all string mapping for column i

void loadStringMapping (int col)
 loads the appropriate string map file for column 'col'

void loadAllStringMappings ()
 loads the appropriate string map file for every column

void copyStringMappingsFrom (VMat source)
 Copy all string mappings from a given VMat.

virtual string getValString (int col, real val) const
 returns the string associated with value val for field# col.

virtual const map< string,
real > & 
getStringToRealMapping (int col) const
 returns the string->value mapping for field 'fld'

virtual const map< real, string > & getRealToStringMapping (int col) const
 returns the value->string mapping for field 'fld'

virtual real getStringVal (int col, const string &str) const
 returns value associated with a string (or MISSING_VALUE if there's no association for this string)

virtual string getString (int row, int col) const
 returns element as a string, even if value doesn't map to a string, in which case tostring(value) is returned

virtual void computeStats ()
bool hasStats () const
void saveStats (const string &filename) const
void loadStats (const string &filename)
virtual void setMetaDataDir (const string &the_metadatadir)
 this should be called by the build method of every VMatrix that has a metadatadir It will create said directory if it doesn's already exist.

bool hasMetaDataDir () const
 Returns true if a metadatadir was set.

string getMetaDataDir () const
 Throws a PLERROR if no metadatadir was set.

void lockMetaDataDir () const
 Locks the metadata directory by creating a .lock file inside it.

void unlockMetaDataDir () const
 Removes the .lock file inside the metadatadir.

string getAlias () const
 returns the 'alias' for this dataset.

void setAlias (const string &the_alias)
TVec< StatsCollectorgetStats () const
 returns the unconditonal statistics for the given field

StatsCollectorgetStats (int fieldnum) const
TVec< RealMappinggetRanges ()
 returns the ranges as defined in the ranges.psave file (for all fields) (if the ranges.psave file does not exist, a reasonable default version is created )

virtual void save (const string &filename) const
 returns the cooccurence statistics conditioned on the given field (within the ranges returned by getRanges() ) The results are cached in file stats#.psave (where # stands for the condfield index)

virtual void savePMAT (const string &pmatfile) const
virtual void saveDMAT (const string &dmatdir) const
virtual void saveAMAT (const string &amatfile, bool verbose=true, bool no_header=false) const
 Save the content of the matrix in the AMAT ASCII format into a file.

int width () const
int length () const
bool isWritable () const
string resolveFieldInfoLink (string target, string source)
time_t getMtime () const
 Return the time of "last modification" associated with this matrix The result returned is typically based on mtime of the files contianing this matrix's data when the object is constructed.

void setMtime (time_t t)
 Sets the "last modification" time for this matrix For matrices on disk, this should be called by the constructor to reflect the mtime of the disk files.

virtual real get (int i, int j) const
 returns element (i,j)

virtual void put (int i, int j, real value)
 sets element (i,j) to value

virtual void getSubRow (int i, int j, Vec v) const
 fills v with the subrow i lying between columns j (inclusive) and j+v.length() (exclusive)

virtual void putSubRow (int i, int j, Vec v)
virtual void appendRow (Vec v)
 This method must be implemented for matrices that are allowed to grow.

virtual void flush ()
 For matrices stored on disk, this should flush all pending buffered write operations.

void putOrAppendRow (int i, Vec v)
 will call putRow if i<length() and appendRow if i==length()

void forcePutRow (int i, Vec v)
 will call putRow if i<length() if i>= length(), it will call appendRow with 0 filled rows as many times as necessary before it can append row i

virtual void getRow (int i, Vec v) const
 copies row i into v (which must have appropriate length equal to the VMat's width)

virtual void putRow (int i, Vec v)
virtual void fill (real value)
virtual void getMat (int i, int j, Mat m) const
 copies the submatrix starting at i,j into m (which must have appropriate length and width)

virtual void putMat (int i, int j, Mat m)
 copies matrix m at position i,j of this VMat

virtual void getColumn (int i, Vec v) const
 copies column i into v (which must have appropriate length equal to the VMat's length)

virtual bool find (const Vec &input, real tolerance, int *i=0) const
 Return true iff the input vector is in this VMat (we compare only the input part).

virtual Mat toMat () const
virtual void compacify ()
 The default implementation of this method does nothing, but subclasses may overload it to reallocate memory to exactly what is needed and no more.

virtual void reset_dimensions ()
 in case the dimensions of an underlying vmat has changed, recompute it

virtual VMat subMat (int i, int j, int l, int w)
virtual real dot (int i1, int i2, int inputsize) const
real dot (int i1, int i2) const
virtual real dot (int i, const Vec &v) const
 returns the result of the dot product between row i and the given vec (only v.length() first elements of row i are considered).

 operator Mat () const
virtual void getRow (int i, VarArray &inputs) const
 Assigns the value of the Vars in the list (the total size of all the vars in the list must equal width() ).

void print (ostream &out) const
virtual void oldwrite (ostream &out) const
virtual void oldread (istream &in)
 DEPRECATED For backward compatibility with old saved object.

 PLEARN_DECLARE_ABSTRACT_OBJECT (VMatrix)
void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
virtual void evaluateKernel (Ker ker, int v1_startcol, int v1_ncols, const Vec &v2, const Vec &result, int startrow=0, int nrows=-1) const
virtual real evaluateKernelSum (Ker ker, int v1_startcol, int v1_ncols, const Vec &v2, int startrow=0, int nrows=-1, int ignore_this_row=-1) const
 returns sum_i [ ker( m(i).subVec(v1_startcol,v1_ncols) , v2) ]

virtual real evaluateKernelWeightedTargetSum (Ker ker, int v1_startcol, int v1_ncols, const Vec &v2, int t_startcol, int t_ncols, Vec &targetsum, int startrow=0, int nrows=-1, int ignore_this_row=-1) const
 targetsum := sum_i [ m(i).subVec(t_startcol,t_ncols) * ker( m(i).subVec(v1_startcol,v1_ncols) , v2) ] and returns sum_i [ ker( m(i).subVec(v1_startcol,v1_ncols) , v2) ]

virtual TVec< pair< real,
int > > 
evaluateKernelTopN (int N, Ker ker, int v1_startcol, int v1_ncols, const Vec &v2, int startrow=0, int nrows=-1, int ignore_this_row=-1) const
virtual TVec< pair< real,
int > > 
evaluateKernelBottomN (int N, Ker ker, int v1_startcol, int v1_ncols, const Vec &v2, int startrow=0, int nrows=-1, int ignore_this_row=-1) const
 same as evaluateKernelTopN but will look for the N smallest values instead of top values.

virtual void accumulateXtY (int X_startcol, int X_ncols, int Y_startcol, int Y_ncols, Mat &result, int startrow=0, int nrows=-1, int ignore_this_row=-1) const
virtual void accumulateXtX (int X_startcol, int X_ncols, Mat &result, int startrow=0, int nrows=-1, int ignore_this_row=-1) const
virtual void evaluateSumOfFprop (Func f, Vec &output_result, int nsamples=-1)
 compute fprop or fbprop of a sumOf operation

virtual void evaluateSumOfFbprop (Func f, Vec &output_result, Vec &output_gradient, int nsamples=-1)
virtual ~VMatrix ()

Static Public Member Functions

void declareOptions (OptionList &ol)
 redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)


Public Attributes

Array< VMFieldfieldinfos
Array< VMFieldStatfieldstats

Protected Attributes

int length_
int width_
time_t mtime_
int inputsize_
int targetsize_
int weightsize_
bool writable
string metadatadir
 Path of directory (possibly relative to DBDIR) that will contain meta information on this dataset (fieldnames, cached statistics, etc...) and possibly the data itself.

string alias_
TVec< StatsCollectorfield_stats
 stats[i] contains stats for field #i

TVec< map< string, real > > map_sr
TVec< map< real, string > > map_rs

Private Types

typedef Object inherited

Private Member Functions

void build_ ()
 This does the actual building.


Private Attributes

FILE * lockf_
Vec get_row
 .lock file in metadatadir Used in the 'find' method to store a row.

Vec dotrow_1
 Used in the default dot(i,j) method to store the i-th and j-th rows.

Vec dotrow_2

Detailed Description

** VMatrix **

Definition at line 65 of file VMatrix.h.


Member Typedef Documentation

typedef Object PLearn::VMatrix::inherited [private]
 

Reimplemented from PLearn::Object.

Reimplemented in PLearn::SDBVMatrix, PLearn::AsciiVMatrix, PLearn::AutoVMatrix, PLearn::BatchVMatrix, PLearn::BootstrapVMatrix, PLearn::ByteMemoryVMatrix, PLearn::CenteredVMatrix, PLearn::CompactVMatrix, PLearn::CompressedVMatrix, PLearn::ConcatColumnsVMatrix, PLearn::ConcatRowsSubVMatrix, PLearn::ConcatRowsVMatrix, PLearn::CrossReferenceVMatrix, PLearn::CumVMatrix, PLearn::DatedJoinVMatrix, PLearn::DatedVMatrix, PLearn::DiskVMatrix, PLearn::ExtendedVMatrix, PLearn::FileVMatrix, PLearn::FilteredVMatrix, PLearn::FinancePreprocVMatrix, PLearn::ForwardVMatrix, PLearn::GeneralizedOneHotVMatrix, PLearn::GetInputVMatrix, PLearn::GramVMatrix, PLearn::IndexedVMatrix, PLearn::InterleaveVMatrix, PLearn::JoinVMatrix, PLearn::JulianizeVMatrix, PLearn::KernelVMatrix, PLearn::KNNVMatrix, PLearn::LearnerProcessedVMatrix, PLearn::LocalNeighborsDifferencesVMatrix, PLearn::MemoryVMatrix, PLearn::MovingAverageVMatrix, PLearn::MultiInstanceVMatrix, PLearn::OneHotVMatrix, PLearn::PairsVMatrix, PLearn::PLearnerOutputVMatrix, PLearn::PrecomputedVMatrix, PLearn::ProcessingVMatrix, PLearn::RangeVMatrix, PLearn::RegularGridVMatrix, PLearn::RemapLastColumnVMatrix, PLearn::RemoveDuplicateVMatrix, PLearn::RemoveRowsVMatrix, PLearn::RowBufferedVMatrix, PLearn::RowsSubVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, PLearn::ShiftAndRescaleVMatrix, PLearn::SortRowsVMatrix, PLearn::SourceVMatrix, PLearn::SparseVMatrix, PLearn::StrTableVMatrix, PLearn::SubInputVMatrix, PLearn::SubVMatrix, PLearn::TemporalHorizonVMatrix, PLearn::ThresholdVMatrix, PLearn::TransposeVMatrix, PLearn::UniformizeVMatrix, PLearn::UniformVMatrix, PLearn::UpsideDownVMatrix, PLearn::VecExtendedVMatrix, PLearn::PreprocessingVMatrix, PLearn::VMatrixFromDistribution, PLearn::VVMatrix, PLearn::YMDDatedVMatrix, and PLearn::TextSenseSequenceVMatrix.

Definition at line 70 of file VMatrix.h.


Constructor & Destructor Documentation

PLearn::VMatrix::VMatrix  ) 
 

Definition at line 76 of file VMatrix.cc.

PLearn::VMatrix::VMatrix int  the_length,
int  the_width
 

Definition at line 82 of file VMatrix.cc.

References map_rs, and map_sr.

PLearn::VMatrix::~VMatrix  )  [virtual]
 

Definition at line 1085 of file VMatrix.cc.


Member Function Documentation

void PLearn::VMatrix::accumulateXtX int  X_startcol,
int  X_ncols,
Mat result,
int  startrow = 0,
int  nrows = -1,
int  ignore_this_row = -1
const [virtual]
 

A special case of method accumulateXtY result += transpose(X).X Where X = this->subMatColumns(X_startcol,X_ncols)

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1287 of file VMatrix.cc.

References PLearn::externalProductAcc(), getSubRow(), length_, and x.

void PLearn::VMatrix::accumulateXtY int  X_startcol,
int  X_ncols,
int  Y_startcol,
int  Y_ncols,
Mat result,
int  startrow = 0,
int  nrows = -1,
int  ignore_this_row = -1
const [virtual]
 

result += transpose(X).Y Where X = this->subMatColumns(X_startcol,X_ncols) and Y = this->subMatColumns(Y_startcol,Y_ncols);

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1270 of file VMatrix.cc.

References PLearn::externalProductAcc(), getSubRow(), length_, and x.

real PLearn::VMatrix::addStringMapping int  col,
string  str
 

adds a string<->real mapping for a new string, if it doesn't already have one and returns the associated value if the string doesn'a already have an associated value, it will be associated with value -100-number_of_strings_already_in_the_map

Definition at line 492 of file VMatrix.cc.

References addStringMapping(), PLearn::TVec< map< string, real > >::find(), init_map_sr(), map_sr, and val.

void PLearn::VMatrix::addStringMapping int  col,
string  str,
real  val
 

adds a string<->real mapping

Definition at line 485 of file VMatrix.cc.

References init_map_sr(), map_rs, map_sr, and val.

Referenced by addStringMapping().

void PLearn::VMatrix::appendRow Vec  v  )  [virtual]
 

This method must be implemented for matrices that are allowed to grow.

Reimplemented in PLearn::AsciiVMatrix, PLearn::CompressedVMatrix, PLearn::DiskVMatrix, PLearn::FileVMatrix, PLearn::ForwardVMatrix, and PLearn::MemoryVMatrix.

Definition at line 932 of file VMatrix.cc.

References PLERROR.

Referenced by forcePutRow(), and putOrAppendRow().

void PLearn::VMatrix::build  )  [virtual]
 

Should call simply inherited::build(), then this class's build_().

This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::AsciiVMatrix, PLearn::AutoVMatrix, PLearn::BatchVMatrix, PLearn::BootstrapVMatrix, PLearn::CenteredVMatrix, PLearn::CompactVMatrix, PLearn::ConcatColumnsVMatrix, PLearn::ConcatRowsSubVMatrix, PLearn::ConcatRowsVMatrix, PLearn::CrossReferenceVMatrix, PLearn::CumVMatrix, PLearn::DatedJoinVMatrix, PLearn::DatedVMatrix, PLearn::DiskVMatrix, PLearn::ExtendedVMatrix, PLearn::FileVMatrix, PLearn::FilteredVMatrix, PLearn::FinancePreprocVMatrix, PLearn::ForwardVMatrix, PLearn::GeneralizedOneHotVMatrix, PLearn::GetInputVMatrix, PLearn::GramVMatrix, PLearn::IndexedVMatrix, PLearn::InterleaveVMatrix, PLearn::JoinVMatrix, PLearn::JulianizeVMatrix, PLearn::KernelVMatrix, PLearn::KNNVMatrix, PLearn::LearnerProcessedVMatrix, PLearn::LocalNeighborsDifferencesVMatrix, PLearn::MemoryVMatrix, PLearn::MovingAverageVMatrix, PLearn::MultiInstanceVMatrix, PLearn::OneHotVMatrix, PLearn::PairsVMatrix, PLearn::PLearnerOutputVMatrix, PLearn::PrecomputedVMatrix, PLearn::ProcessingVMatrix, PLearn::RangeVMatrix, PLearn::RegularGridVMatrix, PLearn::RemapLastColumnVMatrix, PLearn::RemoveDuplicateVMatrix, PLearn::RemoveRowsVMatrix, PLearn::RowsSubVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, PLearn::ShiftAndRescaleVMatrix, PLearn::SortRowsVMatrix, PLearn::SourceVMatrix, PLearn::SparseVMatrix, PLearn::SubInputVMatrix, PLearn::SubVMatrix, PLearn::TemporalHorizonVMatrix, PLearn::TransposeVMatrix, PLearn::UniformizeVMatrix, PLearn::UniformVMatrix, PLearn::UpsideDownVMatrix, PLearn::VecExtendedVMatrix, PLearn::PreprocessingVMatrix, PLearn::VMatrixFromDistribution, PLearn::VVMatrix, PLearn::YMDDatedVMatrix, and PLearn::TextSenseSequenceVMatrix.

Definition at line 207 of file VMatrix.cc.

References build_().

void PLearn::VMatrix::build_  )  [private]
 

This does the actual building.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::AsciiVMatrix, PLearn::AutoVMatrix, PLearn::BatchVMatrix, PLearn::BootstrapVMatrix, PLearn::CenteredVMatrix, PLearn::ConcatColumnsVMatrix, PLearn::ConcatRowsSubVMatrix, PLearn::ConcatRowsVMatrix, PLearn::CrossReferenceVMatrix, PLearn::CumVMatrix, PLearn::DatedJoinVMatrix, PLearn::DatedVMatrix, PLearn::DiskVMatrix, PLearn::ExtendedVMatrix, PLearn::FileVMatrix, PLearn::FilteredVMatrix, PLearn::FinancePreprocVMatrix, PLearn::ForwardVMatrix, PLearn::GeneralizedOneHotVMatrix, PLearn::GetInputVMatrix, PLearn::GramVMatrix, PLearn::IndexedVMatrix, PLearn::InterleaveVMatrix, PLearn::JoinVMatrix, PLearn::JulianizeVMatrix, PLearn::KernelVMatrix, PLearn::KNNVMatrix, PLearn::LearnerProcessedVMatrix, PLearn::LocalNeighborsDifferencesVMatrix, PLearn::MemoryVMatrix, PLearn::MovingAverageVMatrix, PLearn::MultiInstanceVMatrix, PLearn::OneHotVMatrix, PLearn::PairsVMatrix, PLearn::PLearnerOutputVMatrix, PLearn::PrecomputedVMatrix, PLearn::ProcessingVMatrix, PLearn::RangeVMatrix, PLearn::RegularGridVMatrix, PLearn::RemapLastColumnVMatrix, PLearn::RemoveDuplicateVMatrix, PLearn::RemoveRowsVMatrix, PLearn::RowsSubVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, PLearn::ShiftAndRescaleVMatrix, PLearn::SortRowsVMatrix, PLearn::SourceVMatrix, PLearn::SparseVMatrix, PLearn::SubInputVMatrix, PLearn::SubVMatrix, PLearn::TemporalHorizonVMatrix, PLearn::TransposeVMatrix, PLearn::UniformizeVMatrix, PLearn::UniformVMatrix, PLearn::UpsideDownVMatrix, PLearn::VecExtendedVMatrix, PLearn::PreprocessingVMatrix, PLearn::VMatrixFromDistribution, PLearn::VVMatrix, PLearn::YMDDatedVMatrix, and PLearn::TextSenseSequenceVMatrix.

Definition at line 201 of file VMatrix.cc.

References metadatadir, and setMetaDataDir().

Referenced by build().

void PLearn::VMatrix::compacify  )  [virtual]
 

The default implementation of this method does nothing, but subclasses may overload it to reallocate memory to exactly what is needed and no more.

Reimplemented in PLearn::CompressedVMatrix, and PLearn::ForwardVMatrix.

Definition at line 990 of file VMatrix.cc.

void PLearn::VMatrix::computeStats  )  [virtual]
 

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 313 of file VMatrix.cc.

References fieldstats, getRow(), length(), and width().

void PLearn::VMatrix::copySizesFrom VMat  m  ) 
 

Copy the values of inputsize, targetsize and weightsize from the source matrix m.

Definition at line 659 of file VMatrix.cc.

References defineSizes().

void PLearn::VMatrix::copyStringMappingsFrom VMat  source  ) 
 

Copy all string mappings from a given VMat.

Definition at line 799 of file VMatrix.cc.

References map_rs, map_sr, PLERROR, PLearn::TVec< map< string, real > >::resize(), PLearn::TVec< map< real, string > >::resize(), setStringMapping(), PLearn::VMat::width(), and width_.

void PLearn::VMatrix::declareField int  fieldindex,
const string fieldname,
VMField::FieldType  fieldtype = VMField::UnknownType
 

Definition at line 362 of file VMatrix.cc.

References getFieldInfos().

Referenced by declareFieldNames().

void PLearn::VMatrix::declareFieldNames TVec< string fnames  ) 
 

returns the column index corresponding to a fieldname < or -1 if the name was not found

Definition at line 365 of file VMatrix.cc.

References declareField(), PLearn::TVec< T >::length(), PLERROR, and width().

void PLearn::VMatrix::declareOptions OptionList ol  )  [static]
 

redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)

ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); }

Reimplemented from PLearn::Object.

Reimplemented in PLearn::AsciiVMatrix, PLearn::AutoVMatrix, PLearn::BatchVMatrix, PLearn::BootstrapVMatrix, PLearn::CenteredVMatrix, PLearn::ConcatColumnsVMatrix, PLearn::ConcatRowsSubVMatrix, PLearn::ConcatRowsVMatrix, PLearn::CrossReferenceVMatrix, PLearn::CumVMatrix, PLearn::DatedJoinVMatrix, PLearn::DatedVMatrix, PLearn::DiskVMatrix, PLearn::ExtendedVMatrix, PLearn::FileVMatrix, PLearn::FilteredVMatrix, PLearn::FinancePreprocVMatrix, PLearn::ForwardVMatrix, PLearn::GeneralizedOneHotVMatrix, PLearn::GetInputVMatrix, PLearn::GramVMatrix, PLearn::IndexedVMatrix, PLearn::InterleaveVMatrix, PLearn::JoinVMatrix, PLearn::JulianizeVMatrix, PLearn::KernelVMatrix, PLearn::KNNVMatrix, PLearn::LearnerProcessedVMatrix, PLearn::LocalNeighborsDifferencesVMatrix, PLearn::MemoryVMatrix, PLearn::MovingAverageVMatrix, PLearn::MultiInstanceVMatrix, PLearn::OneHotVMatrix, PLearn::PairsVMatrix, PLearn::PLearnerOutputVMatrix, PLearn::PrecomputedVMatrix, PLearn::ProcessingVMatrix, PLearn::RangeVMatrix, PLearn::RegularGridVMatrix, PLearn::RemapLastColumnVMatrix, PLearn::RemoveDuplicateVMatrix, PLearn::RemoveRowsVMatrix, PLearn::RowsSubVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, PLearn::ShiftAndRescaleVMatrix, PLearn::SortRowsVMatrix, PLearn::SourceVMatrix, PLearn::SparseVMatrix, PLearn::SubInputVMatrix, PLearn::SubVMatrix, PLearn::TemporalHorizonVMatrix, PLearn::TransposeVMatrix, PLearn::UniformizeVMatrix, PLearn::UniformVMatrix, PLearn::UpsideDownVMatrix, PLearn::VecExtendedVMatrix, PLearn::PreprocessingVMatrix, PLearn::VMatrixFromDistribution, PLearn::VVMatrix, PLearn::YMDDatedVMatrix, and PLearn::TextSenseSequenceVMatrix.

Definition at line 91 of file VMatrix.cc.

References PLearn::declareOption(), and PLearn::OptionList.

void PLearn::VMatrix::defineSizes int  inputsize,
int  targetsize,
int  weightsize = 0
[inline]
 

Definition at line 139 of file VMatrix.h.

References defineSizes(), inputsize_, targetsize_, and weightsize_.

Referenced by copySizesFrom(), and defineSizes().

void PLearn::VMatrix::deleteStringMapping int  col  ) 
 

deletes all string mapping for column i

Definition at line 580 of file VMatrix.cc.

References PLearn::Object::classname(), PLearn::TVec< map< real, string > >::clear(), PLearn::TVec< map< string, real > >::clear(), init_map_sr(), map_rs, map_sr, PLERROR, PLearn::TVec< map< real, string > >::size(), and PLearn::TVec< map< string, real > >::size().

Referenced by loadStringMapping().

real PLearn::VMatrix::dot int  i,
const Vec v
const [virtual]
 

returns the result of the dot product between row i and the given vec (only v.length() first elements of row i are considered).

Reimplemented in PLearn::CompactVMatrix, PLearn::ConcatColumnsVMatrix, PLearn::ConcatRowsSubVMatrix, PLearn::ConcatRowsVMatrix, PLearn::ForwardVMatrix, PLearn::MemoryVMatrix, PLearn::OneHotVMatrix, PLearn::RemoveRowsVMatrix, PLearn::RowBufferedVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, PLearn::SparseVMatrix, PLearn::SubVMatrix, and PLearn::TemporalHorizonVMatrix.

Definition at line 1015 of file VMatrix.cc.

References PLearn::dot(), dotrow_1, getSubRow(), PLearn::TVec< T >::length(), and PLearn::TVec< T >::resize().

real PLearn::VMatrix::dot int  i1,
int  i2
const [inline]
 

Definition at line 476 of file VMatrix.h.

References PLearn::dot(), and width().

real PLearn::VMatrix::dot int  i1,
int  i2,
int  inputsize
const [virtual]
 

returns the dot product between row i1 and row i2 (considering only the inputsize first elements). The default version in VMatrix is somewhat inefficient, as it repeatedly calls get(i,j) The default version in RowBufferedVMatrix is a little better as it buffers the 2 Vecs between calls in case one of them is needed again. But the real strength of this method is for specialised and efficient versions in subbclasses. This method is typically used by SmartKernels so that they can compute kernel values between input samples efficiently.

Reimplemented in PLearn::CompactVMatrix, PLearn::ConcatColumnsVMatrix, PLearn::ConcatRowsSubVMatrix, PLearn::ConcatRowsVMatrix, PLearn::ForwardVMatrix, PLearn::MemoryVMatrix, PLearn::OneHotVMatrix, PLearn::RemoveRowsVMatrix, PLearn::RowBufferedVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, PLearn::SparseVMatrix, PLearn::SubVMatrix, and PLearn::TemporalHorizonVMatrix.

Definition at line 1006 of file VMatrix.cc.

References PLearn::dot(), dotrow_1, dotrow_2, getSubRow(), and PLearn::TVec< T >::resize().

void PLearn::VMatrix::evaluateKernel Ker  ker,
int  v1_startcol,
int  v1_ncols,
const Vec v2,
const Vec result,
int  startrow = 0,
int  nrows = -1
const [virtual]
 

This will compute for this vmat m a result vector (whose length must be tha same as m's) s.t. result[i] = ker( m(i).subVec(v1_startcol,v1_ncols) , v2) i.e. the kernel value betweeen each (sub)row of m and v2

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1180 of file VMatrix.cc.

References getSubRow(), PLearn::TVec< T >::length(), length_, and PLERROR.

TVec< pair< real, int > > PLearn::VMatrix::evaluateKernelBottomN int  N,
Ker  ker,
int  v1_startcol,
int  v1_ncols,
const Vec v2,
int  startrow = 0,
int  nrows = -1,
int  ignore_this_row = -1
const [virtual]
 

same as evaluateKernelTopN but will look for the N smallest values instead of top values.

results are sorted with smallest kernel value first

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1250 of file VMatrix.cc.

References PLearn::BottomNI< T >::getBottomN(), getSubRow(), length_, PLearn::BottomNI< T >::sort(), and PLearn::BottomNI< T >::update().

real PLearn::VMatrix::evaluateKernelSum Ker  ker,
int  v1_startcol,
int  v1_ncols,
const Vec v2,
int  startrow = 0,
int  nrows = -1,
int  ignore_this_row = -1
const [virtual]
 

returns sum_i [ ker( m(i).subVec(v1_startcol,v1_ncols) , v2) ]

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1196 of file VMatrix.cc.

References getSubRow(), and length_.

TVec< pair< real, int > > PLearn::VMatrix::evaluateKernelTopN int  N,
Ker  ker,
int  v1_startcol,
int  v1_ncols,
const Vec v2,
int  startrow = 0,
int  nrows = -1,
int  ignore_this_row = -1
const [virtual]
 

This will return the Top N kernel evaluated values (between vmat (sub)rows and v2) and their associated row_index. Result is returned as a vector of length N of pairs (kernel_value,row_index) Results are sorted with largest kernel value first

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1233 of file VMatrix.cc.

References getSubRow(), PLearn::TopNI< T >::getTopN(), length_, PLearn::TopNI< T >::sort(), and PLearn::TopNI< T >::update().

real PLearn::VMatrix::evaluateKernelWeightedTargetSum Ker  ker,
int  v1_startcol,
int  v1_ncols,
const Vec v2,
int  t_startcol,
int  t_ncols,
Vec targetsum,
int  startrow = 0,
int  nrows = -1,
int  ignore_this_row = -1
const [virtual]
 

targetsum := sum_i [ m(i).subVec(t_startcol,t_ncols) * ker( m(i).subVec(v1_startcol,v1_ncols) , v2) ] and returns sum_i [ ker( m(i).subVec(v1_startcol,v1_ncols) , v2) ]

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1213 of file VMatrix.cc.

References PLearn::TVec< T >::clear(), getSubRow(), length_, and PLearn::multiplyAcc().

void PLearn::VMatrix::evaluateSumOfFbprop Func  f,
Vec output_result,
Vec output_gradient,
int  nsamples = -1
[virtual]
 

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1322 of file VMatrix.cc.

References PLearn::TVec< T >::clear(), getRow(), PLearn::TVec< T >::length(), length(), and width().

void PLearn::VMatrix::evaluateSumOfFprop Func  f,
Vec output_result,
int  nsamples = -1
[virtual]
 

compute fprop or fbprop of a sumOf operation

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1300 of file VMatrix.cc.

References PLearn::TVec< T >::clear(), getRow(), PLearn::TVec< T >::length(), length(), and width().

string PLearn::VMatrix::fieldheader int  elementcharwidth = 8  ) 
 

Definition at line 354 of file VMatrix.cc.

int PLearn::VMatrix::fieldIndex const string fieldname  )  const
 

This first calls fieldIndex to try and get the index corresponding to the given string.

Definition at line 182 of file VMatrix.cc.

References getFieldInfos(), and width().

Referenced by getFieldIndex().

string PLearn::VMatrix::fieldName int  fieldindex  )  const [inline]
 

Definition at line 191 of file VMatrix.h.

References fieldName(), and getFieldInfos().

Referenced by fieldName(), PLearn::VMat::fieldName(), fieldNames(), getSFIFFilename(), isSFIFDirect(), saveAMAT(), and setSFIFFilename().

TVec< string > PLearn::VMatrix::fieldNames  )  const
 

Definition at line 173 of file VMatrix.cc.

References fieldName(), and width().

const VMFieldStat& PLearn::VMatrix::fieldStat const string fieldname  )  const [inline]
 

Definition at line 198 of file VMatrix.h.

const VMFieldStat& PLearn::VMatrix::fieldStat int  j  )  const [inline]
 

Definition at line 197 of file VMatrix.h.

References fieldStat(), and fieldstats.

Referenced by fieldStat().

VMField::FieldType PLearn::VMatrix::fieldType const string fieldname  )  const [inline]
 

Definition at line 196 of file VMatrix.h.

References fieldType().

VMField::FieldType PLearn::VMatrix::fieldType int  fieldindex  )  const [inline]
 

Definition at line 195 of file VMatrix.h.

References getFieldInfos().

Referenced by fieldType().

void PLearn::VMatrix::fill real  value  )  [virtual]
 

Reimplemented in PLearn::ForwardVMatrix, and PLearn::MemoryVMatrix.

Definition at line 926 of file VMatrix.cc.

References length(), putRow(), and width().

bool PLearn::VMatrix::find const Vec input,
real  tolerance,
int i = 0
const [virtual]
 

Return true iff the input vector is in this VMat (we compare only the input part).

If the parameter 'i' is provided, it will be filled with the index of the corresponding data point, or with -1 if it does not exist in this VMat. The 'tolerance' parameter indicates the maximum squared distance between two points to consider them as equal.

Definition at line 1036 of file VMatrix.cc.

References get_row, getSubRow(), inputsize(), length(), PLearn::TVec< T >::length(), PLERROR, PLearn::powdistance(), and PLearn::TVec< T >::resize().

void PLearn::VMatrix::flush  )  [virtual]
 

For matrices stored on disk, this should flush all pending buffered write operations.

Reimplemented in PLearn::DiskVMatrix, and PLearn::FileVMatrix.

Definition at line 937 of file VMatrix.cc.

void PLearn::VMatrix::forcePutRow int  i,
Vec  v
 

will call putRow if i<length() if i>= length(), it will call appendRow with 0 filled rows as many times as necessary before it can append row i

Definition at line 950 of file VMatrix.cc.

References appendRow(), PLearn::TVec< T >::clear(), length(), putRow(), and width().

real PLearn::VMatrix::get int  i,
int  j
const [virtual]
 

returns element (i,j)

Reimplemented in PLearn::NistDB, PLearn::KernelVMatrix, PLearn::BatchVMatrix, PLearn::ByteMemoryVMatrix, PLearn::ConcatRowsSubVMatrix, PLearn::ConcatRowsVMatrix, PLearn::CrossReferenceVMatrix, PLearn::ForwardVMatrix, PLearn::IndexedVMatrix, PLearn::InterleaveVMatrix, PLearn::KernelVMatrix, PLearn::MemoryVMatrix, PLearn::RangeVMatrix, PLearn::RemoveRowsVMatrix, PLearn::RowBufferedVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, PLearn::ShiftAndRescaleVMatrix, PLearn::SubVMatrix, PLearn::TemporalHorizonVMatrix, PLearn::UniformVMatrix, PLearn::VMatrixFromDistribution, and PLearn::VVMatrix.

Definition at line 869 of file VMatrix.cc.

References c_str(), PLearn::Object::classname(), and PLERROR.

Referenced by getColumn(), getExample(), getString(), getSubRow(), and PLearn::VMat::operator()().

string PLearn::VMatrix::getAlias  )  const [inline]
 

returns the 'alias' for this dataset.

The alias is a short name that can be used as part of a filename containing results related to this VMat.

Definition at line 323 of file VMatrix.h.

References alias_.

void PLearn::VMatrix::getColumn int  i,
Vec  v
const [virtual]
 

copies column i into v (which must have appropriate length equal to the VMat's length)

Reimplemented in PLearn::ForwardVMatrix, PLearn::MemoryVMatrix, and PLearn::VMatrixFromDistribution.

Definition at line 880 of file VMatrix.cc.

References get(), length(), PLearn::TVec< T >::length(), and PLERROR.

Referenced by PLearn::VMat::getColumn().

void PLearn::VMatrix::getExample int  i,
Vec input,
Vec target,
real weight
[virtual]
 

Default version calls getSubRow based on inputsize_ targetsize_ and weightsize_ But exotic subclasses may construct, input, target and weight however they please.

If not a weighted matrix, weight should be set to default value 1.

Definition at line 289 of file VMatrix.cc.

References get(), getSubRow(), inputsize_, PLERROR, PLearn::TVec< T >::resize(), targetsize_, and weightsize_.

Referenced by PLearn::VMat::getExample().

int PLearn::VMatrix::getFieldIndex const string fieldname_or_num  )  const
 

< conversion to int will be returned (or a PLEARNERROR issued if this fails).

Definition at line 191 of file VMatrix.cc.

References fieldIndex(), PLERROR, PLearn::toint(), and width().

Referenced by PLearn::VMat::getFieldIndex(), and printFieldInfo().

VMField& PLearn::VMatrix::getFieldInfos int  fieldindex  )  const [inline]
 

Definition at line 178 of file VMatrix.h.

References getFieldInfos().

Array< VMField > & PLearn::VMatrix::getFieldInfos  )  const
 

If no fieldnames have been set, will set default field names to "0", "1", "2", ... i.e. their column index.

Definition at line 127 of file VMatrix.cc.

References PLearn::append_slash(), fieldinfos, fname, getMetaDataDir(), hasMetaDataDir(), PLearn::isfile(), loadFieldInfos(), PLearn::TVec< VMField >::resize(), PLearn::TVec< VMField >::size(), PLearn::tostring(), and width().

Referenced by PLearn::FileVMatrix::build_(), PLearn::DiskVMatrix::build_(), declareField(), fieldIndex(), fieldName(), fieldType(), PLearn::ConcatRowsVMatrix::fullyCheckMappings(), getFieldInfos(), printFieldInfo(), saveDMAT(), savePMAT(), and unduplicateFieldNames().

void PLearn::VMatrix::getMat int  i,
int  j,
Mat  m
const [virtual]
 

copies the submatrix starting at i,j into m (which must have appropriate length and width)

Reimplemented in PLearn::ForwardVMatrix, PLearn::MemoryVMatrix, PLearn::SubVMatrix, and PLearn::VMatrixFromDistribution.

Definition at line 964 of file VMatrix.cc.

References getSubRow(), length(), PLearn::TMat< T >::length(), PLearn::Mat, PLERROR, width(), and PLearn::TMat< T >::width().

Referenced by PLearn::operator<<(), and toMat().

string PLearn::VMatrix::getMetaDataDir  )  const
 

Throws a PLERROR if no metadatadir was set.

Definition at line 731 of file VMatrix.cc.

References metadatadir.

Referenced by PLearn::VVMatrix::build_(), getFieldInfos(), getRanges(), getSFIFFilename(), getStats(), isSFIFDirect(), loadFieldInfos(), loadStringMapping(), PLearn::FilteredVMatrix::openIndex(), saveFieldInfos(), setSFIFFilename(), and PLearn::PrecomputedVMatrix::usePrecomputed().

time_t PLearn::VMatrix::getMtime  )  const [inline]
 

Return the time of "last modification" associated with this matrix The result returned is typically based on mtime of the files contianing this matrix's data when the object is constructed.

mtime_ defaults to 0, so that's what will be returned by default, if the time was never set by a call to setMtime(t) (see below).

Definition at line 389 of file VMatrix.h.

References mtime_.

Referenced by PLearn::MovingAverageVMatrix::build_(), PLearn::CumVMatrix::build_(), getStats(), PLearn::VVMatrix::isPrecomputedAndUpToDate(), PLearn::FilteredVMatrix::openIndex(), PLearn::SourceVMatrix::setMetaInfoFromSource(), and PLearn::vmatmain().

TVec< RealMapping > PLearn::VMatrix::getRanges  ) 
 

returns the ranges as defined in the ranges.psave file (for all fields) (if the ranges.psave file does not exist, a reasonable default version is created )

Definition at line 832 of file VMatrix.cc.

References PLearn::computeRanges(), getMetaDataDir(), getStats(), PLearn::isfile(), length(), PLearn::load(), PLearn::save(), and slash.

const map< real, string > & PLearn::VMatrix::getRealToStringMapping int  col  )  const [virtual]
 

returns the value->string mapping for field 'fld'

Reimplemented in PLearn::ForwardVMatrix, PLearn::JoinVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsVMatrix, and PLearn::TemporalHorizonVMatrix.

Definition at line 641 of file VMatrix.cc.

References init_map_sr(), and map_rs.

void PLearn::VMatrix::getRow int  i,
VarArray inputs
const [virtual]
 

Assigns the value of the Vars in the list (the total size of all the vars in the list must equal width() ).

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1025 of file VMatrix.cc.

References getRow(), and width().

void PLearn::VMatrix::getRow int  i,
Vec  v
const [virtual]
 

copies row i into v (which must have appropriate length equal to the VMat's width)

Reimplemented in PLearn::SDBVMatrix, PLearn::IntStreamVMatrix, PLearn::CrossReferenceVMatrix, PLearn::ForwardVMatrix, PLearn::MemoryVMatrix, PLearn::RowBufferedVMatrix, PLearn::SelectRowsFileIndexVMatrix, and PLearn::VMatrixFromDistribution.

Definition at line 908 of file VMatrix.cc.

References getSubRow(), PLearn::TVec< T >::length(), PLERROR, and width().

Referenced by computeStats(), evaluateSumOfFbprop(), evaluateSumOfFprop(), getRow(), print(), saveAMAT(), saveDMAT(), and savePMAT().

string PLearn::VMatrix::getSFIFFilename string  fieldname,
string  ext
 

Definition at line 457 of file VMatrix.cc.

References getMetaDataDir(), PLearn::isfile(), PLearn::makeFileNameValid(), resolveFieldInfoLink(), and slash.

string PLearn::VMatrix::getSFIFFilename int  col,
string  ext
 

Definition at line 452 of file VMatrix.cc.

References fieldName(), and getSFIFFilename().

Referenced by getSFIFFilename(), isSFIFDirect(), loadStringMapping(), and saveAllStringMappings().

StatsCollector& PLearn::VMatrix::getStats int  fieldnum  )  const [inline]
 

Definition at line 330 of file VMatrix.h.

References getStats().

TVec< StatsCollector > PLearn::VMatrix::getStats  )  const
 

returns the unconditonal statistics for the given field

Definition at line 811 of file VMatrix.cc.

References PLearn::computeStats(), field_stats, getMetaDataDir(), getMtime(), PLearn::isfile(), PLearn::load(), PLearn::mtime(), PLWARNING, PLearn::save(), and slash.

Referenced by getRanges(), getStats(), and printFieldInfo().

string PLearn::VMatrix::getString int  row,
int  col
const [virtual]
 

returns element as a string, even if value doesn't map to a string, in which case tostring(value) is returned

Reimplemented in PLearn::ConcatColumnsVMatrix, PLearn::ForwardVMatrix, PLearn::JoinVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, and PLearn::TemporalHorizonVMatrix.

Definition at line 618 of file VMatrix.cc.

References get(), getValString(), PLearn::tostring(), and val.

const map< string, real > & PLearn::VMatrix::getStringToRealMapping int  col  )  const [virtual]
 

returns the string->value mapping for field 'fld'

Reimplemented in PLearn::ForwardVMatrix, PLearn::JoinVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, and PLearn::TemporalHorizonVMatrix.

Definition at line 633 of file VMatrix.cc.

References init_map_sr(), and map_sr.

Referenced by saveStringMappings().

real PLearn::VMatrix::getStringVal int  col,
const string str
const [virtual]
 

returns value associated with a string (or MISSING_VALUE if there's no association for this string)

Reimplemented in PLearn::ConcatColumnsVMatrix, PLearn::ForwardVMatrix, PLearn::JoinVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, and PLearn::TemporalHorizonVMatrix.

Definition at line 608 of file VMatrix.cc.

References PLearn::TVec< map< string, real > >::end(), PLearn::TVec< map< string, real > >::find(), PLearn::TVec< map< string, real > >::length(), map_sr, and MISSING_VALUE.

void PLearn::VMatrix::getSubRow int  i,
int  j,
Vec  v
const [virtual]
 

fills v with the subrow i lying between columns j (inclusive) and j+v.length() (exclusive)

Reimplemented in PLearn::NistDB, PLearn::KernelVMatrix, PLearn::ByteMemoryVMatrix, PLearn::ConcatRowsSubVMatrix, PLearn::ConcatRowsVMatrix, PLearn::ForwardVMatrix, PLearn::InterleaveVMatrix, PLearn::KernelVMatrix, PLearn::MemoryVMatrix, PLearn::RemoveRowsVMatrix, PLearn::RowBufferedVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, PLearn::ShiftAndRescaleVMatrix, PLearn::SubVMatrix, PLearn::UniformVMatrix, PLearn::VMatrixFromDistribution, and PLearn::VVMatrix.

Definition at line 893 of file VMatrix.cc.

References get(), k, and PLearn::TVec< T >::length().

Referenced by accumulateXtX(), accumulateXtY(), dot(), evaluateKernel(), evaluateKernelBottomN(), evaluateKernelSum(), evaluateKernelTopN(), evaluateKernelWeightedTargetSum(), find(), getExample(), getMat(), getRow(), and PLearn::VMat::getSubRow().

string PLearn::VMatrix::getValString int  col,
real  val
const [virtual]
 

returns the string associated with value val for field# col.

Or returns "" if no string is associated.

Reimplemented in PLearn::AutoSDBVMatrix, PLearn::ConcatColumnsVMatrix, PLearn::ForwardVMatrix, PLearn::JoinVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, and PLearn::TemporalHorizonVMatrix.

Definition at line 595 of file VMatrix.cc.

References PLearn::TVec< map< real, string > >::end(), PLearn::TVec< map< real, string > >::find(), init_map_sr(), PLearn::is_missing(), map_rs, and val.

Referenced by getString().

bool PLearn::VMatrix::hasFieldInfos  )  const
 

returns true if fieldinfos have been set

Definition at line 153 of file VMatrix.cc.

References fieldinfos, and PLearn::TVec< VMField >::size().

Referenced by PLearn::MovingAverageVMatrix::build_(), PLearn::ForwardVMatrix::build_(), PLearn::CumVMatrix::build_(), PLearn::SourceVMatrix::setMetaDataDir(), and PLearn::SourceVMatrix::setMetaInfoFromSource().

bool PLearn::VMatrix::hasMetaDataDir  )  const [inline]
 

Returns true if a metadatadir was set.

Definition at line 304 of file VMatrix.h.

References metadatadir.

Referenced by getFieldInfos(), loadStringMapping(), lockMetaDataDir(), and PLearn::PrecomputedVMatrix::setMetaDataDir().

bool PLearn::VMatrix::hasStats  )  const [inline]
 

Definition at line 294 of file VMatrix.h.

References fieldstats, and PLearn::TVec< VMFieldStat >::size().

bool PLearn::VMatrix::hasWeights  )  const [inline]
 

Definition at line 152 of file VMatrix.h.

References weightsize_.

void PLearn::VMatrix::init_map_sr  )  const [inline]
 

Definition at line 133 of file VMatrix.h.

References PLearn::TVec< map< string, real > >::length(), map_rs, map_sr, PLearn::TVec< map< real, string > >::resize(), PLearn::TVec< map< string, real > >::resize(), and width().

Referenced by addStringMapping(), deleteStringMapping(), getRealToStringMapping(), getStringToRealMapping(), getValString(), loadStringMapping(), removeAllStringMappings(), removeColumnStringMappings(), removeStringMapping(), and setStringMapping().

int PLearn::VMatrix::inputsize  )  const [inline]
 

Definition at line 149 of file VMatrix.h.

References inputsize_.

Referenced by PLearn::PLearnerOutputVMatrix::build_(), find(), PLearn::KNNVMatrix::getNewRow(), looksTheSameAs(), and PLearn::VMat::subMatRows().

bool PLearn::VMatrix::isSFIFDirect string  fieldname,
string  ext
 

Definition at line 477 of file VMatrix.cc.

References getMetaDataDir(), getSFIFFilename(), PLearn::makeFileNameValid(), and slash.

bool PLearn::VMatrix::isSFIFDirect int  col,
string  ext
 

Definition at line 472 of file VMatrix.cc.

References fieldName(), and isSFIFDirect().

Referenced by isSFIFDirect().

bool PLearn::VMatrix::isWritable  )  const [inline]
 

Definition at line 369 of file VMatrix.h.

References writable.

int PLearn::VMatrix::length  )  const [inline]
 

Definition at line 360 of file VMatrix.h.

References length_, and PLERROR.

Referenced by PLearn::CompactVMatrix::append(), PLearn::AsciiVMatrix::appendRow(), PLearn::SubVMatrix::build_(), PLearn::MemoryVMatrix::build_(), computeStats(), PLearn::SparseVMatrix::dot(), evaluateSumOfFbprop(), evaluateSumOfFprop(), fill(), find(), forcePutRow(), PLearn::ConcatRowsVMatrix::fullyCheckMappings(), PLearn::SubVMatrix::get(), PLearn::RangeVMatrix::get(), PLearn::NistDB::get(), PLearn::KernelVMatrix::get(), PLearn::InterleaveVMatrix::get(), PLearn::CrossReferenceVMatrix::get(), getColumn(), PLearn::VMat::getColumn(), getMat(), PLearn::SubVMatrix::getMat(), PLearn::VecExtendedVMatrix::getNewRow(), PLearn::UniformizeVMatrix::getNewRow(), PLearn::ThresholdVMatrix::getNewRow(), PLearn::SparseVMatrix::getNewRow(), PLearn::RemapLastColumnVMatrix::getNewRow(), PLearn::RegularGridVMatrix::getNewRow(), PLearn::OneHotVMatrix::getNewRow(), PLearn::MovingAverageVMatrix::getNewRow(), PLearn::GeneralizedOneHotVMatrix::getNewRow(), PLearn::ExtendedVMatrix::getNewRow(), PLearn::DiskVMatrix::getNewRow(), PLearn::AsciiVMatrix::getNewRow(), PLearn::ConcatRowsVMatrix::getpositions(), PLearn::ConcatRowsSubVMatrix::getpositions(), getRanges(), PLearn::CrossReferenceVMatrix::getRow(), PLearn::SubVMatrix::getSubRow(), PLearn::NistDB::getSubRow(), PLearn::KernelVMatrix::getSubRow(), PLearn::InterleaveVMatrix::getSubRow(), PLearn::VMat::length(), looksTheSameAs(), PLearn::operator<<(), print(), PLearn::SubVMatrix::put(), putMat(), PLearn::SubVMatrix::putMat(), PLearn::ConcatRowsVMatrix::putMat(), putOrAppendRow(), PLearn::SubVMatrix::putSubRow(), saveAMAT(), saveDMAT(), savePMAT(), PLearn::SparseVMatrix::SparseVMatrix(), and toMat().

void PLearn::VMatrix::loadAllStringMappings  ) 
 

loads the appropriate string map file for every column

Definition at line 741 of file VMatrix.cc.

References PLearn::Object::classname(), loadStringMapping(), and width().

void PLearn::VMatrix::loadFieldInfos  )  const
 

Definition at line 385 of file VMatrix.cc.

References PLearn::append_slash(), fieldinfos, getMetaDataDir(), PLearn::pgetline(), PLERROR, PLearn::TVec< VMField >::resize(), PLearn::split(), PLearn::toint(), and width().

Referenced by getFieldInfos().

void PLearn::VMatrix::loadStats const string filename  ) 
 

Definition at line 325 of file VMatrix.cc.

References fieldstats, PLERROR, PLWARNING, PLearn::Array< VMFieldStat >::read(), PLearn::TVec< VMFieldStat >::resize(), PLearn::TVec< VMFieldStat >::size(), and width().

void PLearn::VMatrix::loadStringMapping int  col  ) 
 

loads the appropriate string map file for column 'col'

Definition at line 753 of file VMatrix.cc.

References c_str(), deleteStringMapping(), fname, PLearn::force_mkdir(), getMetaDataDir(), getSFIFFilename(), hasMetaDataDir(), init_map_sr(), PLearn::isfile(), map_rs, map_sr, PLERROR, slash, and val.

Referenced by loadAllStringMappings().

void PLearn::VMatrix::lockMetaDataDir  )  const
 

Locks the metadata directory by creating a .lock file inside it.

If such a file already exists, it is interpreted as being locked by some other process: this process will print to cerr that it is waiting for a lock on that directory, and will block and wait until the existing .lock is removed before recreating its own. Throws a PLearnError if called and metadatadir is not set, or lock is already held by this object (i.e. this->lockMetaDataDir has already been called previously and no unlockMetaDataDir() was called).

Definition at line 690 of file VMatrix.cc.

References PLearn::append_slash(), c_str(), PLearn::endl(), PLearn::force_mkdir(), PLearn::getHost(), PLearn::getPid(), PLearn::getUser(), hasMetaDataDir(), PLearn::loadFileAsString(), lockf_, metadatadir, PLearn::pathexists(), and PLERROR.

bool PLearn::VMatrix::looksTheSameAs VMat  m  ) 
 

Return true iif it looks like the same matrix, i.e. it has same sizes, width and length.

Definition at line 666 of file VMatrix.cc.

References inputsize(), PLearn::VMat::length(), length(), targetsize(), weightsize(), PLearn::VMat::width(), and width().

void PLearn::VMatrix::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  ) 
 

Reimplemented in PLearn::AutoVMatrix, PLearn::BatchVMatrix, PLearn::CenteredVMatrix, PLearn::CompactVMatrix, PLearn::ConcatRowsVMatrix, PLearn::CumVMatrix, PLearn::DatedJoinVMatrix, PLearn::FileVMatrix, PLearn::FilteredVMatrix, PLearn::FinancePreprocVMatrix, PLearn::ForwardVMatrix, PLearn::GetInputVMatrix, PLearn::GramVMatrix, PLearn::IndexedVMatrix, PLearn::JulianizeVMatrix, PLearn::KNNVMatrix, PLearn::LearnerProcessedVMatrix, PLearn::LocalNeighborsDifferencesVMatrix, PLearn::MemoryVMatrix, PLearn::MovingAverageVMatrix, PLearn::MultiInstanceVMatrix, PLearn::PLearnerOutputVMatrix, PLearn::PrecomputedVMatrix, PLearn::ProcessingVMatrix, PLearn::RegularGridVMatrix, PLearn::RemoveDuplicateVMatrix, PLearn::RowBufferedVMatrix, PLearn::RowsSubVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsVMatrix, PLearn::SortRowsVMatrix, PLearn::SourceVMatrix, PLearn::SubInputVMatrix, PLearn::SubVMatrix, PLearn::TemporalHorizonVMatrix, PLearn::TransposeVMatrix, PLearn::UpsideDownVMatrix, PLearn::VMatrixFromDistribution, PLearn::VVMatrix, and PLearn::TextSenseSequenceVMatrix.

Definition at line 114 of file VMatrix.cc.

References PLearn::deepCopyField(), dotrow_1, dotrow_2, field_stats, fieldinfos, fieldstats, get_row, map_rs, and map_sr.

void PLearn::VMatrix::oldread istream &  in  )  [virtual]
 

DEPRECATED For backward compatibility with old saved object.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1075 of file VMatrix.cc.

References length_, PLearn::readField(), PLearn::readFooter(), PLearn::readHeader(), and width_.

void PLearn::VMatrix::oldwrite ostream &  out  )  const [virtual]
 

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1065 of file VMatrix.cc.

References length_, width_, PLearn::writeField(), PLearn::writeFooter(), and PLearn::writeHeader().

PLearn::VMatrix::operator Mat  )  const [inline]
 

Definition at line 481 of file VMatrix.h.

References toMat().

PLearn::VMatrix::PLEARN_DECLARE_ABSTRACT_OBJECT VMatrix   ) 
 

void PLearn::VMatrix::print ostream &  out  )  const [virtual]
 

Prints a human-readable, short (not necessarily complete) description of this object instance (default prints info()). This is what is called by operator<< on Object

Reimplemented from PLearn::Object.

Definition at line 1055 of file VMatrix.cc.

References PLearn::endl(), getRow(), length(), and width().

Referenced by PLearn::VMat::print().

void PLearn::VMatrix::printFieldInfo ostream &  out,
const string fieldname_or_num
const
 

Definition at line 275 of file VMatrix.cc.

References getFieldIndex(), and printFieldInfo().

void PLearn::VMatrix::printFieldInfo ostream &  out,
int  fieldnum
const
 

Definition at line 213 of file VMatrix.cc.

References PLearn::endl(), PLearn::VMField::fieldtype, getFieldInfos(), getStats(), PLearn::StatsCollector::max(), PLearn::StatsCollector::mean(), PLearn::StatsCollector::min(), PLearn::VMField::name, PLearn::StatsCollector::nmissing(), PLearn::StatsCollector::nnonmissing(), PLERROR, PLearn::StatsCollector::stddev(), and PLearn::StatsCollector::sum().

Referenced by printFieldInfo(), and printFields().

void PLearn::VMatrix::printFields ostream &  out  )  const
 

Definition at line 280 of file VMatrix.cc.

References PLearn::endl(), printFieldInfo(), and width().

void PLearn::VMatrix::put int  i,
int  j,
real  value
[virtual]
 

sets element (i,j) to value

Reimplemented in PLearn::AsciiVMatrix, PLearn::BatchVMatrix, PLearn::FileVMatrix, PLearn::ForwardVMatrix, PLearn::IndexedVMatrix, PLearn::MemoryVMatrix, PLearn::SubVMatrix, and PLearn::TemporalHorizonVMatrix.

Definition at line 875 of file VMatrix.cc.

References PLERROR.

Referenced by putSubRow().

void PLearn::VMatrix::putMat int  i,
int  j,
Mat  m
[virtual]
 

copies matrix m at position i,j of this VMat

Reimplemented in PLearn::ConcatRowsVMatrix, PLearn::ForwardVMatrix, PLearn::MemoryVMatrix, and PLearn::SubVMatrix.

Definition at line 977 of file VMatrix.cc.

References length(), PLearn::TMat< T >::length(), PLERROR, putSubRow(), width(), and PLearn::TMat< T >::width().

void PLearn::VMatrix::putOrAppendRow int  i,
Vec  v
 

will call putRow if i<length() and appendRow if i==length()

Definition at line 940 of file VMatrix.cc.

References appendRow(), length(), PLERROR, and putRow().

void PLearn::VMatrix::putRow int  i,
Vec  v
[virtual]
 

Reimplemented in PLearn::AsciiVMatrix, PLearn::CompactVMatrix, PLearn::DiskVMatrix, PLearn::ForwardVMatrix, and PLearn::MemoryVMatrix.

Definition at line 917 of file VMatrix.cc.

References PLearn::TVec< T >::length(), PLERROR, putSubRow(), and width().

Referenced by fill(), forcePutRow(), putOrAppendRow(), and savePMAT().

void PLearn::VMatrix::putSubRow int  i,
int  j,
Vec  v
[virtual]
 

It is suggested that this method be implemented in subclasses of writable matrices to speed up accesses (default version repeatedly calls put(i,j,value) which may have a significant overhead)

Reimplemented in PLearn::AsciiVMatrix, PLearn::CompactVMatrix, PLearn::FileVMatrix, PLearn::ForwardVMatrix, PLearn::MemoryVMatrix, and PLearn::SubVMatrix.

Definition at line 899 of file VMatrix.cc.

References k, PLearn::TVec< T >::length(), and put().

Referenced by putMat(), and putRow().

void PLearn::VMatrix::removeAllStringMappings  ) 
 

remove all string mappings

Definition at line 509 of file VMatrix.cc.

References PLearn::TVec< map< real, string > >::clear(), PLearn::TVec< map< string, real > >::clear(), init_map_sr(), map_rs, map_sr, and width().

void PLearn::VMatrix::removeColumnStringMappings int  c  ) 
 

remove all string mappings of a given field

Definition at line 519 of file VMatrix.cc.

References PLearn::TVec< map< real, string > >::clear(), PLearn::TVec< map< string, real > >::clear(), init_map_sr(), map_rs, and map_sr.

void PLearn::VMatrix::removeStringMapping int  col,
string  str
 

removes a string mapping

Definition at line 557 of file VMatrix.cc.

References PLearn::find(), PLearn::TVec< map< string, real > >::find(), init_map_sr(), map_rs, map_sr, map_sr, and val.

virtual void PLearn::VMatrix::reset_dimensions  )  [inline, virtual]
 

in case the dimensions of an underlying vmat has changed, recompute it

Reimplemented in PLearn::ConcatColumnsVMatrix, PLearn::ConcatRowsSubVMatrix, PLearn::ConcatRowsVMatrix, PLearn::CrossReferenceVMatrix, PLearn::ExtendedVMatrix, PLearn::ForwardVMatrix, PLearn::GeneralizedOneHotVMatrix, PLearn::InterleaveVMatrix, PLearn::OneHotVMatrix, PLearn::PairsVMatrix, PLearn::RemapLastColumnVMatrix, PLearn::RemoveRowsVMatrix, PLearn::SelectColumnsVMatrix, PLearn::SelectRowsFileIndexVMatrix, PLearn::SelectRowsVMatrix, PLearn::ShiftAndRescaleVMatrix, PLearn::SubVMatrix, PLearn::TemporalHorizonVMatrix, PLearn::ThresholdVMatrix, PLearn::UniformizeVMatrix, PLearn::VecExtendedVMatrix, and PLearn::YMDDatedVMatrix.

Definition at line 460 of file VMatrix.h.

string PLearn::VMatrix::resolveFieldInfoLink string  target,
string  source
 

Definition at line 407 of file VMatrix.cc.

References PLearn::isdir(), PLearn::isfile(), PLearn::loadFileAsString(), PLearn::removeblanks(), resolveFieldInfoLink(), and slash.

Referenced by getSFIFFilename(), and resolveFieldInfoLink().

void PLearn::VMatrix::save const string filename  )  const [virtual]
 

returns the cooccurence statistics conditioned on the given field (within the ranges returned by getRanges() ) The results are cached in file stats#.psave (where # stands for the condfield index)

Reimplemented from PLearn::Object.

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1088 of file VMatrix.cc.

References savePMAT().

Referenced by PLearn::VMat::save().

void PLearn::VMatrix::saveAllStringMappings  ) 
 

Definition at line 529 of file VMatrix.cc.

References fname, getSFIFFilename(), saveStringMappings(), and width().

void PLearn::VMatrix::saveAMAT const string amatfile,
bool  verbose = true,
bool  no_header = false
const [virtual]
 

Save the content of the matrix in the AMAT ASCII format into a file.

If 'no_header' is set to 'true', then the AMAT header won't be saved, which can be useful to export data to other applications.

Definition at line 1136 of file VMatrix.cc.

References PLearn::endl(), fieldName(), getRow(), k, length(), PLERROR, PLearn::space_to_underscore(), PLearn::ProgressBar::update(), and width().

void PLearn::VMatrix::saveDMAT const string dmatdir  )  const [virtual]
 

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1115 of file VMatrix.cc.

References PLearn::DiskVMatrix::appendRow(), PLearn::force_rmdir(), getFieldInfos(), getRow(), length(), setFieldInfos(), and width().

void PLearn::VMatrix::saveFieldInfos  )  const
 

Definition at line 373 of file VMatrix.cc.

References PLearn::append_slash(), PLearn::endl(), fieldinfos, getMetaDataDir(), PLearn::TVec< VMField >::length(), PLERROR, and PLearn::TVec< VMField >::size().

Referenced by PLearn::FinancePreprocVMatrix::build_(), PLearn::FileVMatrix::FileVMatrix(), savePMAT(), PLearn::DiskVMatrix::~DiskVMatrix(), and PLearn::FileVMatrix::~FileVMatrix().

void PLearn::VMatrix::savePMAT const string pmatfile  )  const [virtual]
 

Reimplemented in PLearn::ForwardVMatrix.

Definition at line 1091 of file VMatrix.cc.

References fieldinfos, getFieldInfos(), getRow(), length(), PLERROR, putRow(), saveFieldInfos(), setFieldInfos(), PLearn::TVec< VMField >::size(), and width().

Referenced by save().

void PLearn::VMatrix::saveStats const string filename  )  const
 

Definition at line 340 of file VMatrix.cc.

References PLearn::endl(), fieldstats, PLERROR, PLearn::TVec< VMFieldStat >::size(), and PLearn::Array< VMFieldStat >::write().

void PLearn::VMatrix::saveStringMappings int  col,
string  fname
 

Definition at line 539 of file VMatrix.cc.

References PLearn::endl(), fname, PLearn::force_mkdir_for_file(), getStringToRealMapping(), PLERROR, and PLearn::rm().

Referenced by saveAllStringMappings().

void PLearn::VMatrix::setAlias const string the_alias  )  [inline]
 

Definition at line 324 of file VMatrix.h.

References alias_, and setAlias().

Referenced by setAlias().

void PLearn::VMatrix::setFieldInfos const Array< VMField > &  finfo  ) 
 

Definition at line 148 of file VMatrix.cc.

References fieldinfos.

Referenced by saveDMAT(), and savePMAT().

void PLearn::VMatrix::setMetaDataDir const string the_metadatadir  )  [virtual]
 

this should be called by the build method of every VMatrix that has a metadatadir It will create said directory if it doesn's already exist.

Throws a PLERROR if called with an empty string

Reimplemented in PLearn::FilteredVMatrix, PLearn::PrecomputedVMatrix, PLearn::ProcessingVMatrix, and PLearn::SourceVMatrix.

Definition at line 646 of file VMatrix.cc.

References PLearn::abspath(), PLearn::force_mkdir(), metadatadir, and PLERROR.

Referenced by build_().

void PLearn::VMatrix::setMtime time_t  t  )  [inline]
 

Sets the "last modification" time for this matrix For matrices on disk, this should be called by the constructor to reflect the mtime of the disk files.

Definition at line 394 of file VMatrix.h.

References mtime_, and setMtime().

Referenced by setMtime().

void PLearn::VMatrix::setSFIFFilename string  fieldname,
string  ext,
string  filepath = ""
 

Definition at line 436 of file VMatrix.cc.

References c_str(), PLearn::endl(), PLearn::force_mkdir_for_file(), getMetaDataDir(), PLearn::makeFileNameValid(), PLearn::rm(), and slash.

void PLearn::VMatrix::setSFIFFilename int  col,
string  ext,
string  filepath = ""
 

Definition at line 430 of file VMatrix.cc.

References fieldName(), and setSFIFFilename().

Referenced by setSFIFFilename().

void PLearn::VMatrix::setStringMapping int  col,
const map< string, real > &  zemap
 

overwrite the string<->real mapping with this one (and build the reverse mapping)

Definition at line 570 of file VMatrix.cc.

References PLearn::TVec< map< string, real > >::begin(), PLearn::TVec< map< real, string > >::clear(), PLearn::TVec< map< real, string > >::first(), init_map_sr(), map_rs, map_sr, and map_sr.

Referenced by copyStringMappingsFrom().

VMat PLearn::VMatrix::subMat int  i,
int  j,
int  l,
int  w
[virtual]
 

default version returns a SubVMatrix referencing the current VMatrix however this can be overridden to provide more efficient shortcuts (see MemoryVMatrix::subMat and SubVMatrix::subMat for examples)

Reimplemented in PLearn::ForwardVMatrix, PLearn::MemoryVMatrix, and PLearn::SubVMatrix.

Definition at line 1000 of file VMatrix.cc.

Referenced by PLearn::VMat::subMat(), PLearn::VMat::subMatColumns(), and PLearn::VMat::subMatRows().

int PLearn::VMatrix::targetsize  )  const [inline]
 

Definition at line 150 of file VMatrix.h.

References targetsize_.

Referenced by PLearn::KNNVMatrix::getNewRow(), looksTheSameAs(), and PLearn::VMat::subMatRows().

Mat PLearn::VMatrix::toMat  )  const [virtual]
 

returns a Mat with the same data as this VMat The default version of this method copies the data in a fresh Mat created in memory However this method will typically be overrided by subclasses (such as MemoryVMatrix) whose internal representation is already a Mat in order to return this Mat directly to avoid a new memory allocation and copy of elements. In this case, and in this case only, modifying the elements of the returned Mat will logically result in modified elements in the original VMatrix view of it.

Reimplemented in PLearn::ForwardVMatrix, PLearn::MemoryVMatrix, and PLearn::VMatrixFromDistribution.

Definition at line 993 of file VMatrix.cc.

References getMat(), length(), and width().

Referenced by operator Mat(), PLearn::VMat::operator Mat(), and PLearn::VMat::toMat().

void PLearn::VMatrix::unduplicateFieldNames  ) 
 

Definition at line 158 of file VMatrix.cc.

References fieldinfos, getFieldInfos(), PLearn::tostring(), and width().

Referenced by PLearn::ConcatColumnsVMatrix::build_().

void PLearn::VMatrix::unlockMetaDataDir  )  const
 

Removes the .lock file inside the metadatadir.

It will throw a PLearnError if this object did not hold the lock.

Definition at line 721 of file VMatrix.cc.

References PLearn::append_slash(), lockf_, metadatadir, PLERROR, and PLearn::rm().

int PLearn::VMatrix::weightsize  )  const [inline]
 

Definition at line 151 of file VMatrix.h.

References weightsize_.

Referenced by PLearn::KNNVMatrix::getNewRow(), looksTheSameAs(), and PLearn::VMat::subMatRows().

int PLearn::VMatrix::width  )  const [inline]
 

Definition at line 352 of file VMatrix.h.

References PLERROR, and width_.

Referenced by PLearn::JoinVMatrix::addStatField(), PLearn::CompactVMatrix::append(), PLearn::DiskVMatrix::appendRow(), PLearn::AsciiVMatrix::appendRow(), PLearn::AsciiVMatrix::AsciiVMatrix(), PLearn::TemporalHorizonVMatrix::build_(), PLearn::SubVMatrix::build_(), PLearn::SelectColumnsVMatrix::build_(), PLearn::MemoryVMatrix::build_(), PLearn::JoinVMatrix::build_(), PLearn::InterleaveVMatrix::build_(), PLearn::ForwardVMatrix::build_(), PLearn::CompactVMatrix::CompactVMatrix(), computeStats(), declareFieldNames(), dot(), PLearn::SparseVMatrix::dot(), PLearn::MemoryVMatrix::dot(), PLearn::ConcatColumnsVMatrix::dot(), PLearn::CompactVMatrix::dot(), PLearn::CompactVMatrix::dotProduct(), PLearn::ConcatRowsVMatrix::ensureMappingsConsistency(), evaluateSumOfFbprop(), evaluateSumOfFprop(), fieldIndex(), fieldNames(), fill(), forcePutRow(), PLearn::ConcatRowsVMatrix::fullyCheckMappings(), PLearn::SubVMatrix::get(), PLearn::NistDB::get(), PLearn::KernelVMatrix::get(), PLearn::InterleaveVMatrix::get(), PLearn::CrossReferenceVMatrix::get(), PLearn::ByteMemoryVMatrix::get(), getFieldIndex(), getFieldInfos(), getMat(), PLearn::SubVMatrix::getMat(), PLearn::VecExtendedVMatrix::getNewRow(), PLearn::UniformizeVMatrix::getNewRow(), PLearn::ThresholdVMatrix::getNewRow(), PLearn::SparseVMatrix::getNewRow(), PLearn::RemapLastColumnVMatrix::getNewRow(), PLearn::RegularGridVMatrix::getNewRow(), PLearn::OneHotVMatrix::getNewRow(), PLearn::JoinVMatrix::getNewRow(), PLearn::GeneralizedOneHotVMatrix::getNewRow(), PLearn::ExtendedVMatrix::getNewRow(), PLearn::DiskVMatrix::getNewRow(), PLearn::CompactVMatrix::getNewRow(), PLearn::AutoSDBVMatrix::getNewRow(), PLearn::AsciiVMatrix::getNewRow(), getRow(), PLearn::IntStreamVMatrix::getRow(), PLearn::CrossReferenceVMatrix::getRow(), PLearn::SubVMatrix::getSubRow(), PLearn::NistDB::getSubRow(), PLearn::MemoryVMatrix::getSubRow(), PLearn::KernelVMatrix::getSubRow(), PLearn::InterleaveVMatrix::getSubRow(), init_map_sr(), loadAllStringMappings(), loadFieldInfos(), loadStats(), looksTheSameAs(), PLearn::AutoSDBVMatrix::nstrings(), PLearn::operator<<(), PLearn::CompactVMatrix::perturb(), print(), printFields(), PLearn::SubVMatrix::put(), putMat(), PLearn::SubVMatrix::putMat(), putRow(), PLearn::SubVMatrix::putSubRow(), PLearn::MemoryVMatrix::putSubRow(), PLearn::ConcatRowsVMatrix::recomputeDimensions(), removeAllStringMappings(), PLearn::InterleaveVMatrix::reset_dimensions(), saveAllStringMappings(), saveAMAT(), saveDMAT(), savePMAT(), PLearn::SourceVMatrix::setMetaInfoFromSource(), PLearn::TemporalHorizonVMatrix::TemporalHorizonVMatrix(), toMat(), unduplicateFieldNames(), and PLearn::VMat::width().


Member Data Documentation

string PLearn::VMatrix::alias_ [protected]
 

Definition at line 105 of file VMatrix.h.

Referenced by getAlias(), and setAlias().

Vec PLearn::VMatrix::dotrow_1 [mutable, private]
 

Used in the default dot(i,j) method to store the i-th and j-th rows.

Definition at line 79 of file VMatrix.h.

Referenced by dot(), and makeDeepCopyFromShallowCopy().

Vec PLearn::VMatrix::dotrow_2 [mutable, private]
 

Definition at line 80 of file VMatrix.h.

Referenced by dot(), and makeDeepCopyFromShallowCopy().

TVec<StatsCollector> PLearn::VMatrix::field_stats [mutable, protected]
 

stats[i] contains stats for field #i

Definition at line 108 of file VMatrix.h.

Referenced by getStats(), and makeDeepCopyFromShallowCopy().

Array<VMField> PLearn::VMatrix::fieldinfos [mutable]
 

Definition at line 121 of file VMatrix.h.

Referenced by getFieldInfos(), hasFieldInfos(), loadFieldInfos(), makeDeepCopyFromShallowCopy(), saveFieldInfos(), savePMAT(), setFieldInfos(), and unduplicateFieldNames().

Array<VMFieldStat> PLearn::VMatrix::fieldstats
 

Definition at line 122 of file VMatrix.h.

Referenced by computeStats(), fieldStat(), hasStats(), loadStats(), makeDeepCopyFromShallowCopy(), and saveStats().

Vec PLearn::VMatrix::get_row [mutable, private]
 

.lock file in metadatadir Used in the 'find' method to store a row.

Definition at line 76 of file VMatrix.h.

Referenced by find(), and makeDeepCopyFromShallowCopy().

int PLearn::VMatrix::inputsize_ [protected]
 

Definition at line 93 of file VMatrix.h.

Referenced by defineSizes(), getExample(), and inputsize().

int PLearn::VMatrix::length_ [protected]
 

Definition at line 84 of file VMatrix.h.

Referenced by accumulateXtX(), accumulateXtY(), evaluateKernel(), evaluateKernelBottomN(), evaluateKernelSum(), evaluateKernelTopN(), evaluateKernelWeightedTargetSum(), length(), oldread(), and oldwrite().

FILE* PLearn::VMatrix::lockf_ [mutable, private]
 

Definition at line 73 of file VMatrix.h.

Referenced by lockMetaDataDir(), and unlockMetaDataDir().

TVec<map<real,string> > PLearn::VMatrix::map_rs [mutable, protected]
 

Definition at line 112 of file VMatrix.h.

Referenced by addStringMapping(), copyStringMappingsFrom(), deleteStringMapping(), getRealToStringMapping(), getValString(), init_map_sr(), loadStringMapping(), makeDeepCopyFromShallowCopy(), removeAllStringMappings(), removeColumnStringMappings(), removeStringMapping(), and setStringMapping().

TVec<map<string,real> > PLearn::VMatrix::map_sr [mutable, protected]
 

Definition at line 111 of file VMatrix.h.

Referenced by addStringMapping(), copyStringMappingsFrom(), deleteStringMapping(), getStringToRealMapping(), getStringVal(), init_map_sr(), loadStringMapping(), makeDeepCopyFromShallowCopy(), removeAllStringMappings(), removeColumnStringMappings(), removeStringMapping(), and setStringMapping().

string PLearn::VMatrix::metadatadir [protected]
 

Path of directory (possibly relative to DBDIR) that will contain meta information on this dataset (fieldnames, cached statistics, etc...) and possibly the data itself.

Definition at line 102 of file VMatrix.h.

Referenced by build_(), getMetaDataDir(), hasMetaDataDir(), lockMetaDataDir(), setMetaDataDir(), and unlockMetaDataDir().

time_t PLearn::VMatrix::mtime_ [protected]
 

Definition at line 86 of file VMatrix.h.

Referenced by getMtime(), and setMtime().

int PLearn::VMatrix::targetsize_ [protected]
 

Definition at line 94 of file VMatrix.h.

Referenced by defineSizes(), getExample(), and targetsize().

int PLearn::VMatrix::weightsize_ [protected]
 

Definition at line 95 of file VMatrix.h.

Referenced by defineSizes(), getExample(), hasWeights(), and weightsize().

int PLearn::VMatrix::width_ [protected]
 

Definition at line 85 of file VMatrix.h.

Referenced by copyStringMappingsFrom(), oldread(), oldwrite(), and width().

bool PLearn::VMatrix::writable [protected]
 

Definition at line 98 of file VMatrix.h.

Referenced by isWritable().


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