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

pl_math.h File Reference

#include <cmath>
#include <cfloat>
#include <climits>
#include <plearn/base/plerror.h>

Include dependency graph for pl_math.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  PLearn

Defines

#define REAL_MAX   DBL_MAX
#define MISSING_VALUE   (plearn_nan.d)
 Quiet NaN (float pattern).

#define MIN(a, b)   ((a)<(b)?(a):(b))
 Deprecated, use std::min and std::max instead.

#define MAX(a, b)   ((a)>(b)?(a):(b))
#define SIGN(a)   ((a)>=0?1:-1)
#define ABS(x)   ((x)>0 ?(x) :-(x))
#define random()   rand()
#define Pi   3.141592653589793
#define Log2Pi   1.837877066409
#define LOG_2   0.693147180559945
#define LOG_INIT   -FLT_MAX
#define MINUS_LOG_THRESHOLD   -18.42
#define TANHTABLESIZE   5000
#define MAXTANHX   10.
#define DOUBLE_TO_INT(in, out)   out = int(in)
#define FSWAP(a, b)   do {real _c; _c = *(a); *(a) = *(b); *(b) = _c;} while(0)
#define FLOAT_THRESHOLD   0.00001
#define FEQUAL(a, b)   (FABS((a)-(b))<FLOAT_THRESHOLD)


Define Documentation

#define ABS x   )     ((x)>0 ?(x) :-(x))
 

Definition at line 100 of file pl_math.h.

#define DOUBLE_TO_INT in,
out   )     out = int(in)
 

Definition at line 160 of file pl_math.h.

Referenced by PLearn::fasttanh().

#define FEQUAL a,
 )     (FABS((a)-(b))<FLOAT_THRESHOLD)
 

Definition at line 255 of file pl_math.h.

Referenced by PLearn::inverse_sigmoid(), and PLearn::logsub().

#define FLOAT_THRESHOLD   0.00001
 

Definition at line 254 of file pl_math.h.

#define FSWAP a,
 )     do {real _c; _c = *(a); *(a) = *(b); *(b) = _c;} while(0)
 

Definition at line 253 of file pl_math.h.

#define Log2Pi   1.837877066409
 

Definition at line 104 of file pl_math.h.

#define LOG_2   0.693147180559945
 

Definition at line 105 of file pl_math.h.

Referenced by PLearn::logtwo(), and PLearn::safeflog2().

#define LOG_INIT   -FLT_MAX
 

Definition at line 106 of file pl_math.h.

Referenced by PLearn::logadd().

#define MAX a,
 )     ((a)>(b)?(a):(b))
 

Definition at line 88 of file pl_math.h.

Referenced by PLearn::ElementWiseDivisionRandomVariable::ElementWiseDivisionRandomVariable(), PLearn::fullyRebalance2Classes(), PLearn::RowMapSparseMatrix< real >::getMaxColumnIndex(), PLearn::FinancePreprocVMatrix::getNewRow(), PLearn::max(), PLearn::MinusRandomVariable::MinusRandomVariable(), PLearn::PlusRandomVariable::PlusRandomVariable(), PLearn::TMat< pair< real, real > >::resize(), PLearn::RGBImageVMatrix::RGBImageVMatrix(), PLearn::RGBImage::shrinkToIntersection(), PLearn::SequentialModelSelector::test(), PLearn::MovingAverage::test(), PLearn::EmbeddedSequentialLearner::test(), PLearn::SequentialModelSelector::train(), PLearn::MovingAverage::train(), and PLearn::LiftStatsCollector::update().

#define MAXTANHX   10.
 

Definition at line 138 of file pl_math.h.

Referenced by PLearn::fasttanh(), and PLearn::PLMathInitializer::PLMathInitializer().

#define MIN a,
 )     ((a)<(b)?(a):(b))
 

Deprecated, use std::min and std::max instead.

Definition at line 87 of file pl_math.h.

Referenced by PLearn::LiftStatsCollector::computeLiftMax(), PLearn::displayHistogram(), PLearn::eigenSparseNonSymmMat(), PLearn::eigenSparseSymmMat(), PLearn::LiftStatsIterator::finish(), PLearn::FinancePreprocVMatrix::getNewRow(), PLearn::VarArray::maxUpdate(), PLearn::min(), PLearn::RGBImageVMatrix::RGBImageVMatrix(), PLearn::RGBImageVMatrix::setImage(), and PLearn::RGBImage::shrinkToIntersection().

#define MINUS_LOG_THRESHOLD   -18.42
 

Definition at line 107 of file pl_math.h.

Referenced by PLearn::logadd(), and PLearn::logsub().

#define MISSING_VALUE   (plearn_nan.d)
 

Quiet NaN (float pattern).

Definition at line 75 of file pl_math.h.

Referenced by PLearn::argmax(), PLearn::argmin(), PLearn::SequentialLearner::build_(), PLearn::NeuralNet::build_(), PLearn::MovingAverageVMatrix::build_(), PLearn::CumVMatrix::build_(), PLearn::MultiInstanceNNet::computeCostsFromOutputs(), PLearn::KernelProjection::computeCostsFromOutputs(), PLearn::AddCostToLearner::computeCostsFromOutputs(), PLearn::MultiInstanceNNet::computeOutputAndCosts(), PLearn::SDBVMFieldDateDiff::convertField(), PLearn::date_to_float(), PLearn::datetime_to_double(), PLearn::dilogarithm(), PLearn::QuantilesStatsIterator::finish(), PLearn::StatsCollector::forget(), PLearn::SequentialLearner::forget(), PLearn::GenerateDecisionPlot::GenerateDecisionPlot(), PLearn::AutoSDBVMatrix::getMappings(), PLearn::MovingAverageVMatrix::getNewRow(), PLearn::DatedJoinVMatrix::getNewRow(), PLearn::AutoSDBVMatrix::getNewRow(), PLearn::VecStatsCollector::getStat(), PLearn::VMatrix::getStringVal(), PLearn::harmonic_mean(), PLearn::inverse_softplus(), PLearn::loadAscii(), PLearn::loadSTATLOG(), PLearn::loadUCIMLDB(), PLearn::matlabSave(), PLearn::mean(), PLearn::new_read_compressed(), PLearn::paired_t_test(), PLearn::pl_isnumber(), PLearn::RealMapping::read(), PLearn::PStream::readAsciiNum(), PLearn::RealMapping::RealMapping(), PLearn::VMatLanguage::run(), PLearn::SDBVMFieldDateDiff::SDBVMFieldDateDiff(), PLearn::SequentialModelSelector::sequenceCost(), PLearn::SDBVMOutputCoder::setOutput(), PLearn::StatsCollector::StatsCollector(), PLearn::sum(), PLearn::SequentialModelSelector::test(), PLearn::todouble(), PLearn::RowIterator::toDouble(), PLearn::FieldValue::toDouble(), and PLearn::weighted_mean().

#define Pi   3.141592653589793
 

Definition at line 103 of file pl_math.h.

 
#define random  )     rand()
 

Definition at line 101 of file pl_math.h.

#define REAL_MAX   DBL_MAX
 

Definition at line 68 of file pl_math.h.

Referenced by PLearn::GaussianContinuum::build_(), PLearn::AddCostToLearner::build_(), PLearn::ConcatRowsVMatrix::ensureMappingsConsistency(), PLearn::GeodesicDistanceKernel::evaluate(), PLearn::KernelProjection::KernelProjection(), and PLearn::GeodesicDistanceKernel::setDataForKernelMatrix().

#define SIGN  )     ((a)>=0?1:-1)
 

Definition at line 90 of file pl_math.h.

#define TANHTABLESIZE   5000
 

Definition at line 137 of file pl_math.h.

Referenced by PLearn::fasttanh(), and PLearn::PLMathInitializer::PLMathInitializer().


Generated on Tue Aug 17 16:17:52 2004 for PLearn by doxygen 1.3.7