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

PLearn::TMat< T > Class Template Reference

#include <TMat_decl.h>

Inheritance diagram for PLearn::TMat< T >:

Inheritance graph
[legend]
Collaboration diagram for PLearn::TMat< T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef T value_type
typedef int size_type
typedef TMatElementIterator<
T > 
iterator
typedef TMatElementIterator<
T > 
const_iterator
typedef T * compact_iterator
typedef T * rowelements_iterator
typedef TMatRowsIterator< T > rows_iterator
typedef TMatRowsAsArraysIterator<
T > 
rows_as_arrays_iterator
typedef TMatColRowsIterator<
T > 
colrows_iterator

Public Member Functions

int nrows () const
 for template compatibility with other types of matrices

int ncols () const
 TMat ()
 TMat (int the_length, int the_width)
 TMat (int the_length, int the_width, const T &init_value)
 TMat (int the_length, int the_width, T *the_data)
 TMat (int the_length, int the_width, const TVec< T > &v)
const TMat< T > & operator= (const TMat< T > &other)
 NOTE: operator= COPIES THE TMat STRUCTURE BUT NOT THE DATA (use operator<< to copy data).

iterator begin () const
 returns an iterator over elements

iterator end () const
compact_iterator compact_begin () const
 returns a compact_iterator, which is an iterator over elements, but that works only if the matrix is compact

compact_iterator compact_end () const
rowelements_iterator rowelements_begin (int rownum) const
 returns an iterator over the elements of a particular row

rowelements_iterator rowelements_end (int rownum) const
 IMPORTANT WARNING: use this only to check reaching the end with an iterator obtained through rowelements_begin USING THE *SAME* rownum.

TMatRowsIterator< T > rows_begin ()
 Return an iterator over all rows of the matrix.

TMatRowsIterator< T > rows_end ()
TMatRowsAsArraysIterator< T > rows_as_arrays_begin ()
 Return an iterator over all rows of the matrix.

TMatRowsAsArraysIterator< T > rows_as_arrays_end ()
TMatColRowsIterator< T > col_begin (int column)
 Return an iterator over a single column of the matrix.

TMatColRowsIterator< T > col_end (int column)
 This version is not strictly standards-compliant since the end-pointer is beyond 1-past-the-end-of-the-array.

void resize (int newlength, int newwidth, int extrabytes=0)
int length () const
int width () const
int size () const
int mod () const
PP< Storage< T > > getStorage () const
bool isSquare () const
bool hasMissing () const
T * data () const
 Returns a pointer to the beginning of the matrix data.

T * operator[] (int rownum) const
 Returns a pointer to the data beginning of the required row.

T * rowdata (int i) const
T & operator() (int rownum, int colnum) const
TVec< T > operator() (int rownum) const
void write (PStream &out) const
 writes the Mat to the PStream: Note that users should rather use the form out << m;

void read (PStream &in)
 reads the Mat from the PStream: Note that users should rather use the form in >> m;

void save (const string &filename) const
void load (const string &filename)
TMat< T > column (int colnum) const
 Returns a TMat that is a column of the matrix.

TMat< T > firstColumn () const
TMat< T > lastColumn () const
TMat< T > row (int row) const
 Returns a Mat that is a row of the matrix.

T & firstElement () const
T & lastElement () const
TVec< T > firstRow () const
TVec< T > lastRow () const
TVec< T > front () const
TVec< T > back () const
template<class I> TMat< T > columns (const TVec< I > &columns) const
 selectColumns(*this,columns,result) i.e.

template<class I> TMat< T > rows (const TVec< I > &rows) const
 selectRows(*this,rows,result) i.e.

bool operator== (const TMat< T > &other) const
template<class I> TMat< T > operator() (const TVec< I > &rows, const TVec< I > &columns) const
TMat< T > subMat (int rowstart, int colstart, int newlength, int newwidth) const
 Returns a sub-matrix that is a rectangular portion of this matrix.

TMat< T > subMatRows (int rowstart, int newlength) const
 Returns a sub-matrix that is a range of rows of this matrix.

TMat< T > subMatColumns (int colstart, int newwidth) const
 Returns a sub-matrix that is a range of columns of this matrix.

TMat< T > copy () const
 returns a newly created copy of this Matrix

void copyTo (T *x) const
 copy to a C vector starting at x

void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
TMat< T > deepCopy (map< const void *, void * > &copies) const
TVec< T > toVecCopy () const
 Copy of data.

TVec< T > toVec () const
 Views same data (not always possible) Actually it's the matrix view rows by rows.

bool isNull () const
bool isNotNull () const
bool isEmpty () const
bool isNotEmpty () const
bool operator! () const
 To allow if(!m) statements.

void fill (const T &value) const
void operator= (const T &f) const
void clear () const
void swapRows (int i, int j) const
 swap the contents of row i and row j

int findRow (const TVec< T > &row) const
void appendRow (const TVec< T > &newrow)
void push_back (const TVec< T > &newrow)
 stl-like push_back and pop_back

void pop_back ()
bool isCompact () const
bool isSymmetric () const
void compact ()
 Makes sure the allocated memory for this matrix is exactly length()*width().

void transpose ()
void swapUpsideDown () const
void print (ostream &out=cout) const
 C++ stream output.

void input (istream &in=cin) const
void debugPrint ()
void operator<< (const string &datastring) const

Protected Attributes

int offset_
int mod_
int length_
int width_
PP< Storage< T > > storage

Friends

class TVec< T >

template<class T>
class PLearn::TMat< T >


Member Typedef Documentation

template<class T>
typedef TMatColRowsIterator<T> PLearn::TMat< T >::colrows_iterator
 

Definition at line 94 of file TMat_decl.h.

template<class T>
typedef T* PLearn::TMat< T >::compact_iterator
 

Definition at line 89 of file TMat_decl.h.

template<class T>
typedef TMatElementIterator<T> PLearn::TMat< T >::const_iterator
 

Definition at line 88 of file TMat_decl.h.

template<class T>
typedef TMatElementIterator<T> PLearn::TMat< T >::iterator
 

Definition at line 87 of file TMat_decl.h.

template<class T>
typedef T* PLearn::TMat< T >::rowelements_iterator
 

Definition at line 90 of file TMat_decl.h.

template<class T>
typedef TMatRowsAsArraysIterator<T> PLearn::TMat< T >::rows_as_arrays_iterator
 

Definition at line 93 of file TMat_decl.h.

template<class T>
typedef TMatRowsIterator<T> PLearn::TMat< T >::rows_iterator
 

Definition at line 92 of file TMat_decl.h.

template<class T>
typedef int PLearn::TMat< T >::size_type
 

Definition at line 86 of file TMat_decl.h.

template<class T>
typedef T PLearn::TMat< T >::value_type
 

Definition at line 85 of file TMat_decl.h.


Constructor & Destructor Documentation

template<class T>
PLearn::TMat< T >::TMat  )  [inline]
 

template<class T>
PLearn::TMat< T >::TMat int  the_length,
int  the_width
[inline]
 

template<class T>
PLearn::TMat< T >::TMat int  the_length,
int  the_width,
const T &  init_value
[inline]
 

template<class T>
PLearn::TMat< T >::TMat int  the_length,
int  the_width,
T *  the_data
[inline]
 

template<class T>
PLearn::TMat< T >::TMat int  the_length,
int  the_width,
const TVec< T > &  v
 


Member Function Documentation

template<class T>
void PLearn::TMat< T >::appendRow const TVec< T > &  newrow  )  [inline]
 

Definition at line 297 of file TMat_impl.h.

References PLearn::TMat< T >::length(), PLearn::TVec< T >::length(), PLERROR, resize(), PLearn::TMat< T >::storage, and PLearn::TMat< T >::width().

Referenced by PLearn::MemoryVMatrix::appendRow(), and PLearn::multivariate_normal().

template<class T>
TVec<T> PLearn::TMat< T >::back  )  const [inline]
 

Definition at line 515 of file TMat_decl.h.

template<class T>
TMatElementIterator< T > PLearn::TMat< T >::begin  )  const [inline]
 

returns an iterator over elements

Definition at line 365 of file TMat_impl.h.

References PLearn::TMat< T >::data(), PLearn::TMat< T >::mod_, and PLearn::TMat< T >::width_.

Referenced by PLearn::dot(), PLearn::fill_random_normal(), PLearn::fill_random_uniform(), PLearn::TMat< pair< real, real > >::hasMissing(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::TMat< pair< real, real > >::operator==(), PLearn::squareElements(), PLearn::sumabs(), PLearn::sumsquare(), and PLearn::swap().

template<class T>
void PLearn::TMat< T >::clear  )  const [inline]
 

Definition at line 689 of file TMat_decl.h.

Referenced by PLearn::affineMatrixInitialize(), PLearn::computeInputMeanAndCovar(), PLearn::ReconstructionWeightsKernel::computeLLEMatrix(), PLearn::computeMeanAndCovar(), PLearn::computeWeightedMeanAndCovar(), PLearn::correlations(), PLearn::diagonalizedFactorsTransposeProduct(), PLearn::diagonalizedFactorsTransposeProductTranspose(), PLearn::ProductRandomVariable::EMEpochInitialize(), PLearn::ProjectionErrorVariable::fprop(), PLearn::NllSemisphericalGaussianVariable::fprop(), PLearn::GaussMix::kmeans(), PLearn::linearRegression(), PLearn::product(), PLearn::smartInitialization(), PLearn::SpearmanRankCorrelation(), PLearn::GaussianContinuum::train(), PLearn::transposeProduct(), PLearn::transposeProduct2(), PLearn::GaussMix::updateFromConditionalSorting(), and PLearn::weightedLinearRegression().

template<class T>
TMatColRowsIterator< T > PLearn::TMat< T >::col_begin int  column  ) 
 

Return an iterator over a single column of the matrix.

No const version for now. In other words, this iterator views a single column of the matrix AS A VECTOR to iterate on; very useful for STL algorithms.

Definition at line 395 of file TMat_impl.h.

References PLearn::TMat< T >::data(), and PLearn::TMat< T >::mod_.

template<class T>
TMatColRowsIterator< T > PLearn::TMat< T >::col_end int  column  ) 
 

This version is not strictly standards-compliant since the end-pointer is beyond 1-past-the-end-of-the-array.

But this pointer is never dereferenced and should work on all reasonable architectures

Definition at line 400 of file TMat_impl.h.

References PLearn::TMat< T >::data(), PLearn::TMat< T >::length_, and PLearn::TMat< T >::mod_.

template<class T>
TMat<T> PLearn::TMat< T >::column int  colnum  )  const [inline]
 

Returns a TMat that is a column of the matrix.

Definition at line 496 of file TMat_decl.h.

Referenced by PLearn::VarColumnsVariable::bprop(), PLearn::UnfoldedFuncVariable::bprop(), PLearn::StatsCollector::cdf(), PLearn::columnArgmax(), PLearn::columnArgmin(), PLearn::columnMax(), PLearn::columnMin(), PLearn::columnSumOfSquares(), PLearn::columnVariance(), PLearn::columnWeightedMean(), PLearn::columnWeightedVariance(), PLearn::AddCostToLearner::computeCostsFromOutputs(), PLearn::Kernel::computeKNNeighbourMatrixFromDistanceMatrix(), PLearn::LiftStatsCollector::computeLift(), PLearn::LiftStatsCollector::computeLiftMax(), PLearn::Kernel::computeNeighbourMatrixFromDistanceMatrix(), PLearn::displayDecisionSurface(), PLearn::Kernel::estimateHistograms(), PLearn::UnfoldedFuncVariable::fprop(), PLearn::SumOverBagsVariable::fpropOneBag(), PLearn::VMatrixFromDistribution::getColumn(), PLearn::MemoryVMatrix::getColumn(), PLearn::loadATT800(), PLearn::newIndexedMatArray(), PLearn::PLS::NIPALSEigenvector(), PLearn::normalizeColumns(), PLearn::SequentialModelSelector::paired_t_test(), PLearn::product(), PLearn::rebalanceNClasses(), PLearn::GaussMix::replaceGaussian(), PLearn::TestDependencyCommand::run(), PLearn::TestDependenciesCommand::run(), PLearn::selectAndOrder(), PLearn::selectColumns(), PLearn::SequentialModelSelector::train(), PLearn::PLS::train(), and PLearn::GaussMix::updateSampleWeights().

template<class T>
template<class I>
TMat<T> PLearn::TMat< T >::columns const TVec< I > &  columns  )  const [inline]
 

selectColumns(*this,columns,result) i.e.

return the matrix with specified columns (indices)

Definition at line 520 of file TMat_decl.h.

template<class T>
void PLearn::TMat< T >::compact  )  [inline]
 

Makes sure the allocated memory for this matrix is exactly length()*width().

Definition at line 755 of file TMat_decl.h.

Referenced by PLearn::grep().

template<class T>
compact_iterator PLearn::TMat< T >::compact_begin  )  const [inline]
 

returns a compact_iterator, which is an iterator over elements, but that works only if the matrix is compact

Definition at line 134 of file TMat_decl.h.

Referenced by PLearn::multiply(), PLearn::multiplyAcc(), PLearn::squareElements(), PLearn::sumabs(), and PLearn::sumsquare().

template<class T>
compact_iterator PLearn::TMat< T >::compact_end  )  const [inline]
 

Definition at line 143 of file TMat_decl.h.

Referenced by PLearn::multiply(), PLearn::multiplyAcc(), PLearn::squareElements(), PLearn::sumabs(), and PLearn::sumsquare().

template<class T>
TMat<T> PLearn::TMat< T >::copy  )  const [inline]
 

returns a newly created copy of this Matrix

Definition at line 606 of file TMat_decl.h.

Referenced by PLearn::TMat< pair< real, real > >::compact(), PLearn::det(), PLearn::diagonalizeSubspace(), PLearn::loadLetters(), PLearn::multivariate_normal(), PLearn::operator *(), PLearn::operator+(), PLearn::operator-(), PLearn::operator/(), PLearn::Gnuplot::plotClasses(), and PLearn::Function::verifyHessian().

template<class T>
void PLearn::TMat< T >::copyTo T *  x  )  const [inline]
 

copy to a C vector starting at x

Definition at line 614 of file TMat_decl.h.

template<class T>
T* PLearn::TMat< T >::data  )  const [inline]
 

Returns a pointer to the beginning of the matrix data.

Definition at line 248 of file TMat_decl.h.

Referenced by PLearn::add(), PLearn::addToColumns(), PLearn::addToDiagonal(), PLearn::argmax(), PLearn::argmin(), PLearn::averageAcrossRowsAndColumns(), PLearn::TMat< T >::begin(), PLearn::choleskyInvert(), PLearn::choleskySolve(), PLearn::TMat< pair< real, real > >::clear(), PLearn::TMat< T >::col_begin(), PLearn::TMat< T >::col_end(), PLearn::TMat< pair< real, real > >::compact_begin(), PLearn::TMat< pair< real, real > >::compact_end(), PLearn::computeMeanAndCovar(), PLearn::convolve(), PLearn::TMat< pair< real, real > >::copyTo(), PLearn::det(), PLearn::diagonalizedFactorsProduct(), PLearn::diagonalizedFactorsProductBprop(), PLearn::diagonalizedFactorsProductTranspose(), PLearn::diagonalizedFactorsProductTransposeBprop(), PLearn::diagonalizedFactorsTransposeProduct(), PLearn::diagonalizedFactorsTransposeProductBprop(), PLearn::diagonalizedFactorsTransposeProductTranspose(), PLearn::diagonalizedFactorsTransposeProductTransposeBprop(), PLearn::diffSquareMultiplyAcc(), PLearn::dot(), PLearn::eigen_SymmMat(), PLearn::eigenSparseNonSymmMat(), PLearn::eigenSparseSymmMat(), PLearn::ProductRandomVariable::EMBprop(), PLearn::TMat< T >::end(), PLearn::externalProductAcc(), PLearn::TMat< pair< real, real > >::fill(), PLearn::TMat< pair< real, real > >::firstElement(), PLearn::geometric_mean(), PLearn::inverse(), PLearn::invertElements(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::lapackSolveLinearSystem(), PLearn::lapackSVD(), PLearn::linearRegression(), PLearn::loadADMat(), PLearn::loadCorelDatamat(), PLearn::loadJPEGrgb(), PLearn::loadSTATLOG(), PLearn::loadUCIMLDB(), PLearn::LU_decomposition(), PLearn::matColumnDotVec(), PLearn::matInvert(), PLearn::max(), PLearn::mean(), PLearn::min(), PLearn::multiplyAcc(), PLearn::negateElements(), PLearn::operator *=(), PLearn::operator+=(), PLearn::operator-(), PLearn::operator-=(), PLearn::operator/=(), PLearn::partialSortRows(), PLearn::product(), PLearn::product2Acc(), PLearn::productAcc(), PLearn::TMat< pair< real, real > >::read(), PLearn::regularizeMatrix(), PLearn::TMat< pair< real, real > >::rowelements_begin(), PLearn::TMat< pair< real, real > >::rowelements_end(), PLearn::TMat< T >::rows_as_arrays_begin(), PLearn::TMat< T >::rows_as_arrays_end(), PLearn::TMat< T >::rows_begin(), PLearn::TMat< T >::rows_end(), PLearn::sortRows(), PLearn::squareMultiplyAcc(), PLearn::squareProductAcc(), PLearn::substract(), PLearn::substractFromColumns(), PLearn::sum(), PLearn::sum_of_squares(), PLearn::transposeProduct(), PLearn::transposeProduct2(), PLearn::transposeProduct2Acc(), PLearn::transposeProductAcc(), PLearn::transposeTransposeProduct(), PLearn::transposeTransposeProductAcc(), PLearn::variance(), and PLearn::TMat< pair< real, real > >::write().

template<class T>
void PLearn::TMat< T >::debugPrint  )  [inline]
 

Definition at line 791 of file TMat_decl.h.

template<class T>
TMat< T > PLearn::TMat< T >::deepCopy map< const void *, void * > &  copies  )  const
 

Notice that deepCopy of a Mat returns a Mat rather than a Mat*. The reason for this being that a Mat is already some kind of "smart pointer" to an underlying Storage

Definition at line 352 of file TMat_impl.h.

References PLearn::TMat< T >::makeDeepCopyFromShallowCopy().

Referenced by PLearn::deepCopy().

template<class T>
TMatElementIterator< T > PLearn::TMat< T >::end  )  const [inline]
 

Definition at line 369 of file TMat_impl.h.

References PLearn::TMat< T >::data(), PLearn::TMat< T >::length_, PLearn::TMat< T >::mod_, and PLearn::TMat< T >::width_.

Referenced by PLearn::fill_random_normal(), PLearn::fill_random_uniform(), PLearn::TMat< pair< real, real > >::hasMissing(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::TMat< pair< real, real > >::operator==(), PLearn::squareElements(), PLearn::sumabs(), PLearn::sumsquare(), and PLearn::swap().

template<class T>
void PLearn::TMat< T >::fill const T &  value  )  const [inline]
 

Definition at line 668 of file TMat_decl.h.

Referenced by PLearn::SequentialLearner::build_(), PLearn::MovingAverageVMatrix::build_(), PLearn::CumVMatrix::build_(), PLearn::MemoryVMatrix::fill(), PLearn::QuantilesStatsIterator::finish(), PLearn::SequentialLearner::forget(), PLearn::loadCorel(), PLearn::EntropyContrast::set_NNcontinuous_gradient_from_extra_cost(), PLearn::GeodesicDistanceKernel::setDataForKernelMatrix(), PLearn::PLS::train(), PLearn::GaussMix::train(), and PLearn::VecStatsCollector::update().

template<class T>
int PLearn::TMat< T >::findRow const TVec< T > &  row  )  const
 

Definition at line 288 of file TMat_impl.h.

References PLearn::TMat< T >::length().

template<class T>
TMat<T> PLearn::TMat< T >::firstColumn  )  const [inline]
 

Definition at line 499 of file TMat_decl.h.

template<class T>
T& PLearn::TMat< T >::firstElement  )  const [inline]
 

Definition at line 509 of file TMat_decl.h.

Referenced by PLearn::trace().

template<class T>
TVec<T> PLearn::TMat< T >::firstRow  )  const [inline]
 

Definition at line 512 of file TMat_decl.h.

Referenced by PLearn::MatrixAffineTransformVariable::bprop(), PLearn::AffineTransformVariable::bprop(), PLearn::MatrixAffineTransformFeedbackVariable::fprop(), and PLearn::TMat< pair< real, real > >::front().

template<class T>
TVec<T> PLearn::TMat< T >::front  )  const [inline]
 

Definition at line 514 of file TMat_decl.h.

template<class T>
PP< Storage<T> > PLearn::TMat< T >::getStorage  )  const [inline]
 

Definition at line 231 of file TMat_decl.h.

template<class T>
bool PLearn::TMat< T >::hasMissing  )  const [inline]
 

Definition at line 237 of file TMat_decl.h.

Referenced by PLearn::SequentialModelSelector::train().

template<class T>
void PLearn::TMat< T >::input istream &  in = cin  )  const
 

Definition at line 329 of file TMat_impl.h.

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

Referenced by PLearn::operator>>().

template<class T>
bool PLearn::TMat< T >::isCompact  )  const [inline]
 

Definition at line 732 of file TMat_decl.h.

Referenced by PLearn::TMat< pair< real, real > >::clear(), PLearn::computeMeanAndCovar(), PLearn::Variable::defineGradientLocation(), PLearn::dot(), PLearn::externalProductAcc(), PLearn::TMat< pair< real, real > >::fill(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::squareElements(), PLearn::sumabs(), PLearn::sumsquare(), and PLearn::Variable::Variable().

template<class T>
bool PLearn::TMat< T >::isEmpty  )  const [inline]
 

Definition at line 649 of file TMat_decl.h.

Referenced by PLearn::RemapLastColumnVMatrix::getNewRow(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), and PLearn::TMat< pair< real, real > >::operator!().

template<class T>
bool PLearn::TMat< T >::isNotEmpty  )  const [inline]
 

Definition at line 652 of file TMat_decl.h.

Referenced by PLearn::YMDDatedVMatrix::build_(), PLearn::computeConditionalMeans(), PLearn::SequentialLearner::forget(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::lapackSVD(), and PLearn::MatRowVariable::recomputeSize().

template<class T>
bool PLearn::TMat< T >::isNotNull  )  const [inline]
 

Definition at line 646 of file TMat_decl.h.

Referenced by PLearn::TMat< pair< real, real > >::fill().

template<class T>
bool PLearn::TMat< T >::isNull  )  const [inline]
 

Definition at line 643 of file TMat_decl.h.

template<class T>
bool PLearn::TMat< T >::isSquare  )  const [inline]
 

Definition at line 234 of file TMat_decl.h.

Referenced by PLearn::TMat< pair< real, real > >::isSymmetric(), PLearn::makeItSymmetric(), and PLearn::trace().

template<class T>
bool PLearn::TMat< T >::isSymmetric  )  const [inline]
 

Definition at line 735 of file TMat_decl.h.

Referenced by PLearn::eigen_SymmMat().

template<class T>
TMat<T> PLearn::TMat< T >::lastColumn  )  const [inline]
 

Definition at line 502 of file TMat_decl.h.

Referenced by PLearn::RGBImageDB::computeHistogramRepresentation(), and PLearn::Gnuplot::featureplot().

template<class T>
T& PLearn::TMat< T >::lastElement  )  const [inline]
 

Definition at line 510 of file TMat_decl.h.

template<class T>
TVec<T> PLearn::TMat< T >::lastRow  )  const [inline]
 

Definition at line 513 of file TMat_decl.h.

Referenced by PLearn::TMat< pair< real, real > >::back().

template<class T>
int PLearn::TMat< T >::length  )  const [inline]
 

Definition at line 219 of file TMat_decl.h.

Referenced by PLearn::add(), PLearn::addToColumns(), PLearn::addToDiagonal(), PLearn::addToRows(), PLearn::affineMatrixInitialize(), PLearn::TMat< T >::appendRow(), PLearn::apply(), PLearn::Learner::applyAndComputeCostsOnTestMat(), PLearn::argmax(), PLearn::argmin(), PLearn::averageAcrossRowsAndColumns(), PLearn::GaussianProcessRegressor::BayesianCost(), PLearn::binary_search(), PLearn::bootstrap_rows(), PLearn::NllSemisphericalGaussianVariable::bprop(), PLearn::MatrixAffineTransformVariable::bprop(), PLearn::ConcatColumnsVariable::bprop(), PLearn::AffineTransformVariable::bprop(), PLearn::bpropCholeskyDecomposition(), PLearn::bpropCholeskySolve(), PLearn::YMDDatedVMatrix::build_(), PLearn::UniformizeVMatrix::build_(), PLearn::ToBagSplitter::build_(), PLearn::MemoryVMatrix::build_(), PLearn::choleskyDecomposition(), PLearn::choleskyInvert(), PLearn::choleskySolve(), PLearn::classification_confusion_matrix(), PLearn::TMat< pair< real, real > >::clear(), PLearn::columnArgmax(), PLearn::columnArgmin(), PLearn::columnMax(), PLearn::columnMean(), PLearn::columnMin(), PLearn::TMat< pair< real, real > >::columns(), PLearn::columnSum(), PLearn::columnVariance(), PLearn::columnWeightedMean(), PLearn::columnWeightedVariance(), PLearn::TMat< pair< real, real > >::compact(), PLearn::compressedTransposeProductAcc(), PLearn::computeColumnsMeanAndStddev(), PLearn::computeConditionalMeans(), PLearn::AddCostToLearner::computeCostsFromOutputs(), PLearn::computeCovar(), PLearn::RGBImageDB::computeHistogramRepresentation(), PLearn::Kernel::computeKNNeighbourMatrixFromDistanceMatrix(), PLearn::ReconstructionWeightsKernel::computeLLEMatrix(), PLearn::computeMeanAndCovar(), PLearn::computeNearestNeighbors(), PLearn::Kernel::computeNeighbourMatrixFromDistanceMatrix(), PLearn::IsomapTangentLearner::computeOutput(), PLearn::computePrincipalComponents(), PLearn::computeRanks(), PLearn::constrainedLinearRegression(), PLearn::convolve(), PLearn::TMat< pair< real, real > >::copy(), PLearn::TMat< pair< real, real > >::copyTo(), PLearn::correlation(), PLearn::correlations(), PLearn::cross_valid(), PLearn::det(), PLearn::diag(), PLearn::diagonalizedFactorsProduct(), PLearn::diagonalizedFactorsProductBprop(), PLearn::diagonalizedFactorsProductTranspose(), PLearn::diagonalizedFactorsProductTransposeBprop(), PLearn::diagonalizedFactorsTransposeProduct(), PLearn::diagonalizedFactorsTransposeProductBprop(), PLearn::diagonalizedFactorsTransposeProductTranspose(), PLearn::diagonalizedFactorsTransposeProductTransposeBprop(), PLearn::diagonalizeSubspace(), PLearn::diagonalOfSquare(), PLearn::diffSquareMultiplyAcc(), PLearn::GhostScript::displayBlack(), PLearn::GhostScript::displayGray(), PLearn::displayPoints(), PLearn::GhostScript::displayRGB(), PLearn::DX_write_2D_data(), PLearn::DX_write_2D_data_for_grid(), PLearn::eigen_SymmMat(), PLearn::eigenSparseNonSymmMat(), PLearn::eigenSparseSymmMat(), PLearn::equals(), PLearn::Kernel::estimateHistograms(), PLearn::ReconstructionWeightsKernel::evaluate_sum_k_i_k_j(), PLearn::PLMPI::exchangeColumnBlocks(), PLearn::externalProduct(), PLearn::externalProductAcc(), PLearn::externalProductScaleAcc(), PLearn::Gnuplot::featureplot(), PLearn::TMat< pair< real, real > >::fill(), PLearn::fillItSymmetric(), PLearn::TMat< T >::findRow(), PLearn::ProjectionErrorVariable::fprop(), PLearn::NllSemisphericalGaussianVariable::fprop(), PLearn::MatrixAffineTransformFeedbackVariable::fprop(), PLearn::ConcatColumnsVariable::fprop(), PLearn::SumOverBagsVariable::fpropOneBag(), PLearn::generalizedEigenVecOfSymmMat(), PLearn::GaussianDistribution::generate(), PLearn::PDistribution::generateN(), PLearn::geometric_mean(), PLearn::VecStatsCollector::getCovariance(), PLearn::VMatrixFromDistribution::getMat(), PLearn::VMatrix::getMat(), PLearn::SubVMatrix::getMat(), PLearn::MemoryVMatrix::getMat(), PLearn::RemapLastColumnVMatrix::getNewRow(), PLearn::PairsVMatrix::getNewRow(), PLearn::ToBagSplitter::getSplit(), PLearn::GramSchmidtOrthogonalization(), PLearn::grep(), PLearn::TMat< T >::input(), PLearn::inverse(), PLearn::GaussianProcessRegressor::inverseCovTimesVec(), PLearn::invertElements(), PLearn::TMat< pair< real, real > >::isSquare(), PLearn::TMat< pair< real, real > >::isSymmetric(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::lapackSolveLinearSystem(), PLearn::lapackSVD(), PLearn::leftPseudoInverse(), PLearn::Variable::length(), PLearn::linearRegression(), PLearn::linearRegressionNoBias(), PLearn::loadAsciiWithoutSize(), PLearn::loadATT800(), PLearn::loadBreastCancer(), PLearn::loadCorel(), PLearn::loadCorelDatamat(), PLearn::loadDiabetes(), PLearn::loadLetters(), PLearn::loadPMat(), PLearn::loadToVMat(), PLearn::loadUCISet(), PLearn::loadUSPS(), PLearn::LU_decomposition(), PLearn::makeItSymmetric(), PLearn::makeRowsSumTo1(), PLearn::matColumnDotVec(), PLearn::matInvert(), PLearn::matlabR11eigs(), PLearn::matlabSave(), PLearn::matRowsDots(), PLearn::matRowsDotsAcc(), PLearn::max(), PLearn::mean(), PLearn::min(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::negateElements(), PLearn::newIndexedMatArray(), PLearn::RGBImagesVMatrix::nObjects(), PLearn::normalize(), PLearn::normalizeRows(), PLearn::operator *(), PLearn::operator *=(), PLearn::TMat< pair< real, real > >::operator()(), PLearn::operator+(), PLearn::operator+=(), PLearn::operator-(), PLearn::operator-=(), PLearn::operator/=(), PLearn::operator<<(), PLearn::TMat< pair< real, real > >::operator==(), PLearn::TMat< pair< real, real > >::operator[](), PLearn::operator^(), PLearn::GradientOptimizer::optimizeN(), PLearn::partialSortRows(), PLearn::Gnuplot::plotClasses(), PLearn::TMat< T >::print(), PLearn::product(), PLearn::product2Acc(), PLearn::product2Transpose(), PLearn::product2TransposeAcc(), PLearn::productAcc(), PLearn::productTranspose(), PLearn::productTransposeAcc(), PLearn::projectOnOrthogonalSubspace(), PLearn::VMatrix::putMat(), PLearn::SubVMatrix::putMat(), PLearn::MemoryVMatrix::putMat(), PLearn::GaussianProcessRegressor::QFormInverse(), PLearn::regularizeMatrix(), PLearn::removeRow(), PLearn::TMat< pair< real, real > >::resize(), PLearn::RGBImagesVMatrix::RGBImagesVMatrix(), PLearn::rightPseudoInverse(), PLearn::rowArgmax(), PLearn::rowArgmin(), PLearn::TMat< pair< real, real > >::rowelements_begin(), PLearn::rowMax(), PLearn::rowMean(), PLearn::rowMin(), PLearn::rowSum(), PLearn::rowSumOfSquares(), PLearn::rowVariance(), PLearn::RGBImagesVMatrix::sample(), PLearn::sample(), PLearn::saveAscii(), PLearn::saveAsciiWithoutSize(), PLearn::saveGnuplot(), PLearn::savePMat(), PLearn::saveSNMat(), PLearn::RGBImagesVMatrix::seek(), PLearn::select(), PLearn::selectAndOrder(), PLearn::selectRows(), PLearn::shuffleRows(), PLearn::smooth(), PLearn::smoothCorelHisto(), PLearn::solveLinearSystem(), PLearn::solveLinearSystemByCholesky(), PLearn::solveTransposeLinearSystemByCholesky(), PLearn::sortColumns(), PLearn::PDistribution::sortFromFlags(), PLearn::sortRows(), PLearn::sqrt(), PLearn::square(), PLearn::squareMultiplyAcc(), PLearn::squareProductAcc(), PLearn::squareProductTranspose(), PLearn::squareProductTransposeAcc(), PLearn::TMat< pair< real, real > >::subMat(), PLearn::TMat< pair< real, real > >::subMatRows(), PLearn::subsample(), PLearn::substract(), PLearn::substractFromColumns(), PLearn::substractFromRows(), PLearn::sum(), PLearn::sum_of_squares(), PLearn::TMat< pair< real, real > >::swapUpsideDown(), PLearn::testSpearmanRankCorrelation(), PLearn::TMat< T >::toVec(), PLearn::TMat< T >::toVecCopy(), PLearn::trace(), PLearn::ManifoldParzen2::train(), PLearn::LinearRegressor::train(), PLearn::KernelProjection::train(), PLearn::GaussianProcessRegressor::train(), PLearn::GaussianContinuum::train(), PLearn::ConditionalDensityNet::train(), PLearn::transpose(), PLearn::TMat< pair< real, real > >::transpose(), PLearn::transposeProduct(), PLearn::transposeProduct2(), PLearn::transposeProduct2Acc(), PLearn::transposeProductAcc(), PLearn::transposeTransposeProduct(), PLearn::transposeTransposeProductAcc(), PLearn::VecStatsCollector::update(), PLearn::StatsIterator::update(), PLearn::StatsItArray::update(), PLearn::LiftStatsIterator::update(), PLearn::LiftStatsCollector::update(), PLearn::Learner::use(), PLearn::variance(), PLearn::weightedLinearRegression(), PLearn::GhostScript::writeBitmapHexString1Bit(), PLearn::GhostScript::writeBitmapHexString24Bits(), and PLearn::GhostScript::writeBitmapHexString8Bits().

template<class T>
void PLearn::TMat< T >::load const string filename  )  [inline]
 

Definition at line 493 of file TMat_decl.h.

Referenced by PLearn::loadClassificationDataset().

template<class T>
void PLearn::TMat< T >::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  ) 
 

************ Deep copying

Definition at line 346 of file TMat_impl.h.

References PLearn::deepCopyField(), and PLearn::TMat< T >::storage.

Referenced by PLearn::TMat< T >::deepCopy(), and PLearn::deepCopyField().

template<class T>
int PLearn::TMat< T >::mod  )  const [inline]
 

Definition at line 228 of file TMat_decl.h.

Referenced by PLearn::add(), PLearn::addToColumns(), PLearn::addToDiagonal(), PLearn::argmax(), PLearn::argmin(), PLearn::averageAcrossRowsAndColumns(), PLearn::ConcatColumnsVariable::bprop(), PLearn::choleskySolve(), PLearn::TMat< pair< real, real > >::clear(), PLearn::TMat< pair< real, real > >::compact_begin(), PLearn::Kernel::computeGramMatrix(), PLearn::convolve(), PLearn::TMat< pair< real, real > >::copyTo(), PLearn::det(), PLearn::eigen_SymmMat(), PLearn::TMat< pair< real, real > >::fill(), PLearn::fillItSymmetric(), PLearn::ConcatColumnsVariable::fprop(), PLearn::geometric_mean(), PLearn::invertElements(), PLearn::TMat< pair< real, real > >::isCompact(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::lapackSolveLinearSystem(), PLearn::lapackSVD(), PLearn::linearRegression(), PLearn::LU_decomposition(), PLearn::matColumnDotVec(), PLearn::matInvert(), PLearn::max(), PLearn::mean(), PLearn::min(), PLearn::negateElements(), PLearn::operator *=(), PLearn::TMat< pair< real, real > >::operator()(), PLearn::operator+=(), PLearn::operator-(), PLearn::operator-=(), PLearn::operator/=(), PLearn::TMat< pair< real, real > >::operator[](), PLearn::partialSortRows(), PLearn::product(), PLearn::product2Acc(), PLearn::productAcc(), PLearn::regularizeMatrix(), PLearn::TMat< pair< real, real > >::resize(), PLearn::TMat< pair< real, real > >::rowelements_begin(), PLearn::TMat< pair< real, real > >::rowelements_end(), PLearn::sortRows(), PLearn::SparseMatrix::SparseMatrix(), PLearn::squareProductAcc(), PLearn::TMat< pair< real, real > >::subMat(), PLearn::TMat< pair< real, real > >::subMatRows(), PLearn::substract(), PLearn::substractFromColumns(), PLearn::sum(), PLearn::sum_of_squares(), PLearn::TMat< T >::toVec(), PLearn::GaussianProcessRegressor::train(), PLearn::transpose(), PLearn::TMat< pair< real, real > >::transpose(), PLearn::transposeProduct(), PLearn::transposeProduct2(), PLearn::transposeProduct2Acc(), PLearn::transposeProductAcc(), PLearn::transposeTransposeProduct(), PLearn::transposeTransposeProductAcc(), and PLearn::variance().

template<class T>
int PLearn::TMat< T >::ncols  )  const [inline]
 

Definition at line 81 of file TMat_decl.h.

template<class T>
int PLearn::TMat< T >::nrows  )  const [inline]
 

for template compatibility with other types of matrices

Definition at line 80 of file TMat_decl.h.

template<class T>
bool PLearn::TMat< T >::operator!  )  const [inline]
 

To allow if(!m) statements.

This method is commented out because it is much too dangerous: it allows a TMat to be converted into an int, which can cause some very weird bugs that the compiler would have caught otherwise.

Definition at line 665 of file TMat_decl.h.

template<class T>
template<class I>
TMat<T> PLearn::TMat< T >::operator() const TVec< I > &  rows,
const TVec< I > &  columns
const [inline]
 

Definition at line 555 of file TMat_decl.h.

template<class T>
TVec<T> PLearn::TMat< T >::operator() int  rownum  )  const [inline]
 

Definition at line 279 of file TMat_decl.h.

template<class T>
T& PLearn::TMat< T >::operator() int  rownum,
int  colnum
const [inline]
 

Definition at line 269 of file TMat_decl.h.

template<class T>
void PLearn::TMat< T >::operator<< const string datastring  )  const [inline]
 

Definition at line 794 of file TMat_decl.h.

template<class T>
void PLearn::TMat< T >::operator= const T &  f  )  const [inline]
 

Definition at line 686 of file TMat_decl.h.

template<class T>
const TMat<T>& PLearn::TMat< T >::operator= const TMat< T > &  other  )  [inline]
 

NOTE: operator= COPIES THE TMat STRUCTURE BUT NOT THE DATA (use operator<< to copy data).

Definition at line 119 of file TMat_decl.h.

template<class T>
bool PLearn::TMat< T >::operator== const TMat< T > &  other  )  const [inline]
 

Definition at line 537 of file TMat_decl.h.

template<class T>
T* PLearn::TMat< T >::operator[] int  rownum  )  const [inline]
 

Returns a pointer to the data beginning of the required row.

Definition at line 258 of file TMat_decl.h.

template<class T>
void PLearn::TMat< T >::pop_back  )  [inline]
 

Definition at line 729 of file TMat_decl.h.

template<class T>
void PLearn::TMat< T >::print ostream &  out = cout  )  const
 

C++ stream output.

Definition at line 315 of file TMat_impl.h.

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

Referenced by PLearn::operator<<().

template<class T>
void PLearn::TMat< T >::push_back const TVec< T > &  newrow  )  [inline]
 

stl-like push_back and pop_back

Definition at line 728 of file TMat_decl.h.

template<class T>
void PLearn::TMat< T >::read PStream in  )  [inline]
 

reads the Mat from the PStream: Note that users should rather use the form in >> m;

Definition at line 394 of file TMat_decl.h.

Referenced by PLearn::operator>>().

template<class T>
void PLearn::TMat< T >::resize int  newlength,
int  newwidth,
int  extrabytes = 0
[inline]
 

Resizes the matrix to a new length() and width() Notice that the previous structure of the data in the matrix is not preserved if you increase the width() beyond mod(). The underlying storage is never shrunk, and it is grown only if necessary. When grown, it is grown with extrabytes to anticipate further resizes.

Definition at line 189 of file TMat_decl.h.

Referenced by PLearn::Kernel::apply(), PLearn::autocorrelation_function(), PLearn::bootstrap_rows(), PLearn::bpropCholeskyDecomposition(), PLearn::VMatrixFromDistribution::build_(), PLearn::ToBagSplitter::build_(), PLearn::SumOverBagsVariable::build_(), PLearn::StackedLearner::build_(), PLearn::SequentialLearner::build_(), PLearn::ProjectionErrorVariable::build_(), PLearn::PLearnerOutputVMatrix::build_(), PLearn::NllSemisphericalGaussianVariable::build_(), PLearn::MultiInstanceVMatrix::build_(), PLearn::MovingAverageVMatrix::build_(), PLearn::MemoryVMatrix::build_(), PLearn::KNNVMatrix::build_(), PLearn::GramVMatrix::build_(), PLearn::GaussianProcessRegressor::build_(), PLearn::GaussianContinuum::build_(), PLearn::EntropyContrast::build_(), PLearn::CumVMatrix::build_(), PLearn::AddCostToLearner::build_(), PLearn::choleskyDecomposition(), PLearn::choleskyInvert(), PLearn::GaussianContinuum::compute_train_and_validation_costs(), PLearn::AddCostToLearner::computeCostsFromOutputs(), PLearn::computeCovar(), PLearn::computeInputMeanAndCovar(), PLearn::computeMeanAndCovar(), PLearn::Kernel::computeNearestNeighbors(), PLearn::KernelProjection::computeOutput(), PLearn::computePrincipalComponents(), PLearn::computeRanks(), PLearn::computeWeightedMeanAndCovar(), PLearn::ReconstructionWeightsKernel::computeWeights(), PLearn::YMDDatedVMatrix::copyDatesOfRows(), PLearn::correlations(), PLearn::cross_valid(), PLearn::eigen_SymmMat(), PLearn::eigenSparseNonSymmMat(), PLearn::eigenSparseSymmMat(), PLearn::eigenVecOfSymmMat(), PLearn::MatlabInterface::eigs_r11(), PLearn::ProductRandomVariable::EMTrainingInitialize(), PLearn::LiftStatsCollector::finalize(), PLearn::LiftStatsIterator::finish(), PLearn::VecStatsCollector::forget(), PLearn::LinearRegressor::forget(), PLearn::LiftStatsCollector::forget(), PLearn::ProjectionErrorVariable::fprop(), PLearn::NllSemisphericalGaussianVariable::fprop(), PLearn::SumOverBagsVariable::fpropOneBag(), PLearn::generalizedEigenVecOfSymmMat(), PLearn::GaussianContinuum::get_image_matrix(), PLearn::grep(), PLearn::LiftStatsIterator::init(), PLearn::inverse(), PLearn::GaussMix::kmeans(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::lapackSVD(), PLearn::RGBImageDB::load(), PLearn::loadAscii(), PLearn::loadAsciiSingleBinaryDescriptor(), PLearn::loadCorel(), PLearn::loadCorelDatamat(), PLearn::loadGnuplot(), PLearn::loadJPEGrgb(), PLearn::loadLetters(), PLearn::loadPMat(), PLearn::GaussianContinuum::make_random_walk(), PLearn::matlabR11eigs(), PLearn::MemoryVMatrix::MemoryVMatrix(), PLearn::newMatArray(), PLearn::ReconstructionWeightsKernel::reconstruct(), PLearn::Variable::resize(), PLearn::Variable::resizeDiagHessian(), PLearn::Variable::resizeRValue(), PLearn::GaussMix::resizeStuffBeforeTraining(), PLearn::PDistribution::sortFromFlags(), PLearn::SpearmanRankCorrelation(), PLearn::Learner::test(), PLearn::testSpearmanRankCorrelation(), PLearn::PLS::train(), PLearn::PCA::train(), PLearn::LinearRegressor::train(), PLearn::KernelProjection::train(), PLearn::GaussianContinuum::train(), PLearn::ConditionalGaussianDistribution::train(), PLearn::VecStatsCollector::update(), PLearn::LiftStatsIterator::update(), PLearn::LiftStatsCollector::update(), and PLearn::GaussMix::updateFromConditionalSorting().

template<class T>
TMat<T> PLearn::TMat< T >::row int  row  )  const [inline]
 

Returns a Mat that is a row of the matrix.

Definition at line 506 of file TMat_decl.h.

Referenced by PLearn::VarRowsVariable::bprop(), PLearn::KNNVMatrix::build_(), and PLearn::Variable::clearGradient().

template<class T>
T* PLearn::TMat< T >::rowdata int  i  )  const [inline]
 

Definition at line 267 of file TMat_decl.h.

Referenced by PLearn::MemoryVMatrix::dot(), PLearn::TMat< T >::input(), PLearn::matRowDotVec(), PLearn::TMat< T >::print(), PLearn::GhostScript::writeBitmapHexString1Bit(), PLearn::GhostScript::writeBitmapHexString24Bits(), and PLearn::GhostScript::writeBitmapHexString8Bits().

template<class T>
rowelements_iterator PLearn::TMat< T >::rowelements_begin int  rownum  )  const [inline]
 

returns an iterator over the elements of a particular row

Definition at line 147 of file TMat_decl.h.

template<class T>
rowelements_iterator PLearn::TMat< T >::rowelements_end int  rownum  )  const [inline]
 

IMPORTANT WARNING: use this only to check reaching the end with an iterator obtained through rowelements_begin USING THE *SAME* rownum.

Definition at line 158 of file TMat_decl.h.

template<class T>
template<class I>
TMat<T> PLearn::TMat< T >::rows const TVec< I > &  rows  )  const [inline]
 

selectRows(*this,rows,result) i.e.

return the matrix with specified rows (indices)

Definition at line 530 of file TMat_decl.h.

template<class T>
TMatRowsAsArraysIterator< T > PLearn::TMat< T >::rows_as_arrays_begin  ) 
 

Return an iterator over all rows of the matrix.

No const version for now

Definition at line 385 of file TMat_impl.h.

References PLearn::TMat< T >::data(), PLearn::TMat< T >::mod_, and PLearn::TMat< T >::width_.

Referenced by PLearn::sortRows().

template<class T>
TMatRowsAsArraysIterator< T > PLearn::TMat< T >::rows_as_arrays_end  ) 
 

Definition at line 390 of file TMat_impl.h.

References PLearn::TMat< T >::data(), PLearn::TMat< T >::length_, PLearn::TMat< T >::mod_, and PLearn::TMat< T >::width_.

Referenced by PLearn::sortRows().

template<class T>
TMatRowsIterator< T > PLearn::TMat< T >::rows_begin  ) 
 

Return an iterator over all rows of the matrix.

No const version for now

Definition at line 374 of file TMat_impl.h.

References PLearn::TMat< T >::data(), PLearn::TMat< T >::mod_, and PLearn::TMat< T >::width_.

template<class T>
TMatRowsIterator< T > PLearn::TMat< T >::rows_end  ) 
 

Definition at line 379 of file TMat_impl.h.

References PLearn::TMat< T >::data(), PLearn::TMat< T >::length_, PLearn::TMat< T >::mod_, and PLearn::TMat< T >::width_.

template<class T>
void PLearn::TMat< T >::save const string filename  )  const [inline]
 

Definition at line 492 of file TMat_decl.h.

template<class T>
int PLearn::TMat< T >::size  )  const [inline]
 

Definition at line 225 of file TMat_decl.h.

Referenced by PLearn::TMat< pair< real, real > >::clear(), PLearn::TMat< pair< real, real > >::compact_end(), PLearn::computeMeanAndCovar(), PLearn::dot(), PLearn::TMat< pair< real, real > >::fill(), PLearn::PLearnerOutputVMatrix::getNewRow(), PLearn::Variable::size(), PLearn::squareElements(), PLearn::sumabs(), PLearn::sumsquare(), and PLearn::HistogramDistribution::variance().

template<class T>
TMat<T> PLearn::TMat< T >::subMat int  rowstart,
int  colstart,
int  newlength,
int  newwidth
const [inline]
 

Returns a sub-matrix that is a rectangular portion of this matrix.

Definition at line 563 of file TMat_decl.h.

Referenced by PLearn::ProjectionErrorVariable::build_(), PLearn::ReconstructionWeightsKernel::evaluate_x_i_again(), PLearn::LiftStatsIterator::finish(), PLearn::SequentialLearner::getCostSequence(), PLearn::VMatrixFromDistribution::getMat(), PLearn::MemoryVMatrix::getMat(), PLearn::loadCorel(), PLearn::MemoryVMatrix::putMat(), PLearn::MemoryVMatrix::subMat(), PLearn::SequentialModelSelector::train(), and PLearn::GaussMix::updateFromConditionalSorting().

template<class T>
TMat<T> PLearn::TMat< T >::subMatColumns int  colstart,
int  newwidth
const [inline]
 

Returns a sub-matrix that is a range of columns of this matrix.

Definition at line 593 of file TMat_decl.h.

Referenced by PLearn::StringTable::appendRow(), PLearn::RGBImageDB::computeHistogramRepresentation(), PLearn::Kernel::estimateHistograms(), PLearn::Gnuplot::featureplot(), PLearn::hconcat(), PLearn::loadATT800(), PLearn::loadBreastCancerWisconsin(), PLearn::loadDiabetes(), PLearn::loadHousing(), PLearn::loadLetters(), PLearn::loadPimaIndians(), PLearn::loadUCI(), PLearn::newIndexedMatArray(), PLearn::normalizeDataSets(), PLearn::operator^(), PLearn::removeColumn(), and PLearn::PCA::train().

template<class T>
TMat<T> PLearn::TMat< T >::subMatRows int  rowstart,
int  newlength
const [inline]
 

Returns a sub-matrix that is a range of rows of this matrix.

Definition at line 580 of file TMat_decl.h.

Referenced by PLearn::MatrixAffineTransformVariable::bprop(), PLearn::AffineTransformVariable::bprop(), PLearn::KernelProjection::computeOutput(), PLearn::IsomapTangentLearner::computeOutput(), PLearn::diagonalizeSubspace(), PLearn::MatrixAffineTransformFeedbackVariable::fprop(), PLearn::loadATT800(), PLearn::loadBreastCancer(), PLearn::loadDiabetes(), PLearn::loadLetters(), PLearn::loadUCI(), PLearn::newIndexedMatArray(), PLearn::removeRow(), PLearn::TestDependenciesCommand::run(), PLearn::PCA::train(), PLearn::LinearRegressor::train(), PLearn::KernelProjection::train(), and PLearn::vconcat().

template<class T>
void PLearn::TMat< T >::swapRows int  i,
int  j
const [inline]
 

swap the contents of row i and row j

Definition at line 706 of file TMat_decl.h.

Referenced by PLearn::LU_decomposition(), PLearn::partialSortRows(), PLearn::selectAndOrder(), PLearn::shuffleRows(), and PLearn::sortRows().

template<class T>
void PLearn::TMat< T >::swapUpsideDown  )  const [inline]
 

Definition at line 779 of file TMat_decl.h.

Referenced by PLearn::eigen_SymmMat_decreasing(), PLearn::eigenVecOfSymmMat(), and PLearn::generalizedEigenVecOfSymmMat().

template<class T>
TVec< T > PLearn::TMat< T >::toVec  )  const
 

Views same data (not always possible) Actually it's the matrix view rows by rows.

Definition at line 275 of file TMat_impl.h.

References PLearn::TMat< T >::length(), PLearn::TVec< T >::length_, PLearn::TMat< T >::mod(), PLearn::TMat< T >::offset_, PLearn::TVec< T >::offset_, PLERROR, PLearn::TMat< T >::storage, PLearn::TVec< T >::storage, and PLearn::TMat< T >::width().

Referenced by PLearn::SumOverBagsVariable::build_(), PLearn::StackedLearner::computeCostsFromOutputs(), PLearn::StackedLearner::computeOutput(), PLearn::KPCATangentLearner::computeOutput(), PLearn::IsomapTangentLearner::computeOutput(), PLearn::ProductRandomVariable::EMTrainingInitialize(), PLearn::PLearnerOutputVMatrix::getNewRow(), PLearn::multivariate_normal(), PLearn::Variable::resize(), PLearn::Variable::resizeDiagHessian(), PLearn::Variable::resizeRValue(), PLearn::GaussianProcessRegressor::train(), PLearn::ConditionalDistribution::use(), and PLearn::Variable::Variable().

template<class T>
TVec< T > PLearn::TMat< T >::toVecCopy  )  const
 

Copy of data.

Definition at line 264 of file TMat_impl.h.

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

Referenced by PLearn::columnWeightedMean(), PLearn::columnWeightedVariance(), PLearn::displayHistogram(), PLearn::fullyRebalance2Classes(), and PLearn::rebalanceNClasses().

template<class T>
void PLearn::TMat< T >::transpose  )  [inline]
 

Definition at line 765 of file TMat_decl.h.

template<class T>
int PLearn::TMat< T >::width  )  const [inline]
 

Definition at line 222 of file TMat_decl.h.

Referenced by PLearn::add(), PLearn::addToColumns(), PLearn::affineMatrixInitialize(), PLearn::affineNormalization(), PLearn::TMat< T >::appendRow(), PLearn::argmax(), PLearn::argmin(), PLearn::averageAcrossRowsAndColumns(), PLearn::bootstrap_rows(), PLearn::NllSemisphericalGaussianVariable::bprop(), PLearn::VMatrixFromDistribution::build_(), PLearn::ToBagSplitter::build_(), PLearn::MemoryVMatrix::build_(), PLearn::choleskyDecomposition(), PLearn::choleskySolve(), PLearn::TMat< pair< real, real > >::clear(), PLearn::columnArgmax(), PLearn::columnArgmin(), PLearn::columnMax(), PLearn::columnMean(), PLearn::columnMin(), PLearn::columnSum(), PLearn::columnSumOfSquares(), PLearn::columnVariance(), PLearn::columnWeightedMean(), PLearn::columnWeightedVariance(), PLearn::TMat< pair< real, real > >::compact(), PLearn::TMat< pair< real, real > >::compact_begin(), PLearn::AddCostToLearner::computeCostsFromOutputs(), PLearn::computeCovar(), PLearn::ReconstructionWeightsKernel::computeLLEMatrix(), PLearn::computeLocalPrincipalComponents(), PLearn::computeMeanAndCovar(), PLearn::PLS::computeOutput(), PLearn::computePrincipalComponents(), PLearn::computeRanks(), PLearn::constrainedLinearRegression(), PLearn::convolve(), PLearn::TMat< pair< real, real > >::copy(), PLearn::TMat< pair< real, real > >::copyTo(), PLearn::correlation(), PLearn::correlations(), PLearn::cross_valid(), PLearn::det(), PLearn::diagonalizedFactorsProduct(), PLearn::diagonalizedFactorsProductBprop(), PLearn::diagonalizedFactorsProductTranspose(), PLearn::diagonalizedFactorsProductTransposeBprop(), PLearn::diagonalizedFactorsTransposeProduct(), PLearn::diagonalizedFactorsTransposeProductBprop(), PLearn::diagonalizedFactorsTransposeProductTranspose(), PLearn::diagonalizedFactorsTransposeProductTransposeBprop(), PLearn::diffSquareMultiplyAcc(), PLearn::GhostScript::displayBlack(), PLearn::GhostScript::displayGray(), PLearn::GhostScript::displayRGB(), PLearn::DX_write_2D_data(), PLearn::DX_write_2D_data_for_grid(), PLearn::eigen_SymmMat(), PLearn::eigenSparseNonSymmMat(), PLearn::eigenSparseSymmMat(), PLearn::eigenVecOfSymmMat(), PLearn::equals(), PLearn::Kernel::estimateHistograms(), PLearn::ReconstructionWeightsKernel::evaluate_i_j(), PLearn::ReconstructionWeightsKernel::evaluate_sum_k_i_k_j(), PLearn::PLMPI::exchangeColumnBlocks(), PLearn::externalProduct(), PLearn::externalProductAcc(), PLearn::externalProductScaleAcc(), PLearn::Gnuplot::featureplot(), PLearn::TMat< pair< real, real > >::fill(), PLearn::LinearRegressor::forget(), PLearn::ProjectionErrorVariable::fprop(), PLearn::NllSemisphericalGaussianVariable::fprop(), PLearn::SumOverBagsVariable::fpropOneBag(), PLearn::generalizedEigenVecOfSymmMat(), PLearn::PDistribution::generateN(), PLearn::geometric_mean(), PLearn::VecStatsCollector::getCorrelation(), PLearn::VecStatsCollector::getCovariance(), PLearn::VMatrixFromDistribution::getMat(), PLearn::VMatrix::getMat(), PLearn::SubVMatrix::getMat(), PLearn::MemoryVMatrix::getMat(), PLearn::RemapLastColumnVMatrix::getNewRow(), PLearn::grep(), PLearn::TMat< T >::input(), PLearn::inverse(), PLearn::invertElements(), PLearn::TMat< pair< real, real > >::isCompact(), PLearn::TMat< pair< real, real > >::isSquare(), PLearn::TMat< pair< real, real > >::isSymmetric(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::lapackSolveLinearSystem(), PLearn::lapackSVD(), PLearn::TMat< pair< real, real > >::lastColumn(), PLearn::leftPseudoInverse(), PLearn::linearRegression(), PLearn::linearRegressionNoBias(), PLearn::loadAsciiWithoutSize(), PLearn::loadATT800(), PLearn::loadBreastCancerWisconsin(), PLearn::loadClassificationDataset(), PLearn::loadCorel(), PLearn::loadCorelDatamat(), PLearn::loadDiabetes(), PLearn::loadLetters(), PLearn::loadPimaIndians(), PLearn::loadPMat(), PLearn::loadSTATLOG(), PLearn::loadUCIMLDB(), PLearn::loadUCISet(), PLearn::LU_decomposition(), PLearn::makeItSymmetric(), PLearn::Variable::makeSharedGradient(), PLearn::Variable::makeSharedRValue(), PLearn::Variable::makeSharedValue(), PLearn::matInvert(), PLearn::matlabSave(), PLearn::matRowDotVec(), PLearn::matRowsDots(), PLearn::matRowsDotsAcc(), PLearn::max(), PLearn::mean(), PLearn::MemoryVMatrix::MemoryVMatrix(), PLearn::min(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::negateElements(), PLearn::newIndexedMatArray(), PLearn::normalize(), PLearn::normalizeColumns(), PLearn::normalizeDataSet(), PLearn::normalizeDataSets(), PLearn::operator *(), PLearn::operator *=(), PLearn::TMat< pair< real, real > >::operator()(), PLearn::operator+(), PLearn::operator+=(), PLearn::operator-(), PLearn::operator-=(), PLearn::operator/=(), PLearn::operator<<(), PLearn::TMat< pair< real, real > >::operator==(), PLearn::operator^(), PLearn::TMat< T >::print(), PLearn::product(), PLearn::product2Acc(), PLearn::product2Transpose(), PLearn::product2TransposeAcc(), PLearn::productAcc(), PLearn::productTranspose(), PLearn::productTransposeAcc(), PLearn::VMatrix::putMat(), PLearn::SubVMatrix::putMat(), PLearn::MemoryVMatrix::putMat(), PLearn::MatRowVariable::recomputeSize(), PLearn::removeColumn(), PLearn::rightPseudoInverse(), PLearn::rowArgmax(), PLearn::rowArgmin(), PLearn::TMat< pair< real, real > >::rowelements_end(), PLearn::rowMax(), PLearn::rowMean(), PLearn::rowMin(), PLearn::TMat< pair< real, real > >::rows(), PLearn::rowSum(), PLearn::rowSumOfSquares(), PLearn::rowVariance(), PLearn::saveAscii(), PLearn::savePMat(), PLearn::saveSNMat(), PLearn::select(), PLearn::selectAndOrder(), PLearn::selectColumns(), PLearn::smooth(), PLearn::solveLinearSystemByCholesky(), PLearn::solveTransposeLinearSystemByCholesky(), PLearn::sortColumns(), PLearn::PDistribution::sortFromFlags(), PLearn::SparseMatrix::SparseMatrix(), PLearn::sqrt(), PLearn::square(), PLearn::squareMultiplyAcc(), PLearn::squareProductAcc(), PLearn::squareProductTranspose(), PLearn::squareProductTransposeAcc(), PLearn::TMat< pair< real, real > >::subMat(), PLearn::TMat< pair< real, real > >::subMatColumns(), PLearn::subsample(), PLearn::substract(), PLearn::substractFromColumns(), PLearn::sum(), PLearn::sum_of_squares(), PLearn::TMat< pair< real, real > >::swapRows(), PLearn::testSpearmanRankCorrelation(), PLearn::TMat< T >::toVec(), PLearn::TMat< T >::toVecCopy(), PLearn::KernelProjection::train(), PLearn::transpose(), PLearn::TMat< pair< real, real > >::transpose(), PLearn::transposeProduct(), PLearn::transposeProduct2(), PLearn::transposeProduct2Acc(), PLearn::transposeProductAcc(), PLearn::transposeTransposeProduct(), PLearn::transposeTransposeProductAcc(), PLearn::variance(), PLearn::weightedLinearRegression(), PLearn::Variable::width(), PLearn::GhostScript::writeBitmapHexString1Bit(), PLearn::GhostScript::writeBitmapHexString24Bits(), and PLearn::GhostScript::writeBitmapHexString8Bits().

template<class T>
void PLearn::TMat< T >::write PStream out  )  const [inline]
 

writes the Mat to the PStream: Note that users should rather use the form out << m;

Definition at line 294 of file TMat_decl.h.


Friends And Related Function Documentation

template<class T>
friend class TVec< T > [friend]
 

Definition at line 66 of file TMat_decl.h.


Member Data Documentation

template<class T>
int PLearn::TMat< T >::length_ [protected]
 

the actual length() of the matrix

Definition at line 73 of file TMat_decl.h.

Referenced by PLearn::TMat< T >::col_end(), PLearn::TMat< T >::end(), PLearn::TMat< pair< real, real > >::operator=(), PLearn::TMat< T >::rows_as_arrays_end(), PLearn::TMat< T >::rows_end(), PLearn::TMat< pair< real, real > >::subMat(), PLearn::TMat< pair< real, real > >::subMatRows(), and PLearn::TVec< T >::toMat().

template<class T>
int PLearn::TMat< T >::mod_ [protected]
 

the real width() of the matrix

Definition at line 72 of file TMat_decl.h.

Referenced by PLearn::TMat< T >::begin(), PLearn::TMat< T >::col_begin(), PLearn::TMat< T >::col_end(), PLearn::TMat< T >::end(), PLearn::Variable::makeSharedGradient(), PLearn::Variable::makeSharedRValue(), PLearn::Variable::makeSharedValue(), PLearn::TMat< pair< real, real > >::operator=(), PLearn::TMat< T >::rows_as_arrays_begin(), PLearn::TMat< T >::rows_as_arrays_end(), PLearn::TMat< T >::rows_begin(), PLearn::TMat< T >::rows_end(), and PLearn::TVec< T >::toMat().

template<class T>
int PLearn::TMat< T >::offset_ [protected]
 

the displacement to do with respect to storage->data

Definition at line 71 of file TMat_decl.h.

Referenced by PLearn::Variable::makeSharedGradient(), PLearn::Variable::makeSharedRValue(), PLearn::Variable::makeSharedValue(), PLearn::TMat< pair< real, real > >::operator=(), PLearn::TMat< pair< real, real > >::subMat(), PLearn::TMat< pair< real, real > >::subMatColumns(), PLearn::TMat< pair< real, real > >::subMatRows(), PLearn::TVec< T >::toMat(), and PLearn::TMat< T >::toVec().

template<class T>
PP< Storage<T> > PLearn::TMat< T >::storage [protected]
 

where the data is really kept

Definition at line 75 of file TMat_decl.h.

Referenced by PLearn::TMat< T >::appendRow(), PLearn::TMat< T >::makeDeepCopyFromShallowCopy(), PLearn::Variable::makeSharedGradient(), PLearn::Variable::makeSharedRValue(), PLearn::Variable::makeSharedValue(), PLearn::TMat< pair< real, real > >::operator=(), PLearn::TVec< T >::toMat(), and PLearn::TMat< T >::toVec().

template<class T>
int PLearn::TMat< T >::width_ [protected]
 

the actual width() of the matrix

Definition at line 74 of file TMat_decl.h.

Referenced by PLearn::TMat< T >::begin(), PLearn::TMat< T >::end(), PLearn::TMat< pair< real, real > >::operator=(), PLearn::TMat< T >::rows_as_arrays_begin(), PLearn::TMat< T >::rows_as_arrays_end(), PLearn::TMat< T >::rows_begin(), PLearn::TMat< T >::rows_end(), PLearn::TMat< pair< real, real > >::subMat(), PLearn::TMat< pair< real, real > >::subMatColumns(), and PLearn::TVec< T >::toMat().


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