Expression.cpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
45 #include <sstream>
46 #include <map>
47 #include <list>
48 #include <vector>
49 #include <string>
50 #include <ctype.h>
51 #include <math.h>
52 
53 #include "GNSSconstants.hpp"
54 #include "StringUtils.hpp"
55 #include "Expression.hpp"
56 
57 namespace gnsstk
58 {
59 
61  {
62 
63  // To get the value, compute the value of the left and
64  // right operands, and combine them with the operator.
65  double leftVal = left->getValue();
66  double rightVal = right->getValue();
67 
68  if (op=="+") return leftVal + rightVal;
69  if (op=="-") return leftVal - rightVal;
70  if (op=="*") return leftVal * rightVal;
71  if (op=="/") return leftVal / rightVal;
72 
73  // else THROW exception
74  GNSSTK_THROW(ExpressionException());
75 
76  }
77 
79  {
80  // To get the value, compute the value of the right first
81  double rightVal = right->getValue();
82 
83  if (op=="cos") return ::cos(rightVal);
84  if (op=="sin") return ::sin(rightVal);
85  if (op=="tan") return ::tan(rightVal);
86  if (op=="acos") return ::acos(rightVal);
87  if (op=="asin") return ::asin(rightVal);
88  if (op=="atan") return ::atan(rightVal);
89  if (op=="exp") return ::exp(rightVal);
90  if (op=="abs") return ::fabs(rightVal);
91  if (op=="sqrt") return ::sqrt(rightVal);
92  if (op=="log") return ::log(rightVal);
93  if (op=="log10") return ::log10(rightVal);
94 
95  // else THROW exception
96  GNSSTK_THROW(ExpressionException());
97  }
98 
99  std::ostream& Expression::FuncOpNode::print(std::ostream& ostr) {
100  ostr << op;
101  right->print(ostr);
102 
103  return ostr;
104  }
105 
106  std::ostream& Expression::BinOpNode::print(std::ostream& ostr) {
107  ostr << "(";
108  left->print(ostr);
109  ostr << op;
110  right->print(ostr);
111  ostr << ")";
112 
113  return ostr;
114  }
115 
116  void Expression::VarNode::setValue(double newValue)
117  {
118  value=newValue;
119  hasValue=true;
120  };
121 
123  {
124  if (!hasValue)
125  {
126  ExpressionException ee("Variable " + name + " undefined.");
127  GNSSTK_THROW(ee);
128  }
129 
130  return value;
131  }
132  Expression::Token::Token(std::string iValue, int iPriority,
133  bool isOp=false)
134  :
135  value(iValue), isOperator(isOp), resolved(false), priority(iPriority),
136  expNode(0), used(false)
137  { }
138  void Expression::Token::print(std::ostream& ostr)
139  {
140  ostr <<" Value '" << value;
141  ostr << "', operation priority " << priority << ", ";
142 
143  if (isOperator) ostr << "operator";
144  else ostr << "not operator";
145 
146  ostr << ", ";
147 
148  if (used) ostr << "used,";
149  else ostr << "not used,";
150 
151  if (resolved) ostr << "resolved";
152  else ostr << "not resolved ";
153 
154  return;
155  }
156 
157  bool Expression::operatorsDefined = false;
158  std::map<std::string,int> Expression::operatorMap;
159  std::map<std::string,std::string> Expression::argumentPatternMap;
160 
161  Expression::Expression(const std::string& istr)
162  : root(0)
163  {
164  defineOperators();
165  setExpression(istr);
166  }
167 
168  void Expression::setExpression(const std::string& istr)
169  {
170  dumpLists();
171  tokenize(istr);
173  }
174 
176  : root(0)
177  {
178  defineOperators();
179  setExpression("0");
180  }
181 
183  {
184  defineOperators();
185  std::ostringstream ostr;
186  rhs.print(ostr);
187  setExpression(ostr.str());
188  }
189 
191  {
192  std::ostringstream ostr;
193  rhs.print(ostr);
194  setExpression(ostr.str());
195  return (*this);
196  }
197 
199  {
200  // first release the points tracked by this Expression
201  std::list<ExpNode *>::iterator i= eList.begin(), itemp;
202  while (i!= eList.end())
203  {
204  itemp=i;
205  itemp++;
206  delete(*i);
207  i=itemp;
208  }
209  std::list<ExpNode *> emptyENodeList;
210  eList = emptyENodeList;
211  std::list<Token> emptyTokenList;
212  tList = emptyTokenList;
213  root =0;
214  }
215 
216 
218  {
219  if (!operatorsDefined)
220  {
221  operatorMap["+"]=1;
222  operatorMap["-"]=1;
223  operatorMap["*"]=2;
224  operatorMap["/"]=2;
225  operatorMap["^"]=3;
226  operatorMap["cos"]=4;
227  operatorMap["sin"]=4;
228  operatorMap["tan"]=4;
229  operatorMap["acos"]=4;
230  operatorMap["asin"]=4;
231  operatorMap["atan"]=4;
232  operatorMap["exp"]=4;
233  operatorMap["abs"]=4;
234  operatorMap["sqrt"]=4;
235  operatorMap["log"]=4;
236  operatorMap["log10"]=4;
237 
238  argumentPatternMap["+"]="RL";
239  argumentPatternMap["-"]="RL";
240  argumentPatternMap["*"]="RL";
241  argumentPatternMap["/"]="RL";
242  argumentPatternMap["^"]="RL";
243  argumentPatternMap["cos"]="R";
244  argumentPatternMap["sin"]="R";
245  argumentPatternMap["tan"]="R";
246  argumentPatternMap["acos"]="R";
247  argumentPatternMap["asin"]="R";
248  argumentPatternMap["atan"]="R";
249  argumentPatternMap["exp"]="R";
250  argumentPatternMap["abs"]="R";
251  argumentPatternMap["sqrt"]="R";
252  argumentPatternMap["log"]="R";
253  argumentPatternMap["log10"]="R";
254 
255  operatorsDefined = true;
256  }
257  }
258 
260  {
261  std::list<ExpNode *>::iterator i;
262  for (i=eList.begin(); i!=eList.end(); i++)
263  delete (*i);
264  }
265 
266  void Expression::tokenize(const std::string& istr)
267  {
268  using namespace std;
269 
270  // Remove spaces and parenthesis from the input string
271  // Must store informatin from parenthesis in another list
272  stringstream ss(istr);
273  string str;
274  char tempc;
275  vector<int> baseOrder;
276  int currentOrder = 0;
277 
278  while (ss >> skipws >> tempc)
279  {
280  bool strip=false;
281 
282  if (tempc == '(')
283  {
284  currentOrder+=10;
285  strip=true;
286  }
287 
288  if (tempc == ')')
289  {
290  currentOrder-=10;
291  strip=true;
292  }
293 
294  if (!strip)
295  {
296  baseOrder.push_back(currentOrder);
297  str.append(&tempc,1);
298  }
299  }
300 
301  map<string, int>::iterator it;
302  list<int> breaks;
303  breaks.push_back(0);
304 
305  // Break the expression into candidates for tokens. First known
306  // operators and functions
307  // are found and marked with as a "break" in the the string.
308  // Note the location and compute the order of operation of each.
309  // key is location in string. value is ord. of op.
310  map<int,int> breakPriority;
311 
312  // Note when the breaks are due to an operator or to an operand.
313  // Each break can become a token but not all othem do.
314  // Key is location in the string, value is boolean, true for operators and functions.
315  map<int, bool> breakType;
316 
317  for (it=operatorMap.begin(); it!=operatorMap.end(); it++)
318  {
319  std::string::size_type position = 0;
320  while ((position=str.find(it->first,position+1))!=string::npos)
321  {
322  // Account for scientific notation
323  bool sciNotation=false;
324  if ((it->first=="+") || (it->first=="-"))
325  {
326  sciNotation =
327  ( ( (str.substr(position-1,1)=="E") ||
328  (str.substr(position-1,1)=="e") ) &&
329  (isdigit(str.substr(position-2,1).c_str()[0])) &&
330  (isdigit(str.substr(position+1,1).c_str()[0])) );
331  }
332 
333  if (!sciNotation)
334  {
335  breaks.push_back(position);
336  breakPriority[position] = it->second + baseOrder[position];
337  breakType[position] = true;
338 
339  int operandPos = position+(it->first.size());
340  breaks.push_back(operandPos);
341  breakPriority[operandPos] = baseOrder[operandPos];
342  breakType[operandPos] = false;
343  }
344  }
345 
346  }
347  breaks.push_back(str.size());
348 
349  // Sort the breaks into a list
350  // Please note that sorting a linked list is expensive compared to
351  // sorting a vector or map, as the search cost is high (lists are not sorted).
352  // This should be revisited IF large expressions are handled by the GNSSTk.
353  breaks.sort();
354 
355  list<string> tokens;
356  list<int>::iterator ls = breaks.begin(), rs = ls; // used to identify token string
357 
358  for (rs++ ;rs!=breaks.end(); rs++, ls++)
359  {
360  if (*rs!=*ls) // If not two operators in a row
361  {
362  string thisToken = str.substr(*ls,(*rs)-(*ls));
363  int thisOop = breakPriority[*ls];
364  bool isOp = breakType[*ls];
365 
366  // Create the token
367  Token tok(thisToken,thisOop, isOp);
368 
369  if ( tok.getOperator() )
370  tok.setArgumentPattern( argumentPatternMap[thisToken] );
371 
372  // Create an expression node, save it, and link it to the token
373  ExpNode *expNode;
374 
375 
376  if (!isOp)
377  {
378  char testChar = thisToken.c_str()[0];
379  if (isalpha(testChar))
380  expNode = new VarNode(thisToken);
381  else
382  expNode = new ConstNode(StringUtils::asDouble(thisToken));
383  eList.push_back(expNode);
384  tok.setNode(expNode);
385  tok.setResolved(true);
386  }
387 
388  // Now that the token has the best possible state, save it
389  tList.push_back(tok);
390  }
391  }
392  } // end tokenize function
393 
394 
396  {
397  using namespace std;
398 
399  list<Token>::iterator itt;
400 
401  // How many have already been processed? Are we done yet?
402  int totalResolved=0;
403  for (itt = tList.begin(); itt!=tList.end(); itt++)
404  {
405  if (itt->getResolved()) totalResolved++;
406  }
407  return totalResolved;
408  }
409 
410 
412  {
413  using namespace std;
414 
415  list<Token>::iterator itt, targetToken;
416 
417  if ((tList.size()==1)&&(tList.begin()->getResolved()))
418  {
419  root = tList.begin()->getNode();
420  return;
421  }
422 
423  size_t totalResolved = countResolvedTokens();
424 
425  while (totalResolved<tList.size())
426  {
427 
428  //
429  // Step through tokens to find the value for the highest priority
430  // that doesn not yet have an expression node ExpNode assigned to it.
431  // A subtle but important sideeffect of this traversal is taht
432  // operators with the same priority get evaluated from right to
433  // left.
434  itt=tList.begin();
435  int highestP = -1;
436 
437  for (itt = tList.begin(); itt !=tList.end(); itt++)
438  {
439  if ( itt->getOperator() && !itt->getResolved() )
440  {
441  if (itt->getPriority()>highestP)
442  {
443  targetToken = itt;
444  highestP=itt->getPriority();
445  }
446  }
447  }
448 
449  if ( targetToken->getOperator() )
450  {
451  // Find the arg(s) for this operator.
452  list<Token>::iterator leftArg=targetToken, rightArg=leftArg;
453 
454  stringstream argstr(targetToken->getArgumentPattern());
455  char thisArg;
456  bool searching;
457 
458  while (argstr >> thisArg)
459  {
460  switch (thisArg) {
461  case 'R':
462  searching = true;
463 
464  while (searching)
465  {
466  if (rightArg==tList.end())// TODO throw exception
467  cout << "Mistake, no right arg for " << targetToken->getValue() << endl;
468  else
469  rightArg++;
470 
471  searching = (rightArg->getUsed());
472  }
473 
474  break;
475 
476  case 'L':
477 
478  // Resolve left arg
479  searching=true;
480 
481  while (searching)
482  {
483  if (leftArg == tList.begin()) // TODO throw
484  cout << "Mistake - no right argument for operator?!" << endl;
485  else
486  leftArg--;
487 
488  searching = (leftArg->getUsed());
489  }
490 
491  break;
492  } // end of argumentPattern cases
493  } // done processing argument list
494 
495 
496  if (targetToken->getArgumentPattern()=="RL")
497  {
498  ExpNode *opNode =
499  new BinOpNode(targetToken->getValue(),leftArg->getNode(), rightArg->getNode());
500  targetToken->setNode(opNode);
501  eList.push_back(opNode);
502 
503  targetToken->setResolved(true);
504  root = targetToken->getNode();
505 
506  leftArg->setUsed();
507  rightArg->setUsed();
508  }
509 
510  if (targetToken->getArgumentPattern()=="R")
511  {
512  ExpNode *opNode =
513  new FuncOpNode(targetToken->getValue(),rightArg->getNode());
514  targetToken->setNode(opNode);
515 
516  eList.push_back(opNode);
517 
518  targetToken->setResolved(true);
519  root = targetToken->getNode();
520 
521  rightArg->setUsed();
522  }
523 
524  } // If this is an operator
525 
526  // Are we done yet?
527  totalResolved = countResolvedTokens();
528  }
529 
530  } // end buildExpressionTree
531 
532 
533  bool Expression::set(const std::string name, double value)
534  {
535  using namespace std;
536 
537  bool gotSet;
538 
539  std::list<ExpNode *>::iterator i;
540  int t;
541 
542  for (t=0, i=eList.begin(); i!=eList.end(); t++, i++)
543  {
544  VarNode *vnode = dynamic_cast<VarNode *> (*i);
545  if (vnode!=0)
546  {
547  if (StringUtils::upperCase(vnode->name) ==
549  {
550  vnode->setValue(value);
551  gotSet = true;
552  }
553  }
554  }
555 
556  return gotSet;
557  }
558 
559 
561  {
562  using namespace std;
563 
564  bool areSet=true;
565 
566  std::list<ExpNode *>::iterator i;
567  int t;
568 
569  for (t=0, i=eList.begin(); i!=eList.end(); t++, i++)
570  {
571  VarNode *vnode = dynamic_cast<VarNode *> (*i);
572  if (vnode!=0)
573  {
574  areSet &= vnode->hasValue;
575  }
576  }
577 
578  return areSet;
579  }
580 
582  {
583  bool gotSet = false;
584 
585  gotSet |= set("gamma",(L1_FREQ_GPS / L2_FREQ_GPS)*(L1_FREQ_GPS / L2_FREQ_GPS));
586  gotSet |= set("pi",PI);
587  gotSet |= set("c",C_MPS);
588  gotSet |= set("c_gps_m",C_MPS);
589  gotSet |= set("l0",OSC_FREQ_GPS);
590  gotSet |= set("f1",L1_MULT_GPS);
591  gotSet |= set("f2",L2_MULT_GPS);
592  gotSet |= set("l1",L1_FREQ_GPS);
593  gotSet |= set("l2",L2_FREQ_GPS);
594  gotSet |= set("wl1",C_MPS/L1_FREQ_GPS);
595  gotSet |= set("wl2",C_MPS/L2_FREQ_GPS);
596  return gotSet;
597  }
598 
600  {
601  bool gotSet = false;
602 
603  RinexObsData::RinexObsTypeMap::const_iterator i;
604  for (i=rotm.begin(); i!=rotm.end(); i++)
605  gotSet |= set(i->first.type, i->second.data);
606 
607  return gotSet;
608  }
609 
610  // We use the rinex 3 type identifiers for this since the rinex 2 will leave
611  // things ambigous. This is in contrast to the setRinexObs() method which
612  // uses the rinex 2 type identifiers.
614  {
615  bool gotSet = false;
616  for (SvObsEpoch::const_iterator i=soe.begin(); i != soe.end(); i++)
617  {
618 
619  // Note that there are some combinations of the following that are not
620  // 'valid'. Well, they aren't defined in the RINEX 3 spec
621  // Also, this needs to be moved to another file once we have
622  // rinex 3 support in the src directory.
623  std::string type, band, attribute;
624  bool ignore=false;
625  switch (i->first.type)
626  {
627  case ObservationType::Range: type = "C"; break;
628  case ObservationType::Phase: type = "L"; break;
629  case ObservationType::Doppler: type = "D"; break;
630  case ObservationType::SNR: type = "S"; break;
631  case ObservationType::SSI: ignore = true; break;
632  case ObservationType::LLI: ignore = true; break;
633  case ObservationType::TrackLen: ignore = true; break;
634  default: break; //NB Determine if additional enumeration values need to be handled
635  }
636 
637  switch (i->first.band)
638  {
639  case CarrierBand::L1: band = "1"; break;
640  case CarrierBand::L2: band = "2"; break;
641  case CarrierBand::L5: band = "5"; break;
642  case CarrierBand::E6: band = "6"; break;
643  case CarrierBand::E5b: band = "7"; break;
644  case CarrierBand::E5ab: band = "8"; break;
645  default: break; //NB Determine if additional enumeration values need to be handled
646  }
647 
648  switch (i->first.code)
649  {
650  case TrackingCode::CA: attribute = "C"; break;
651  case TrackingCode::P: attribute = "P"; break;
652  case TrackingCode::Y: attribute = "Y"; break;
653  case TrackingCode::Ztracking: attribute = "W"; break;
654  case TrackingCode::YCodeless: attribute = "N"; break;
655  case TrackingCode::MDP: attribute = "M"; break;
656  case TrackingCode::L2CM: attribute = "S"; break;
657  case TrackingCode::L2CL: attribute = "L"; break;
658  case TrackingCode::L2CML: attribute = "X"; break;
659  case TrackingCode::L5I: attribute = "I"; break;
660  case TrackingCode::L5Q: attribute = "Q"; break;
661  case TrackingCode::L5IQ: attribute = "X"; break;
662  case TrackingCode::E1A: attribute = "A"; break;
663  case TrackingCode::E1B: attribute = "B"; break;
664  case TrackingCode::E1C: attribute = "C"; break;
665  case TrackingCode::E1BC: attribute = "X"; break;
666  case TrackingCode::E1ABC: attribute = "Z"; break;
667  default: break; //NB Determine if additional enumeration values need to be handled
668  }
669  if (ignore)
670  continue;
671 
672  std::string id = type + band + attribute;
673 
674  if (id.length() != 3)
675  std::cout << "Unimplimented ObsID:" << i->first << std::endl;
676 
677  gotSet |= set(id, i->second);
678  }
679  return gotSet;
680  }
681 
682 } // end namespace gnsstk
gnsstk::Expression::VarNode
Definition: Expression.hpp:222
gnsstk::Expression::VarNode::hasValue
bool hasValue
Definition: Expression.hpp:240
gnsstk::StringUtils::upperCase
std::string & upperCase(std::string &s)
Definition: StringUtils.hpp:2117
gnsstk::Expression::tokenize
void tokenize(const std::string &str)
Definition: Expression.cpp:266
gnsstk::ObservationType::TrackLen
@ TrackLen
Number of continuous epochs of 'good' tracking.
gnsstk::Expression::BinOpNode
Definition: Expression.hpp:251
gnsstk::TrackingCode::L5IQ
@ L5IQ
Modernized GPS L5 civil I+Q combined tracking.
gnsstk::TrackingCode::YCodeless
@ YCodeless
Encrypted legacy GPS precise code, squaring codeless tracking.
gnsstk::Expression::set
bool set(const std::string name, double value)
Definition: Expression.cpp:533
gnsstk::Expression::~Expression
~Expression(void)
Destructor.
Definition: Expression.cpp:259
gnsstk::Expression::setExpression
void setExpression(const std::string &newExpression)
Definition: Expression.cpp:168
gnsstk::Expression::root
ExpNode * root
Definition: Expression.hpp:349
gnsstk::TrackingCode::L5Q
@ L5Q
Modernized GPS L5 civil quadrature.
gnsstk::Expression::FuncOpNode::getValue
double getValue()
Definition: Expression.cpp:78
gnsstk::TrackingCode::E1A
@ E1A
Galileo L1 PRS code.
gnsstk::TrackingCode::L2CL
@ L2CL
Modernized GPS L2 civil L code.
StringUtils.hpp
gnsstk::TrackingCode::E1B
@ E1B
Galileo E1-B signal, supporting OS/HAS/SoL.
gnsstk::CarrierBand::E5b
@ E5b
Galileo E5b.
gnsstk::ObservationType::Phase
@ Phase
accumulated phase, in cycles
gnsstk::Expression::countResolvedTokens
int countResolvedTokens(void)
Definition: Expression.cpp:395
gnsstk::L1_FREQ_GPS
const double L1_FREQ_GPS
GPS L1 carrier frequency in Hz.
Definition: DeprecatedConsts.hpp:51
gnsstk::TrackingCode::Y
@ Y
Encrypted legacy GPS precise code.
gnsstk::ObservationType::LLI
@ LLI
Loss of Lock Indicator (RINEX)
gnsstk::TrackingCode::L5I
@ L5I
Modernized GPS L5 civil in-phase.
gnsstk::Expression::BinOpNode::getValue
double getValue()
Definition: Expression.cpp:60
gnsstk::Expression::setRinexObs
bool setRinexObs(const RinexObsData::RinexObsTypeMap &rotm)
Definition: Expression.cpp:599
gnsstk::Expression::Token::Token
Token(std::string value, int relPriority, bool isOperator)
Definition: Expression.cpp:132
gnsstk::Expression::BinOpNode::op
std::string op
Definition: Expression.hpp:265
gnsstk::PI
const double PI
GPS value of PI; also specified by GAL.
Definition: GNSSconstants.hpp:62
gnsstk::Expression::setSvObsEpoch
bool setSvObsEpoch(const SvObsEpoch &soe)
Definition: Expression.cpp:613
gnsstk::Expression::Expression
Expression(void)
Definition: Expression.cpp:175
GNSSconstants.hpp
gnsstk::ObservationType::SNR
@ SNR
Signal strength, in dB-Hz.
gnsstk::Expression::Token::setArgumentPattern
void setArgumentPattern(std::string value)
Definition: Expression.hpp:317
gnsstk::ObservationType::Range
@ Range
pseudorange, in meters
gnsstk::TrackingCode::MDP
@ MDP
Modernized GPS military unique code.
gnsstk::Expression::Token
Definition: Expression.hpp:293
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::Expression::buildExpressionTree
void buildExpressionTree(void)
Definition: Expression.cpp:411
gnsstk::Expression::tList
std::list< Token > tList
Definition: Expression.hpp:347
gnsstk::Expression::FuncOpNode
Definition: Expression.hpp:272
gnsstk::CarrierBand::L2
@ L2
GPS L2, QZSS L2.
std::sin
double sin(gnsstk::Angle x)
Definition: Angle.hpp:144
gnsstk::Expression::BinOpNode::right
ExpNode * right
Definition: Expression.hpp:267
gnsstk::TrackingCode::CA
@ CA
Legacy GPS civil code.
gnsstk::L2_FREQ_GPS
const double L2_FREQ_GPS
GPS L2 carrier frequency in Hz.
Definition: DeprecatedConsts.hpp:53
gnsstk::Expression::Token::print
void print(std::ostream &ostr)
Definition: Expression.cpp:138
gnsstk::Expression::VarNode::getValue
double getValue()
Definition: Expression.cpp:122
gnsstk::C_MPS
const double C_MPS
m/s, speed of light; this value defined by GPS but applies to GAL and GLO.
Definition: GNSSconstants.hpp:74
gnsstk::Expression::argumentPatternMap
static std::map< std::string, std::string > argumentPatternMap
Definition: Expression.hpp:344
gnsstk::Expression::ExpNode
Definition: Expression.hpp:184
gnsstk::Expression::Token::setNode
void setNode(ExpNode *newNode)
Definition: Expression.hpp:308
gnsstk::Expression::defineOperators
void defineOperators(void)
Definition: Expression.cpp:217
log
#define log
Definition: DiscCorr.cpp:625
gnsstk::TrackingCode::L2CML
@ L2CML
Modernized GPS L2 civil M+L combined tracking.
gnsstk::Expression::operatorMap
static std::map< std::string, int > operatorMap
Definition: Expression.hpp:343
gnsstk::Expression::eList
std::list< ExpNode * > eList
Definition: Expression.hpp:348
gnsstk::L1_MULT_GPS
const double L1_MULT_GPS
GPS L1 frequency in units of oscillator frequency.
Definition: GNSSconstants.hpp:96
gnsstk::TrackingCode::Ztracking
@ Ztracking
Encrypted legacy GPS precise code, codeless Z tracking.
gnsstk::OSC_FREQ_GPS
const double OSC_FREQ_GPS
Hz, GPS Oscillator or chip frequency.
Definition: GNSSconstants.hpp:88
gnsstk::CarrierBand::E5ab
@ E5ab
Galileo E5, BeiDou B2.
gnsstk::CarrierBand::L1
@ L1
GPS L1, Galileo E1, SBAS L1, QZSS L1, BeiDou L1.
gnsstk::TrackingCode::E1BC
@ E1BC
Galileo E1 B+C combined tracking.
gnsstk::Expression::VarNode::setValue
void setValue(double newValue)
Definition: Expression.cpp:116
std::cos
double cos(gnsstk::Angle x)
Definition: Angle.hpp:146
gnsstk::Expression::dumpLists
void dumpLists(void)
Definition: Expression.cpp:198
gnsstk::StringUtils::asDouble
double asDouble(const std::string &s)
Definition: StringUtils.hpp:705
gnsstk::Expression::VarNode::name
std::string name
Definition: Expression.hpp:239
gnsstk::TrackingCode::P
@ P
Legacy GPS precise code.
gnsstk::Expression::canEvaluate
bool canEvaluate(void)
Definition: Expression.cpp:560
gnsstk::Expression::operator=
Expression & operator=(const Expression &rhs)
Assignment operator.
Definition: Expression.cpp:190
gnsstk::RinexObsData::RinexObsTypeMap
std::map< RinexObsType, gnsstk::RinexDatum > RinexObsTypeMap
map from RinexObsType to RinexDatum.
Definition: RinexObsData.hpp:73
gnsstk::Expression::Token::setResolved
void setResolved(bool value)
Definition: Expression.hpp:310
gnsstk::TrackingCode::L2CM
@ L2CM
Modernized GPS L2 civil M code.
std::tan
double tan(gnsstk::Angle x)
Definition: Angle.hpp:148
gnsstk::Expression::BinOpNode::left
ExpNode * left
Definition: Expression.hpp:266
std
Definition: Angle.hpp:142
gnsstk::SvObsEpoch
All the observations collected from a single SV at a single epoch.
Definition: SvObsEpoch.hpp:55
gnsstk::Expression::ExpNode::getValue
virtual double getValue()=0
gnsstk::ObservationType::Doppler
@ Doppler
Doppler, in Hz.
gnsstk::StringUtils::strip
std::string & strip(std::string &s, const std::string &aString, std::string::size_type num=std::string::npos)
Definition: StringUtils.hpp:1482
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
example5.soe
soe
Definition: example5.py:25
gnsstk::Expression::operatorsDefined
static bool operatorsDefined
Definition: Expression.hpp:345
gnsstk::TrackingCode::E1ABC
@ E1ABC
Galileo E1 A+B+C combined tracking.
gnsstk::Expression::ConstNode
Definition: Expression.hpp:202
gnsstk::Expression::Token::getOperator
bool getOperator(void)
Definition: Expression.hpp:313
gnsstk::ObservationType::SSI
@ SSI
Signal Strength Indicator (RINEX)
gnsstk::TrackingCode::E1C
@ E1C
Galileo E1 Dataless code.
gnsstk::Expression::print
void print(std::ostream &ostr) const
Definition: Expression.hpp:180
Expression.hpp
gnsstk::CarrierBand::E6
@ E6
Galileo E6, QZSS L6.
gnsstk::Expression::BinOpNode::print
std::ostream & print(std::ostream &ostr)
Definition: Expression.cpp:106
gnsstk::Expression::setGPSConstants
bool setGPSConstants(void)
Definition: Expression.cpp:581
gnsstk::Expression::FuncOpNode::print
std::ostream & print(std::ostream &ostr)
Definition: Expression.cpp:99
gnsstk::Expression
Definition: Expression.hpp:88
gnsstk::CarrierBand::L5
@ L5
GPS L5, Galileo E5a, SBAS L5, QZSS L5, BeiDou B2a, NavIC L5.
gnsstk::L2_MULT_GPS
const double L2_MULT_GPS
GPS L2 frequency in units of oscillator frequency.
Definition: GNSSconstants.hpp:98


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39