#include <Number.h>
Inheritance diagram for Number:
Public Member Functions | |
Number () | |
Default constructor:. | |
Number (double value, bool isApproximate=false) | |
Constructor for a scaler precise or approximate value:. | |
Number (const char *value) | |
Number (const std::string &value) | |
Number (const Number *) | |
bool | isMissing (void) const |
void | setMissing (void) |
void | set (const std::string &value) |
void | set (const char *value) |
const std::string | get (void) const |
void | set (double value) |
bool | isApproximate (void) const |
Number | operator+ (const Number &b) const |
Number & | operator+= (const Number &b) |
Number & | operator++ () |
Number | operator++ (int) |
Number | operator- (const Number &b) const |
Number & | operator-= (const Number &b) |
Number & | operator-- () |
Number | operator-- (int) |
Number | operator * (const Number &b) const |
Number & | operator *= (const Number &b) |
Number | operator/ (const Number &b) const |
Number & | operator/= (const Number &b) |
Number | getSin () const |
Number | getCos () const |
Number | getTan () const |
Number | getAsin () const |
Number | getAcos () const |
Number | getAtan () const |
Number | getSinh () const |
Number | getCosh () const |
Number | getTanh () const |
Number | getFloor () const |
Number | getCeiling () const |
Number | getRound () const |
Number | getExponent () const |
Number | getSquareRoot () const |
Number | getPower (const Number &b) const |
Number | getAbsoluteValue () const |
Number | getInverse () const |
Number | getLog10 () const |
Number | getLog () const |
Number | getLod () const |
Number | haldaneToTheta () const |
Number | thetaToHaldane () const |
Number | kosambiToTheta () const |
Number | thetaToKosambi () const |
bool | operator== (const Data &b) const |
bool | operator< (const Data &b) const |
bool | operator<= (const Number &b) const |
bool | operator>= (const Number &b) const |
bool | operator!= (const Number &b) const |
bool | operator> (const Number &b) const |
const DATATYPE | getDataType (void) const |
virtual Number * | clone () const |
Static Public Member Functions | |
static void | addNumberMissingValue (std::string value) |
static bool | isMissingValue (std::string value) |
static void | displayRangeMeans (bool) |
static bool | isA (const std::string &s) |
Static Public Attributes | |
static const double | PI = M_PI |
Value of PI. | |
static const double | PI_OVER_TWO = M_PI_2 |
Value of PI/2. | |
static const double | THREE_PI_OVER_TWO = M_PI+M_PI_2 |
Value of 3*PI/2:. | |
static const double | TWO_PI = M_PI*2.0 |
Value of 2*PI:. | |
static const double | E = M_E |
Value of E. | |
static const double | NEGATIVE_PI_OVER_TWO = -1*M_PI/2 |
Value of -PI/2:. | |
static const double | NEGATIVE_THREE_PI_OVER_TWO = -3*M_PI/2 |
Value of -3PI/2:. | |
static const double | SQRT_TWO = M_SQRT2 |
static const Number | MISSING |
static const double | MINIMUM_DIFFERENCE = 3E-8 |
Private Member Functions | |
void | _checkSwapLowAndHighValue (void) |
double | _min (double a, double b, double c, double d) const |
double | _max (double a, double b, double c, double d) const |
double | _sin (double v) const |
double | _haldane_cM_To_Theta (double) const |
double | _theta_To_Haldane_cM (double) const |
double | _kosambi_cM_To_Theta (double) const |
double | _theta_To_Kosambi_cM (double) const |
double | _lod (double) const |
bool | _differByLessThanMinimum (const Number &b) const |
bool | _intersectionIsNotNull (const Number &test) const |
Private Attributes | |
bool | _isMissing |
double | _value |
double | _highEndValue |
bool | _isApproximate |
bool | _isRange |
Static Private Attributes | |
static std::set< std::string > | _numberMissingValue |
static bool | _displayRangeMeans = false |
Friends | |
class | Date |
The Number class handles exact numeric values, approximate numeric values, and missing numeric values. Approximate numeric values can be of two types: numeric ranges and approximate unranged numeric values. Of these, numeric ranges are preferred because they provide inclusive lower and upper bounds on a measurement. (For example, it is more informative if we can say that a patient's fasting blood glucose level is "80-87" g/dl than if we merely say it is "approximately" "~85").
Note that the constructor handles non-ASCII digits seamlessly: See the DigitConverter class for details.
Unranged approximate values are indicated by a "~" prefix. Ranged values are indicated by a dash "-", "r", "R" or arrow separating the inclusive lower and upper bounds.
In addition to standard mathematical and trigonometric methods, some methods useful in linkage analysis, such as obtaining the LOD score from a p-value or converting haldane centiMorgans to a recombination fraction are also provided.
|
Default constructor:.
|
|
Constructor for a scaler precise or approximate value:.
|
|
|
|
|
|
Copy construct a number from a const pointer to a number: |
|
_checkSwapLowAndHighValue(): Only call on ranges where there is a possibility of the low value > high value as the result of a mathematical operation: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clone(): virtual copy constructor: Implements Data. |
|
|
|
get(): return a std::string Implements Data. |
|
abs(): returns the absolute value of a Number |
|
acos(): Arc cosine |
|
asin(): Arc sine |
|
atan(): Arc tangent |
|
getCeiling(): returns the ceiling of a Number |
|
|
cosh(): Hyperbolic cosine |
|
Implements Data. |
|
|
getFloor(): returns the floor of a Number |
|
inv(): returns the inverse of a Number |
|
Lod(): returns a p-value's equivalent LOD score. |
|
log(): natural logarithm (base e) |
|
log10(): logarithm base 10 |
|
|
getRound(): rounds a Number |
|
sin(): |
|
sinh(): Hyperbolic sine |
|
|
|
tanh(): Hyperbolic tangent |
|
Converts a Haldane genetic distance in centiMorgans to a recombination fraction. |
|
isA(): This is a static method: Determines whether an input string fits the pattern for a Number. |
|
|
|
Implements Data. |
|
isMissingValue() determines whether an input string is present in the missing value lookup table and should therefore be treated as a missing value. |
|
kosambiToTheta(): converts Kosambi genetic distance in cM to recombination fraction. |
|
|
|
operator != |
|
|
Postfix ++ |
|
Prefix ++ |
|
|
|
Postfix -- |
|
Prefix -- |
|
|
|
|
operator < NOTA BENE: This is used for SORTING ONLY Implements Data. |
|
operator <= |
|
operator == Implements Data. |
|
operator > |
|
operator >= |
|
set() from double: |
|
set() from const char *: This method accepts : (1) An ordinary number string (2) An approximate number string indicated by using "~" as a prefix. (3) A range string following the pattern shown below: Pattern: " ~ [ + 123.456e+2 - + 123.589e+2 ]" " - E- r - E- " Implements Data. |
|
set() from std::string: Implements Data. |
|
setMissing(): set a Number to missing. Implements Data. |
|
thetaToHaldane(): converts recombination fraction to Haldane distance in cM. |
|
thetaToKosambi(): converts a recombination fraction to Kosambi genetic distance in cM. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Value of E.
|
|
|
|
|
|
Value of -PI/2:.
|
|
Value of -3PI/2:.
|
|
Value of PI.
|
|
Value of PI/2.
|
|
|
|
Value of 3*PI/2:.
|
|
Value of 2*PI:.
|