PLearn 0.1
|
#include <TMat_decl.h>
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 new_length, int new_width, int extra=0, bool preserve_content=false) |
Resizes the matrix to a new length() and width(). | |
int | length () const |
int | width () const |
int | size () const |
int | mod () const |
bool | isContiguous () const |
returns true if matrix elements are contiguous in memory (i.e. | |
bool | isNotContiguous () const |
returns true if matrix elements are not contiguous in memory (i.e. | |
void | setMod (int new_mod) |
Set a new value for 'mod'. | |
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; | |
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 |
bool | isEqual (const TMat< T > &other, real precision=1e-6) 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 | copyColumnTo (int col, T *x) const |
Copy a column to a C vector starting at x. | |
void | makeDeepCopyFromShallowCopy (CopiesMap &copies) |
TMat< T > | deepCopy (CopiesMap &copies) const |
TVec< T > | toVecCopy () const |
Copy of data. | |
TVec< T > | toVec () const |
Views same data (not always possible) | |
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 content of row i and row j. | |
void | swapColumns (int i, int j) const |
Swap the content of column i and column 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 () |
void | makeSharedValue (T *x, int n) |
bool | isCompact () const |
bool | isSymmetric (bool exact_check=true, bool accept_empty=false) const |
Return 'true' iff the matrix is symmetric. | |
void | compact () |
Ensure the allocated memory for this matrix is exactly length * width. | |
void | transpose () |
Swap element (i,j) with element (j,i). | |
void | swapUpsideDown () const |
void | print (ostream &out=cout) const |
C++ stream output. | |
void | input (istream &in=cin) const |
void | input (PStream &in) const |
void | debugPrint () |
void | operator<< (const string &datastring) const |
Protected Member Functions | |
void | resizePreserve (int new_length, int new_width, int extra=0) |
Utility function to resize a matrix while preserving contents. | |
void | resizeBoundCheck (int new_length, int new_width) |
Perform bound-checking on resize. | |
void | resizeModError () |
Report PLERROR if we resize changing the mod with usage > 1. | |
Protected Attributes | |
int | offset_ |
int | mod_ |
int | length_ |
int | width_ |
PP< Storage< T > > | storage |
Friends | |
class | TVec< T > |
class | Variable |
for makeShared hack... (to be cleaned) | |
class | VarArray |
for makeShared hack... (to be cleaned) |
Definition at line 64 of file TMat_decl.h.
typedef TMatColRowsIterator<T> PLearn::TMat< T >::colrows_iterator |
Definition at line 94 of file TMat_decl.h.
typedef T* PLearn::TMat< T >::compact_iterator |
Definition at line 89 of file TMat_decl.h.
typedef TMatElementIterator<T> PLearn::TMat< T >::const_iterator |
Definition at line 88 of file TMat_decl.h.
typedef TMatElementIterator<T> PLearn::TMat< T >::iterator |
Definition at line 87 of file TMat_decl.h.
typedef T* PLearn::TMat< T >::rowelements_iterator |
Definition at line 90 of file TMat_decl.h.
typedef TMatRowsAsArraysIterator<T> PLearn::TMat< T >::rows_as_arrays_iterator |
Definition at line 93 of file TMat_decl.h.
typedef TMatRowsIterator<T> PLearn::TMat< T >::rows_iterator |
Definition at line 92 of file TMat_decl.h.
typedef int PLearn::TMat< T >::size_type |
Definition at line 86 of file TMat_decl.h.
typedef T PLearn::TMat< T >::value_type |
Definition at line 85 of file TMat_decl.h.
PLearn::TMat< T >::TMat | ( | ) | [inline] |
PLearn::TMat< T >::TMat | ( | int | the_length, |
int | the_width | ||
) | [inline] |
PLearn::TMat< T >::TMat | ( | int | the_length, |
int | the_width, | ||
const T & | init_value | ||
) | [inline] |
PLearn::TMat< T >::TMat | ( | int | the_length, |
int | the_width, | ||
T * | the_data | ||
) | [inline] |
PLearn::TMat< T >::TMat | ( | int | the_length, |
int | the_width, | ||
const TVec< T > & | v | ||
) |
Definition at line 282 of file TMat_impl.h.
References PLearn::TVec< T >::length(), PLearn::TMat< T >::length(), PLERROR, and PLearn::TMat< T >::width().
: offset_(v.offset()), mod_(the_width), length_(the_length), width_(the_width), storage(v.storage) { if(length()*width()!=v.length()) PLERROR("In Mat constructor from Vec: length()*width() of matrix must be equal to length() of Vec"); }
void PLearn::TMat< T >::appendRow | ( | const TVec< T > & | newrow | ) | [inline] |
Definition at line 324 of file TMat_impl.h.
References PLearn::TVec< T >::length(), and PLERROR.
Referenced by PLearn::MemoryCachedKernel::addDataForKernelMatrix(), PLearn::TreeDBNModule::appendPort(), PLearn::MemoryVMatrix::appendRow(), PLearn::NetworkModule::build_(), PLearn::MultiTargetOneHotVMatrix::build_(), PLearn::KNNImputationVMatrix::build_(), PLearn::Kernel::computeSparseGramMatrix(), PLearn::UniformizeLearner::computeWeightedRankMap(), PLearn::ConvertFromPyObject< TMat< T > >::convert(), PLearn::BallTreeNearestNeighbors::createAnchors(), PLearn::PLearnDiff::diff(), PLearn::ICP::iterate(), PLearn::multivariate_normal(), PLearn::BasisSelectionRegressor::thread_wawr::operator()(), PLearn::ChemicalICP::run(), PLearn::ThresholdedKernel::setDataForKernelMatrix(), PLearn::StatsCollector::sort_values_by_magnitude(), PLearn::ModuleLearner::train(), PLearn::GaussMix::train(), and PLearn::ToBagClassifier::updateCostAndBagOutput().
{ #ifdef BOUNDCHECK if(newrow.length()!=width() && width() > 0) PLERROR("In TMat::appendRow newrow vector should be as long as the matrix is wide (%d != %d)", newrow.length(), width()); #endif if (storage) { resize(length()+1, newrow.length(), storage->length()); } else { // This Mat is empty: it has no storage, so using storage would crash. resize(length()+1, newrow.length()); } (*this)(length()-1) << newrow; }
TVec<T> PLearn::TMat< T >::back | ( | ) | const [inline] |
Definition at line 599 of file TMat_decl.h.
{ return lastRow(); }
TMatElementIterator< T > PLearn::TMat< T >::begin | ( | ) | const [inline] |
returns an iterator over elements
Definition at line 483 of file TMat_impl.h.
Referenced by PLearn::RBMLocalMultinomialLayer::bpropUpdate(), PLearn::clear(), PLearn::dot(), PLearn::fill_random_normal(), PLearn::fill_random_uniform(), PLearn::RBMLocalMultinomialLayer::fpropNLL(), PLearn::NeuralProbabilisticLanguageModel::gradient_penalty(), PLearn::FeatureSetSequentialCRF::gradient_penalty(), PLearn::FeatureSetNNet::gradient_penalty(), PLearn::TMat< T >::isEqual(), PLearn::RowMapSparseMatrix< real >::isSymmetric(), PLearn::logadd(), PLearn::multinomial_sample(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::TMat< T >::operator==(), PLearn::softmax(), PLearn::squareElements(), PLearn::sumabs(), PLearn::sumsquare(), PLearn::swap(), and PLearn::GaussMix::train().
void PLearn::TMat< T >::clear | ( | ) | const [inline] |
Definition at line 771 of file TMat_decl.h.
Referenced by PLearn::addEigenMatrices(), PLearn::affineMatrixInitialize(), PLearn::backConvolve2D(), PLearn::backConvolve2Dbackprop(), PLearn::SparseIncrementalAffineTransformVariable::bprop(), PLearn::RBMModule::bpropAccUpdate(), PLearn::RBMConv2DConnection::bpropAccUpdate(), PLearn::OnBagsModule::bpropAccUpdate(), PLearn::NetworkModule::bpropAccUpdate(), PLearn::KLp0p1RBMModule::bpropAccUpdate(), PLearn::Convolution2DModule::bpropAccUpdate(), PLearn::RBMLateralBinomialLayer::bpropNLL(), PLearn::Supersampling2DModule::bpropUpdate(), PLearn::Subsampling2DModule::bpropUpdate(), PLearn::SquaredErrorCostModule::bpropUpdate(), PLearn::SoftmaxNLLCostModule::bpropUpdate(), PLearn::ShuntingNNetLayerModule::bpropUpdate(), PLearn::ScaleGradientModule::bpropUpdate(), PLearn::RBMWoodsLayer::bpropUpdate(), PLearn::RBMSparse1DMatrixConnection::bpropUpdate(), PLearn::RBMMultitaskClassificationModule::bpropUpdate(), PLearn::RBMMultinomialLayer::bpropUpdate(), PLearn::RBMMixedConnection::bpropUpdate(), PLearn::RBMLocalMultinomialLayer::bpropUpdate(), PLearn::RBMLateralBinomialLayer::bpropUpdate(), PLearn::RBMConv2DConnection::bpropUpdate(), PLearn::RBMBinomialLayer::bpropUpdate(), PLearn::NLLCostModule::bpropUpdate(), PLearn::LayerCostModule::bpropUpdate(), PLearn::CrossEntropyCostModule::bpropUpdate(), PLearn::Convolution2DModule::bpropUpdate(), PLearn::CombiningCostsModule::bpropUpdate(), PLearn::TreeDBNModule::build_(), PLearn::SparseIncrementalAffineTransformVariable::build_(), PLearn::OnlineGramNaturalGradientOptimizer::build_(), PLearn::MovingAverageVMatrix::build_(), PLearn::GaussianContinuumDistribution::build_(), PLearn::GaussianContinuum::build_(), PLearn::FNetLayerVariable::build_(), PLearn::EntropyContrastLearner::build_(), PLearn::DictionaryVMatrix::build_(), PLearn::RBMQLParameters::clearStats(), PLearn::RBMMatrixTransposeConnection::clearStats(), PLearn::RBMMatrixConnection::clearStats(), PLearn::RBMLQParameters::clearStats(), PLearn::RBMLLParameters::clearStats(), PLearn::RBMLateralBinomialLayer::clearStats(), PLearn::RBMGenericParameters::clearStats(), PLearn::RBMConv2DLLParameters::clearStats(), PLearn::RBMConv2DConnection::clearStats(), PLearn::LayerCostModule::computeCorrelationStatistics(), PLearn::computeCovar(), PLearn::LayerCostModule::computeHisto(), PLearn::computeInputCovar(), PLearn::ReconstructionWeightsKernel::computeLLEMatrix(), PLearn::LocalGaussianClassifier::computeOutput(), PLearn::LayerCostModule::computePascalStatistics(), PLearn::RBMSparse1DMatrixConnection::computeProducts(), PLearn::RBMMixedConnection::computeProducts(), PLearn::convolve2D(), PLearn::convolve2Dbackprop(), PLearn::correlations(), PLearn::diagonalizedFactorsTransposeProduct(), PLearn::diagonalizedFactorsTransposeProductTranspose(), PLearn::ProductRandomVariable::EMEpochInitialize(), PLearn::DenoisingRecurrentNet::encode_onehot_diffNote_duration(), PLearn::DenoisingRecurrentNet::encode_onehot_note_octav_duration(), PLearn::DenoisingRecurrentNet::encode_onehot_timeframe(), PLearn::NeuralProbabilisticLanguageModel::fillWeights(), PLearn::FeatureSetSequentialCRF::fillWeights(), PLearn::FeatureSetNNet::fillWeights(), PLearn::SubsamplingDBN::fineTuningStep(), PLearn::DeepNonLocalManifoldParzen::fineTuningStep(), PLearn::DeepBeliefNet::fineTuningStep(), PLearn::ShuntingNNetLayerModule::forget(), PLearn::RBMSparse1DMatrixConnection::forget(), PLearn::RBMQLParameters::forget(), PLearn::RBMMatrixConnection::forget(), PLearn::RBMLQParameters::forget(), PLearn::RBMLLParameters::forget(), PLearn::RBMLateralBinomialLayer::forget(), PLearn::RBMGenericParameters::forget(), PLearn::RBMConv2DLLParameters::forget(), PLearn::RBMConv2DConnection::forget(), PLearn::PseudolikelihoodRBM::forget(), PLearn::ManifoldParzen::forget(), PLearn::LayerCostModule::forget(), PLearn::GradNNetLayerModule::forget(), PLearn::ShuntingNNetLayerModule::fprop(), PLearn::RBMModule::fprop(), PLearn::ProjectionErrorVariable::fprop(), PLearn::NllSemisphericalGaussianVariable::fprop(), PLearn::NllGeneralGaussianVariable::fprop(), PLearn::LinearCombinationModule::fprop(), PLearn::LayerCostModule::fprop(), PLearn::KLp0p1RBMModule::fprop(), PLearn::RBMMixedLayer::fpropNLL(), PLearn::RBMWoodsLayer::generateSamples(), PLearn::GaussianContinuum::get_image_matrix(), PLearn::RBMSparse1DMatrixConnection::getWeights(), PLearn::OnlineGramNaturalGradientOptimizer::gramEigenNaturalGradient(), PLearn::InferenceRBM::hiddenExpGivenInput(), PLearn::NeuralProbabilisticLanguageModel::initializeParams(), PLearn::FeatureSetSequentialCRF::initializeParams(), PLearn::FeatureSetNNet::initializeParams(), PLearn::linearRegression(), PLearn::TransformationLearner::MStepTransformationDiv(), PLearn::TransformationLearner::MStepTransformations(), PLearn::SubsamplingDBN::onlineStep(), PLearn::DeepBeliefNet::onlineStep(), PLearn::NatGradEstimator::operator()(), PLearn::product(), PLearn::productTranspose(), PLearn::DenoisingRecurrentNet::recurrentUpdate(), PLearn::SparseIncrementalAffineTransformVariable::reset(), PLearn::RBMLateralBinomialLayer::reset(), PLearn::CorrelationProfiler::reset(), PLearn::smartInitialization(), PLearn::SpearmanRankCorrelation(), PLearn::PseudolikelihoodRBM::train(), PLearn::ManifoldParzen::train(), PLearn::transposeProduct(), PLearn::transposeProduct2(), PLearn::transposeTransposeProduct(), PLearn::GaussianProcessRegressor::variance(), PLearn::NeuralProbabilisticLanguageModel::verify_gradient(), PLearn::FeatureSetSequentialCRF::verify_gradient(), PLearn::FeatureSetNNet::verify_gradient(), and PLearn::weightedLinearRegression().
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 513 of file TMat_impl.h.
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 518 of file TMat_impl.h.
TMat<T> PLearn::TMat< T >::column | ( | int | colnum | ) | const [inline] |
Returns a TMat that is a column of the matrix.
Definition at line 580 of file TMat_decl.h.
Referenced by PLearn::BallTreeNearestNeighbors::anchorTrain(), PLearn::VarColumnsVariable::bprop(), PLearn::UnfoldedFuncVariable::bprop(), PLearn::LogaddOnBagsModule::bprop(), PLearn::RBMSparse1DMatrixConnection::bpropAccUpdate(), PLearn::CostModule::bpropAccUpdate(), PLearn::CombiningCostsModule::bpropAccUpdate(), PLearn::RBMMixedLayer::bpropNLL(), PLearn::RBMSparse1DMatrixConnection::bpropUpdate(), PLearn::SortRowsVMatrix::build_(), PLearn::RBMConnection::build_(), PLearn::RankedVMatrix::build_(), PLearn::MaxSubsampling2DModule::build_(), PLearn::Convolution2DModule::build_(), 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::BaggingLearner::computeOutput(), PLearn::RBMModule::computePartitionFunction(), PLearn::RBMSparse1DMatrixConnection::computeProducts(), PLearn::LinearRegressor::computeResidualsVariance(), PLearn::RBMQLParameters::computeUnitActivations(), PLearn::RBMLQParameters::computeUnitActivations(), PLearn::UniformizeLearner::computeWeightedRankMap(), PLearn::displayDecisionSurface(), PLearn::Kernel::estimateHistograms(), PLearn::findClosestPairsOfDifferentClass(), PLearn::SubsamplingDBN::fineTuningStep(), PLearn::DeepBeliefNet::fineTuningStep(), PLearn::UnfoldedFuncVariable::fprop(), PLearn::RBMModule::fprop(), PLearn::GaussianProcessNLLVariable::fprop(), PLearn::CostModule::fprop(), PLearn::CombiningCostsModule::fprop(), PLearn::RBMMixedLayer::fpropNLL(), PLearn::SumOverBagsVariable::fpropOneBag(), PLearn::GCV(), PLearn::VMatrixFromDistribution::getColumn(), PLearn::MemoryVMatrix::getColumn(), PLearn::SplitModule::getPortSizes(), PLearn::SubsamplingDBN::greedyStep(), PLearn::DeepBeliefNet::greedyStep(), PLearn::InferenceRBM::hiddenExpGivenInput(), PLearn::kernelPCAfromDotProducts(), PLearn::NonLocalManifoldParzen::knn(), PLearn::GaussianContinuumDistribution::knn(), PLearn::GaussianContinuum::knn(), PLearn::StatsCollector::lift(), PLearn::loadATT800(), PLearn::StatsCollector::mean_lift(), PLearn::metricMultiDimensionalScaling(), PLearn::newIndexedMatArray(), PLearn::WPLS::NIPALSEigenvector(), PLearn::PLS::NIPALSEigenvector(), PLearn::normalizeColumns(), PLearn::SubsamplingDBN::onlineStep(), PLearn::StackedAutoassociatorsNet::onlineStep(), PLearn::DeepBeliefNet::onlineStep(), PLearn::SequentialModelSelector::paired_t_test(), PLearn::StatsCollector::prbp(), PLearn::product(), PLearn::MoleculeTemplate::readFromAMATFile(), PLearn::rebalanceNClasses(), PLearn::regulargrid_x_y_outputs_to_bitmap(), PLearn::ridgeRegressionByGCV(), PLearn::TestDependencyCommand::run(), PLearn::TestDependenciesCommand::run(), PLearn::selectAndOrder(), PLearn::selectColumns(), PLearn::SpearmanRankCorrelation(), PLearn::testCholeskyRoutines(), PLearn::WPLS::train(), PLearn::StackedSVDNet::train(), PLearn::SequentialModelSelector::train(), PLearn::RankLearner::train(), PLearn::PLS::train(), PLearn::AutoLinearRegressor::train(), PLearn::RBMSparse1DMatrixConnection::update(), PLearn::GaussMix::updateSampleWeights(), and PLearn::weightedRidgeRegressionByGCV().
{ return subMatColumns(colnum, 1); }
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 604 of file TMat_decl.h.
{ TMat<T> result(length(),columns.length()); selectColumns(*this,columns,result); return result; }
void PLearn::TMat< T >::compact | ( | ) | [inline] |
Ensure the allocated memory for this matrix is exactly length * width.
Definition at line 906 of file TMat_decl.h.
Referenced by PLearn::MoleculeTemplate::readFromAMATFile(), and PLearn::Molecule::readFromAMATFile().
{ if(storage->length() != length()*width()) { if(storage->usage()>1) PLERROR("In TMat<T>::compact() - Compact operation not allowed" " when matrix storage is shared, for obvious reasons"); operator=(copy()); } }
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::clear(), PLearn::NeuralProbabilisticLanguageModel::gradient_penalty(), PLearn::FeatureSetSequentialCRF::gradient_penalty(), PLearn::FeatureSetNNet::gradient_penalty(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::squareElements(), PLearn::sumabs(), and PLearn::sumsquare().
{ #ifdef BOUNDCHECK if(mod()!=width()) PLERROR("You cannot use a compact iterator to iterate over the elements of a non compact matrix"); #endif return data(); }
compact_iterator PLearn::TMat< T >::compact_end | ( | ) | const [inline] |
Definition at line 143 of file TMat_decl.h.
Referenced by PLearn::clear(), PLearn::FeatureSetNNet::gradient_penalty(), PLearn::FeatureSetSequentialCRF::gradient_penalty(), PLearn::NeuralProbabilisticLanguageModel::gradient_penalty(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::squareElements(), PLearn::sumabs(), and PLearn::sumsquare().
TMat<T> PLearn::TMat< T >::copy | ( | ) | const [inline] |
returns a newly created copy of this Matrix
Definition at line 677 of file TMat_decl.h.
Referenced by PLearn::GaussianDistribution::computeEigenDecomposition(), PLearn::PruningLinearRegressor::computeTRatio(), PLearn::diagonalizeSubspace(), PLearn::RBMModule::fprop(), PLearn::loadLetters(), PLearn::multivariate_normal(), PLearn::ConvertToPyObject< Mat >::newPyObject(), PLearn::operator*(), PLearn::operator+(), PLearn::operator-(), PLearn::operator/(), PLearn::TMatTest::perform(), PLearn::Gnuplot::plotClasses(), PLearn::TransformationLearner::returnAllTransforms(), and PLearn::AdaBoost::train().
void PLearn::TMat< T >::copyColumnTo | ( | int | col, |
T * | x | ||
) | const [inline] |
void PLearn::TMat< T >::copyTo | ( | T * | x | ) | const [inline] |
T* PLearn::TMat< T >::data | ( | ) | const [inline] |
Returns a pointer to the beginning of the matrix data.
Definition at line 324 of file TMat_decl.h.
Referenced by PLearn::absargmax(), PLearn::add(), PLearn::addToColumns(), PLearn::addToDiagonal(), PLearn::argmax(), PLearn::argmin(), PLearn::averageAcrossRowsAndColumns(), PLearn::backConvolve2D(), PLearn::backConvolve2Dbackprop(), PLearn::SparseIncrementalAffineTransformVariable::bprop(), PLearn::SoftSoftMaxVariable::bprop(), PLearn::MaxSubsampling2DModule::bpropAccUpdate(), PLearn::RBMLateralBinomialLayer::bpropNLL(), PLearn::RBMMultinomialLayer::bpropUpdate(), PLearn::RBMLateralBinomialLayer::bpropUpdate(), PLearn::chol_rotapp_tr_opt(), PLearn::choleskyDecomposition(), PLearn::choleskyInvert(), PLearn::choleskySolve(), PLearn::RationalQuadraticARDKernel::computeGramMatrix(), PLearn::RationalQuadraticARDKernel::computeGramMatrixDerivIspAlpha(), PLearn::SquaredExponentialARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::RationalQuadraticARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::NeuralNetworkARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::Matern1ARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::LinearARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::computeInverseStandardDeviationFromMeanAndSquareMean(), PLearn::convolve(), PLearn::convolve2D(), PLearn::convolve2Dbackprop(), 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::externalProductAcc(), PLearn::RBMLateralBinomialLayer::externalSymetricProductAcc(), PLearn::RBMLateralBinomialLayer::forget(), PLearn::SoftSoftMaxVariable::fprop(), PLearn::geometric_mean(), PLearn::DenoisingRecurrentNet::inject_zero_forcing_noise(), PLearn::inverse(), PLearn::invertElements(), PLearn::lapackCholeskyDecompositionInPlace(), PLearn::lapackCholeskySolveInPlace(), 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::maxabs(), PLearn::mean(), PLearn::min(), PLearn::minabs(), PLearn::multiplyAcc(), PLearn::multiplyScaledAdd(), PLearn::negateElements(), PLearn::ConvertToPyObject< Mat >::newPyObject(), PLearn::StackedAutoassociatorsNet::onlineStep(), PLearn::operator*=(), PLearn::operator+=(), PLearn::operator-(), PLearn::operator-=(), PLearn::operator/=(), PLearn::partialSortRows(), PLearn::RBMMatrixConnection::petiteCulotteOlivierCD(), PLearn::product(), PLearn::product2Acc(), PLearn::productAcc(), PLearn::productScaleAcc(), PLearn::qld_interface(), PLearn::regularizeMatrix(), 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::transposeProductScaleAcc(), PLearn::transposeTransposeProduct(), PLearn::transposeTransposeProductAcc(), PLearn::transposeTransposeProductScaleAcc(), PLearn::RBMMatrixTransposeConnection::update(), PLearn::RBMMatrixConnection::update(), PLearn::RBMLLParameters::update(), PLearn::RBMLateralBinomialLayer::update(), PLearn::RBMConv2DLLParameters::update(), PLearn::RBMConv2DConnection::update(), PLearn::NeuralProbabilisticLanguageModel::update_affine_transform(), PLearn::FeatureSetSequentialCRF::update_affine_transform(), PLearn::FeatureSetNNet::update_affine_transform(), and PLearn::variance().
void PLearn::TMat< T >::debugPrint | ( | ) | [inline] |
Definition at line 946 of file TMat_decl.h.
{print(cerr);}
TMat< T > PLearn::TMat< T >::deepCopy | ( | CopiesMap & | 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 470 of file TMat_impl.h.
References PLearn::TMat< T >::makeDeepCopyFromShallowCopy().
Referenced by PLearn::deepCopy().
{ // First do a shallow copy TMat<T> deep_copy = *this; // Transform the shallow copy into a deep copy deep_copy.makeDeepCopyFromShallowCopy(copies); // return the completed deep_copy return deep_copy; }
TMatElementIterator< T > PLearn::TMat< T >::end | ( | ) | const [inline] |
Definition at line 487 of file TMat_impl.h.
Referenced by PLearn::clear(), PLearn::fill_random_normal(), PLearn::fill_random_uniform(), PLearn::NeuralProbabilisticLanguageModel::gradient_penalty(), PLearn::FeatureSetSequentialCRF::gradient_penalty(), PLearn::FeatureSetNNet::gradient_penalty(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::softmax(), PLearn::squareElements(), PLearn::sumabs(), PLearn::sumsquare(), and PLearn::swap().
void PLearn::TMat< T >::fill | ( | const T & | value | ) | const [inline] |
Definition at line 750 of file TMat_decl.h.
Referenced by align_(), PLearn::VecStatsCollector::append(), PLearn::Supersampling2DModule::bbpropUpdate(), PLearn::Subsampling2DModule::bbpropUpdate(), PLearn::Supersampling2DModule::bpropUpdate(), PLearn::Subsampling2DModule::bpropUpdate(), PLearn::SoftmaxModule::bpropUpdate(), PLearn::ShuntingNNetLayerModule::bpropUpdate(), PLearn::OnlineLearningModule::bpropUpdate(), PLearn::OnBagsModule::bpropUpdate(), PLearn::LinearFilterModule::bpropUpdate(), PLearn::GradNNetLayerModule::bpropUpdate(), PLearn::SplitWiseValidationVMatrix::build_(), PLearn::SequentialLearner::build_(), PLearn::RBMModule::build_(), PLearn::RBMConnection::build_(), PLearn::OnBagsModule::build_(), PLearn::MovingAverageVMatrix::build_(), PLearn::ModuleTester::build_(), PLearn::MaxSubsampling2DModule::build_(), PLearn::LayerCostModule::build_(), PLearn::KLp0p1RBMModule::build_(), PLearn::FNetLayerVariable::build_(), PLearn::CumVMatrix::build_(), PLearn::Convolution2DModule::build_(), PLearn::BackConvolution2DModule::build_(), PLearn::ChemicalICP::cacheFeatureDistances(), PLearn::DeepReconstructorNet::computeAndSaveLayerActivationStats(), PLearn::LayerCostModule::computeCorrelationStatistics(), PLearn::PLearnerDiagonalKernel::computeGramMatrix(), PLearn::IIDNoiseKernel::computeGramMatrixDerivative(), PLearn::GaussMix::computeLogLikelihood(), PLearn::LocalGaussianClassifier::computeOutput(), PLearn::KNNClassifier::computeOutput(), PLearn::GaussianProcessRegressor::computeOutputCovMat(), PLearn::ModuleLearner::computeOutputsAndCosts(), PLearn::DeepBeliefNet::computeOutputsAndCosts(), PLearn::computeRanks(), PLearn::LayerCostModule::computeSafeHisto(), PLearn::correlations(), PLearn::displayVarGraph(), PLearn::MemoryVMatrix::fill(), PLearn::fill_one_hot(), PLearn::QuantilesStatsIterator::finish(), PLearn::SequentialLearner::forget(), PLearn::IncrementalNNet::forget(), PLearn::Supersampling2DModule::fprop(), PLearn::Subsampling2DModule::fprop(), PLearn::RBMModule::fprop(), PLearn::LayerCostModule::fprop(), PLearn::SplitModule::getPortSizes(), PLearn::OnlineLearningModule::getPortSizes(), PLearn::NullModule::getPortSizes(), PLearn::CostModule::getPortSizes(), PLearn::BinarizeModule::getPortSizes(), PLearn::InferenceRBM::hiddenExpGivenInput(), PLearn::loadCorel(), PLearn::LocallyMagnifiedDistribution::log_density(), PLearn::VecStatsCollector::merge(), PLearn::TransformationLearner::MStepBias(), PLearn::OldDisplayVarGraph(), PLearn::TMatTest::perform(), PLearn::SourceVariable::randomInitialize(), PLearn::NnlmOutputLayer::resetAllClassVars(), PLearn::NnlmOutputLayer::resetParameters(), PLearn::UndirectedSoftmaxModule::resetWeights(), PLearn::NnlmWordRepresentationLayer::resetWeights(), PLearn::EntropyContrast::set_NNcontinuous_gradient_from_extra_cost(), PLearn::GeodesicDistanceKernel::setDataForKernelMatrix(), PLearn::MatrixModule::setGradientTo(), PLearn::GaussMix::setPredictor(), PLearn::GaussMix::setPredictorPredictedSizes_const(), PLearn::StackedFocusedAutoassociatorsNet::setTrainingSet(), PLearn::RowMapSparseMatrix< real >::toMat(), PLearn::WPLS::train(), PLearn::VariableSelectionWithDirectedGradientDescent::train(), PLearn::SubsamplingDBN::train(), PLearn::PLS::train(), PLearn::NatGradSMPNNet::train(), PLearn::NatGradNNet::train(), PLearn::mNNet::train(), PLearn::LinearInductiveTransferClassifier::train(), PLearn::GaussMix::train(), PLearn::DeepBeliefNet::train(), PLearn::VecStatsCollector::update(), and PLearn::GaussMix::updateInverseVarianceFromPrevious().
int PLearn::TMat< T >::findRow | ( | const TVec< T > & | row | ) | const |
TMat<T> PLearn::TMat< T >::firstColumn | ( | ) | const [inline] |
Definition at line 583 of file TMat_decl.h.
{ return column(0); }
T& PLearn::TMat< T >::firstElement | ( | ) | const [inline] |
Definition at line 593 of file TMat_decl.h.
Referenced by PLearn::trace().
{ return *data(); }
TVec<T> PLearn::TMat< T >::firstRow | ( | ) | const [inline] |
Definition at line 596 of file TMat_decl.h.
Referenced by PLearn::SparseIncrementalAffineTransformVariable::bprop(), PLearn::MatrixAffineTransformVariable::bprop(), PLearn::AffineTransformVariable::bprop(), and PLearn::MatrixAffineTransformFeedbackVariable::fprop().
{ return operator()(0); }
TVec<T> PLearn::TMat< T >::front | ( | ) | const [inline] |
Definition at line 598 of file TMat_decl.h.
{ return firstRow(); }
PP< Storage<T> > PLearn::TMat< T >::getStorage | ( | ) | const [inline] |
Definition at line 304 of file TMat_decl.h.
{ return storage; }
bool PLearn::TMat< T >::hasMissing | ( | ) | const [inline] |
Definition at line 310 of file TMat_decl.h.
Referenced by PLearn::choleskyAppendDimension(), PLearn::PCA::classical_algo(), PLearn::GaussMix::computeLogLikelihood(), PLearn::GaussMix::computeMeansAndCovariances(), PLearn::GaussianProcessRegressor::computeOutputCovMat(), PLearn::RBMMultinomialLayer::fpropNLL(), PLearn::RBMLocalMultinomialLayer::fpropNLL(), PLearn::ridgeRegressionByGCV(), and PLearn::SVD().
{ if ( isEmpty() ) return false; iterator it = begin(); iterator itend = end(); for(; it!=itend; ++it) if(is_missing(*it)) return true; return false; }
void PLearn::TMat< T >::input | ( | PStream & | in | ) | const |
void PLearn::TMat< T >::input | ( | istream & | in = cin | ) | const |
bool PLearn::TMat< T >::isCompact | ( | ) | const [inline] |
Definition at line 860 of file TMat_decl.h.
Referenced by PLearn::clear(), PLearn::Variable::defineGradientLocation(), PLearn::Variable::defineValueLocation(), PLearn::dot(), PLearn::externalProductAcc(), PLearn::RBMLateralBinomialLayer::externalSymetricProductAcc(), PLearn::NeuralProbabilisticLanguageModel::gradient_penalty(), PLearn::FeatureSetSequentialCRF::gradient_penalty(), PLearn::FeatureSetNNet::gradient_penalty(), PLearn::DenoisingRecurrentNet::inject_zero_forcing_noise(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::squareElements(), PLearn::sumabs(), PLearn::sumsquare(), PLearn::NeuralProbabilisticLanguageModel::update_affine_transform(), PLearn::FeatureSetSequentialCRF::update_affine_transform(), PLearn::FeatureSetNNet::update_affine_transform(), and PLearn::Variable::Variable().
bool PLearn::TMat< T >::isContiguous | ( | ) | const [inline] |
returns true if matrix elements are contiguous in memory (i.e.
no gap between last element of a row and first element of next row).
Definition at line 259 of file TMat_decl.h.
bool PLearn::TMat< T >::isEmpty | ( | ) | const [inline] |
Definition at line 731 of file TMat_decl.h.
Referenced by PLearn::TreeDBNModule::bpropAccUpdate(), PLearn::SoftmaxNLLCostModule::bpropAccUpdate(), PLearn::RBMSparse1DMatrixConnection::bpropAccUpdate(), PLearn::RBMModule::bpropAccUpdate(), PLearn::RBMMixedConnection::bpropAccUpdate(), PLearn::RBMMatrixConnection::bpropAccUpdate(), PLearn::RBMConv2DConnection::bpropAccUpdate(), PLearn::OnlineLearningModule::bpropAccUpdate(), PLearn::OnBagsModule::bpropAccUpdate(), PLearn::NLLCostModule::bpropAccUpdate(), PLearn::NetworkModule::bpropAccUpdate(), PLearn::MaxSubsampling2DModule::bpropAccUpdate(), PLearn::MatrixModule::bpropAccUpdate(), PLearn::LinearCombinationModule::bpropAccUpdate(), PLearn::LayerCostModule::bpropAccUpdate(), PLearn::KLp0p1RBMModule::bpropAccUpdate(), PLearn::IdentityModule::bpropAccUpdate(), PLearn::CrossEntropyCostModule::bpropAccUpdate(), PLearn::CostModule::bpropAccUpdate(), PLearn::Convolution2DModule::bpropAccUpdate(), PLearn::OnlineLearningModule::bpropUpdate(), PLearn::RemapLastColumnVMatrix::build_(), PLearn::ClassErrorCostModule::build_(), PLearn::RBMModule::computeFreeEnergyOfHidden(), PLearn::KLp0p1RBMModule::computeFreeEnergyOfHidden(), PLearn::RBMModule::computeFreeEnergyOfVisible(), PLearn::KLp0p1RBMModule::computeFreeEnergyOfVisible(), PLearn::RBMModule::computeHiddenActivations(), PLearn::KLp0p1RBMModule::computeHiddenActivations(), PLearn::RBMModule::computePositivePhaseHiddenActivations(), PLearn::KLp0p1RBMModule::computePositivePhaseHiddenActivations(), PLearn::RBMModule::computeVisibleActivations(), PLearn::KLp0p1RBMModule::computeVisibleActivations(), PLearn::eigenVecOfSymmMat(), PLearn::VBoundDBN2::fprop(), PLearn::TreeDBNModule::fprop(), PLearn::SquaredErrorCostModule::fprop(), PLearn::SoftmaxNLLCostModule::fprop(), PLearn::RBMModule::fprop(), PLearn::OnlineLearningModule::fprop(), PLearn::OnBagsModule::fprop(), PLearn::NLLCostModule::fprop(), PLearn::NetworkModule::fprop(), PLearn::MaxSubsampling2DModule::fprop(), PLearn::LinearCombinationModule::fprop(), PLearn::LayerCostModule::fprop(), PLearn::KLp0p1RBMModule::fprop(), PLearn::CostModule::fprop(), PLearn::Convolution2DModule::fprop(), PLearn::ClassErrorCostModule::fprop(), PLearn::ArgmaxModule::fprop(), PLearn::TreeDBNModule::full_fprop(), PLearn::RemapLastColumnVMatrix::getNewRow(), PLearn::SplitModule::getPortSizes(), PLearn::NullModule::getPortSizes(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::logadd(), PLearn::matInvert(), PLearn::ConvertToPyObject< Mat >::newPyObject(), PLearn::product(), PLearn::productAcc(), PLearn::productScaleAcc(), PLearn::productTranspose(), PLearn::productTransposeAcc(), PLearn::productTransposeScaleAcc(), PLearn::transposeProduct(), PLearn::transposeProductAcc(), PLearn::transposeProductScaleAcc(), PLearn::transposeTransposeProduct(), PLearn::transposeTransposeProductAcc(), and PLearn::transposeTransposeProductScaleAcc().
bool PLearn::TMat< T >::isEqual | ( | const TMat< T > & | other, |
real | precision = 1e-6 |
||
) | const [inline] |
Definition at line 540 of file TMat_impl.h.
References PLearn::TMat< T >::begin(), PLearn::is_equal(), PLearn::TMat< T >::length(), and PLearn::TMat< T >::width().
Referenced by PLearn::save_load_compare().
{ if ( length() != other.length() || width() != other.width() ) return false; iterator it = begin(); iterator end_ = end(); iterator other_it = other.begin(); for(; it != end_; ++it, ++other_it) if( !is_equal(*it,*other_it, 10.0, precision, precision) ) return false; return true; }
bool PLearn::TMat< T >::isNotContiguous | ( | ) | const [inline] |
returns true if matrix elements are not contiguous in memory (i.e.
there is a gap between last element of a row and first element of next row).
Definition at line 264 of file TMat_decl.h.
Referenced by PLearn::UnaryVariable::checkContiguity().
bool PLearn::TMat< T >::isNotEmpty | ( | ) | const [inline] |
Definition at line 734 of file TMat_decl.h.
Referenced by PLearn::YMDDatedVMatrix::build_(), PLearn::computeConditionalMeans(), PLearn::fill_one_hot(), PLearn::SequentialLearner::forget(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::lapackSVD(), PLearn::operator-=(), and PLearn::MatRowVariable::recomputeSize().
bool PLearn::TMat< T >::isNotNull | ( | ) | const [inline] |
Definition at line 728 of file TMat_decl.h.
Referenced by PLearn::MemoryCachedKernel::addDataForKernelMatrix(), PLearn::GaussianProcessNLLVariable::build_(), PLearn::KernelRidgeRegressor::computeOutput(), PLearn::GenericNearestNeighbors::constructOutputVector(), and PLearn::MemoryCachedKernel::dataRow().
{ return storage.isNotNull(); }
bool PLearn::TMat< T >::isNull | ( | ) | const [inline] |
Definition at line 725 of file TMat_decl.h.
Referenced by PLearn::ICP::buildMeshes(), and PLearn::ConvertToPyObject< Mat >::newPyObject().
{ return storage.isNull(); }
bool PLearn::TMat< T >::isSquare | ( | ) | const [inline] |
Definition at line 307 of file TMat_decl.h.
Referenced by PLearn::makeItSymmetric(), and PLearn::trace().
bool PLearn::TMat< T >::isSymmetric | ( | bool | exact_check = true , |
bool | accept_empty = false |
||
) | const [inline] |
Return 'true' iff the matrix is symmetric.
If 'exact_check' is true, it performs a fast exact equality check (which does not handle 'nan' or 'inf' for instance), otherwise it uses the approximate and slower 'is_equal' function from pl_math.h. If 'accept_empty' is set to 'true', then empty matrices will be considered as symmetric, otherwise a warning will be issued and 'false' will be returned.
Definition at line 870 of file TMat_decl.h.
Referenced by PLearn::GaussMix::addToCovariance(), PLearn::GaussMix::computeLogLikelihood(), PLearn::GaussMix::computeMeansAndCovariances(), PLearn::eigen_SymmMat(), PLearn::eigenVecOfSymmMat(), PLearn::GaussianProcessNLLVariable::fbpropFragments(), PLearn::GaussMix::setPredictor(), PLearn::GaussMix::setPredictorPredictedSizes_const(), and PLearn::GaussMix::updateInverseVarianceFromPrevious().
{ if (!isSquare()) return false; if (isEmpty()) { if (accept_empty) return true; else { PLWARNING("In TMat::isSymmetric - The matrix is empty, considering " "it is not symmetric (use 'accept_empty' if you want to " " allow it)"); return false; } } int n = length(); PLASSERT( width() == n ); if (exact_check) { for (int i = 0; i < n - 1 ; i++) for (int j = i + 1; j < n; j++) if ( !fast_exact_is_equal((*this)[i][j], (*this)[j][i]) ) return false; } else { for (int i = 0; i < n ; i++) for (int j = i + 1; j < n; j++) if ( !is_equal((*this)[i][j], (*this)[j][i] ) ) return false; } return true; }
TMat<T> PLearn::TMat< T >::lastColumn | ( | ) | const [inline] |
Definition at line 586 of file TMat_decl.h.
Referenced by PLearn::RGBImageDB::computeHistogramRepresentation(), PLearn::Gnuplot::featureplot(), PLearn::LocallyMagnifiedDistribution::log_density(), and PLearn::BasisSelectionRegressor::retrainLearner().
T& PLearn::TMat< T >::lastElement | ( | ) | const [inline] |
Definition at line 594 of file TMat_decl.h.
Referenced by PLearn::DTWKernel::evaluate().
{ return operator()(length_-1,width_-1); }
TVec<T> PLearn::TMat< T >::lastRow | ( | ) | const [inline] |
Definition at line 597 of file TMat_decl.h.
{ return operator()(length_ - 1); }
int PLearn::TMat< T >::length | ( | ) | const [inline] |
Definition at line 245 of file TMat_decl.h.
Referenced by PLearn::absargmax(), PLearn::RBMSparse1DMatrixConnection::accumulateNegStats(), PLearn::RBMMatrixConnection::accumulateNegStats(), PLearn::RBMLayer::accumulateNegStats(), PLearn::RBMDiagonalMatrixConnection::accumulateNegStats(), PLearn::RBMSparse1DMatrixConnection::accumulatePosStats(), PLearn::RBMMatrixConnection::accumulatePosStats(), PLearn::RBMLayer::accumulatePosStats(), PLearn::RBMDiagonalMatrixConnection::accumulatePosStats(), PLearn::add(), PLearn::RBMLayer::addBiasDecay(), PLearn::MemoryCachedKernel::addDataForKernelMatrix(), PLearn::PLearnDiff::addDiffPrefix(), PLearn::addEigenMatrices(), PLearn::addToColumns(), PLearn::GaussMix::addToCovariance(), PLearn::addToDiagonal(), PLearn::addToRows(), PLearn::RBMMatrixConnection::addWeightPenalty(), PLearn::affineMatrixInitialize(), align(), align_(), PLearn::GaussianProcessNLLVariable::alpha(), PLearn::VecStatsCollector::append(), PLearn::BasisSelectionRegressor::appendKernelFunctions(), PLearn::VMatrix::appendRows(), PLearn::apply(), PLearn::Learner::applyAndComputeCostsOnTestMat(), PLearn::applyGeomTransformation(), PLearn::argmax(), PLearn::argmin(), PLearn::averageAcrossRowsAndColumns(), PLearn::backConvolve2D(), PLearn::backConvolve2Dbackprop(), PLearn::TransformationLearner::batchGeneratePredictedFrom(), PLearn::GaussianProcessRegressor::BayesianCost(), PLearn::binary_search(), PLearn::bootstrap_rows(), PLearn::WeightedLogGaussian::bprop(), PLearn::TransposedDoubleProductVariable::bprop(), PLearn::TraceVariable::bprop(), PLearn::SumVarianceOfLinearTransformedCategoricals::bprop(), PLearn::SumVarianceOfLinearTransformedBernoullis::bprop(), PLearn::SumEntropyOfCategoricals::bprop(), PLearn::SumEntropyOfBernoullis::bprop(), PLearn::SparseIncrementalAffineTransformVariable::bprop(), PLearn::NonDiagVariable::bprop(), PLearn::MultiMaxVariable::bprop(), PLearn::MatrixAffineTransformVariable::bprop(), PLearn::LogSoftSoftMaxVariable::bprop(), PLearn::LogaddOnBagsModule::bprop(), PLearn::LocalizedFeaturesLayerVariable::bprop(), PLearn::InsertZerosVariable::bprop(), PLearn::GaussianProcessNLLVariable::bprop(), PLearn::DoubleProductVariable::bprop(), PLearn::Cov2CorrVariable::bprop(), PLearn::ConstrainVariable::bprop(), PLearn::ConcatColumnsVariable::bprop(), PLearn::AffineTransformVariable::bprop(), PLearn::NllGeneralGaussianVariable::bprop_to_bases(), PLearn::DeepNonLocalManifoldParzen::bprop_to_bases(), PLearn::VBoundDBN2::bpropAccUpdate(), PLearn::TreeDBNModule::bpropAccUpdate(), PLearn::SplitModule::bpropAccUpdate(), PLearn::SoftmaxNLLCostModule::bpropAccUpdate(), PLearn::RBMSparse1DMatrixConnection::bpropAccUpdate(), PLearn::RBMModule::bpropAccUpdate(), PLearn::RBMMixedConnection::bpropAccUpdate(), PLearn::RBMMatrixConnection::bpropAccUpdate(), PLearn::RBMConv2DConnection::bpropAccUpdate(), PLearn::OnlineLearningModule::bpropAccUpdate(), PLearn::OnBagsModule::bpropAccUpdate(), PLearn::NLLCostModule::bpropAccUpdate(), PLearn::NetworkModule::bpropAccUpdate(), PLearn::MaxSubsampling2DModule::bpropAccUpdate(), PLearn::MatrixModule::bpropAccUpdate(), PLearn::LinearCombinationModule::bpropAccUpdate(), PLearn::LayerCostModule::bpropAccUpdate(), PLearn::KLp0p1RBMModule::bpropAccUpdate(), PLearn::IdentityModule::bpropAccUpdate(), PLearn::CrossEntropyCostModule::bpropAccUpdate(), PLearn::CostModule::bpropAccUpdate(), PLearn::Convolution2DModule::bpropAccUpdate(), PLearn::CombiningCostsModule::bpropAccUpdate(), PLearn::BinarizeModule::bpropAccUpdate(), PLearn::bpropCholeskyDecomposition(), PLearn::bpropCholeskySolve(), PLearn::mNNet::bpropNet(), PLearn::RBMWoodsLayer::bpropNLL(), PLearn::RBMMultinomialLayer::bpropNLL(), PLearn::RBMMixedLayer::bpropNLL(), PLearn::RBMLocalMultinomialLayer::bpropNLL(), PLearn::RBMLateralBinomialLayer::bpropNLL(), PLearn::RBMGaussianLayer::bpropNLL(), PLearn::RBMBinomialLayer::bpropNLL(), PLearn::TanhModule::bpropUpdate(), PLearn::SquaredErrorCostModule::bpropUpdate(), PLearn::SoftmaxNLLCostModule::bpropUpdate(), PLearn::SoftmaxModule::bpropUpdate(), PLearn::ShuntingNNetLayerModule::bpropUpdate(), PLearn::ScaleGradientModule::bpropUpdate(), PLearn::RBMWoodsLayer::bpropUpdate(), PLearn::RBMSparse1DMatrixConnection::bpropUpdate(), PLearn::RBMMultinomialLayer::bpropUpdate(), PLearn::RBMMixedLayer::bpropUpdate(), PLearn::RBMMixedConnection::bpropUpdate(), PLearn::RBMMatrixTransposeConnection::bpropUpdate(), PLearn::RBMMatrixConnectionNatGrad::bpropUpdate(), PLearn::RBMMatrixConnection::bpropUpdate(), PLearn::RBMLocalMultinomialLayer::bpropUpdate(), PLearn::RBMLateralBinomialLayer::bpropUpdate(), PLearn::RBMDiagonalMatrixConnection::bpropUpdate(), PLearn::RBMConv2DConnection::bpropUpdate(), PLearn::RBMBinomialLayer::bpropUpdate(), PLearn::ProcessInputCostModule::bpropUpdate(), PLearn::OnlineLearningModule::bpropUpdate(), PLearn::OnBagsModule::bpropUpdate(), PLearn::NLLCostModule::bpropUpdate(), PLearn::ModuleStackModule::bpropUpdate(), PLearn::LinearFilterModule::bpropUpdate(), PLearn::LayerCostModule::bpropUpdate(), PLearn::GradNNetLayerModule::bpropUpdate(), PLearn::CrossEntropyCostModule::bpropUpdate(), PLearn::CombiningCostsModule::bpropUpdate(), PLearn::mNNet::bpropUpdateNet(), PLearn::YMDDatedVMatrix::build_(), PLearn::SplitWiseValidationVMatrix::build_(), PLearn::ShuntingNNetLayerModule::build_(), PLearn::ScoreLayerVariable::build_(), PLearn::RepeatSplitter::build_(), PLearn::RBMSparse1DMatrixConnection::build_(), PLearn::RBMQLParameters::build_(), PLearn::RBMMatrixConnection::build_(), PLearn::RBMLQParameters::build_(), PLearn::RBMLLParameters::build_(), PLearn::RBMGenericParameters::build_(), PLearn::RBMConv2DLLParameters::build_(), PLearn::RBMConv2DConnection::build_(), PLearn::RankedVMatrix::build_(), PLearn::PLearnDiff::build_(), PLearn::ObjectOptionVariable::build_(), PLearn::MultiTargetOneHotVMatrix::build_(), PLearn::MoleculeTemplate::build_(), PLearn::ModuleTester::build_(), PLearn::MemoryVMatrix::build_(), PLearn::LocalNeighborsDifferencesVMatrix::build_(), PLearn::LinearInductiveTransferClassifier::build_(), PLearn::LemmatizeVMatrix::build_(), PLearn::KNNImputationVMatrix::build_(), PLearn::GradNNetLayerModule::build_(), PLearn::FNetLayerVariable::build_(), PLearn::ExtractNNetParamsVMatrix::build_(), PLearn::DictionaryVMatrix::build_(), PLearn::Convolution2DModule::build_(), PLearn::ClassErrorCostModule::build_(), PLearn::BackConvolution2DModule::build_(), PLearn::AppendNeighborsVMatrix::build_(), PLearn::Convolution2DModule::build_kernels(), PLearn::BackConvolution2DModule::build_kernels(), PLearn::BasisSelectionRegressor::buildTopCandidateFunctions(), PLearn::ChemicalICP::cacheFeatureDistances(), PLearn::RBMTrainer::CD1(), PLearn::chol_dxch(), PLearn::chol_rotapp_tr(), PLearn::choleskyAppendDimension(), PLearn::choleskyDecomposition(), PLearn::choleskyInsertBasis(), PLearn::choleskyInvert(), PLearn::choleskyLeftSolve(), PLearn::choleskyRemoveDimension(), PLearn::choleskyRightSolve(), PLearn::choleskySolve(), PLearn::choleskyUpgrade(), PLearn::classification_confusion_matrix(), PLearn::columnArgmax(), PLearn::columnArgmin(), PLearn::columnMax(), PLearn::columnMean(), PLearn::columnMin(), PLearn::columnSum(), PLearn::columnVariance(), PLearn::columnWeightedMean(), PLearn::columnWeightedVariance(), PLearn::RBMModule::computeAllHiddenProbabilities(), PLearn::DeepBeliefNet::computeClassifAndFinalCostsFromOutputs(), PLearn::computeColumnsMeanAndStddev(), PLearn::computeConditionalMeans(), PLearn::LayerCostModule::computeCorrelationStatistics(), PLearn::AddCostToLearner::computeCostsFromOutputs(), PLearn::computeCovar(), PLearn::RBMModule::computeEnergy(), PLearn::KLp0p1RBMModule::computeEnergy(), PLearn::RBMWoodsLayer::computeExpectations(), PLearn::RBMTruncExpLayer::computeExpectations(), PLearn::RBMRateLayer::computeExpectations(), PLearn::RBMMultinomialLayer::computeExpectations(), PLearn::RBMLocalMultinomialLayer::computeExpectations(), PLearn::RBMLateralBinomialLayer::computeExpectations(), PLearn::RBMGaussianLayer::computeExpectations(), PLearn::RBMBinomialLayer::computeExpectations(), PLearn::RBMModule::computeFreeEnergyOfHidden(), PLearn::KLp0p1RBMModule::computeFreeEnergyOfHidden(), PLearn::RBMModule::computeFreeEnergyOfVisible(), PLearn::KLp0p1RBMModule::computeFreeEnergyOfVisible(), PLearn::ThresholdedKernel::computeGramMatrix(), PLearn::SummationKernel::computeGramMatrix(), PLearn::RationalQuadraticARDKernel::computeGramMatrix(), PLearn::PLearnerDiagonalKernel::computeGramMatrix(), PLearn::KroneckerBaseKernel::computeGramMatrix(), PLearn::Kernel::computeGramMatrix(), PLearn::IIDNoiseKernel::computeGramMatrix(), PLearn::RationalQuadraticARDKernel::computeGramMatrixDerivIspAlpha(), PLearn::Matern1ARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::RationalQuadraticARDKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::PLearnerDiagonalKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::Matern1ARDKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::IIDNoiseKernel::computeGramMatrixDerivKronecker(), PLearn::MemoryCachedKernel::computeGramMatrixNV(), PLearn::RBMModule::computeHiddenActivations(), PLearn::KLp0p1RBMModule::computeHiddenActivations(), PLearn::LayerCostModule::computeHisto(), PLearn::RGBImageDB::computeHistogramRepresentation(), PLearn::LinearRegressor::computeInformationCriteria(), PLearn::computeInverseStandardDeviationFromMeanAndSquareMean(), PLearn::LayerCostModule::computeKLdiv(), PLearn::Kernel::computeKNNeighbourMatrixFromDistanceMatrix(), PLearn::ReconstructionWeightsKernel::computeLLEMatrix(), PLearn::GaussMix::computeLogLikelihood(), PLearn::RBMModule::computeLogLikelihoodOfVisible(), PLearn::DeepNonLocalManifoldParzen::computeManifoldParzenParameters(), PLearn::computeMeanAndCovar(), PLearn::computeNearestNeighbors(), PLearn::RBMModule::computeNegLogPVisibleGivenPHidden(), PLearn::Kernel::computeNeighbourMatrixFromDistanceMatrix(), PLearn::ManifoldParzen2::computeOutput(), PLearn::KernelRidgeRegressor::computeOutput(), PLearn::IsomapTangentLearner::computeOutput(), PLearn::BaggingLearner::computeOutput(), PLearn::ModuleLearner::computeOutputAndCosts(), PLearn::PLearner::computeOutputCovMat(), PLearn::GaussianProcessRegressor::computeOutputCovMat(), PLearn::StackedAutoassociatorsNet::computeOutputs(), PLearn::PLearner::computeOutputs(), PLearn::NatGradNNet::computeOutputs(), PLearn::mNNet::computeOutputs(), PLearn::StackedAutoassociatorsNet::computeOutputsAndCosts(), PLearn::PLearner::computeOutputsAndCosts(), PLearn::NatGradNNet::computeOutputsAndCosts(), PLearn::ModuleLearner::computeOutputsAndCosts(), PLearn::mNNet::computeOutputsAndCosts(), PLearn::DeepBeliefNet::computeOutputsAndCosts(), PLearn::AddCostToLearner::computeOutputsAndCosts(), PLearn::Kernel::computePartialGramMatrix(), PLearn::LayerCostModule::computePascalStatistics(), PLearn::RBMModule::computePositivePhaseHiddenActivations(), PLearn::KLp0p1RBMModule::computePositivePhaseHiddenActivations(), PLearn::GaussMix::computePosteriors(), PLearn::computePrincipalComponents(), PLearn::RBMSparse1DMatrixConnection::computeProducts(), PLearn::RBMMatrixTransposeConnection::computeProducts(), PLearn::RBMMatrixConnection::computeProducts(), PLearn::RBMDiagonalMatrixConnection::computeProducts(), PLearn::RBMConv2DConnection::computeProducts(), PLearn::computeRanks(), PLearn::LinearRegressor::computeResidualsVariance(), PLearn::LayerCostModule::computeSafeHisto(), PLearn::LocalizedFeaturesLayerVariable::computeSubsets(), PLearn::Kernel::computeTestGramMatrix(), PLearn::PruningLinearRegressor::computeTRatio(), PLearn::RBMModule::computeVisibleActivations(), PLearn::KLp0p1RBMModule::computeVisibleActivations(), PLearn::ICP::computeWeightedDistance(), PLearn::ChemicalICP::computeWeightedDistance(), PLearn::UniformizeLearner::computeWeightedRankMap(), PLearn::ICP::computeWeights(), PLearn::ChemicalICP::computeWeights(), PLearn::SumVarianceOfLinearTransformedBernoullis::computeWsqnorm(), PLearn::constrainedLinearRegression(), PLearn::convolve(), PLearn::convolve2D(), PLearn::convolve2Dbackprop(), PLearn::correlation(), PLearn::BallTreeNearestNeighbors::createAnchors(), PLearn::cross_valid(), PLearn::Variable::defineGradientLocation(), PLearn::Variable::defineValueLocation(), PLearn::SecondIterationWrapper::deGaussianize(), 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::ICP::dynamicDistanceThreshold(), PLearn::eigen_SymmMat(), PLearn::eigenSparseNonSymmMat(), PLearn::eigenSparseSymmMat(), PLearn::eigenVecOfSymmMat(), PLearn::DenoisingRecurrentNet::encode_artificialData(), PLearn::DenoisingRecurrentNet::encode_onehot_diffNote_duration(), PLearn::DenoisingRecurrentNet::encode_onehot_note_octav_duration(), PLearn::DenoisingRecurrentNet::encode_onehot_timeframe(), PLearn::DenoisingRecurrentNet::encodeAndCreateSupervisedSequence(), PLearn::DenoisingRecurrentNet::encodeAndCreateSupervisedSequence2(), PLearn::equals(), PLearn::Kernel::estimateHistograms(), PLearn::ReconstructionWeightsKernel::evaluate_sum_k_i_k_j(), PLearn::PLMPI::exchangeColumnBlocks(), PLearn::externalProduct(), PLearn::externalProductAcc(), PLearn::externalProductDivUpdate(), PLearn::externalProductMultUpdate(), PLearn::externalProductScaleAcc(), PLearn::RBMLateralBinomialLayer::externalSymetricProductAcc(), PLearn::StackedAutoassociatorsNet::fantasizeKTimeOnMultiSrcImg(), PLearn::DeepBeliefNet::fantasizeKTimeOnMultiSrcImg(), PLearn::GaussianProcessNLLVariable::fbpropFragments(), PLearn::NatGradSMPNNet::fbpropLoss(), PLearn::NatGradNNet::fbpropLoss(), PLearn::mNNet::fbpropLoss(), PLearn::Gnuplot::featureplot(), PLearn::PRandom::fill_random_normal(), PLearn::PRandom::fill_random_uniform(), PLearn::fillDiagonal(), PLearn::fillItSymmetric(), PLearn::NeuralProbabilisticLanguageModel::fillWeights(), PLearn::FeatureSetSequentialCRF::fillWeights(), PLearn::FeatureSetNNet::fillWeights(), PLearn::LiftStatsCollector::finalize(), PLearn::findSmallestEigenPairOfSymmMat(), PLearn::RBMLateralBinomialLayer::forget(), PLearn::PseudolikelihoodRBM::forget(), PLearn::GradNNetLayerModule::forget(), PLearn::WeightedLogGaussian::fprop(), PLearn::VBoundDBN2::fprop(), PLearn::TreeDBNModule::fprop(), PLearn::TransposedDoubleProductVariable::fprop(), PLearn::TraceVariable::fprop(), PLearn::TanhModule::fprop(), PLearn::SumVarianceOfLinearTransformedCategoricals::fprop(), PLearn::SumVarianceOfLinearTransformedBernoullis::fprop(), PLearn::SumEntropyOfCategoricals::fprop(), PLearn::SumEntropyOfBernoullis::fprop(), PLearn::SplitModule::fprop(), PLearn::SoftmaxNLLCostModule::fprop(), PLearn::SoftmaxModule::fprop(), PLearn::ShuntingNNetLayerModule::fprop(), PLearn::ScaleGradientModule::fprop(), PLearn::RunICPVariable::fprop(), PLearn::RBMWoodsLayer::fprop(), PLearn::RBMModule::fprop(), PLearn::RBMMixedLayer::fprop(), PLearn::RBMLayer::fprop(), PLearn::RBMLateralBinomialLayer::fprop(), PLearn::RBMConnection::fprop(), PLearn::RBMClassificationModule::fprop(), PLearn::RBMBinomialLayer::fprop(), PLearn::ProjectionErrorVariable::fprop(), PLearn::ProcessInputCostModule::fprop(), PLearn::OnBagsModule::fprop(), PLearn::NonDiagVariable::fprop(), PLearn::NllSemisphericalGaussianVariable::fprop(), PLearn::NllGeneralGaussianVariable::fprop(), PLearn::NLLCostModule::fprop(), PLearn::NetworkModule::fprop(), PLearn::MultiSampleVariable::fprop(), PLearn::MultiMaxVariable::fprop(), PLearn::MatrixModule::fprop(), PLearn::MatrixAffineTransformFeedbackVariable::fprop(), PLearn::LogSoftSoftMaxVariable::fprop(), PLearn::LocalizedFeaturesLayerVariable::fprop(), PLearn::LinearFilterModule::fprop(), PLearn::LayerCostModule::fprop(), PLearn::KLp0p1RBMModule::fprop(), PLearn::InsertZerosVariable::fprop(), PLearn::IdentityModule::fprop(), PLearn::GradNNetLayerModule::fprop(), PLearn::GaussianProcessNLLVariable::fprop(), PLearn::DoubleProductVariable::fprop(), PLearn::CrossEntropyCostModule::fprop(), PLearn::Cov2CorrVariable::fprop(), PLearn::CostModule::fprop(), PLearn::ConstrainVariable::fprop(), PLearn::ConcatColumnsVariable::fprop(), PLearn::CombiningCostsModule::fprop(), PLearn::ClassErrorCostModule::fprop(), PLearn::BinarizeModule::fprop(), PLearn::RBMWoodsLayer::fpropNLL(), PLearn::RBMMultinomialLayer::fpropNLL(), PLearn::RBMMixedLayer::fpropNLL(), PLearn::RBMLocalMultinomialLayer::fpropNLL(), PLearn::RBMLayer::fpropNLL(), PLearn::RBMLateralBinomialLayer::fpropNLL(), PLearn::RBMGaussianLayer::fpropNLL(), PLearn::RBMBinomialLayer::fpropNLL(), PLearn::SumOverBagsVariable::fpropOneBag(), PLearn::TreeDBNModule::full_fprop(), PLearn::GCV(), PLearn::GDFindSmallEigenPairs(), PLearn::generalizedEigenVecOfSymmMat(), PLearn::RBMDistribution::generateN(), PLearn::PDistribution::generateN(), PLearn::ExplicitListOracle::generateNextTrial(), PLearn::RBMWoodsLayer::generateSamples(), PLearn::RBMTruncExpLayer::generateSamples(), PLearn::RBMRateLayer::generateSamples(), PLearn::RBMMultinomialLayer::generateSamples(), PLearn::RBMLocalMultinomialLayer::generateSamples(), PLearn::RBMLateralBinomialLayer::generateSamples(), PLearn::RBMGaussianLayer::generateSamples(), PLearn::RBMBinomialLayer::generateSamples(), PLearn::geometric_mean(), PLearn::RegressionTreeRegisters::getAllRegisteredRow(), PLearn::RegressionTreeRegisters::getAllRegisteredRowLeave(), PLearn::VecStatsCollector::getCovariance(), PLearn::LemmatizeVMatrix::getLemma(), PLearn::VMatrixFromDistribution::getMat(), PLearn::VMatrix::getMat(), PLearn::TransposeVMatrix::getMat(), PLearn::SubVMatrix::getMat(), PLearn::MemoryVMatrix::getMat(), PLearn::RemapLastColumnVMatrix::getNewRow(), PLearn::PairsVMatrix::getNewRow(), PLearn::OnlineLearningModule::getPortSizes(), PLearn::MatrixModule::getPortSizes(), PLearn::CostModule::getPortSizes(), PLearn::ToBagSplitter::getSplit(), PLearn::BootstrapSplitter::getSplit(), PLearn::OnlineGramNaturalGradientOptimizer::gramEigenNaturalGradient(), PLearn::GramSchmidtOrthogonalization(), PLearn::grep(), PLearn::InferenceRBM::hiddenExpGivenInput(), PLearn::InferenceRBM::hiddenExpGivenInputTarget(), PLearn::identityMatrix(), PLearn::inverse(), PLearn::GaussianProcessRegressor::inverseCovTimesVec(), PLearn::InversePowerIteration(), PLearn::invertElements(), PLearn::TMat< T >::isEqual(), PLearn::ICP::iterate(), PLearn::ICP::iterativeReweight(), PLearn::jacobi(), PLearn::kernelPCAfromDotProducts(), PLearn::lapackCholeskyDecompositionInPlace(), PLearn::lapackCholeskySolveInPlace(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::lapackSolveLinearSystem(), PLearn::lapackSVD(), PLearn::layerBpropUpdate(), PLearn::layerL1BpropUpdate(), PLearn::layerL2BpropUpdate(), PLearn::leftPseudoInverse(), PLearn::ObservationWindow::length(), PLearn::StatsCollector::lift(), PLearn::linearRegression(), PLearn::linearRegressionNoBias(), PLearn::loadAsciiWithoutSize(), PLearn::loadATT800(), PLearn::loadBreastCancer(), PLearn::loadCorel(), PLearn::loadCorelDatamat(), PLearn::loadDiabetes(), PLearn::loadLetters(), PLearn::loadPMat(), PLearn::loadUCISet(), PLearn::loadUSPS(), PLearn::ManifoldKNNDistribution::log_density(), PLearn::log_fullGaussianRBF(), PLearn::LU_decomposition(), main(), PLearn::makeItSymmetric(), PLearn::makeRowsSumTo1(), PLearn::ChemicalICP::matchNearestNeighbors(), PLearn::matColumnDotVec(), PLearn::matInvert(), PLearn::matlabR11eigs(), PLearn::matlabSave(), PLearn::matRowsDots(), PLearn::matRowsDotsAcc(), PLearn::max(), PLearn::maxabs(), PLearn::maxPointMotion(), PLearn::mean(), PLearn::StatsCollector::mean_lift(), PLearn::VecStatsCollector::merge(), PLearn::metricMultiDimensionalScaling(), PLearn::min(), PLearn::minabs(), PLearn::GaussMix::missingExpectation(), PLearn::Molecule::Molecule(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::multiplyColumns(), PLearn::multiplyScaledAdd(), PLearn::OnlineLearningModule::namedBpropAccUpdate(), PLearn::PLearnDiff::nDiffs(), PLearn::negateElements(), PLearn::PruningLinearRegressor::newDatasetIndices(), PLearn::newIndexedMatArray(), PLearn::ConvertToPyObject< Mat >::newPyObject(), PLearn::RBMTrainer::NLL(), PLearn::RGBImagesVMatrix::nObjects(), PLearn::normalize(), PLearn::normalizeRows(), PLearn::FractionSplitter::nsplits(), PLearn::SubsamplingDBN::onlineStep(), PLearn::StackedAutoassociatorsNet::onlineStep(), PLearn::NatGradSMPNNet::onlineStep(), PLearn::NatGradNNet::onlineStep(), PLearn::mNNet::onlineStep(), PLearn::DeepBeliefNet::onlineStep(), PLearn::CorrelationProfiler::operator()(), PLearn::operator*(), PLearn::operator*=(), PLearn::operator+(), PLearn::operator+=(), PLearn::operator-(), PLearn::operator-=(), PLearn::operator/=(), PLearn::operator<<(), PLearn::TMat< T >::operator==(), PLearn::operator^(), PLearn::GradientOptimizer::optimizeN(), PLearn::AutoScaledGradientOptimizer::optimizeN(), PLearn::partialSortRows(), PLearn::RBMMatrixConnection::petiteCulotteOlivierCD(), PLearn::Gnuplot::plotClasses(), PLearn::YMDDatedVMatrix::positionOfDate(), PLearn::PowerIteration(), PLearn::product(), PLearn::product2Acc(), PLearn::product2Transpose(), PLearn::product2TransposeAcc(), PLearn::productAcc(), PLearn::productScaleAcc(), PLearn::productTranspose(), PLearn::productTransposeAcc(), PLearn::productTransposeScaleAcc(), PLearn::projectOnOrthogonalSubspace(), PLearn::VMatrix::putMat(), PLearn::SubVMatrix::putMat(), PLearn::MemoryVMatrix::putMat(), PLearn::GaussianProcessRegressor::QFormInverse(), PLearn::qld_interface(), PLearn::SourceVariable::randomInitialize(), PLearn::Molecule::readMolecule(), PLearn::RBMTrainer::recError(), PLearn::DenoisingRecurrentNet::recurrentUpdate(), PLearn::regulargrid_x_y_outputs_to_bitmap(), PLearn::regulargrid_x_y_rgbreal_to_bitmap(), PLearn::regularizeMatrix(), PLearn::PLearner::remote_computeOutputs(), PLearn::remote_solveLinearSystemByCholesky(), PLearn::removeRow(), PLearn::RGBImagesVMatrix::RGBImagesVMatrix(), PLearn::ridgeRegressionByGCV(), PLearn::rightPseudoInverse(), PLearn::rotationFromWeightedMatchedPoints(), PLearn::rowArgmax(), PLearn::rowArgmin(), PLearn::rowMax(), PLearn::rowMean(), PLearn::rowMin(), PLearn::rowSum(), PLearn::rowSumAcc(), PLearn::rowSumOfSquares(), PLearn::rowVariance(), PLearn::ExtractOptionCommand::run(), PLearn::ChemicalICP::run(), PLearn::RGBImagesVMatrix::sample(), PLearn::sample(), PLearn::saveAscii(), PLearn::saveAsciiWithoutSize(), PLearn::saveGnuplot(), PLearn::savePMat(), PLearn::saveSNMat(), PLearn::scores_to_winners(), PLearn::RGBImagesVMatrix::seek(), PLearn::select(), PLearn::selectAndOrder(), PLearn::selectRows(), PLearn::ThresholdedKernel::setDataForKernelMatrix(), PLearn::MemoryCachedKernel::setDataForKernelMatrix(), PLearn::RBMMixedLayer::setExpectations(), PLearn::RBMLayer::setExpectations(), PLearn::RBMMixedLayer::setExpectationsByRef(), PLearn::RBMLayer::setExpectationsByRef(), PLearn::MatrixModule::setGradientTo(), PLearn::TransformationLearner::setTransformsParameters(), PLearn::Variable::setValueSubMat(), PLearn::SurfaceMesh::setVertexCoords(), PLearn::SurfaceMesh::setVertexCoordsAndFeatures(), PLearn::SurfaceMesh::setVertexFeatures(), PLearn::SurfaceMesh::setVertexNorms(), PLearn::shuffleRows(), PLearn::PRandom::shuffleRows(), PLearn::smooth(), PLearn::smoothCorelHisto(), PLearn::softmax(), PLearn::solveLinearSystem(), PLearn::solveLinearSystemByCholesky(), PLearn::solveTransposeLinearSystemByCholesky(), PLearn::sortColumns(), PLearn::sortRows(), PLearn::RegressionTreeRegisters::sortRows(), PLearn::SpearmanRankCorrelation(), PLearn::DenoisingRecurrentNet::splitRawMaskedSupervisedSequence(), PLearn::sqrt(), PLearn::square(), PLearn::squareMultiplyAcc(), PLearn::squareProductAcc(), PLearn::squareProductTranspose(), PLearn::squareProductTransposeAcc(), PLearn::subsample(), PLearn::substract(), PLearn::substractFromColumns(), PLearn::substractFromRows(), PLearn::sum(), PLearn::sum_of_squares(), PLearn::InferenceRBM::supCDStep(), PLearn::InferenceRBM::targetExpGivenInput(), PLearn::testSpearmanRankCorrelation(), PLearn::ThresholdedKernel::thresholdGramMatrix(), PLearn::TMat< T >::TMat(), PLearn::SparseMatrix::toMat(), PLearn::trace(), PLearn::StructuralLearner::train(), PLearn::RankLearner::train(), PLearn::PseudolikelihoodRBM::train(), PLearn::ModuleLearner::train(), PLearn::LLC::train(), PLearn::LinearRegressor::train(), PLearn::KernelRidgeRegressor::train(), PLearn::KernelProjection::train(), PLearn::GaussMix::train(), PLearn::GaussianProcessRegressor::train(), PLearn::GaussianDistribution::train(), PLearn::DiverseComponentAnalysis::train(), PLearn::ConditionalDensityNet::train(), PLearn::AutoLinearRegressor::train(), PLearn::ModuleLearner::trainingStep(), PLearn::GaussianProcessRegressor::trainProjectedProcess(), PLearn::DenoisingRecurrentNet::trainUnconditionalPredictor(), PLearn::transformPoints(), PLearn::transpose(), PLearn::transposedLayerL1BpropUpdate(), PLearn::transposedLayerL2BpropUpdate(), PLearn::transposeProduct(), PLearn::transposeProduct2(), PLearn::transposeProduct2Acc(), PLearn::transposeProductAcc(), PLearn::transposeProductScaleAcc(), PLearn::transposeTransposeProduct(), PLearn::transposeTransposeProductAcc(), PLearn::transposeTransposeProductScaleAcc(), PLearn::VecStatsCollector::update(), PLearn::StatsIterator::update(), PLearn::StatsItArray::update(), PLearn::LiftStatsIterator::update(), PLearn::RBMSparse1DMatrixConnection::update(), PLearn::RBMMatrixTransposeConnection::update(), PLearn::RBMMatrixConnectionNatGrad::update(), PLearn::RBMMatrixConnection::update(), PLearn::RBMLLParameters::update(), PLearn::RBMLayer::update(), PLearn::RBMLateralBinomialLayer::update(), PLearn::RBMGaussianLayer::update(), PLearn::RBMDiagonalMatrixConnection::update(), PLearn::RBMConv2DConnection::update(), PLearn::LiftStatsCollector::update(), PLearn::NeuralProbabilisticLanguageModel::update_affine_transform(), PLearn::FeatureSetSequentialCRF::update_affine_transform(), PLearn::FeatureSetNNet::update_affine_transform(), PLearn::RBMMatrixConnection::updateCDandGibbs(), PLearn::RBMLayer::updateCDandGibbs(), PLearn::GaussMix::updateCholeskyFromPrevious(), PLearn::RBMMatrixConnection::updateGibbs(), PLearn::RBMLayer::updateGibbs(), PLearn::GaussMix::updateInverseVarianceFromPrevious(), PLearn::PLearner::use(), PLearn::Learner::use(), PLearn::variance(), PLearn::GaussianProcessRegressor::variance(), PLearn::NeuralProbabilisticLanguageModel::verify_gradient_affine_transform(), PLearn::FeatureSetSequentialCRF::verify_gradient_affine_transform(), PLearn::FeatureSetNNet::verify_gradient_affine_transform(), PLearn::weightedCentroid(), PLearn::weightedLinearRegression(), PLearn::weightedRidgeRegressionByGCV(), PLearn::weightedRotationFromMatchedPoints(), PLearn::weightedTransformationFromMatchedPoints(), PLearn::GhostScript::writeBitmapHexString1Bit(), PLearn::GhostScript::writeBitmapHexString24Bits(), and PLearn::GhostScript::writeBitmapHexString8Bits().
{ return length_; }
void PLearn::TMat< T >::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) |
************ Deep copying
Definition at line 464 of file TMat_impl.h.
References PLearn::deepCopyField().
Referenced by PLearn::TMat< T >::deepCopy(), and PLearn::deepCopyField().
{ deepCopyField(storage, copies); }
void PLearn::TMat< T >::makeSharedValue | ( | T * | x, |
int | n | ||
) | [inline] |
make the storage point to this address and copy current value to it (i.e. without changing current contents)
< get data start
Definition at line 841 of file TMat_decl.h.
Referenced by PLearn::RBMMatrixConnection::makeParametersPointHere(), PLearn::RBMQLParameters::makeParametersPointHere(), PLearn::RBMConv2DConnection::makeParametersPointHere(), PLearn::RBMLLParameters::makeParametersPointHere(), PLearn::RBMConv2DLLParameters::makeParametersPointHere(), PLearn::RBMGenericParameters::makeParametersPointHere(), and PLearn::RBMLQParameters::makeParametersPointHere().
{ #ifdef BOUNDCHECK int m = size(); if(n != m) PLERROR("IN TMat::makeSharedValue(T* x, int n)\nn(%d)!=size(%d)", n,m); if(offset_!=0) PLERROR("IN TMat::makeSharedValue(T* x, int n)\noffset should be 0."); if (mod_!=width_) PLERROR("IN TMat::makeSharedValue(T* x, int n)\nMatrix should be compact (mod==width), but isn't."); #endif T* v = data(); for(int i=0,k=0; i<length_; i++, v+=mod_) for (int j=0;j<width_; j++, k++) x[k] = v[j]; storage->pointTo(n,x); }
int PLearn::TMat< T >::mod | ( | ) | const [inline] |
Definition at line 254 of file TMat_decl.h.
Referenced by PLearn::absargmax(), PLearn::add(), PLearn::addToColumns(), PLearn::addToDiagonal(), PLearn::argmax(), PLearn::argmin(), PLearn::averageAcrossRowsAndColumns(), PLearn::backConvolve2D(), PLearn::backConvolve2Dbackprop(), PLearn::SparseIncrementalAffineTransformVariable::bprop(), PLearn::FNetLayerVariable::bprop(), PLearn::ConcatColumnsVariable::bprop(), PLearn::CostModule::bpropAccUpdate(), PLearn::RBMLateralBinomialLayer::bpropNLL(), PLearn::RBMLateralBinomialLayer::bpropUpdate(), PLearn::chol_rotapp_tr_opt(), PLearn::choleskyDecomposition(), PLearn::choleskySolve(), PLearn::SquaredExponentialARDKernel::computeGramMatrix(), PLearn::RationalQuadraticARDKernel::computeGramMatrix(), PLearn::NeuralNetworkARDKernel::computeGramMatrix(), PLearn::Matern1ARDKernel::computeGramMatrix(), PLearn::LinearARDKernel::computeGramMatrix(), PLearn::KroneckerBaseKernel::computeGramMatrix(), PLearn::Kernel::computeGramMatrix(), PLearn::IIDNoiseKernel::computeGramMatrix(), PLearn::RationalQuadraticARDKernel::computeGramMatrixDerivIspAlpha(), PLearn::SquaredExponentialARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::RationalQuadraticARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::NeuralNetworkARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::Matern1ARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::LinearARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::MemoryCachedKernel::computeGramMatrixNV(), PLearn::computeInverseStandardDeviationFromMeanAndSquareMean(), PLearn::GaussianProcessRegressor::computeOutputCovMat(), PLearn::Kernel::computePartialGramMatrix(), PLearn::convolve(), PLearn::convolve2D(), PLearn::convolve2Dbackprop(), PLearn::det(), PLearn::eigen_SymmMat(), PLearn::fillItSymmetric(), PLearn::RBMLateralBinomialLayer::forget(), PLearn::FNetLayerVariable::fprop(), PLearn::ConcatColumnsVariable::fprop(), PLearn::geometric_mean(), PLearn::invertElements(), PLearn::lapackCholeskyDecompositionInPlace(), PLearn::lapackCholeskySolveInPlace(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::lapackSolveLinearSystem(), PLearn::lapackSVD(), PLearn::linearRegression(), PLearn::LU_decomposition(), PLearn::matColumnDotVec(), PLearn::matInvert(), PLearn::max(), PLearn::maxabs(), PLearn::mean(), PLearn::min(), PLearn::minabs(), PLearn::multiplyScaledAdd(), PLearn::negateElements(), PLearn::ConvertToPyObject< Mat >::newPyObject(), PLearn::operator*=(), PLearn::operator+=(), PLearn::operator-(), PLearn::operator-=(), PLearn::operator/=(), PLearn::partialSortRows(), PLearn::RBMMatrixConnection::petiteCulotteOlivierCD(), PLearn::product(), PLearn::product2Acc(), PLearn::productAcc(), PLearn::productScaleAcc(), PLearn::regularizeMatrix(), PLearn::sortRows(), PLearn::SparseMatrix::SparseMatrix(), PLearn::squareProductAcc(), PLearn::subsample(), PLearn::substract(), PLearn::substractFromColumns(), PLearn::sum(), PLearn::sum_of_squares(), PLearn::PseudolikelihoodRBM::train(), PLearn::GaussianProcessRegressor::train(), PLearn::transpose(), PLearn::transposeProduct(), PLearn::transposeProduct2(), PLearn::transposeProduct2Acc(), PLearn::transposeProductAcc(), PLearn::transposeProductScaleAcc(), PLearn::transposeTransposeProduct(), PLearn::transposeTransposeProductAcc(), PLearn::transposeTransposeProductScaleAcc(), PLearn::RBMMatrixTransposeConnection::update(), PLearn::RBMMatrixConnection::update(), PLearn::RBMLLParameters::update(), PLearn::RBMLateralBinomialLayer::update(), PLearn::RBMConv2DLLParameters::update(), PLearn::RBMConv2DConnection::update(), and PLearn::variance().
{ return mod_; }
int PLearn::TMat< T >::ncols | ( | ) | const [inline] |
Definition at line 81 of file TMat_decl.h.
Referenced by calcTransformation4(), findRelevantWeights(), nodekernel(), and performLP().
{ return width_; }
int PLearn::TMat< T >::nrows | ( | ) | const [inline] |
for template compatibility with other types of matrices
Definition at line 80 of file TMat_decl.h.
Referenced by autoThreshLP(), calcTransformation4(), calculateEuclDist(), findRelevantWeights(), nodekernel(), and performLP().
{ return length_; }
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 747 of file TMat_decl.h.
{ return isEmpty(); }
T& PLearn::TMat< T >::operator() | ( | int | rownum, |
int | colnum | ||
) | const [inline] |
Definition at line 345 of file TMat_decl.h.
{ #ifdef BOUNDCHECK if(rownum<0 || rownum>=length() || colnum<0 || colnum>=width()) PLERROR("OUT OF BOUND ACCESS IN TMat::operator()(int rownum, int colnum)" " width=%d; length=%d; colnum=%d; rownum=%d;", width(), length(), colnum, rownum); #endif return storage->data[offset_ + mod()*rownum + colnum]; }
TMat<T> PLearn::TMat< T >::operator() | ( | const TVec< I > & | rows, |
const TVec< I > & | columns | ||
) | const [inline] |
TVec<T> PLearn::TMat< T >::operator() | ( | int | rownum | ) | const [inline] |
void PLearn::TMat< T >::operator<< | ( | const string & | datastring | ) | const [inline] |
Definition at line 949 of file TMat_decl.h.
{ // istrstream in(datastring.c_str()); PStream in = openString(datastring,PStream::plearn_ascii); input(in); }
void PLearn::TMat< T >::operator= | ( | const T & | f | ) | const [inline] |
Definition at line 768 of file TMat_decl.h.
{ fill(f); }
const TMat<T>& PLearn::TMat< T >::operator= | ( | const TMat< T > & | other | ) | [inline] |
bool PLearn::TMat< T >::operator== | ( | const TMat< T > & | other | ) | const [inline] |
Definition at line 523 of file TMat_impl.h.
References PLearn::TMat< T >::begin(), PLearn::TMat< T >::length(), and PLearn::TMat< T >::width().
{ if ( length() != other.length() || width() != other.width() ) return false; iterator it = begin(); iterator end_ = end(); iterator other_it = other.begin(); for(; it != end_; ++it, ++other_it) if(*it != *other_it) return false; return true; }
T* PLearn::TMat< T >::operator[] | ( | int | rownum | ) | const [inline] |
Returns a pointer to the data beginning of the required row.
Definition at line 334 of file TMat_decl.h.
void PLearn::TMat< T >::pop_back | ( | ) | [inline] |
Definition at line 834 of file TMat_decl.h.
{ length_ -= 1; }
void PLearn::TMat< T >::print | ( | ostream & | out = cout | ) | const |
C++ stream output.
Definition at line 342 of file TMat_impl.h.
References i, j, and PLearn::left().
Referenced by PLearn::CorrelationProfiler::printAndReset().
{ out.flags(ios::left); for(int i=0; i<length(); i++) { const T* m_i = rowdata(i); for(int j=0; j<width(); j++) out << setw(11) << m_i[j] << ' '; out << "\n"; } out.flush(); }
void PLearn::TMat< T >::push_back | ( | const TVec< T > & | newrow | ) | [inline] |
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 470 of file TMat_decl.h.
Referenced by PLearn::operator>>().
{ switch(in.inmode) { case PStream::raw_ascii: case PStream::raw_binary: { T* ptr = (length_>0 && width_>0)? data():0; for(int i=0; i<length_; i++, ptr+=mod_) for(int j=0; j<width_; j++) in >> ptr[j]; } break; case PStream::plearn_ascii: case PStream::plearn_binary: { in.skipBlanksAndComments(); int c = in.peek(); if(c=='T') // explicit storage { char word[6]; // !!!! BUG: For some reason, this hangs!!! // in.read(word,5); for(int i=0; i<5; i++) in.get(word[i]); word[5]='\0'; if(strcmp(word,"TMat(")!=0) PLERROR("In operator>>(PStream&, TMat&) '%s' not a proper header for a TMat!",word); // v.storage = 0; in >> length_ >> width_ >> mod_ >> offset_; in >> storage; in.skipBlanksAndCommentsAndSeparators(); int c = in.get(); // skip ')' if(c!=')') PLERROR("In operator>>(PStream&, TMat&) expected a closing parenthesis, found '%c'",c); } else // implicit storage { if(isdigit(c)) // ascii mode with length and width given { int l,w; in >> l >> w; in.skipBlanksAndComments(); c = in.get(); if(c!='[') PLERROR("Error in TMat::read(PStream& in), expected '[', read '%c'",c); in.skipBlanksAndCommentsAndSeparators(); resize(l,w); T* ptr = (l>0 && w>0)? data():0; for(int i=0; i<length_; i++, ptr+=mod_) for(int j=0; j<width_; j++) { in.skipBlanksAndCommentsAndSeparators(); try{ in >> ptr[j]; } catch(const PLearnError& e) { PLERROR("In TMat::read() - Error while reading a serialised TMat<T>." " Did you set correctly the mat size?\n" "%s",e.message().c_str()); } } in.skipBlanksAndCommentsAndSeparators(); c = in.get(); if(c!=']') PLERROR("Error in TMat::read(PStream& in), expected ']', read '%c'",c); } else if(c==0x14 || c==0x15) // it's a binary 2D sequence { in.get(); // eat c unsigned char typecode = in.get(); int l, w; in.read((char*)&l,sizeof(l)); in.read((char*)&w,sizeof(w)); bool inverted_byte_order = ((c==0x14 && byte_order()==BIG_ENDIAN_ORDER) || (c==0x15 && byte_order()==LITTLE_ENDIAN_ORDER) ); if(inverted_byte_order) { endianswap(&l); endianswap(&w); } resize(l,w); T* ptr = (l>0 && w>0)? data():0; for(int i=0; i<length_; i++, ptr+=mod_) binread_(in, ptr, width_, typecode); } else PLERROR("In TMat::read(PStream& in) Char with ascii code %d not a proper first character in the header of a TMat!",c); } } break; default: PLERROR("In TMat<T>::read(PStream& in) unknown inmode!!!!!!!!!"); break; } }
void PLearn::TMat< T >::resize | ( | int | new_length, |
int | new_width, | ||
int | extra = 0 , |
||
bool | preserve_content = false |
||
) | [inline] |
Resizes the matrix to a new length() and width().
Note 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 extra entries to anticipate further resizes. If preserve_content is true then a change of mod_ triggers a COPY of the old entries so that their old value remains accessed at the same indices.
This function is split into several parts: a `small' one that handles the common cases, and a few `auxiliary' ones that perform the heavy-lifting. The small one is easily inlined, whereas having one `large' resize() function would overflow the compiler inlining threshold, yielding no inlining whatsoever.
Definition at line 200 of file TMat_decl.h.
Referenced by PLearn::addEigenMatrices(), PLearn::GaussMix::addToCovariance(), PLearn::GaussianProcessNLLVariable::alpha(), PLearn::BallTreeNearestNeighbors::anchorTrain(), PLearn::BasisSelectionRegressor::appendFunctionToSelection(), PLearn::BasisSelectionRegressor::appendKernelFunctions(), PLearn::Kernel::apply(), PLearn::applyGeomTransformation(), PLearn::autocorrelation_function(), PLearn::bootstrap_rows(), PLearn::LogaddOnBagsModule::bprop(), PLearn::VBoundDBN2::bpropAccUpdate(), PLearn::SplitModule::bpropAccUpdate(), PLearn::SoftmaxNLLCostModule::bpropAccUpdate(), PLearn::RBMSparse1DMatrixConnection::bpropAccUpdate(), PLearn::RBMModule::bpropAccUpdate(), PLearn::RBMMixedConnection::bpropAccUpdate(), PLearn::RBMMatrixConnection::bpropAccUpdate(), PLearn::RBMConv2DConnection::bpropAccUpdate(), PLearn::OnlineLearningModule::bpropAccUpdate(), PLearn::OnBagsModule::bpropAccUpdate(), PLearn::NLLCostModule::bpropAccUpdate(), PLearn::NetworkModule::bpropAccUpdate(), PLearn::MaxSubsampling2DModule::bpropAccUpdate(), PLearn::MatrixModule::bpropAccUpdate(), PLearn::KLp0p1RBMModule::bpropAccUpdate(), PLearn::CrossEntropyCostModule::bpropAccUpdate(), PLearn::CostModule::bpropAccUpdate(), PLearn::Convolution2DModule::bpropAccUpdate(), PLearn::BinarizeModule::bpropAccUpdate(), PLearn::bpropCholeskyDecomposition(), PLearn::RBMWoodsLayer::bpropNLL(), PLearn::RBMMultinomialLayer::bpropNLL(), PLearn::RBMMixedLayer::bpropNLL(), PLearn::RBMLocalMultinomialLayer::bpropNLL(), PLearn::RBMLateralBinomialLayer::bpropNLL(), PLearn::RBMGaussianLayer::bpropNLL(), PLearn::RBMBinomialLayer::bpropNLL(), PLearn::TanhModule::bpropUpdate(), PLearn::SquaredErrorCostModule::bpropUpdate(), PLearn::SoftmaxNLLCostModule::bpropUpdate(), PLearn::SoftmaxModule::bpropUpdate(), PLearn::ShuntingNNetLayerModule::bpropUpdate(), PLearn::ScaleGradientModule::bpropUpdate(), PLearn::RBMWoodsLayer::bpropUpdate(), PLearn::RBMSparse1DMatrixConnection::bpropUpdate(), PLearn::RBMMultinomialLayer::bpropUpdate(), PLearn::RBMMixedLayer::bpropUpdate(), PLearn::RBMMixedConnection::bpropUpdate(), PLearn::RBMMatrixTransposeConnection::bpropUpdate(), PLearn::RBMMatrixConnectionNatGrad::bpropUpdate(), PLearn::RBMMatrixConnection::bpropUpdate(), PLearn::RBMLocalMultinomialLayer::bpropUpdate(), PLearn::RBMLateralBinomialLayer::bpropUpdate(), PLearn::RBMDiagonalMatrixConnection::bpropUpdate(), PLearn::RBMConv2DConnection::bpropUpdate(), PLearn::RBMBinomialLayer::bpropUpdate(), PLearn::OnlineLearningModule::bpropUpdate(), PLearn::OnBagsModule::bpropUpdate(), PLearn::NLLCostModule::bpropUpdate(), PLearn::ModuleStackModule::bpropUpdate(), PLearn::LinearFilterModule::bpropUpdate(), PLearn::LayerCostModule::bpropUpdate(), PLearn::GradNNetLayerModule::bpropUpdate(), PLearn::CrossEntropyCostModule::bpropUpdate(), PLearn::CombiningCostsModule::bpropUpdate(), PLearn::VMatrixFromDistribution::build_(), PLearn::TrainValidTestSplitter::build_(), PLearn::Supersampling2DModule::build_(), PLearn::SumOverBagsVariable::build_(), PLearn::Subsampling2DModule::build_(), PLearn::StackedSVDNet::build_(), PLearn::SplitWiseValidationVMatrix::build_(), PLearn::SparseIncrementalAffineTransformVariable::build_(), PLearn::SequentialModelSelector::build_(), PLearn::SequentialLearner::build_(), PLearn::RemoveDuplicateVMatrix::build_(), PLearn::RBMSparse1DMatrixConnection::build_(), PLearn::RBMQLParameters::build_(), PLearn::RBMMultitaskClassificationModule::build_(), PLearn::RBMModule::build_(), PLearn::RBMMatrixTransposeConnection::build_(), PLearn::RBMMatrixConnectionNatGrad::build_(), PLearn::RBMMatrixConnection::build_(), PLearn::RBMLQParameters::build_(), PLearn::RBMLLParameters::build_(), PLearn::RBMLateralBinomialLayer::build_(), PLearn::RBMGenericParameters::build_(), PLearn::RBMConv2DLLParameters::build_(), PLearn::RBMConv2DConnection::build_(), PLearn::RBMConnection::build_(), PLearn::RankedVMatrix::build_(), PLearn::RandomGaussMix::build_(), PLearn::ProjectionErrorVariable::build_(), PLearn::PLearnDiff::build_(), PLearn::OnlineGramNaturalGradientOptimizer::build_(), PLearn::OnBagsModule::build_(), PLearn::NxProfileLearner::build_(), PLearn::NonLocalManifoldParzen::build_(), PLearn::NNet::build_(), PLearn::NllSemisphericalGaussianVariable::build_(), PLearn::NllGeneralGaussianVariable::build_(), PLearn::NetworkModule::build_(), PLearn::NeighborhoodImputationVMatrix::build_(), PLearn::NatGradSMPNNet::build_(), PLearn::NatGradNNet::build_(), PLearn::MultiTargetOneHotVMatrix::build_(), PLearn::MultiInstanceVMatrix::build_(), PLearn::MovingAverageVMatrix::build_(), PLearn::ModuleTester::build_(), PLearn::mNNet::build_(), PLearn::MemoryVMatrix::build_(), PLearn::MaxSubsampling2DModule::build_(), PLearn::ManifoldKNNDistribution::build_(), PLearn::LocalNeighborsDifferencesVMatrix::build_(), PLearn::LayerCostModule::build_(), PLearn::KNNVMatrix::build_(), PLearn::KNNImputationVMatrix::build_(), PLearn::KLp0p1RBMModule::build_(), PLearn::IncrementalNNet::build_(), PLearn::GraphicalBiText::build_(), PLearn::GramVMatrix::build_(), PLearn::GaussianProcessRegressor::build_(), PLearn::GaussianContinuumDistribution::build_(), PLearn::GaussianContinuum::build_(), PLearn::FNetLayerVariable::build_(), PLearn::ExtractNNetParamsVMatrix::build_(), PLearn::EntropyContrast::build_(), PLearn::DictionaryVMatrix::build_(), PLearn::CumVMatrix::build_(), PLearn::CorrelationProfiler::build_(), PLearn::Convolution2DModule::build_(), PLearn::CompareLearner::build_(), PLearn::BootstrapSplitter::build_(), PLearn::BaseRegressorConfidence::build_(), PLearn::BackConvolution2DModule::build_(), PLearn::AppendNeighborsVMatrix::build_(), PLearn::AddCostToLearner::build_(), PLearn::Convolution2DModule::build_kernels(), PLearn::BackConvolution2DModule::build_kernels(), PLearn::PseudolikelihoodRBM::build_layers_and_connections(), PLearn::RBMJointLLParameters::build_units_types(), PLearn::RBMJointGenericParameters::build_units_types(), PLearn::ChemicalICP::cacheFeatureDistances(), PLearn::RBMTrainer::CD1(), PLearn::chol_rotapp_tr(), PLearn::chol_rotapp_tr_opt(), PLearn::choleskyAppendDimension(), PLearn::choleskyDecomposition(), PLearn::choleskyInsertBasis(), PLearn::choleskyInvert(), PLearn::LayerCostModule::computeCorrelationStatistics(), PLearn::AddCostToLearner::computeCostsFromOutputs(), PLearn::computeCovar(), PLearn::GaussianDistribution::computeEigenDecomposition(), PLearn::RBMModule::computeEnergy(), PLearn::KLp0p1RBMModule::computeEnergy(), PLearn::RBMWoodsLayer::computeExpectations(), PLearn::RBMLateralBinomialLayer::computeExpectations(), PLearn::RBMModule::computeFreeEnergyOfHidden(), PLearn::KLp0p1RBMModule::computeFreeEnergyOfHidden(), PLearn::RBMModule::computeFreeEnergyOfVisible(), PLearn::KLp0p1RBMModule::computeFreeEnergyOfVisible(), PLearn::VMatKernel::computeGramMatrix(), PLearn::ThresholdedKernel::computeGramMatrix(), PLearn::RationalQuadraticARDKernel::computeGramMatrix(), PLearn::PLearnerDiagonalKernel::computeGramMatrix(), PLearn::Matern1ARDKernel::computeGramMatrix(), PLearn::Kernel::computeGramMatrix(), PLearn::IIDNoiseKernel::computeGramMatrix(), PLearn::Kernel::computeGramMatrixDerivative(), PLearn::IIDNoiseKernel::computeGramMatrixDerivative(), PLearn::RationalQuadraticARDKernel::computeGramMatrixDerivIspAlpha(), PLearn::SquaredExponentialARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::RationalQuadraticARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::NeuralNetworkARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::Matern1ARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::LinearARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::SquaredExponentialARDKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::RationalQuadraticARDKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::PLearnerDiagonalKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::NeuralNetworkARDKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::Matern1ARDKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::LinearARDKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::IIDNoiseKernel::computeGramMatrixDerivKronecker(), PLearn::MemoryCachedKernel::computeGramMatrixDerivNV(), PLearn::MemoryCachedKernel::computeGramMatrixNV(), PLearn::LayerCostModule::computeHisto(), PLearn::computeInputCovar(), PLearn::GaussMix::computeLogLikelihood(), PLearn::DeepNonLocalManifoldParzen::computeManifoldParzenParameters(), PLearn::computeMeanAndCovar(), PLearn::Kernel::computeNearestNeighbors(), PLearn::RBMModule::computeNegLogPVisibleGivenPHidden(), PLearn::ManifoldParzen2::computeOutput(), PLearn::ManifoldParzen::computeOutput(), PLearn::KNNClassifier::computeOutput(), PLearn::KernelProjection::computeOutput(), PLearn::BaggingLearner::computeOutput(), PLearn::ModuleLearner::computeOutputAndCosts(), PLearn::PLearner::computeOutputCovMat(), PLearn::GaussianProcessRegressor::computeOutputCovMat(), PLearn::StackedAutoassociatorsNet::computeOutputsAndCosts(), PLearn::PLearner::computeOutputsAndCosts(), PLearn::NatGradNNet::computeOutputsAndCosts(), PLearn::ModuleLearner::computeOutputsAndCosts(), PLearn::mNNet::computeOutputsAndCosts(), PLearn::DeepBeliefNet::computeOutputsAndCosts(), PLearn::RBMModule::computePartitionFunction(), PLearn::LayerCostModule::computePascalStatistics(), PLearn::RBMModule::computePositivePhaseHiddenActivations(), PLearn::KLp0p1RBMModule::computePositivePhaseHiddenActivations(), PLearn::GaussMix::computePosteriors(), PLearn::computePrincipalComponents(), PLearn::RBMSparse1DMatrixConnection::computeProducts(), PLearn::RBMMixedConnection::computeProducts(), PLearn::RBMMatrixTransposeConnection::computeProducts(), PLearn::RBMMatrixConnection::computeProducts(), PLearn::RBMDiagonalMatrixConnection::computeProducts(), PLearn::RBMConv2DConnection::computeProducts(), PLearn::computeRanks(), PLearn::LayerCostModule::computeSafeHisto(), PLearn::Kernel::computeSparseGramMatrix(), PLearn::LocalizedFeaturesLayerVariable::computeSubsets(), PLearn::UniformizeLearner::computeWeightedRankMap(), PLearn::ReconstructionWeightsKernel::computeWeights(), PLearn::SubsamplingDBN::contrastiveDivergenceStep(), PLearn::DeepBeliefNet::contrastiveDivergenceStep(), PLearn::ConvertFromPyObject< TMat< T > >::convert(), PLearn::ConvertFromPyObject< Mat >::convert(), PLearn::YMDDatedVMatrix::copyDatesOfRows(), PLearn::correlations(), PLearn::cross_valid(), PLearn::Variable::defineGradientLocation(), PLearn::Variable::defineValueLocation(), PLearn::det(), PLearn::DTWKernel::dtw(), PLearn::eigen_SymmMat(), PLearn::eigenSparseNonSymmMat(), PLearn::eigenSparseSymmMat(), PLearn::eigenVecOfSymmMat(), PLearn::MatlabInterface::eigs_r11(), PLearn::PCA::em_algo(), PLearn::PCA::em_orth_algo(), PLearn::ProductRandomVariable::EMTrainingInitialize(), PLearn::DenoisingRecurrentNet::encode_artificialData(), PLearn::DenoisingRecurrentNet::encode_onehot_diffNote_duration(), PLearn::DenoisingRecurrentNet::encode_onehot_note_octav_duration(), PLearn::DenoisingRecurrentNet::encode_onehot_timeframe(), PLearn::DenoisingRecurrentNet::encodeSequence(), PLearn::ConcatRowsVMatrix::ensureMappingsConsistency(), PLearn::GaussianProcessNLLVariable::fbpropFragments(), PLearn::LiftStatsCollector::finalize(), PLearn::BasisSelectionRegressor::findBestCandidateFunction(), PLearn::SubsamplingDBN::fineTuningStep(), PLearn::DeepNonLocalManifoldParzen::fineTuningStep(), PLearn::DeepBeliefNet::fineTuningStep(), PLearn::LiftStatsIterator::finish(), PLearn::VecStatsCollector::forget(), PLearn::ShuntingNNetLayerModule::forget(), PLearn::PseudolikelihoodRBM::forget(), PLearn::PLearnDiff::forget(), PLearn::ObservationWindow::forget(), PLearn::LLC::forget(), PLearn::LiftStatsCollector::forget(), PLearn::KMeansClustering::forget(), PLearn::KernelRidgeRegressor::forget(), PLearn::GradNNetLayerModule::forget(), PLearn::ExhaustiveNearestNeighbors::forget(), PLearn::Convolution2DModule::forget(), PLearn::BasisSelectionRegressor::forget(), PLearn::BackConvolution2DModule::forget(), PLearn::AutoLinearRegressor::forget(), PLearn::VBoundDBN2::fprop(), PLearn::TreeDBNModule::fprop(), PLearn::TanhModule::fprop(), PLearn::SquaredErrorCostModule::fprop(), PLearn::SplitModule::fprop(), PLearn::SoftSoftMaxVariable::fprop(), PLearn::SoftmaxNLLCostModule::fprop(), PLearn::SoftmaxModule::fprop(), PLearn::ShuntingNNetLayerModule::fprop(), PLearn::ScaleGradientModule::fprop(), PLearn::RBMWoodsLayer::fprop(), PLearn::RBMModule::fprop(), PLearn::RBMMixedLayer::fprop(), PLearn::RBMLayer::fprop(), PLearn::RBMLateralBinomialLayer::fprop(), PLearn::RBMConnection::fprop(), PLearn::RBMClassificationModule::fprop(), PLearn::RBMBinomialLayer::fprop(), PLearn::ProjectionErrorVariable::fprop(), PLearn::OnBagsModule::fprop(), PLearn::NllSemisphericalGaussianVariable::fprop(), PLearn::NllGeneralGaussianVariable::fprop(), PLearn::NLLCostModule::fprop(), PLearn::NetworkModule::fprop(), PLearn::MaxSubsampling2DModule::fprop(), PLearn::MatrixModule::fprop(), PLearn::LinearFilterModule::fprop(), PLearn::LinearCombinationModule::fprop(), PLearn::LayerCostModule::fprop(), PLearn::KLp0p1RBMModule::fprop(), PLearn::IdentityModule::fprop(), PLearn::GradNNetLayerModule::fprop(), PLearn::CrossEntropyCostModule::fprop(), PLearn::CostModule::fprop(), PLearn::Convolution2DModule::fprop(), PLearn::CombiningCostsModule::fprop(), PLearn::ClassErrorCostModule::fprop(), PLearn::BinarizeModule::fprop(), PLearn::ArgmaxModule::fprop(), PLearn::RBMMixedLayer::fpropNLL(), PLearn::SumOverBagsVariable::fpropOneBag(), PLearn::TreeDBNModule::full_fprop(), PLearn::GCV(), PLearn::generalizedEigenVecOfSymmMat(), PLearn::RBMDistribution::generate(), PLearn::DynamicallyLinkedRBMsModel::generate(), PLearn::DenoisingRecurrentNet::generate(), PLearn::DenoisingRecurrentNet::generateArtificial(), PLearn::RBMDistribution::generateN(), PLearn::GaussianContinuum::get_image_matrix(), PLearn::GaussianContinuum::get_nll(), PLearn::VecStatsCollector::getCovariance(), PLearn::VMatrix::getExamples(), PLearn::SplitModule::getPortSizes(), PLearn::OnlineLearningModule::getPortSizes(), PLearn::NullModule::getPortSizes(), PLearn::MatrixModule::getPortSizes(), PLearn::CostModule::getPortSizes(), PLearn::BinarizeModule::getPortSizes(), PLearn::DenoisingRecurrentNet::getSequence(), PLearn::SurfaceMesh::getVertexCoordsAndFeatures(), PLearn::OnlineGramNaturalGradientOptimizer::gramEigenNaturalGradient(), PLearn::SubsamplingDBN::greedyStep(), PLearn::DeepBeliefNet::greedyStep(), PLearn::LiftStatsIterator::init(), PLearn::NatGradEstimator::init(), PLearn::NeuralProbabilisticLanguageModel::initializeParams(), PLearn::FeatureSetSequentialCRF::initializeParams(), PLearn::FeatureSetNNet::initializeParams(), PLearn::TreeDBNModule::initSampling(), PLearn::TransformationLearner::initTransformsParameters(), PLearn::inverse(), PLearn::ICP::iterate(), PLearn::kernelPCAfromDotProducts(), PLearn::GaussMix::kmeans(), PLearn::NonLocalManifoldParzen::knn(), PLearn::GaussianContinuumDistribution::knn(), PLearn::GaussianContinuum::knn(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::lapackSVD(), PLearn::linearRegression(), PLearn::linearRegressionNoBias(), PLearn::RGBImageDB::load(), PLearn::loadAscii(), PLearn::loadAsciiSingleBinaryDescriptor(), PLearn::loadCorel(), PLearn::loadCorelDatamat(), PLearn::loadGnuplot(), PLearn::loadJPEGrgb(), PLearn::loadPMat(), PLearn::RBMDistribution::log_density(), PLearn::GaussianContinuumDistribution::log_density(), PLearn::TransformationLearner::mainLearnerBuild(), PLearn::matlabR11eigs(), PLearn::MemoryVMatrix::MemoryVMatrix(), PLearn::VecStatsCollector::merge(), PLearn::metricMultiDimensionalScaling(), PLearn::GaussMix::missingExpectation(), PLearn::Molecule::Molecule(), PLearn::multiply(), PLearn::OnlineLearningModule::namedBpropAccUpdate(), PLearn::SubsamplingDBN::onlineStep(), PLearn::StackedAutoassociatorsNet::onlineStep(), PLearn::DeepBeliefNet::onlineStep(), PLearn::BasisSelectionRegressor::thread_wawr::operator()(), PLearn::MaxSubsamplingTest::perform(), PLearn::PTester::perform1Split(), PLearn::ExhaustiveNearestNeighbors::preloadInputCache(), PLearn::Molecule::readMolecule(), PLearn::BasisSelectionRegressor::recomputeFeatures(), PLearn::ReconstructionWeightsKernel::reconstruct(), PLearn::DenoisingRecurrentNet::recurrentUpdate(), PLearn::regulargrid_x_y_rgbreal_to_bitmap(), PLearn::LinearRegressor::resetAccumulators(), PLearn::NnlmOutputLayer::resetAllClassVars(), PLearn::NnlmOutputLayer::resetParameters(), PLearn::UndirectedSoftmaxModule::resetWeights(), PLearn::NnlmWordRepresentationLayer::resetWeights(), PLearn::Variable::resize(), PLearn::DenoisingRecurrentNet::resize_lists(), PLearn::GaussMix::resizeDataBeforeTraining(), PLearn::GaussMix::resizeDataBeforeUsing(), PLearn::Variable::resizeDiagHessian(), PLearn::Variable::resizeRValue(), PLearn::BasisSelectionRegressor::retrainLearner(), PLearn::ridgeRegressionByGCV(), PLearn::ChemicalICP::run(), PLearn::scores_to_winners(), PLearn::RBMLayer::setBatchSize(), PLearn::ThresholdedKernel::setDataForKernelMatrix(), PLearn::MatrixModule::setGradientTo(), PLearn::GaussMix::setPredictor(), PLearn::GaussMix::setPredictorPredictedSizes_const(), PLearn::StackedFocusedAutoassociatorsNet::setTrainingSet(), PLearn::LocalGaussianClassifier::setTrainingSet(), PLearn::ExhaustiveNearestNeighbors::setTrainingSet(), PLearn::TransformationLearner::setTransformsParameters(), PLearn::StatsCollector::sort_values_by_magnitude(), PLearn::RegressionTreeRegisters::sortRows(), PLearn::SpearmanRankCorrelation(), PLearn::DenoisingRecurrentNet::splitRawMaskedSupervisedSequence(), PLearn::InferenceRBM::supCDStep(), PLearn::SVDVariable::SVDVariable(), PLearn::SymmMatNullSpaceByInversePowerIteration(), PLearn::PLearner::test(), PLearn::Learner::test(), PLearn::DynamicallyLinkedRBMsModel::test(), PLearn::DenoisingRecurrentNet::test(), PLearn::testSpearmanRankCorrelation(), PLearn::WPLS::train(), PLearn::VariableSelectionWithDirectedGradientDescent::train(), PLearn::SubsamplingDBN::train(), PLearn::StackedSVDNet::train(), PLearn::StackedAutoassociatorsNet::train(), PLearn::RankLearner::train(), PLearn::PseudolikelihoodRBM::train(), PLearn::PLS::train(), PLearn::NatGradSMPNNet::train(), PLearn::NatGradNNet::train(), PLearn::ModuleLearner::train(), PLearn::mNNet::train(), PLearn::ManifoldParzen::train(), PLearn::LinearRegressor::train(), PLearn::KMeansClustering::train(), PLearn::KernelRidgeRegressor::train(), PLearn::KernelProjection::train(), PLearn::IncrementalNNet::train(), PLearn::GaussMix::train(), PLearn::GaussianDistribution::train(), PLearn::GaussianContinuum::train(), PLearn::ExhaustiveNearestNeighbors::train(), PLearn::DynamicallyLinkedRBMsModel::train(), PLearn::DenoisingRecurrentNet::train(), PLearn::DeepNonLocalManifoldParzen::train(), PLearn::DeepBeliefNet::train(), PLearn::ConditionalGaussianDistribution::train(), PLearn::AutoLinearRegressor::train(), PLearn::ModuleLearner::trainingStep(), PLearn::DenoisingRecurrentNet::trainUnconditionalPredictor(), PLearn::transformPoints(), PLearn::TransformationLearner::treeDataSet(), PLearn::VecStatsCollector::update(), PLearn::LiftStatsIterator::update(), PLearn::RBMMatrixTransposeConnection::update(), PLearn::RBMMatrixConnection::update(), PLearn::RBMLLParameters::update(), PLearn::RBMConv2DLLParameters::update(), PLearn::RBMConv2DConnection::update(), PLearn::ObservationWindow::update(), PLearn::LiftStatsCollector::update(), PLearn::GaussianContinuumDistribution::update_reference_set_parameters(), PLearn::GaussianContinuum::update_reference_set_parameters(), PLearn::GaussMix::updateCholeskyFromPrevious(), PLearn::ToBagClassifier::updateCostAndBagOutput(), PLearn::RBMMatrixConnection::updateGibbs(), PLearn::GaussMix::updateInverseVarianceFromPrevious(), PLearn::DeepNonLocalManifoldParzen::updateManifoldParzenParameters(), PLearn::DiscriminativeDeepBeliefNet::updateNearestNeighbors(), PLearn::StackedFocusedAutoassociatorsNet::updateTrainSetRepresentations(), PLearn::PLearner::use(), PLearn::PLearner::useOnTrain(), PLearn::GaussianProcessRegressor::variance(), PLearn::NeuralProbabilisticLanguageModel::verify_gradient(), PLearn::FeatureSetSequentialCRF::verify_gradient(), PLearn::FeatureSetNNet::verify_gradient(), and PLearn::weightedRidgeRegressionByGCV().
{ #ifdef BOUNDCHECK resizeBoundCheck(new_length, new_width); #endif if (new_length==length_ && new_width==width_) return; else if(storage.isNull()) { offset_ = 0; length_ = new_length; width_ = new_width; mod_ = new_width; long newsize=(long)length()*mod() + extra; storage = new Storage<T>(newsize); } else { int usage = storage->usage(); if (usage > 1 && mod() != 0 && new_width > mod()-offset_%mod()) resizeModError(); else if (preserve_content && size() > 0) resizePreserve(new_length, new_width, extra); else { // 'new_size' takes into account the ABSOLUTELY REQUIRED size // to hold the elements of the matrix. We only resize the // underlying storage when the latter is not big enough to hold // 'new_size'. When resizing the storage, we include 'extra' // more elements to anticipate further resizes (e.g. coming // from appendRow()). IMPORTANT NOTE: don't include those // 'extra' bytes in the computation of 'new_size', for // otherwise a matrix reallocation will occur EVERY TIME // appendRow is called, turning an amortized O(N) algorithm // into an O(N^2) one. long new_size = offset_+(long)new_length*MAX(mod(),new_width); if(new_size > storage->length()) storage->resize(new_size + extra); if(new_width > mod()) mod_ = new_width; } length_ = new_length; width_ = new_width; } }
void PLearn::TMat< T >::resizeBoundCheck | ( | int | new_length, |
int | new_width | ||
) | [inline, protected] |
Perform bound-checking on resize.
Definition at line 446 of file TMat_impl.h.
References PLERROR.
{ if(new_length<0 || new_width<0) PLERROR("IN TMat::resize(int new_length, int new_width)\nInvalid arguments (%d, %d)", new_length, new_width); }
void PLearn::TMat< T >::resizeModError | ( | ) | [protected] |
Report PLERROR if we resize changing the mod with usage > 1.
Definition at line 453 of file TMat_impl.h.
References PLERROR.
{ PLERROR("IN TMat::resize(int new_length, int new_width) - For safety " "reasons, increasing the width() beyond mod()-offset_ modulo " "mod() is not allowed when the storage is shared with others"); }
void PLearn::TMat< T >::resizePreserve | ( | int | new_length, |
int | new_width, | ||
int | extra = 0 |
||
) | [protected] |
Utility function to resize a matrix while preserving contents.
Definition at line 386 of file TMat_impl.h.
References PLearn::max(), MAX, PLearn::min(), PLearn::sqrt(), PLearn::square(), PLearn::usage(), w, and x.
{ int usage = storage->usage(); int new_size = new_length*MAX(mod(),new_width); int new_offset = usage>1?offset_:0; if (new_size>storage->length() || new_width>mod()) { int extracols=0, extrarows=0; if (extra>min(new_width,new_length)) { // if width has increased, bet that it will increase again in the future, // similarly for length, so allocate the extra as extra mod float l=float(length_), l1=float(new_length), w=float(width_), w1=float(new_width), x=float(extra); // Solve the following equations to apportion the extra // while keeping the same percentage increase in width and length: // Solve[{x+w1*l1==w2*l2,(w2/w1 - 1)/(l2/l1 - 1) == (w1/w - 1)/(l1/l - 1)},{w2,l2}] // This is a quadratic system which has two solutions: {w2a,l2a} and {w2b,l2b}: float w2a = w1*(-1 - l1/(l - l1) + w1/w + (l1*w1)/(l*w - l1*w) + (2*l*(-w + w1)*x)/ (2*l*l1*w*w1 - l1*l1*w*w1 - l*l1*w1*w1 + sqrt(square(l1*l1*w*w1 - l*l1*w1*w1) + 4*l*(l - l1)*l1*w*(w - w1)*w1*(l1*w1 + x)))); float l2a = -(-l1*l1*w*w1 + l*l1*w1*w1 + sqrt(square(l1*l1*w*w1 - l*l1*w1*w1) + 4*l*(l - l1)*l1*w*(w - w1)*w1*(l1*w1 + x)))/(2*l*(w - w1)*w1); float w2b =w1*(-1 - l1/(l - l1) + w1/w + (l1*w1)/(l*w - l1*w) - (2*l*(-w + w1)*x)/ (-2*l*l1*w*w1 + l1*l1*w*w1 + l*l1*w1*w1 + sqrt(square(l1*l1*w*w1 - l*l1*w1*w1) + 4*l*(l - l1)*l1*w*(w - w1)*w1*(l1*w1 + x)))); float l2b = (l1*l1*w*w1 - l*l1*w1*w1 + sqrt(square(l1*l1*w*w1 - l*l1*w1*w1) + 4*l*(l - l1)*l1*w*(w - w1)*w1*(l1*w1 + x)))/(2*l*(w - w1)*w1); // pick one that is feasible and maximizes the mod if (w2b>w2a && w2b>w1 && l2b>l1) { extracols=int(ceil(w2b-w1)); extrarows=int(ceil(l2b-l1)); } else if (w2a>w1 && l2a>l1) { extrarows=int(ceil(l2a-l1)); extracols=int(ceil(w2a-w1)); } else { // no valid solution to the system of equation, use a heuristic extracols = max(0,int(ceil(sqrt(real(extra))/new_length))); extrarows = max(0,int((extra+l1*w1)/(w1+extracols) - l1)); } } storage->resizeMat(new_length,new_width,extrarows,extracols, new_offset,mod_,length_,width_,offset_); mod_ = new_width + extracols; } offset_ = new_offset; }
TMat<T> PLearn::TMat< T >::row | ( | int | row | ) | const [inline] |
Returns a Mat that is a row of the matrix.
Definition at line 590 of file TMat_decl.h.
Referenced by PLearn::VarRowsVariable::bprop(), PLearn::KNNVMatrix::build_(), PLearn::OnBagsModule::fprop(), and PLearn::GaussianProcessNLLVariable::fprop().
{ return subMatRows(row, 1); }
T* PLearn::TMat< T >::rowdata | ( | int | i | ) | const [inline] |
Definition at line 343 of file TMat_decl.h.
Referenced by PLearn::MemoryVMatrix::dot(), PLearn::matRowDotVec(), PLearn::GhostScript::writeBitmapHexString1Bit(), PLearn::GhostScript::writeBitmapHexString24Bits(), and PLearn::GhostScript::writeBitmapHexString8Bits().
{ return (*this)[i]; }
rowelements_iterator PLearn::TMat< T >::rowelements_begin | ( | int | rownum | ) | const [inline] |
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.
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 614 of file TMat_decl.h.
{ TMat<T> result(rows.length(),width()); selectRows(*this,rows,result); return result; }
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 503 of file TMat_impl.h.
Referenced by PLearn::sortRows().
TMatRowsAsArraysIterator< T > PLearn::TMat< T >::rows_as_arrays_end | ( | ) |
Definition at line 508 of file TMat_impl.h.
Referenced by PLearn::sortRows().
TMatRowsIterator< T > PLearn::TMat< T >::rows_begin | ( | ) |
Return an iterator over all rows of the matrix.
No const version for now
Definition at line 492 of file TMat_impl.h.
TMatRowsIterator< T > PLearn::TMat< T >::rows_end | ( | ) |
void PLearn::TMat< T >::setMod | ( | int | new_mod | ) | [inline] |
Set a new value for 'mod'.
The content of the matrix will be destroyed (i.e. moved around). In addition, if the new mod is strictly less than the width, the width will be set to this new mod (in order to ensure it remains a valid Mat).
Definition at line 271 of file TMat_decl.h.
Referenced by PLearn::GaussMix::addToCovariance(), PLearn::GaussMix::computeLogLikelihood(), PLearn::Variable::defineGradientLocation(), PLearn::Variable::defineValueLocation(), PLearn::Variable::resize(), PLearn::GaussMix::setPredictor(), and PLearn::GaussMix::updateInverseVarianceFromPrevious().
{ if (new_mod == mod()) // Nothing to do (the new mod is equal to the old one). return; if (storage.isNull()) { mod_ = new_mod; return; } if (storage->usage() > 1) PLERROR("In setMod - You cannot change the 'mod' of a matrix " "whose storage is shared"); if (new_mod > mod()) { // The mod is increased: we may need a larger storage. To this // extent, the matrix is first resized to a width equal to the new // mod, to ensure the storage is large enough for the new mod. int width_backup = width(); resize(length(), new_mod); PLASSERT( mod() == new_mod ); width_ = width_backup; } else { // Note that since new_mod < curent mod, then the storage is // necessarily already large enough and does not need resizing. mod_ = new_mod; if (new_mod < width()) { // We cannot just change the mod, because in order to be a // valid Mat, we must have mod >= width. Thus we also change // the width to match the new mod. width_ = new_mod; } } }
int PLearn::TMat< T >::size | ( | ) | const [inline] |
Definition at line 251 of file TMat_decl.h.
Referenced by PLearn::UndirectedSoftmaxModule::build_(), PLearn::NnlmWordRepresentationLayer::build_(), PLearn::NnlmOutputLayer::build_(), PLearn::LinearInductiveTransferClassifier::build_(), PLearn::Convolution2DModule::build_kernels(), PLearn::BackConvolution2DModule::build_kernels(), PLearn::SquaredExponentialARDKernel::computeGramMatrix(), PLearn::RationalQuadraticARDKernel::computeGramMatrix(), PLearn::PLearnerDiagonalKernel::computeGramMatrix(), PLearn::NeuralNetworkARDKernel::computeGramMatrix(), PLearn::Matern1ARDKernel::computeGramMatrix(), PLearn::LinearARDKernel::computeGramMatrix(), PLearn::KroneckerBaseKernel::computeGramMatrix(), PLearn::MemoryCachedKernel::dataCached(), PLearn::dot(), PLearn::fill_one_hot(), PLearn::ExhaustiveNearestNeighbors::findNearestNeighbors(), PLearn::UndirectedSoftmaxModule::forget(), PLearn::PseudolikelihoodRBM::forget(), PLearn::GradNNetLayerModule::forget(), PLearn::RBMModule::fprop(), PLearn::DenoisingRecurrentNet::inject_zero_forcing_noise(), PLearn::logadd(), PLearn::RBMQLParameters::makeParametersPointHere(), PLearn::RBMMatrixConnection::makeParametersPointHere(), PLearn::RBMLQParameters::makeParametersPointHere(), PLearn::RBMLLParameters::makeParametersPointHere(), PLearn::RBMGenericParameters::makeParametersPointHere(), PLearn::RBMConv2DLLParameters::makeParametersPointHere(), PLearn::RBMConv2DConnection::makeParametersPointHere(), PLearn::max(), PLearn::maxabs(), PLearn::min(), PLearn::minabs(), PLearn::multinomial_sample(), PLearn::RBMSparse1DMatrixConnection::nParameters(), PLearn::RBMQLParameters::nParameters(), PLearn::RBMMatrixTransposeConnection::nParameters(), PLearn::RBMMatrixConnection::nParameters(), PLearn::RBMLQParameters::nParameters(), PLearn::RBMLLParameters::nParameters(), PLearn::RBMGenericParameters::nParameters(), PLearn::RBMConv2DLLParameters::nParameters(), PLearn::RBMConv2DConnection::nParameters(), performLP(), PLearn::SurfaceMesh::readVRMLCoordinate3_(), PLearn::sizeInBytes(), PLearn::squareElements(), PLearn::sumabs(), PLearn::sumsquare(), and PLearn::HistogramDistribution::variance().
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 633 of file TMat_decl.h.
Referenced by PLearn::VecStatsCollector::append(), PLearn::MaxSubsampling2DModule::bpropAccUpdate(), PLearn::RBMLocalMultinomialLayer::bpropUpdate(), PLearn::StackedSVDNet::build_(), PLearn::ProjectionErrorVariable::build_(), PLearn::chol_rotapp_tr_opt(), PLearn::choleskyRemoveDimension(), PLearn::DeepReconstructorNet::computeAndSaveLayerActivationStats(), PLearn::DeepBeliefNet::computeClassifAndFinalCostsFromOutputs(), PLearn::RBMLocalMultinomialLayer::computeExpectation(), PLearn::RBMLocalMultinomialLayer::computeExpectations(), PLearn::GaussMix::computeLogLikelihood(), PLearn::ReconstructionWeightsKernel::evaluate_x_i_again(), PLearn::StackedSVDNet::fineTuningStep(), PLearn::LiftStatsIterator::finish(), PLearn::RunICPVariable::fprop(), PLearn::RBMLocalMultinomialLayer::fprop(), PLearn::MaxSubsampling2DModule::fprop(), PLearn::RBMLocalMultinomialLayer::fpropNLL(), PLearn::RBMLocalMultinomialLayer::freeEnergyContribution(), PLearn::RBMLocalMultinomialLayer::generateSample(), PLearn::RBMLocalMultinomialLayer::generateSamples(), PLearn::RBMLocalMultinomialLayer::getConfiguration(), PLearn::VMatrixFromDistribution::getMat(), PLearn::MemoryVMatrix::getMat(), PLearn::SplitModule::getPortSizes(), PLearn::OnlineGramNaturalGradientOptimizer::gramEigenNaturalGradient(), PLearn::NatGradEstimator::init(), PLearn::StatsCollector::lift(), PLearn::loadCorel(), PLearn::StatsCollector::prbp(), PLearn::MemoryVMatrix::putMat(), PLearn::rotationFromWeightedMatchedPoints(), PLearn::GaussMix::setPredictor(), PLearn::GaussMix::setPredictorPredictedSizes_const(), PLearn::Variable::setValueSubMat(), PLearn::MemoryVMatrix::subMat(), PLearn::testCholeskyRoutines(), PLearn::WPLS::train(), PLearn::StackedSVDNet::train(), PLearn::SequentialModelSelector::train(), PLearn::GaussMix::updateInverseVarianceFromPrevious(), and PLearn::weightedRotationFromMatchedPoints().
{ #ifdef BOUNDCHECK if(rowstart<0 || newlength<0 || rowstart+newlength>length() || colstart<0 || newwidth<0 || colstart+newwidth>width()) PLERROR("Mat::subMat(int rowstart, int colstart, int newlength, int newwidth) OUT OF BOUNDS" " rowstart=%d colstart=%d newlength=%d newwidth=%d length()=%d width()=%d", rowstart, colstart, newlength, newwidth, length(), width()); #endif TMat<T> subm = *this; subm.length_ = newlength; subm.width_ = newwidth; subm.offset_ += rowstart*mod() + colstart; return subm; }
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 664 of file TMat_decl.h.
Referenced by PLearn::RBMSparse1DMatrixConnection::accumulateNegStats(), PLearn::RBMSparse1DMatrixConnection::accumulatePosStats(), PLearn::StringTable::appendRow(), PLearn::SplitModule::bpropAccUpdate(), PLearn::RBMSparse1DMatrixConnection::bpropAccUpdate(), PLearn::RBMMixedConnection::bpropAccUpdate(), PLearn::RBMMixedLayer::bpropNLL(), PLearn::RBMSparse1DMatrixConnection::bpropUpdate(), PLearn::RBMMixedLayer::bpropUpdate(), PLearn::RBMMixedConnection::bpropUpdate(), PLearn::RBMJointLLParameters::build_(), PLearn::RBMJointGenericParameters::build_(), PLearn::NatGradSMPNNet::build_(), PLearn::NatGradNNet::build_(), PLearn::mNNet::build_(), PLearn::chol_dxch_tr(), PLearn::RGBImageDB::computeHistogramRepresentation(), PLearn::RBMJointGenericParameters::computeLinearUnitActivations(), PLearn::ModuleLearner::computeOutputsAndCosts(), PLearn::AddCostToLearner::computeOutputsAndCosts(), PLearn::RBMMatrixTransposeConnection::computeProduct(), PLearn::RBMMatrixConnection::computeProduct(), PLearn::RBMSparse1DMatrixConnection::computeProducts(), PLearn::RBMMixedConnection::computeProducts(), PLearn::RBMMatrixTransposeConnection::computeProducts(), PLearn::RBMMatrixConnection::computeProducts(), PLearn::RBMJointLLParameters::computeUnitActivations(), PLearn::PCA::em_orth_algo(), PLearn::DenoisingRecurrentNet::encode_artificialData(), PLearn::Kernel::estimateHistograms(), PLearn::GaussianProcessNLLVariable::fbpropFragments(), PLearn::Gnuplot::featureplot(), PLearn::SubsamplingDBN::fineTuningStep(), PLearn::DeepBeliefNet::fineTuningStep(), PLearn::SplitModule::fprop(), PLearn::RBMMixedLayer::fprop(), PLearn::CombiningCostsModule::fprop(), PLearn::RBMMixedLayer::fpropNLL(), PLearn::OnlineGramNaturalGradientOptimizer::gramEigenNaturalGradient(), PLearn::hconcat(), PLearn::InferenceRBM::hiddenExpGivenInput(), PLearn::ICP::iterate(), PLearn::loadATT800(), PLearn::loadBreastCancerWisconsin(), PLearn::loadDiabetes(), PLearn::loadHousing(), PLearn::loadLetters(), PLearn::loadPimaIndians(), PLearn::loadUCI(), PLearn::newIndexedMatArray(), PLearn::normalizeDataSets(), PLearn::SubsamplingDBN::onlineStep(), PLearn::StackedAutoassociatorsNet::onlineStep(), PLearn::DeepBeliefNet::onlineStep(), PLearn::operator^(), PLearn::MoleculeTemplate::readFromAMATFile(), PLearn::regulargrid_x_y_outputs_to_bitmap(), PLearn::removeColumn(), PLearn::RBMMixedConnection::setAsDownInputs(), PLearn::RBMMixedConnection::setAsUpInputs(), PLearn::RBMMixedLayer::setExpectationsByRef(), PLearn::DenoisingRecurrentNet::splitRawMaskedSupervisedSequence(), PLearn::testCholeskyRoutines(), PLearn::AutoLinearRegressor::train(), PLearn::ModuleLearner::trainingStep(), PLearn::BasicIdentityCallsTest::unary(), PLearn::RBMSparse1DMatrixConnection::update(), PLearn::RBMMixedLayer::update(), and PLearn::RBMMixedConnection::update().
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 650 of file TMat_decl.h.
Referenced by PLearn::SparseIncrementalAffineTransformVariable::bprop(), PLearn::MatrixAffineTransformVariable::bprop(), PLearn::AffineTransformVariable::bprop(), PLearn::OnBagsModule::bpropUpdate(), PLearn::TransformationLearner::buildLearnedParameters(), PLearn::chol_dxch(), PLearn::Kernel::computeKNNeighbourMatrixFromDistanceMatrix(), PLearn::KernelProjection::computeOutput(), PLearn::IsomapTangentLearner::computeOutput(), PLearn::BaggingLearner::computeOutput(), PLearn::RBMMatrixTransposeConnection::computeProduct(), PLearn::RBMMatrixConnection::computeProduct(), PLearn::RBMMatrixTransposeConnection::computeProducts(), PLearn::RBMMatrixConnection::computeProducts(), PLearn::diagonalizeSubspace(), PLearn::PCA::em_orth_algo(), PLearn::DenoisingRecurrentNet::encodeAndCreateSupervisedSequence(), PLearn::DenoisingRecurrentNet::encodeAndCreateSupervisedSequence2(), PLearn::NatGradSMPNNet::fbpropLoss(), PLearn::NatGradNNet::fbpropLoss(), PLearn::mNNet::fbpropLoss(), PLearn::MatrixAffineTransformVariable::fprop(), PLearn::MatrixAffineTransformFeedbackVariable::fprop(), PLearn::NatGradSMPNNet::fpropNet(), PLearn::NatGradNNet::fpropNet(), PLearn::mNNet::fpropNet(), PLearn::RBMDistribution::generateN(), PLearn::TransformationLearner::generatorBuild(), PLearn::DenoisingRecurrentNet::getInputWindow(), PLearn::GramSchmidtOrthogonalization(), PLearn::TransformationLearner::initTransformsParameters(), PLearn::loadATT800(), PLearn::loadBreastCancer(), PLearn::loadDiabetes(), PLearn::loadLetters(), PLearn::loadUCI(), PLearn::TransformationLearner::mainLearnerBuild(), PLearn::newIndexedMatArray(), PLearn::SourceVariable::randomInitialize(), PLearn::removeRow(), PLearn::TestDependenciesCommand::run(), PLearn::LocalGaussianClassifier::setTrainingSet(), PLearn::TransformationLearner::setTransformsParameters(), PLearn::SymmMatNullSpaceByInversePowerIteration(), PLearn::LLC::train(), PLearn::LinearRegressor::train(), PLearn::KernelProjection::train(), PLearn::GaussianProcessRegressor::trainProjectedProcess(), PLearn::TransformationLearner::treeDataSet(), and PLearn::vconcat().
{ #ifdef BOUNDCHECK if(rowstart<0 || newlength<0 || rowstart+newlength>length()) PLERROR("TMat::subMatRows(int rowstart, int newlength) OUT OF BOUNDS" "length=%d, rowstart=%d, newlength=%d", length(), rowstart, newlength); #endif TMat<T> subm = *this; subm.length_ = newlength; subm.offset_ += rowstart*mod(); return subm; }
void PLearn::TMat< T >::swapColumns | ( | int | i, |
int | j | ||
) | const [inline] |
Swap the content of column i and column j.
Definition at line 811 of file TMat_decl.h.
Referenced by PLearn::chol_dxch().
{ if (i != j) { T* Mi = data() + i; T* Mj = data() + j; int n = length(); for (int k = 0; k < n; k++) { T tmp = *Mi; *Mi = *Mj; *Mj = tmp; Mi += mod(); Mj += mod(); } } }
void PLearn::TMat< T >::swapRows | ( | int | i, |
int | j | ||
) | const [inline] |
Swap the content of row i and row j.
Note: a potentially more efficient version can be found in TMat_maths_impl.h.
Definition at line 793 of file TMat_decl.h.
Referenced by PLearn::LU_decomposition(), PLearn::partialSortRows(), PLearn::selectAndOrder(), PLearn::shuffleRows(), PLearn::PRandom::shuffleRows(), PLearn::sortRows(), and PLearn::swapRows().
{ if(i!=j) { //T* Mi = rowdata(i); //T* Mj = rowdata(j); T* Mi = (*this)[i]; T* Mj = (*this)[j]; for (int k=0;k<width();k++) { T tmp = Mi[k]; Mi[k] = Mj[k]; Mj[k] = tmp; } } }
void PLearn::TMat< T >::swapUpsideDown | ( | ) | const [inline] |
Definition at line 933 of file TMat_decl.h.
Referenced by PLearn::eigen_SymmMat_decreasing(), PLearn::eigenVecOfSymmMat(), PLearn::generalizedEigenVecOfSymmMat(), and PLearn::kernelPCAfromDotProducts().
TVec< T > PLearn::TMat< T >::toVec | ( | ) | const |
Views same data (not always possible)
Views same data (not always possible) Actually it's the matrix view rows by rows.
Definition at line 302 of file TMat_impl.h.
References PLearn::TVec< T >::length_, PLearn::TVec< T >::offset_, PLERROR, and PLearn::TVec< T >::storage.
Referenced by PLearn::VBoundDBN2::bpropAccUpdate(), PLearn::RBMSparse1DMatrixConnection::bpropAccUpdate(), PLearn::CostModule::bpropAccUpdate(), PLearn::RBMSparse1DMatrixConnection::bpropUpdate(), PLearn::SumOverBagsVariable::build_(), PLearn::RBMModule::computeLogLikelihoodOfVisible(), PLearn::LinearRegressor::computeOutput(), PLearn::KPCATangentLearner::computeOutput(), PLearn::IsomapTangentLearner::computeOutput(), PLearn::BaggingLearner::computeOutput(), PLearn::NNet::computeOutputAndCosts(), PLearn::RBMSparse1DMatrixConnection::computeProducts(), PLearn::ConvertFromPyObject< TMat< T > >::convert(), PLearn::ConvertFromPyObject< Mat >::convert(), PLearn::Variable::defineGradientLocation(), PLearn::Variable::defineValueLocation(), PLearn::ProductRandomVariable::EMTrainingInitialize(), PLearn::DenoisingRecurrentNet::encodeAndCreateSupervisedSequence(), PLearn::DenoisingRecurrentNet::encodeAndCreateSupervisedSequence2(), PLearn::GCV(), PLearn::RBMDistribution::generate(), PLearn::RBMDistribution::generateN(), PLearn::DenoisingRecurrentNet::getInputWindow(), PLearn::NeuralProbabilisticLanguageModel::initializeParams(), PLearn::FeatureSetSequentialCRF::initializeParams(), PLearn::FeatureSetNNet::initializeParams(), PLearn::NonLocalManifoldParzen::log_density(), PLearn::multivariate_normal(), PLearn::Variable::resize(), PLearn::Variable::resizeDiagHessian(), PLearn::Variable::resizeRValue(), PLearn::BinSplitter::setDataSet(), PLearn::NonLocalManifoldParzen::train(), PLearn::GaussianProcessRegressor::train(), PLearn::MemoryStressTest::unary(), PLearn::BasicIdentityCallsTest::unary(), PLearn::RBMSparse1DMatrixConnection::update(), PLearn::ConditionalDistribution::use(), PLearn::Variable::Variable(), PLearn::NeuralProbabilisticLanguageModel::verify_gradient(), PLearn::FeatureSetSequentialCRF::verify_gradient(), and PLearn::FeatureSetNNet::verify_gradient().
{ if(length()>1 && width()<mod()) PLERROR("In Mat::toVec internal structure of this Mat makes it impossible to build a Vec that would view exactly the same data. Consider using toVecCopy() instead!"); TVec<T> v; v.offset_ = offset_; v.length_ = length()*width(); v.storage = storage; return v; }
TVec< T > PLearn::TMat< T >::toVecCopy | ( | ) | const |
Copy of data.
Definition at line 291 of file TMat_impl.h.
Referenced by PLearn::UnfoldedFuncVariable::bprop(), PLearn::LogaddOnBagsModule::bprop(), PLearn::displayHistogram(), PLearn::Gnuplot::featureplot(), PLearn::RBMModule::fprop(), PLearn::fullyRebalance2Classes(), PLearn::SequentialModelSelector::paired_t_test(), PLearn::MoleculeTemplate::readFromAMATFile(), PLearn::rebalanceNClasses(), PLearn::rotationFromWeightedMatchedPoints(), PLearn::testCholeskyRoutines(), PLearn::SequentialModelSelector::train(), and PLearn::AutoLinearRegressor::train().
void PLearn::TMat< T >::transpose | ( | ) | [inline] |
Swap element (i,j) with element (j,i).
Currently only implemented for square matrices.
Definition at line 919 of file TMat_decl.h.
int PLearn::TMat< T >::width | ( | ) | const [inline] |
Definition at line 248 of file TMat_decl.h.
Referenced by PLearn::absargmax(), PLearn::add(), PLearn::RBMLayer::addBiasDecay(), PLearn::addToColumns(), PLearn::GaussMix::addToCovariance(), PLearn::RBMMatrixConnection::addWeightPenalty(), PLearn::affineMatrixInitialize(), PLearn::affineNormalization(), PLearn::GaussianProcessNLLVariable::alpha(), PLearn::VecStatsCollector::append(), PLearn::apply(), PLearn::argmax(), PLearn::argmin(), PLearn::averageAcrossRowsAndColumns(), PLearn::backConvolve2D(), PLearn::backConvolve2Dbackprop(), PLearn::TransformationLearner::batchGeneratePredictedFrom(), PLearn::bootstrap_rows(), PLearn::TransposedDoubleProductVariable::bprop(), PLearn::TraceVariable::bprop(), PLearn::SumVarianceOfLinearTransformedBernoullis::bprop(), PLearn::SumEntropyOfCategoricals::bprop(), PLearn::SumEntropyOfBernoullis::bprop(), PLearn::SparseIncrementalAffineTransformVariable::bprop(), PLearn::NonDiagVariable::bprop(), PLearn::LogSoftSoftMaxVariable::bprop(), PLearn::InsertZerosVariable::bprop(), PLearn::GaussianProcessNLLVariable::bprop(), PLearn::DoubleProductVariable::bprop(), PLearn::Cov2CorrVariable::bprop(), PLearn::ConstrainVariable::bprop(), PLearn::NllGeneralGaussianVariable::bprop_to_bases(), PLearn::DeepNonLocalManifoldParzen::bprop_to_bases(), PLearn::TreeDBNModule::bpropAccUpdate(), PLearn::SplitModule::bpropAccUpdate(), PLearn::SoftmaxNLLCostModule::bpropAccUpdate(), PLearn::RBMSparse1DMatrixConnection::bpropAccUpdate(), PLearn::RBMModule::bpropAccUpdate(), PLearn::RBMMixedConnection::bpropAccUpdate(), PLearn::RBMMatrixConnection::bpropAccUpdate(), PLearn::RBMConv2DConnection::bpropAccUpdate(), PLearn::OnlineLearningModule::bpropAccUpdate(), PLearn::OnBagsModule::bpropAccUpdate(), PLearn::NLLCostModule::bpropAccUpdate(), PLearn::NetworkModule::bpropAccUpdate(), PLearn::MaxSubsampling2DModule::bpropAccUpdate(), PLearn::MatrixModule::bpropAccUpdate(), PLearn::LinearCombinationModule::bpropAccUpdate(), PLearn::LayerCostModule::bpropAccUpdate(), PLearn::KLp0p1RBMModule::bpropAccUpdate(), PLearn::IdentityModule::bpropAccUpdate(), PLearn::CrossEntropyCostModule::bpropAccUpdate(), PLearn::CostModule::bpropAccUpdate(), PLearn::Convolution2DModule::bpropAccUpdate(), PLearn::CombiningCostsModule::bpropAccUpdate(), PLearn::BinarizeModule::bpropAccUpdate(), PLearn::mNNet::bpropNet(), PLearn::RBMWoodsLayer::bpropNLL(), PLearn::RBMMultinomialLayer::bpropNLL(), PLearn::RBMMixedLayer::bpropNLL(), PLearn::RBMLocalMultinomialLayer::bpropNLL(), PLearn::RBMLateralBinomialLayer::bpropNLL(), PLearn::RBMGaussianLayer::bpropNLL(), PLearn::RBMBinomialLayer::bpropNLL(), PLearn::SquaredErrorCostModule::bpropUpdate(), PLearn::SoftmaxNLLCostModule::bpropUpdate(), PLearn::SoftmaxModule::bpropUpdate(), PLearn::ShuntingNNetLayerModule::bpropUpdate(), PLearn::ScaleGradientModule::bpropUpdate(), PLearn::RBMWoodsLayer::bpropUpdate(), PLearn::RBMSparse1DMatrixConnection::bpropUpdate(), PLearn::RBMMultinomialLayer::bpropUpdate(), PLearn::RBMMixedLayer::bpropUpdate(), PLearn::RBMMixedConnection::bpropUpdate(), PLearn::RBMMatrixTransposeConnection::bpropUpdate(), PLearn::RBMMatrixConnectionNatGrad::bpropUpdate(), PLearn::RBMMatrixConnection::bpropUpdate(), PLearn::RBMLocalMultinomialLayer::bpropUpdate(), PLearn::RBMLateralBinomialLayer::bpropUpdate(), PLearn::RBMDiagonalMatrixConnection::bpropUpdate(), PLearn::RBMConv2DConnection::bpropUpdate(), PLearn::RBMBinomialLayer::bpropUpdate(), PLearn::ProcessInputCostModule::bpropUpdate(), PLearn::OnlineLearningModule::bpropUpdate(), PLearn::OnBagsModule::bpropUpdate(), PLearn::NLLCostModule::bpropUpdate(), PLearn::ModuleStackModule::bpropUpdate(), PLearn::LinearFilterModule::bpropUpdate(), PLearn::LayerCostModule::bpropUpdate(), PLearn::GradNNetLayerModule::bpropUpdate(), PLearn::CrossEntropyCostModule::bpropUpdate(), PLearn::CombiningCostsModule::bpropUpdate(), PLearn::mNNet::bpropUpdateNet(), PLearn::VMatrixFromDistribution::build_(), PLearn::SplitWiseValidationVMatrix::build_(), PLearn::ShuntingNNetLayerModule::build_(), PLearn::RemapLastColumnVMatrix::build_(), PLearn::RBMSparse1DMatrixConnection::build_(), PLearn::RBMQLParameters::build_(), PLearn::RBMMatrixConnection::build_(), PLearn::RBMLQParameters::build_(), PLearn::RBMLLParameters::build_(), PLearn::RBMGenericParameters::build_(), PLearn::RBMConv2DLLParameters::build_(), PLearn::RBMConv2DConnection::build_(), PLearn::ObjectOptionVariable::build_(), PLearn::MoleculeTemplate::build_(), PLearn::ModuleTester::build_(), PLearn::MemoryVMatrix::build_(), PLearn::LinearInductiveTransferClassifier::build_(), PLearn::LemmatizeVMatrix::build_(), PLearn::GradNNetLayerModule::build_(), PLearn::GaussMix::build_(), PLearn::FNetLayerVariable::build_(), PLearn::ExtractNNetParamsVMatrix::build_(), PLearn::Convolution2DModule::build_(), PLearn::ClassErrorCostModule::build_(), PLearn::BackConvolution2DModule::build_(), PLearn::AppendNeighborsVMatrix::build_(), PLearn::Convolution2DModule::build_kernels(), PLearn::BackConvolution2DModule::build_kernels(), PLearn::ChemicalICP::cacheFeatureDistances(), PLearn::chol_dxch_tr(), PLearn::chol_rotapp_tr(), PLearn::choleskyAppendDimension(), PLearn::choleskyDecomposition(), PLearn::choleskyLeftSolve(), PLearn::choleskyRightSolve(), PLearn::choleskySolve(), PLearn::classification_confusion_matrix(), PLearn::columnArgmax(), PLearn::columnArgmin(), PLearn::columnMax(), PLearn::columnMean(), PLearn::columnMin(), PLearn::columnSum(), PLearn::columnSumOfSquares(), PLearn::columnVariance(), PLearn::columnWeightedMean(), PLearn::columnWeightedVariance(), PLearn::GaussianContinuum::compute_train_and_validation_costs(), PLearn::DeepBeliefNet::computeClassifAndFinalCostsFromOutputs(), PLearn::AddCostToLearner::computeCostsFromOutputs(), PLearn::computeCovar(), PLearn::RBMWoodsLayer::computeExpectations(), PLearn::RBMTruncExpLayer::computeExpectations(), PLearn::RBMRateLayer::computeExpectations(), PLearn::RBMMultinomialLayer::computeExpectations(), PLearn::RBMLocalMultinomialLayer::computeExpectations(), PLearn::RBMLateralBinomialLayer::computeExpectations(), PLearn::RBMGaussianLayer::computeExpectations(), PLearn::RBMBinomialLayer::computeExpectations(), PLearn::RBMModule::computeFreeEnergyOfHidden(), PLearn::KLp0p1RBMModule::computeFreeEnergyOfHidden(), PLearn::RBMModule::computeFreeEnergyOfVisible(), PLearn::KLp0p1RBMModule::computeFreeEnergyOfVisible(), PLearn::SummationKernel::computeGramMatrix(), PLearn::RationalQuadraticARDKernel::computeGramMatrix(), PLearn::PLearnerDiagonalKernel::computeGramMatrix(), PLearn::KroneckerBaseKernel::computeGramMatrix(), PLearn::Kernel::computeGramMatrix(), PLearn::IIDNoiseKernel::computeGramMatrix(), PLearn::RationalQuadraticARDKernel::computeGramMatrixDerivIspAlpha(), PLearn::Matern1ARDKernel::computeGramMatrixDerivIspInputSigma(), PLearn::RationalQuadraticARDKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::PLearnerDiagonalKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::Matern1ARDKernel::computeGramMatrixDerivIspSignalSigma(), PLearn::IIDNoiseKernel::computeGramMatrixDerivKronecker(), PLearn::MemoryCachedKernel::computeGramMatrixNV(), PLearn::RBMModule::computeHiddenActivations(), PLearn::KLp0p1RBMModule::computeHiddenActivations(), PLearn::LinearRegressor::computeInformationCriteria(), PLearn::computeInverseStandardDeviationFromMeanAndSquareMean(), PLearn::LayerCostModule::computeKLdiv(), PLearn::ReconstructionWeightsKernel::computeLLEMatrix(), PLearn::computeLocalPrincipalComponents(), PLearn::GaussMix::computeLogLikelihood(), PLearn::DeepNonLocalManifoldParzen::computeManifoldParzenParameters(), PLearn::computeMeanAndCovar(), PLearn::WPLS::computeOutput(), PLearn::PLS::computeOutput(), PLearn::ManifoldParzen2::computeOutput(), PLearn::KernelRidgeRegressor::computeOutput(), PLearn::ModuleLearner::computeOutputAndCosts(), PLearn::PLearner::computeOutputCovMat(), PLearn::GaussianProcessRegressor::computeOutputCovMat(), PLearn::NatGradNNet::computeOutputs(), PLearn::mNNet::computeOutputs(), PLearn::ModuleLearner::computeOutputsAndCosts(), PLearn::Kernel::computePartialGramMatrix(), PLearn::computePrincipalComponents(), PLearn::RBMSparse1DMatrixConnection::computeProducts(), PLearn::RBMMixedConnection::computeProducts(), PLearn::RBMMatrixConnection::computeProducts(), PLearn::RBMDiagonalMatrixConnection::computeProducts(), PLearn::RBMConv2DConnection::computeProducts(), PLearn::computeRanks(), PLearn::LinearRegressor::computeResidualsVariance(), PLearn::LocalizedFeaturesLayerVariable::computeSubsets(), PLearn::Kernel::computeTestGramMatrix(), PLearn::PruningLinearRegressor::computeTRatio(), PLearn::RBMModule::computeVisibleActivations(), PLearn::KLp0p1RBMModule::computeVisibleActivations(), PLearn::SumVarianceOfLinearTransformedBernoullis::computeWsqnorm(), PLearn::constrainedLinearRegression(), PLearn::convolve(), PLearn::convolve2D(), PLearn::convolve2Dbackprop(), PLearn::correlation(), PLearn::cross_valid(), PLearn::Variable::defineGradientLocation(), PLearn::Variable::defineValueLocation(), PLearn::det(), PLearn::diagonalizedFactorsProduct(), PLearn::diagonalizedFactorsProductBprop(), PLearn::diagonalizedFactorsProductTranspose(), PLearn::diagonalizedFactorsProductTransposeBprop(), PLearn::diagonalizedFactorsTransposeProduct(), PLearn::diagonalizedFactorsTransposeProductBprop(), PLearn::diagonalizedFactorsTransposeProductTranspose(), PLearn::diagonalizedFactorsTransposeProductTransposeBprop(), PLearn::diffSquareMultiplyAcc(), PLearn::DirichletEstimatorMMoments(), 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::DenoisingRecurrentNet::encode_artificialData(), PLearn::DenoisingRecurrentNet::encodeAndCreateSupervisedSequence(), 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::externalProductDivUpdate(), PLearn::externalProductMultUpdate(), PLearn::externalProductScaleAcc(), PLearn::RBMLateralBinomialLayer::externalSymetricProductAcc(), PLearn::GaussianProcessNLLVariable::fbpropFragments(), PLearn::Gnuplot::featureplot(), PLearn::fill_one_hot(), PLearn::LiftStatsCollector::finalize(), PLearn::SubsamplingDBN::fineTuningStep(), PLearn::DeepBeliefNet::fineTuningStep(), PLearn::PseudolikelihoodRBM::forget(), PLearn::PLearnDiff::forget(), PLearn::LinearInductiveTransferClassifier::forget(), PLearn::GradNNetLayerModule::forget(), PLearn::WeightedLogGaussian::fprop(), PLearn::TreeDBNModule::fprop(), PLearn::TransposedDoubleProductVariable::fprop(), PLearn::TraceVariable::fprop(), PLearn::SumVarianceOfLinearTransformedBernoullis::fprop(), PLearn::SumEntropyOfCategoricals::fprop(), PLearn::SumEntropyOfBernoullis::fprop(), PLearn::SoftmaxNLLCostModule::fprop(), PLearn::SoftmaxModule::fprop(), PLearn::ShuntingNNetLayerModule::fprop(), PLearn::ScaleGradientModule::fprop(), PLearn::RBMWoodsLayer::fprop(), PLearn::RBMModule::fprop(), PLearn::RBMMixedLayer::fprop(), PLearn::RBMLayer::fprop(), PLearn::RBMLateralBinomialLayer::fprop(), PLearn::RBMBinomialLayer::fprop(), PLearn::ProjectionErrorVariable::fprop(), PLearn::ProcessInputCostModule::fprop(), PLearn::NonDiagVariable::fprop(), PLearn::NllSemisphericalGaussianVariable::fprop(), PLearn::NllGeneralGaussianVariable::fprop(), PLearn::NLLCostModule::fprop(), PLearn::NetworkModule::fprop(), PLearn::ModuleStackModule::fprop(), PLearn::MatrixModule::fprop(), PLearn::LogSoftSoftMaxVariable::fprop(), PLearn::LinearFilterModule::fprop(), PLearn::LayerCostModule::fprop(), PLearn::KLp0p1RBMModule::fprop(), PLearn::InsertZerosVariable::fprop(), PLearn::IdentityModule::fprop(), PLearn::GradNNetLayerModule::fprop(), PLearn::GaussianProcessNLLVariable::fprop(), PLearn::DoubleProductVariable::fprop(), PLearn::Cov2CorrVariable::fprop(), PLearn::ConstrainVariable::fprop(), PLearn::CombiningCostsModule::fprop(), PLearn::BinarizeModule::fprop(), PLearn::RBMWoodsLayer::fpropNLL(), PLearn::RBMMultinomialLayer::fpropNLL(), PLearn::RBMMixedLayer::fpropNLL(), PLearn::RBMLocalMultinomialLayer::fpropNLL(), PLearn::RBMLayer::fpropNLL(), PLearn::RBMLateralBinomialLayer::fpropNLL(), PLearn::RBMGaussianLayer::fpropNLL(), PLearn::RBMBinomialLayer::fpropNLL(), PLearn::SumOverBagsVariable::fpropOneBag(), PLearn::TreeDBNModule::full_fprop(), PLearn::GCV(), PLearn::generalizedEigenVecOfSymmMat(), PLearn::RBMDistribution::generate(), PLearn::RBMDistribution::generateN(), PLearn::PDistribution::generateN(), PLearn::RBMWoodsLayer::generateSamples(), PLearn::RBMTruncExpLayer::generateSamples(), PLearn::RBMRateLayer::generateSamples(), PLearn::RBMMultinomialLayer::generateSamples(), PLearn::RBMLocalMultinomialLayer::generateSamples(), PLearn::RBMLateralBinomialLayer::generateSamples(), PLearn::RBMGaussianLayer::generateSamples(), PLearn::RBMBinomialLayer::generateSamples(), PLearn::geometric_mean(), PLearn::VecStatsCollector::getCorrelation(), PLearn::VecStatsCollector::getCovariance(), PLearn::VMatrixFromDistribution::getMat(), PLearn::VMatrix::getMat(), PLearn::TransposeVMatrix::getMat(), PLearn::SubVMatrix::getMat(), PLearn::MemoryVMatrix::getMat(), PLearn::RemapLastColumnVMatrix::getNewRow(), PLearn::PairsVMatrix::getNewRow(), PLearn::AppendNeighborsVMatrix::getNewRow(), PLearn::MatrixModule::getPortSizes(), PLearn::OnlineGramNaturalGradientOptimizer::gramEigenNaturalGradient(), PLearn::grep(), PLearn::InferenceRBM::hiddenExpGivenInput(), PLearn::InferenceRBM::hiddenExpGivenInputTarget(), PLearn::InferenceRBM::hiddenExpGivenVisible(), PLearn::identityMatrix(), PLearn::NeighborhoodImputationVMatrix::impute(), PLearn::inverse(), PLearn::invertElements(), PLearn::TMat< T >::isEqual(), PLearn::jacobi(), PLearn::kernelPCAfromDotProducts(), PLearn::lapackCholeskyDecompositionInPlace(), PLearn::lapackCholeskySolveInPlace(), PLearn::lapackEIGEN(), PLearn::lapackGeneralizedEIGEN(), PLearn::lapackSolveLinearSystem(), PLearn::lapackSVD(), PLearn::layerBpropUpdate(), PLearn::layerL1BpropUpdate(), PLearn::layerL2BpropUpdate(), PLearn::leftPseudoInverse(), PLearn::linearRegression(), PLearn::linearRegressionNoBias(), PLearn::loadAsciiAsVMat(), 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(), main(), PLearn::makeItSymmetric(), PLearn::Variable::makeSharedGradient(), PLearn::Variable::makeSharedRValue(), PLearn::Variable::makeSharedValue(), PLearn::matInvert(), PLearn::matlabSave(), PLearn::matRowDotVec(), PLearn::matRowsDots(), PLearn::matRowsDotsAcc(), PLearn::MatTPlusSumSquaredVec< MatT >::MatTPlusSumSquaredVec(), PLearn::max(), PLearn::maxabs(), PLearn::mean(), PLearn::MemoryVMatrix::MemoryVMatrix(), PLearn::VecStatsCollector::merge(), PLearn::metricMultiDimensionalScaling(), PLearn::min(), PLearn::minabs(), PLearn::GaussMix::missingExpectation(), PLearn::Molecule::Molecule(), PLearn::multinomial_sample(), PLearn::multiply(), PLearn::multiplyAcc(), PLearn::multiplyColumns(), PLearn::multiplyScaledAdd(), PLearn::OnlineLearningModule::namedBpropAccUpdate(), PLearn::negateElements(), PLearn::newIndexedMatArray(), PLearn::ConvertToPyObject< Mat >::newPyObject(), PLearn::RBMTrainer::NLL(), PLearn::normalize(), PLearn::normalizeColumns(), PLearn::normalizeDataSet(), PLearn::normalizeDataSets(), PLearn::FractionSplitter::nSetsPerSplit(), PLearn::SubsamplingDBN::onlineStep(), PLearn::StackedAutoassociatorsNet::onlineStep(), PLearn::NatGradSMPNNet::onlineStep(), PLearn::NatGradNNet::onlineStep(), PLearn::DeepBeliefNet::onlineStep(), PLearn::operator*(), PLearn::operator*=(), PLearn::operator+(), PLearn::operator+=(), PLearn::operator-(), PLearn::operator-=(), PLearn::operator/=(), PLearn::operator<<(), PLearn::TMat< T >::operator==(), PLearn::operator^(), PLearn::RBMMatrixConnection::petiteCulotteOlivierCD(), PLearn::product(), PLearn::product2Acc(), PLearn::product2Transpose(), PLearn::product2TransposeAcc(), PLearn::productAcc(), PLearn::productScaleAcc(), PLearn::productTranspose(), PLearn::productTransposeAcc(), PLearn::productTransposeScaleAcc(), PLearn::VMatrix::putMat(), PLearn::SubVMatrix::putMat(), PLearn::MemoryVMatrix::putMat(), PLearn::qld_interface(), PLearn::RBMTrainer::recError(), PLearn::MatRowVariable::recomputeSize(), PLearn::regulargrid_x_y_outputs_to_bitmap(), PLearn::remote_solveLinearSystemByCholesky(), PLearn::removeColumn(), PLearn::LinearRegressor::resetAccumulators(), PLearn::ridgeRegressionByGCV(), PLearn::rightPseudoInverse(), PLearn::rowArgmax(), PLearn::rowArgmin(), PLearn::rowMax(), PLearn::rowMean(), PLearn::rowMin(), PLearn::rowSum(), PLearn::rowSumAcc(), PLearn::rowSumOfSquares(), PLearn::rowVariance(), PLearn::ExtractOptionCommand::run(), PLearn::ChemicalICP::run(), PLearn::saveAscii(), PLearn::saveAsciiWithoutSize(), PLearn::saveGnuplot(), PLearn::savePMat(), PLearn::saveSNMat(), PLearn::select(), PLearn::selectAndOrder(), PLearn::selectColumns(), PLearn::RBMConnection::setAsDownInputs(), PLearn::RBMConnection::setAsUpInputs(), PLearn::RBMLayer::setBatchSize(), PLearn::MatrixModule::setGradientTo(), PLearn::GaussMix::setPredictor(), PLearn::GaussMix::setPredictorPredictedSizes_const(), PLearn::TransformationLearner::setTransformsParameters(), PLearn::Variable::setValueSubMat(), PLearn::smooth(), PLearn::softmax(), PLearn::solveLinearSystemByCholesky(), PLearn::solveTransposeLinearSystemByCholesky(), PLearn::sortColumns(), PLearn::RegressionTreeRegisters::sortRows(), PLearn::SparseMatrix::SparseMatrix(), PLearn::DenoisingRecurrentNet::splitRawMaskedSupervisedSequence(), PLearn::sqrt(), PLearn::square(), PLearn::squareMultiplyAcc(), PLearn::squareProductAcc(), PLearn::squareProductTranspose(), PLearn::squareProductTransposeAcc(), PLearn::subsample(), PLearn::substract(), PLearn::substractFromColumns(), PLearn::sum(), PLearn::sum_of_squares(), PLearn::InferenceRBM::supCDStep(), PLearn::InferenceRBM::targetExpGivenInput(), PLearn::testSpearmanRankCorrelation(), PLearn::ThresholdedKernel::thresholdGramMatrix(), PLearn::TMat< T >::TMat(), PLearn::StructuralLearner::train(), PLearn::StackedSVDNet::train(), PLearn::PseudolikelihoodRBM::train(), PLearn::NatGradSMPNNet::train(), PLearn::NatGradNNet::train(), PLearn::mNNet::train(), PLearn::KernelRidgeRegressor::train(), PLearn::KernelProjection::train(), PLearn::GaussMix::train(), PLearn::GaussianDistribution::train(), PLearn::ModuleLearner::trainingStep(), PLearn::GaussianProcessRegressor::trainProjectedProcess(), PLearn::DenoisingRecurrentNet::trainUnconditionalPredictor(), PLearn::transpose(), PLearn::transposedLayerL1BpropUpdate(), PLearn::transposedLayerL2BpropUpdate(), PLearn::transposeProduct(), PLearn::transposeProduct2(), PLearn::transposeProduct2Acc(), PLearn::transposeProductAcc(), PLearn::transposeProductScaleAcc(), PLearn::transposeTransposeProduct(), PLearn::transposeTransposeProductAcc(), PLearn::transposeTransposeProductScaleAcc(), PLearn::RBMSparse1DMatrixConnection::update(), PLearn::RBMMatrixTransposeConnection::update(), PLearn::RBMMatrixConnectionNatGrad::update(), PLearn::RBMMatrixConnection::update(), PLearn::RBMLLParameters::update(), PLearn::RBMGaussianLayer::update(), PLearn::RBMDiagonalMatrixConnection::update(), PLearn::RBMConv2DConnection::update(), PLearn::NeuralProbabilisticLanguageModel::update_affine_transform(), PLearn::FeatureSetSequentialCRF::update_affine_transform(), PLearn::FeatureSetNNet::update_affine_transform(), PLearn::RBMLayer::updateCDandGibbs(), PLearn::ToBagClassifier::updateCostAndBagOutput(), PLearn::RBMMatrixConnection::updateGibbs(), PLearn::RBMLayer::updateGibbs(), PLearn::GaussMix::updateInverseVarianceFromPrevious(), PLearn::variance(), PLearn::NeuralProbabilisticLanguageModel::verify_gradient_affine_transform(), PLearn::FeatureSetSequentialCRF::verify_gradient_affine_transform(), PLearn::FeatureSetNNet::verify_gradient_affine_transform(), PLearn::weightedLinearRegression(), PLearn::weightedRidgeRegressionByGCV(), PLearn::GhostScript::writeBitmapHexString1Bit(), PLearn::GhostScript::writeBitmapHexString24Bits(), and PLearn::GhostScript::writeBitmapHexString8Bits().
{ return width_; }
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 370 of file TMat_decl.h.
{ T* ptr = 0; if(storage) ptr = data(); switch(out.outmode) { case PStream::raw_ascii: case PStream::pretty_ascii: for(int i=0; i<length_; i++, ptr+=mod_) { for(int j=0; j<width_; j++) { out << ptr[j]; out.put('\t'); } out.put('\n'); } break; case PStream::raw_binary: for(int i=0; i<length_; i++, ptr+=mod_) binwrite_(out, ptr, width_); break; case PStream::plearn_ascii: { if(!out.implicit_storage) { out.write("TMat("); out << length_ << width_ << mod_ << offset_ << storage; out.write(")\n"); } else // implicit storage { out << length_; out.put(' '); out << width_; out.write(" [ \n"); for(int i=0; i<length_; i++, ptr+=mod_) { for(int j=0; j<width_; j++) { out << ptr[j]; out.put('\t'); } out.put('\n'); } out.write("]\n"); } } break; case PStream::plearn_binary: { if(!out.implicit_storage) { out.write("TMat("); out << length_ << width_ << mod_ << offset_ << storage; out.write(")\n"); } else // implicit storage { unsigned char typecode; if(byte_order()==LITTLE_ENDIAN_ORDER) { out.put(0x14); // 2D little-endian typecode = TypeTraits<T>::little_endian_typecode(); } else { out.put(0x15); // 2D big-endian typecode = TypeTraits<T>::big_endian_typecode(); } // write typecode out.put(typecode); // write length and width in raw_binary out.write((char*)&length_, sizeof(length_)); out.write((char*)&width_, sizeof(width_)); // write the data for(int i=0; i<length_; i++, ptr+=mod_) binwrite_(out, ptr, width_); } } break; default: PLERROR("In TMat::write(PStream& out) unknown outmode!!!!!!!!!"); break; } }
friend class TVec< T > [friend] |
Definition at line 66 of file TMat_decl.h.
friend class VarArray [friend] |
for makeShared hack... (to be cleaned)
Definition at line 68 of file TMat_decl.h.
friend class Variable [friend] |
for makeShared hack... (to be cleaned)
Definition at line 67 of file TMat_decl.h.
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< pair< real, real > >::operator=(), PLearn::TMat< pair< real, real > >::subMat(), PLearn::TMat< pair< real, real > >::subMatRows(), and PLearn::TVec< T >::toMat().
int PLearn::TMat< T >::mod_ [protected] |
the real width() of the matrix
Definition at line 72 of file TMat_decl.h.
Referenced by PLearn::Variable::makeSharedGradient(), PLearn::Variable::makeSharedRValue(), PLearn::Variable::makeSharedValue(), PLearn::TMat< pair< real, real > >::operator=(), and PLearn::TVec< T >::toMat().
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(), and PLearn::TVec< T >::toMat().
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::Variable::makeSharedGradient(), PLearn::Variable::makeSharedRValue(), PLearn::Variable::makeSharedValue(), PLearn::TMat< pair< real, real > >::operator=(), and PLearn::TVec< T >::toMat().
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< pair< real, real > >::operator=(), PLearn::TMat< pair< real, real > >::subMat(), PLearn::TMat< pair< real, real > >::subMatColumns(), and PLearn::TVec< T >::toMat().