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

PLearn::ProbabilitySparseMatrix Class Reference

#include <ProbabilitySparseMatrix.h>

Inheritance diagram for PLearn::ProbabilitySparseMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ProbabilitySparseMatrix (int ny=0, int nx=0, string pname="pYX")
void resize (int ny, int nx)
int nx ()
int ny ()
void rename (string new_name)
Set computeX ()
Set computeY ()
real get (int y, int x)
bool exists (int y, int x)
real operator() (int y, int x)
void incr (int y, int x, real increment=1)
const map< int, real > & getPYx (int x, bool dont_raise_error=false)
const map< int, real > & getPyX (int y)
map< int, realgetPYxCopy (int x, bool dont_raise_error=false)
map< int, realgetPyXCopy (int y)
void setPYx (int x, const map< int, real > &pYx)
void setPyX (int y, const map< int, real > &pyX)
void set (int y, int x, real v, bool dont_warn_for_zero=false)
void removeElem (int y, int x)
real sumPYx (int x, Set Y)
real sumPyX (int y, Set X)
real sumPYx (int x)
real sumPyX (int y)
void clearElements ()
void clear ()
void removeRow (int y, Set X)
void removeRow (int y)
void removeColumn (int x)
int size ()
void removeExtra (ProbabilitySparseMatrix &m)
void fullPrint ()
void save (string filename)
void load (string filename)
realgetAsFullVector ()
void getAsMaxSizedVectors (int max_size, vector< pair< real *, int > > &vectors)
void add (real *full_vector, int n_elems)
void set (real *full_vector, int n_elems)
real sumOfElements ()

Public Attributes

Set Y
Set X
bool raise_error
string name

Private Attributes

RowMapSparseMatrix< realx2y
RowMapSparseMatrix< realy2x

Constructor & Destructor Documentation

PLearn::ProbabilitySparseMatrix::ProbabilitySparseMatrix int  ny = 0,
int  nx = 0,
string  pname = "pYX"
[inline]
 

Definition at line 38 of file ProbabilitySparseMatrix.h.

References name, raise_error, and resize().


Member Function Documentation

void PLearn::ProbabilitySparseMatrix::add real full_vector,
int  n_elems
[inline]
 

Definition at line 418 of file ProbabilitySparseMatrix.h.

void PLearn::ProbabilitySparseMatrix::clear  )  [inline]
 

Definition at line 240 of file ProbabilitySparseMatrix.h.

References PLearn::RowMapSparseMatrix< real >::clear(), x2y, and y2x.

Referenced by set(), PLearn::update(), and PLearn::updateAndClearCounts().

void PLearn::ProbabilitySparseMatrix::clearElements  )  [inline]
 

Definition at line 227 of file ProbabilitySparseMatrix.h.

References nx(), x, x2y, and y2x.

Set PLearn::ProbabilitySparseMatrix::computeX  )  [inline]
 

Definition at line 52 of file ProbabilitySparseMatrix.h.

References PLearn::Set::clear(), PLearn::Set::insert(), nx(), sumPYx(), and X.

Referenced by PLearn::update(), and PLearn::updateAndClearCounts().

Set PLearn::ProbabilitySparseMatrix::computeY  )  [inline]
 

Definition at line 65 of file ProbabilitySparseMatrix.h.

References PLearn::Set::clear(), PLearn::Set::insert(), ny(), sumPyX(), and Y.

Referenced by PLearn::update(), and PLearn::updateAndClearCounts().

bool PLearn::ProbabilitySparseMatrix::exists int  y,
int  x
[inline]
 

Definition at line 92 of file ProbabilitySparseMatrix.h.

References exists(), x, and x2y.

Referenced by exists(), removeExtra(), and PLearn::samePos().

void PLearn::ProbabilitySparseMatrix::fullPrint  )  [inline]
 

Definition at line 310 of file ProbabilitySparseMatrix.h.

References PLearn::endl(), nx(), ny(), x, x2y, and y2x.

real PLearn::ProbabilitySparseMatrix::get int  y,
int  x
[inline]
 

Definition at line 78 of file ProbabilitySparseMatrix.h.

References get(), name, PLWARNING, raise_error, x, and x2y.

Referenced by get().

real* PLearn::ProbabilitySparseMatrix::getAsFullVector  )  [inline]
 

Definition at line 344 of file ProbabilitySparseMatrix.h.

References ny(), PLERROR, PLearn::RowMapSparseMatrix< real >::size(), and y2x.

void PLearn::ProbabilitySparseMatrix::getAsMaxSizedVectors int  max_size,
vector< pair< real *, int > > &  vectors
[inline]
 

Definition at line 367 of file ProbabilitySparseMatrix.h.

References getAsMaxSizedVectors(), ny(), PLWARNING, PLearn::RowMapSparseMatrix< real >::size(), and y2x.

Referenced by getAsMaxSizedVectors().

const map<int,real>& PLearn::ProbabilitySparseMatrix::getPyX int  y  )  [inline]
 

Definition at line 122 of file ProbabilitySparseMatrix.h.

References getPyX(), and y2x.

Referenced by getPyX(), and PLearn::samePos().

const map<int,real>& PLearn::ProbabilitySparseMatrix::getPYx int  x,
bool  dont_raise_error = false
[inline]
 

Definition at line 115 of file ProbabilitySparseMatrix.h.

References getPYx(), PLERROR, raise_error, x, and x2y.

Referenced by PLearn::check_prob(), and getPYx().

map<int,real> PLearn::ProbabilitySparseMatrix::getPyXCopy int  y  )  [inline]
 

Definition at line 135 of file ProbabilitySparseMatrix.h.

References getPyXCopy(), and y2x.

Referenced by getPyXCopy().

map<int,real> PLearn::ProbabilitySparseMatrix::getPYxCopy int  x,
bool  dont_raise_error = false
[inline]
 

Definition at line 127 of file ProbabilitySparseMatrix.h.

References getPYxCopy(), PLERROR, raise_error, x, and x2y.

Referenced by getPYxCopy().

void PLearn::ProbabilitySparseMatrix::incr int  y,
int  x,
real  increment = 1
[inline]
 

Definition at line 100 of file ProbabilitySparseMatrix.h.

References incr(), x, and x2y.

Referenced by incr().

void PLearn::ProbabilitySparseMatrix::load string  filename  )  [inline]
 

Definition at line 338 of file ProbabilitySparseMatrix.h.

References PLearn::RowMapSparseMatrix< real >::load(), x2y, and y2x.

int PLearn::ProbabilitySparseMatrix::nx  )  [inline]
 

Definition at line 47 of file ProbabilitySparseMatrix.h.

References PLearn::RowMapSparseMatrix< real >::length(), and x2y.

Referenced by clearElements(), computeX(), fullPrint(), and PLearn::operator<<().

int PLearn::ProbabilitySparseMatrix::ny  )  [inline]
 

Definition at line 48 of file ProbabilitySparseMatrix.h.

References PLearn::RowMapSparseMatrix< real >::length(), and y2x.

Referenced by computeY(), fullPrint(), getAsFullVector(), getAsMaxSizedVectors(), PLearn::operator<<(), removeExtra(), and sumOfElements().

real PLearn::ProbabilitySparseMatrix::operator() int  y,
int  x
[inline]
 

Definition at line 99 of file ProbabilitySparseMatrix.h.

References operator()(), and x.

Referenced by operator()().

void PLearn::ProbabilitySparseMatrix::removeColumn int  x  )  [inline]
 

Definition at line 266 of file ProbabilitySparseMatrix.h.

References x, x2y, and y2x.

void PLearn::ProbabilitySparseMatrix::removeElem int  y,
int  x
[inline]
 

Definition at line 172 of file ProbabilitySparseMatrix.h.

References removeElem(), and x.

Referenced by removeElem().

void PLearn::ProbabilitySparseMatrix::removeExtra ProbabilitySparseMatrix m  )  [inline]
 

Definition at line 286 of file ProbabilitySparseMatrix.h.

References PLearn::Set::begin(), PLearn::Set::clear(), PLearn::ConstSparseVec, PLearn::Set::end(), exists(), PLearn::Set::insert(), ny(), removeExtra(), PLearn::SetIterator, and x.

Referenced by removeExtra().

void PLearn::ProbabilitySparseMatrix::removeRow int  y  )  [inline]
 

Definition at line 253 of file ProbabilitySparseMatrix.h.

References x, x2y, and y2x.

void PLearn::ProbabilitySparseMatrix::removeRow int  y,
Set  X
[inline]
 

Definition at line 242 of file ProbabilitySparseMatrix.h.

References PLearn::Set::begin(), PLearn::RowMapSparseMatrix< real >::clear(), PLearn::Set::end(), PLearn::SetIterator, x, x2y, and y2x.

void PLearn::ProbabilitySparseMatrix::rename string  new_name  )  [inline]
 

Definition at line 50 of file ProbabilitySparseMatrix.h.

References name, and rename().

Referenced by rename().

void PLearn::ProbabilitySparseMatrix::resize int  ny,
int  nx
[inline]
 

Definition at line 43 of file ProbabilitySparseMatrix.h.

References PLearn::RowMapSparseMatrix< real >::resize(), x2y, and y2x.

void PLearn::ProbabilitySparseMatrix::save string  filename  )  [inline]
 

Definition at line 332 of file ProbabilitySparseMatrix.h.

References PLearn::RowMapSparseMatrix< real >::save(), x2y, and y2x.

void PLearn::ProbabilitySparseMatrix::set real full_vector,
int  n_elems
[inline]
 

Definition at line 424 of file ProbabilitySparseMatrix.h.

References clear().

void PLearn::ProbabilitySparseMatrix::set int  y,
int  x,
real  v,
bool  dont_warn_for_zero = false
[inline]
 

Definition at line 153 of file ProbabilitySparseMatrix.h.

References name, PLWARNING, x, x2y, and y2x.

Referenced by PLearn::update(), and PLearn::updateAndClearCounts().

void PLearn::ProbabilitySparseMatrix::setPyX int  y,
const map< int, real > &  pyX
[inline]
 

Definition at line 147 of file ProbabilitySparseMatrix.h.

References setPyX().

Referenced by setPyX().

void PLearn::ProbabilitySparseMatrix::setPYx int  x,
const map< int, real > &  pYx
[inline]
 

Definition at line 141 of file ProbabilitySparseMatrix.h.

References setPYx(), and x.

Referenced by setPYx().

int PLearn::ProbabilitySparseMatrix::size  )  [inline]
 

Definition at line 279 of file ProbabilitySparseMatrix.h.

References PLWARNING, PLearn::RowMapSparseMatrix< real >::size(), x2y, and y2x.

real PLearn::ProbabilitySparseMatrix::sumOfElements  )  [inline]
 

Definition at line 431 of file ProbabilitySparseMatrix.h.

References ny(), PLearn::sum(), and y2x.

real PLearn::ProbabilitySparseMatrix::sumPyX int  y  )  [inline]
 

Definition at line 214 of file ProbabilitySparseMatrix.h.

References y2x.

real PLearn::ProbabilitySparseMatrix::sumPYx int  x  )  [inline]
 

Definition at line 203 of file ProbabilitySparseMatrix.h.

References x, and x2y.

real PLearn::ProbabilitySparseMatrix::sumPyX int  y,
Set  X
[inline]
 

Definition at line 190 of file ProbabilitySparseMatrix.h.

References PLearn::Set::contains(), sumPyX(), x, and y2x.

Referenced by computeY(), and sumPyX().

real PLearn::ProbabilitySparseMatrix::sumPYx int  x,
Set  Y
[inline]
 

Definition at line 177 of file ProbabilitySparseMatrix.h.

References PLearn::Set::contains(), sumPYx(), x, and x2y.

Referenced by computeX(), sumPYx(), PLearn::update(), and PLearn::updateAndClearCounts().


Member Data Documentation

string PLearn::ProbabilitySparseMatrix::name
 

Definition at line 36 of file ProbabilitySparseMatrix.h.

Referenced by get(), ProbabilitySparseMatrix(), rename(), and set().

bool PLearn::ProbabilitySparseMatrix::raise_error
 

Definition at line 35 of file ProbabilitySparseMatrix.h.

Referenced by get(), getPYx(), getPYxCopy(), PLearn::operator<<(), and ProbabilitySparseMatrix().

Set PLearn::ProbabilitySparseMatrix::X
 

Definition at line 33 of file ProbabilitySparseMatrix.h.

Referenced by PLearn::check_prob(), computeX(), PLearn::update(), and PLearn::updateAndClearCounts().

RowMapSparseMatrix<real> PLearn::ProbabilitySparseMatrix::x2y [private]
 

Definition at line 28 of file ProbabilitySparseMatrix.h.

Referenced by clear(), clearElements(), exists(), fullPrint(), get(), getPYx(), getPYxCopy(), incr(), load(), nx(), removeColumn(), removeRow(), resize(), save(), set(), size(), and sumPYx().

Set PLearn::ProbabilitySparseMatrix::Y
 

Definition at line 32 of file ProbabilitySparseMatrix.h.

Referenced by computeY(), PLearn::samePos(), PLearn::update(), and PLearn::updateAndClearCounts().

RowMapSparseMatrix<real> PLearn::ProbabilitySparseMatrix::y2x [private]
 

Definition at line 29 of file ProbabilitySparseMatrix.h.

Referenced by clear(), clearElements(), fullPrint(), getAsFullVector(), getAsMaxSizedVectors(), getPyX(), getPyXCopy(), load(), ny(), removeColumn(), removeRow(), resize(), save(), set(), size(), sumOfElements(), and sumPyX().


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