Expression Class Reference
[Mathematical algorithms]

#include <Expression.hpp>

List of all members.

Public Member Functions

 Expression (void)
 Empty constructor.
 Expression (const std::string &str)
 Constructor.
 Expression (const Expression &rhs)
 Copy constructor.
 ~Expression (void)
 Destructor.
Expressionoperator= (const Expression &rhs)
 Assignment operator.
bool set (const std::string name, double value)
 Sets a variable in the expression to the input value.
bool set (const char *name, double value)
 Sets a variable in the expression to the input value.
bool setGPSConstants (void)
 Sets multiple variables in the expression to constants associated with GPS.
bool setRinexObs (const RinexObsData::RinexObsTypeMap &rotm)
 Sets multiple variables in the expression using values stored in a RinexObsType stucture.
bool setSvObsEpoch (const SvObsEpoch &soe)
 Sets multiple variables in the expression using values stored in a RinexObsType stucture.
bool canEvaluate (void)
 Checks in advance if all variables have been set.
double evaluate (void) throw (ExpressionException)
 Returns the numerical value of the expression.
void print (std::ostream &ostr) const
 Writes the expression out to a stream.


Constructor & Destructor Documentation

Expression void   ) 
 

Empty constructor.

Definition at line 168 of file Expression.cpp.

Expression const std::string &  str  ) 
 

Constructor.

Parameters:
str Expression to be evaluated.

Definition at line 154 of file Expression.cpp.

Expression const Expression rhs  ) 
 

Copy constructor.

Parameters:
expr Expression to be copied. Note that variable values are not copied.

Definition at line 175 of file Expression.cpp.

References Expression::print().

~Expression void   ) 
 

Destructor.

Definition at line 252 of file Expression.cpp.


Member Function Documentation

bool canEvaluate void   ) 
 

Checks in advance if all variables have been set.

Returns:
True if all variables are set.

Definition at line 553 of file Expression.cpp.

double evaluate void   )  throw (ExpressionException) [inline]
 

Returns the numerical value of the expression.

Note that if the expression contains variables, those variables must be set.

Definition at line 176 of file Expression.hpp.

Referenced by main().

Expression & operator= const Expression rhs  ) 
 

Assignment operator.

Definition at line 183 of file Expression.cpp.

References Expression::print().

void print std::ostream &  ostr  )  const [inline]
 

Writes the expression out to a stream.

Definition at line 182 of file Expression.hpp.

Referenced by Expression::Expression(), main(), and Expression::operator=().

bool set const char *  name,
double  value
[inline]
 

Sets a variable in the expression to the input value.

All instances of the variable are set to this value. This is required before an expression can be evaluated, if the expression contains variables. In the search, case is not important (e.g., "c" and "C" would be a match).

Parameters:
name Name of the variable to set
value Value to set the variable to.
Returns:
True if the variable was found.

Definition at line 134 of file Expression.hpp.

bool set const std::string  name,
double  value
 

Sets a variable in the expression to the input value.

All instances of the variable are set to this value. This is required before an expression can be evaluated, if the expression contains variables.

Parameters:
name Name of the variable to set
value Value to set the variable to.
Returns:
True if the variable was found.

Definition at line 526 of file Expression.cpp.

References gpstk::StringUtils::upperCase().

Referenced by main(), Expression::setGPSConstants(), Expression::setRinexObs(), and Expression::setSvObsEpoch().

bool setGPSConstants void   ) 
 

Sets multiple variables in the expression to constants associated with GPS.

Predefined variables include: PI; C (meters per second); L1 and L2, carrier frequencies in cycles per second; WL1 and WL2, carrier wavelengths. As with other variables, the case is insensitive.

Returns:
True if any GPS related constants were found

Definition at line 574 of file Expression.cpp.

References gpstk::C_MPS, gpstk::L1_FREQ_GPS, gpstk::L1_MULT_GPS, gpstk::L2_FREQ_GPS, gpstk::L2_MULT_GPS, gpstk::OSC_FREQ_GPS, gpstk::PI, and Expression::set().

Referenced by main().

bool setRinexObs const RinexObsData::RinexObsTypeMap rotm  ) 
 

Sets multiple variables in the expression using values stored in a RinexObsType stucture.

This structure is nested within the RinexObsData class.

Parameters:
rotm Map of RinexObsType to RinexObsDatum
Returns:
True if an obs variable was found.

Definition at line 592 of file Expression.cpp.

References Expression::set().

Referenced by main().

bool setSvObsEpoch const SvObsEpoch soe  ) 
 

Sets multiple variables in the expression using values stored in a RinexObsType stucture.

This structure is nested within the RinexObsData class.

Parameters:
rotm Map of RinexObsType to RinexObsDatum
Returns:
True if an obs variable was found.

Definition at line 606 of file Expression.cpp.

References Expression::set().


The documentation for this class was generated from the following files:
Generated on Sun May 19 03:31:48 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1