MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
doubleEq.cpp File Reference
#include <math.h>
+ Include dependency graph for doubleEq.cpp:

Go to the source code of this file.

Macros

#define EPS1   1e-6
 
#define EPS2   1e-12
 
#define EPS3   1e-3
 

Functions

bool doubleApprox (double x, double y)
 
bool doubleEq (double x, double y)
 

Macro Definition Documentation

#define EPS1   1e-6

Definition at line 10 of file doubleEq.cpp.

Referenced by doubleApprox(), and doubleEq().

#define EPS2   1e-12

Definition at line 11 of file doubleEq.cpp.

Referenced by doubleEq().

#define EPS3   1e-3

Definition at line 12 of file doubleEq.cpp.

Referenced by doubleApprox().

Function Documentation

bool doubleApprox ( double  x,
double  y 
)

Definition at line 24 of file doubleEq.cpp.

References EPS1, and EPS3.

Referenced by CubeMesh::compareMeshSpacing(), Vec::orthogonalAxes(), Interpol2D::setXmax(), Interpol2D::setXmin(), Interpol2D::setYmax(), Interpol2D::setYmin(), testMMenzProcess(), and testStats().

25 {
26  double denom = fabs( x ) + fabs( y );
27  if ( denom < EPS1 )
28  denom = EPS1;
29  return ( fabs( x - y ) / denom ) < EPS3;
30 }
#define EPS3
Definition: doubleEq.cpp:12
#define EPS1
Definition: doubleEq.cpp:10

+ Here is the caller graph for this function:

bool doubleEq ( double  x,
double  y 
)

Definition at line 16 of file doubleEq.cpp.

Referenced by Dsolve::build(), checkOutput(), coordSystem(), doPartialPivot(), NeuroMesh::insertSingleDummy(), Interpol2D::Interpol2D(), VectorTable::lookupByValue(), matInv(), SynChan::normalizeGbar(), Vec::operator==(), FastMatrixElim::operator==(), Vec::orthogonalAxes(), Neuron::scaleBufAndRates(), HHChannelBase::selectPower(), Stoich::setCompartment(), CubeMesh::setDiffScale(), Interpol2D::setDx(), Interpol2D::setDy(), HHChannel2D::setGatePower(), HHChannel::setGatePower(), moose::CompartmentBase::setGeomAndElec(), moose::CompartmentBase::setLength(), StimulusTable::setStopTime(), Interpol2D::setSy(), SynChan::setTau2(), test2ArgSetVec(), testCalcJunction(), testCellDiffn(), testClock(), testConvVectorOfVectors(), testCopyFieldElement(), testCopyMsgOps(), testCreateMsg(), testCubeMesh(), testCylDiffn(), testCylDiffnWithStoich(), testFuncTerm(), testGet(), testGetMsg(), testHopFunc(), testLookupSetGet(), testMMenz(), testMpiFibonacci(), testMsgField(), testObjIdToAndFromPath(), testPoolVolumeScaling(), testReacVolumeScaling(), ReadCspace::testReadModel(), testReMesh(), testSendMsg(), testSendSpike(), testSetDiffusionAndTransport(), testSetGet(), testSetGetDouble(), testSetGetExtField(), testSetGetSynapse(), testSetRepeat(), testShellAddMsg(), testShellSetGet(), testSmallCellDiffn(), testTable(), testTaperingCylDiffn(), testUtilsForCompareXplot(), testUtilsForLoadXplot(), testVec(), testVolScaling(), CylMesh::updateCoords(), MarkovRateTable::updateRates(), and SynChan::vReinit().

17 {
18  double denom = fabs( x ) + fabs( y );
19  if ( denom < EPS2 )
20  denom = EPS1;
21  return ( fabs( x - y ) / denom ) < EPS1;
22 }
#define EPS1
Definition: doubleEq.cpp:10
#define EPS2
Definition: doubleEq.cpp:11