COPASI API  4.16.103
CNodeK.cpp
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/function/CNodeK.cpp,v $
3  $Revision: 1.31 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2012/04/23 21:10:23 $
7  End CVS Header */
8 
9 // Copyright (C) 2012 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 // CNodeK.cpp : classes for function tree
19 //
20 /////////////////////////////////////////////////////////////////////////////
21 
22 #include <stdio.h>
23 
24 #include "copasi.h"
25 #include "utilities/CReadConfig.h"
27 #include "utilities/utility.h"
28 
29 #include "CNodeK.h"
30 
32 {
34  mType = N_NOP;
35  mSubtype = N_NOP;
36  mLeft = NULL;
37  mRight = NULL;
38  mConstant = 0.0;
39  mIndex = -1;
40  mOldIndex = -1;
41 }
42 
43 CNodeK::CNodeK(const CNodeK & src)
44 {
46  mType = src.mType;
47  mSubtype = src.mSubtype;
48  mLeft = src.mLeft;
49  mRight = src.mRight;
50  mConstant = src.mConstant;
51  mName = src.mName;
52  mIndex = src.mIndex;
53  mOldIndex = src.mOldIndex;
54 }
55 
56 CNodeK::CNodeK(char type, char subtype)
57 {
59  mType = type;
60  mSubtype = subtype;
61  mLeft = NULL;
62  mRight = NULL;
63  mConstant = 0.0;
64  mIndex = -1;
65  mOldIndex = -1;
66 }
67 
68 CNodeK::CNodeK(const std::string & name)
69 {
72  mSubtype = N_NOP;
73  mLeft = NULL;
74  mRight = NULL;
75  mConstant = 0.0;
76  mName = name;
77  mIndex = -1;
78  mOldIndex = -1;
79 }
80 
82 {
84  mType = N_NUMBER;
85  mSubtype = N_NOP;
86  mLeft = NULL;
87  mRight = NULL;
88  mConstant = constant;
89  mIndex = -1;
90  mOldIndex = -1;
91 }
92 
94 {}
95 
97 {
99 }
100 
102 {
103  C_INT32 Fail = 0;
104 
105  if ((Fail = configbuffer.getVariable("Node", "node", &mType, &mSubtype,
107  return Fail;
108 
109  /* This COPASI treats all these as identifiers */
110  if (mType == N_SUBSTRATE ||
111  mType == N_PRODUCT ||
112  mType == N_MODIFIER ||
113  mType == N_KCONSTANT)
114  {
115  mSubtype = mType;
117  }
118 
119  // leave the Left & Right pointers out
120  // value of the constant if one
121  if (mType == N_NUMBER)
122  {
123  if ((Fail = configbuffer.getVariable("Value", "C_FLOAT64", &mConstant)))
124  return Fail;
125  }
126  else if (mType == N_IDENTIFIER)
127  {
128  if ((Fail = configbuffer.getVariable("Index", "C_INT32", &mIndex)))
129  return Fail;
130 
131  if ((Fail = configbuffer.getVariable("Name", "string", &mName)))
132  return Fail;
133  }
134 
135  return Fail;
136 }
137 
138 /*
139 std::string CNodeK::getExplicitFunctionString(const std::vector< std::vector< std::string > > & callParameterNames,
140  const std::string &r)
141 {
142  char fstr[256];
143  switch (mType)
144  {
145  case N_ROOT:
146  return mLeft->getExplicitFunctionString(callParameterNames, r);
147  case N_NUMBER:
148  sprintf(fstr, "%-20g", mConstant);
149  mExplicitFunction = fstr;
150  break;
151  case N_IDENTIFIER:
152  FixSName(callParameterNames[mIndex][0], mExplicitFunction);
153  if (mSubtype == N_KCONSTANT)
154  mExplicitFunction += r;
155  break;
156  case N_OPERATOR:
157  switch (mSubtype)
158  {
159  case '+':
160  mExplicitFunction = mLeft->getExplicitFunctionString(callParameterNames, r) + "+"
161  + mRight->getExplicitFunctionString(callParameterNames, r);
162  break;
163  case '-':
164  mExplicitFunction = mLeft->getExplicitFunctionString(callParameterNames, r) + "-"
165  + mRight->getExplicitFunctionString(callParameterNames, r);
166  break;
167  case '*':
168  mExplicitFunction = "(" + mLeft->getExplicitFunctionString(callParameterNames, r)
169  + ")*(" + mRight->getExplicitFunctionString(callParameterNames, r)
170  + ")";
171  break;
172  case '/':
173  mExplicitFunction = "(" + mLeft->getExplicitFunctionString(callParameterNames, r)
174  + ")/(" + mRight->getExplicitFunctionString(callParameterNames, r)
175  + ")";
176  break;
177  case '^':
178  mExplicitFunction = "(" + mLeft->getExplicitFunctionString(callParameterNames, r)
179  + ")^(" + mRight->getExplicitFunctionString(callParameterNames, r)
180  + ")";
181  break;
182  default:
183  mExplicitFunction.empty();
184  }
185  break;
186  case N_FUNCTION:
187  switch (mSubtype)
188  {
189  case '+':
190  mExplicitFunction = "+(" + mLeft->getExplicitFunctionString(callParameterNames, r)
191  + ")";
192  break;
193  case '-':
194  mExplicitFunction = "-(" + mLeft->getExplicitFunctionString(callParameterNames, r)
195  + ")";
196  break;
197  case N_EXP:
198  mExplicitFunction = "e^(" + mLeft->getExplicitFunctionString(callParameterNames, r)
199  + ")";
200  break;
201  case N_LOG:
202  mExplicitFunction = "log10(" + mLeft->getExplicitFunctionString(callParameterNames, r)
203  + ")";
204  break;
205  case N_LOG10:
206  mExplicitFunction = "log(" + mLeft->getExplicitFunctionString(callParameterNames, r)
207  + ")";
208  break;
209  case N_SIN:
210  mExplicitFunction = "sin(" + mLeft->getExplicitFunctionString(callParameterNames, r)
211  + ")";
212  break;
213  case N_COS:
214  mExplicitFunction = "cos(" + mLeft->getExplicitFunctionString(callParameterNames, r)
215  + ")";
216  break;
217  case N_TAN:
218  mExplicitFunction = "tan(" + mLeft->getExplicitFunctionString(callParameterNames, r)
219  + ")";
220  break;
221  case N_SEC:
222  mExplicitFunction = "sec(" + mLeft->getExplicitFunctionString(callParameterNames, r)
223  + ")";
224  break;
225  case N_CSC:
226  mExplicitFunction = "csc(" + mLeft->getExplicitFunctionString(callParameterNames, r)
227  + ")";
228  break;
229  case N_COT:
230  mExplicitFunction = "cot(" + mLeft->getExplicitFunctionString(callParameterNames, r)
231  + ")";
232  break;
233  case N_SINH:
234  mExplicitFunction = "sinh(" + mLeft->getExplicitFunctionString(callParameterNames, r)
235  + ")";
236  break;
237  case N_COSH:
238  mExplicitFunction = "cosh(" + mLeft->getExplicitFunctionString(callParameterNames, r)
239  + ")";
240  break;
241  case N_TANH:
242  mExplicitFunction = "tanh(" + mLeft->getExplicitFunctionString(callParameterNames, r)
243  + ")";
244  break;
245  case N_SECH:
246  mExplicitFunction = "sech(" + mLeft->getExplicitFunctionString(callParameterNames, r)
247  + ")";
248  break;
249  case N_CSCH:
250  mExplicitFunction = "csch(" + mLeft->getExplicitFunctionString(callParameterNames, r)
251  + ")";
252  break;
253  case N_COTH:
254  mExplicitFunction = "coth(" + mLeft->getExplicitFunctionString(callParameterNames, r)
255  + ")";
256  break;
257  case N_ARCSIN:
258  mExplicitFunction = "arcsin(" + mLeft->getExplicitFunctionString(callParameterNames, r)
259  + ")";
260  break;
261  case N_ARCCOS:
262  mExplicitFunction = "arccos(" + mLeft->getExplicitFunctionString(callParameterNames, r)
263  + ")";
264  break;
265  case N_ARCTAN:
266  mExplicitFunction = "arctan(" + mLeft->getExplicitFunctionString(callParameterNames, r)
267  + ")";
268  break;
269  case N_ARCSEC:
270  mExplicitFunction = "arcsec(" + mLeft->getExplicitFunctionString(callParameterNames, r)
271  + ")";
272  break;
273  case N_ARCCSC:
274  mExplicitFunction = "arccsc(" + mLeft->getExplicitFunctionString(callParameterNames, r)
275  + ")";
276  break;
277  case N_ARCCOT:
278  mExplicitFunction = "arccot(" + mLeft->getExplicitFunctionString(callParameterNames, r)
279  + ")";
280  break;
281  case N_ARCSINH:
282  mExplicitFunction = "arcsinh(" + mLeft->getExplicitFunctionString(callParameterNames, r)
283  + ")";
284  break;
285  case N_ARCCOSH:
286  mExplicitFunction = "arccosh(" + mLeft->getExplicitFunctionString(callParameterNames, r)
287  + ")";
288  break;
289  case N_ARCTANH:
290  mExplicitFunction = "arctanh(" + mLeft->getExplicitFunctionString(callParameterNames, r)
291  + ")";
292  break;
293  case N_ARCSECH:
294  mExplicitFunction = "arcsech(" + mLeft->getExplicitFunctionString(callParameterNames, r)
295  + ")";
296  break;
297  case N_ARCCSCH:
298  mExplicitFunction = "arccsch(" + mLeft->getExplicitFunctionString(callParameterNames, r)
299  + ")";
300  break;
301  case N_ARCCOTH:
302  mExplicitFunction = "arccoth(" + mLeft->getExplicitFunctionString(callParameterNames, r)
303  + ")";
304  break;
305  case N_ABS:
306  mExplicitFunction = "abs(" + mLeft->getExplicitFunctionString(callParameterNames, r)
307  + ")";
308  break;
309  case N_SQRT:
310  mExplicitFunction = "sqrt(" + mLeft->getExplicitFunctionString(callParameterNames, r)
311  + ")";
312  break;
313  case N_GAUSS:
314  case N_BOLTZ:
315  case N_RND:
316  mExplicitFunction = "(" + mLeft->getExplicitFunctionString(callParameterNames, r)
317  + ")";
318  break;
319  default:
320  mExplicitFunction.empty();
321  }
322  break;
323  default:
324  mExplicitFunction.empty();
325  }
326  return mExplicitFunction;
327 }
328  */
329 
330 char CNodeK::getType() const
331 {
332  return mType;
333 }
334 
335 char CNodeK::getSubtype() const
336 {
337  return mSubtype;
338 }
339 
341 {
342  if (!mLeft)
343  fatalError(); // Call LeftIsValid first to avoid this!
344 
345  return *mLeft;
346 }
347 
349 {
350  if (!mRight)
351  fatalError(); // Call RightIsValid first to avoid this!
352 
353  return *mRight;
354 }
355 
356 std::string CNodeK::getName() const
357 {
358  return mName;
359 #ifdef XXXX
360 
361  static unsigned C_INT ctr = 0;
362  char name[9];
363 
364  if (isIdentifier())
365  return mName;
366  else
367  {
368  sprintf(name, "%X", ctr++);
369  return name;
370  }
371 
372 #endif // XXXX
373 }
374 
376 {
377  return mConstant;
378 }
379 
381 {
382  return mIndex;
383 }
384 
385 void CNodeK::setType(char type)
386 {
387  mType = type;
388 }
389 
390 void CNodeK::setSubtype(char subtype)
391 {
392  mSubtype = subtype;
393 }
394 
396 {
397  mLeft = &left;
398 }
399 
400 void CNodeK::setLeft(CNodeK * pleft)
401 {
402  mLeft = pleft;
403 }
404 
406 {
407  mRight = &right;
408 }
409 
410 void CNodeK::setRight(CNodeK * pright)
411 {
412  mRight = pright;
413 }
414 
415 void CNodeK::setName(const std::string & name)
416 {
417  mName = name;
418 }
419 
421 {
422  mConstant = constant;
423 }
424 
426 {
427  mIndex = index;
428 }
429 
431 {
432  mOldIndex = oldindex;
433 }
434 
436 {
437  return (mLeft != NULL);
438 }
439 
441 {
442  return (mRight != NULL);
443 }
444 
446 {
447  return (mType == N_NUMBER);
448 }
449 
451 {
452  switch (mType)
453  {
454  case N_OBJECT:
455  case N_IDENTIFIER:
456  case N_SUBSTRATE:
457  case N_PRODUCT:
458  case N_MODIFIER:
459  case N_KCONSTANT:
460  case N_VOLUME:
461  return true;
462  default:
463  return false;
464  }
465 }
466 
468 {
469  return mType == N_OPERATOR;
470 }
471 
473 {
474  switch (mType)
475  {
476  case N_OBJECT:
477  case N_NUMBER:
478  case N_IDENTIFIER:
479  case N_FUNCTION:
480  return 5;
481  }
482 
483  // if we got here then it is an operator
484  switch (mSubtype)
485  {
486  case '+':
487  case '-':
488  return 1;
489  case '*':
490  case '/':
491  return 3;
492  case '(':
493  return 6;
494  case '^':
495  return 5;
496  case ')':
497  case '%':
498  return 0;
499  }
500 
501  return 0;
502 }
503 
505 {
506  switch (mType)
507  {
508  case N_OBJECT:
509  case N_NUMBER:
510  case N_IDENTIFIER:
511  return 6;
512  case N_FUNCTION:
513  return 4;
514  }
515 
516  // if we got here then it is an operator
517  switch (mSubtype)
518  {
519  case '+':
520  case '-':
521  return 2;
522  case '*':
523  case '/':
524  return 4;
525  case ')':
526  return 6;
527  case '^':
528  return 4;
529  case '(':
530  case '%':
531  return 0;
532  }
533 
534  return 0;
535 }
536 
537 /*
538 C_FLOAT64 CNodeK::value(const CCallParameters<C_FLOAT64> & callParameters) const
539  {
540  // if it is a constant or an identifier just return its value
541  if (isNumber())
542  return mConstant;
543  switch (mType)
544  {
545  case N_OBJECT:
546  return *(double*)((CCopasiObject*)mLeft)->getValuePointer();
547  break;
548  case N_IDENTIFIER:
549  return * callParameters[mIndex].value;
550  break;
551  case N_OPERATOR:
552  switch (mSubtype)
553  {
554  case '+':
555  return mLeft->value(callParameters) + mRight->value(callParameters);
556  case '-':
557  return mLeft->value(callParameters) - mRight->value(callParameters);
558  case '*':
559  return mLeft->value(callParameters) * mRight->value(callParameters);
560  case '/':
561  return mLeft->value(callParameters) / mRight->value(callParameters);
562  case '^':
563  return pow(mLeft->value(callParameters), mRight->value(callParameters));
564  default:
565  fatalError(); // THROW EXCEPTION
566  return 0.0;
567  }
568  break;
569  case N_FUNCTION:
570  switch (mSubtype)
571  {
572  case '+':
573  return mLeft->value(callParameters);
574  case '-':
575  return - mLeft->value(callParameters);
576  case N_EXP:
577  return exp(mLeft->value(callParameters));
578  case N_LOG:
579  return log(mLeft->value(callParameters));
580  case N_LOG10:
581  return log10(mLeft->value(callParameters));
582 
583 
584  case N_SIN:
585  return sin(mLeft->value(callParameters));
586  case N_COS:
587  return cos(mLeft->value(callParameters));
588  case N_TAN:
589  return tan(mLeft->value(callParameters));
590 
591 
592  case N_SEC:
593  return 1 / cos(mLeft->value(callParameters));
594  case N_CSC:
595  return 1 / sin(mLeft->value(callParameters));
596  case N_COT:
597  return 1 / tan(mLeft->value(callParameters));
598 
599 
600  case N_SINH:
601  return sinh(mLeft->value(callParameters));
602  case N_COSH:
603  return cosh(mLeft->value(callParameters));
604  case N_TANH:
605  return tanh(mLeft->value(callParameters));
606 
607 
608  case N_SECH:
609  return 1 / cosh(mLeft->value(callParameters));
610  case N_CSCH:
611  return 1 / sinh(mLeft->value(callParameters));
612  case N_COTH:
613  return 1 / tanh(mLeft->value(callParameters));
614 
615 
616  case N_ARCSIN:
617  return asin(mLeft->value(callParameters));
618  case N_ARCCOS:
619  return acos(mLeft->value(callParameters));
620  case N_ARCTAN:
621  return atan(mLeft->value(callParameters));
622 
623 
624  case N_ARCSEC: //TODO
625  return acos(1 / mLeft->value(callParameters));
626  case N_ARCCSC: //TODO
627  return asin(1 / mLeft->value(callParameters));
628  case N_ARCCOT: //TODO
629  return atan(1 / mLeft->value(callParameters));
630 
631 
632  case N_ARCSINH:
633  return asinh(mLeft->value(callParameters));
634  case N_ARCCOSH:
635  return acosh(mLeft->value(callParameters));
636  case N_ARCTANH:
637  return atanh(mLeft->value(callParameters));
638 
639 
640  case N_ARCSECH:
641  return acosh(1 / mLeft->value(callParameters));
642  case N_ARCCSCH:
643  return asinh(1 / mLeft->value(callParameters));
644  case N_ARCCOTH:
645  return atanh(1 / mLeft->value(callParameters));
646 
647 
648  case N_ABS:
649  return fabs(mLeft->value(callParameters));
650  case N_SQRT:
651  return sqrt(mLeft->value(callParameters));
652 
653 
654  default:
655  fatalError(); // THROW EXCEPTION
656  return 0.0;
657  }
658  break;
659  default:
660  fatalError(); // THROW EXCEPTION
661  return 0.0;
662  }
663  fatalError(); // THROW EXCEPTION
664  return 0.0;
665  }
666  */
667 
668 /*
669 #define SPC(level) std::string(level, ' ')
670 
671 
672 void CNodeK::writeMathML(std::ostream & out, C_INT32 level) const
673  {
674  bool flag = false;
675 
676 
677  switch (mType)
678  {
679  case N_NUMBER:
680  out << SPC(level) << "<mn>" << mConstant << "</mn>" << std::endl;
681  break;
682  // case N_OBJECT:
683  // return *(double*)((CCopasiObject*)mLeft)->getReference();
684  // break;
685  case N_IDENTIFIER: //do some heuristics for indentifiers starting with "K" or "V"
686  out << SPC(level);
687  if (mName.substr(0, 1) == "K")
688  out << "<msub><mi>K</mi><mi>" << mName.substr(1) << "</mi></msub>" << std::endl;
689  else if (mName.substr(0, 1) == "V")
690  out << "<msub><mi>V</mi><mi>" << mName.substr(1) << "</mi></msub>" << std::endl;
691  else
692  out << "<mi>" << mName << "</mi>" << std::endl;
693  break;
694  case N_OPERATOR:
695  switch (mSubtype)
696  {
697  case '+':
698  out << SPC(level) << "<mrow>" << std::endl;
699  mLeft->writeMathML(out, level + 1);
700  out << SPC(level + 1) << "<mo>" << "+" << "</mo>" << std::endl;
701  mRight->writeMathML(out, level + 1);
702  out << SPC(level) << "</mrow>" << std::endl;
703  break;
704  case '-':
705  out << SPC(level) << "<mrow>" << std::endl;
706  mLeft->writeMathML(out, level + 1);
707  out << SPC(level + 1) << "<mo>" << "-" << "</mo>" << std::endl;
708 
709 
710  //do we need "()" ?
711  flag = (mRight->mType == N_OPERATOR) && ((mRight->mSubtype == '-') || (mRight->mSubtype == '+'));
712  if (flag)
713  {
714  out << SPC(level + 1) << "<mfenced>" << std::endl;
715  }
716  mRight->writeMathML(out, level + 1);
717  if (flag)
718  {
719  out << SPC(level + 1) << "</mfenced>" << std::endl;
720  }
721  out << SPC(level) << "</mrow>" << std::endl;
722  break;
723  case '*':
724  out << SPC(level) << "<mrow>" << std::endl;
725 
726 
727  //do we need "()" ?
728  flag = (mLeft->mType == N_OPERATOR) && ((mLeft->mSubtype == '-') || (mLeft->mSubtype == '+'));
729  if (flag)
730  {
731  out << SPC(level + 1) << "<mfenced>" << std::endl;
732  }
733  mLeft->writeMathML(out, level + 1);
734  if (flag)
735  {
736  out << SPC(level + 1) << "</mfenced>" << std::endl;
737  }
738  out << SPC(level + 1) << "<mo>" << "&CenterDot;" << "</mo>" << std::endl;
739  flag = (mRight->mType == N_OPERATOR) && ((mRight->mSubtype == '-') || (mRight->mSubtype == '+'));
740  if (flag)
741  {
742  out << SPC(level) << "<mfenced>" << std::endl;
743  }
744  mRight->writeMathML(out, level + 1);
745  if (flag)
746  {
747  out << SPC(level + 1) << "</mfenced>" << std::endl;
748  }
749  out << SPC(level) << "</mrow>" << std::endl;
750  break;
751  case '^':
752  out << SPC(level) << "<msup>" << std::endl;
753 
754 
755  //do we need "()" ?
756  flag = (mLeft->mType == N_OPERATOR) && ((mLeft->mSubtype == '-') || (mLeft->mSubtype == '+')
757  || (mLeft->mSubtype == '*') || (mLeft->mSubtype == '/')
758  || (mLeft->mSubtype == '^'));
759  if (flag)
760  {
761  out << SPC(level + 1) << "<mfenced>" << std::endl;
762  }
763  mLeft->writeMathML(out, level + 2);
764  if (flag)
765  {
766  out << SPC(level + 1) << "</mfenced>" << std::endl;
767  }
768 
769 
770  out << SPC(level + 1) << "<mrow>" << std::endl;
771  mRight->writeMathML(out, level + 2);
772  out << SPC(level + 1) << "</mrow>" << std::endl;
773 
774 
775  out << SPC(level) << "</msup>" << std::endl;
776  break;
777  case '/':
778  out << SPC(level) << "<mfrac>" << std::endl;
779 
780 
781  out << SPC(level + 1) << "<mrow>" << std::endl;
782  mLeft->writeMathML(out, level + 2);
783  out << SPC(level + 1) << "</mrow>" << std::endl;
784 
785 
786  out << SPC(level + 1) << "<mrow>" << std::endl;
787  mRight->writeMathML(out, level + 2);
788  out << SPC(level + 1) << "</mrow>" << std::endl;
789 
790 
791  out << SPC(level) << "</mfrac>" << std::endl;
792  break;
793  }
794  break;
795  case N_FUNCTION:
796  switch (mSubtype)
797  {
798  case '+': //do nothing
799  mLeft->writeMathML(out, level);
800  break;
801  case '-':
802  out << SPC(level) << "<mrow>" << std::endl;
803  out << SPC(level + 1) << "<mo>" << "-" << "</mo>" << std::endl;
804 
805 
806  //do we need "()" ?
807  flag = (mLeft->mType == N_OPERATOR) && ((mLeft->mSubtype == '-') || (mLeft->mSubtype == '+'));
808  if (flag)
809  {
810  out << SPC(level + 1) << "<mfenced>" << std::endl;
811  }
812  mLeft->writeMathML(out, level + 1);
813  if (flag)
814  {
815  out << SPC(level + 1) << "</mfenced>" << std::endl;
816  }
817  out << SPC(level) << "</mrow>" << std::endl;
818  break;
819  case N_EXP:
820  //return exp(mLeft->value(callParameters));
821  case N_LOG:
822  //return log(mLeft->value(callParameters));
823  case N_LOG10:
824  //return log10(mLeft->value(callParameters));
825  case N_SIN:
826  //return sin(mLeft->value(callParameters));
827  case N_COS:
828  //return cos(mLeft->value(callParameters));
829  case N_TAN:
830  //return cos(mLeft->value(callParameters));
831  default:
832  //fatalError(); // THROW EXCEPTION
833  //return 0.0;
834  break;
835  }
836  break;
837  //default:
838  //fatalError(); // THROW EXCEPTION
839  //return 0.0;
840  }
841  }
842 
843 
844 #undef SPC
845  */
#define C_INT
Definition: copasi.h:115
C_INT16 rightPrecedence() const
Definition: CNodeK.cpp:504
#define N_OBJECT
Definition: CNodeK.h:39
char mType
Definition: CNodeK.h:92
void setLeft(CNodeK &left)
Definition: CNodeK.cpp:395
CNodeK & getLeft() const
Definition: CNodeK.cpp:340
C_INT16 isRightValid() const
Definition: CNodeK.cpp:440
#define N_IDENTIFIER
Definition: CNodeK.h:37
CNodeK & getRight() const
Definition: CNodeK.cpp:348
#define fatalError()
void setConstant(C_FLOAT64 &constant)
Definition: CNodeK.cpp:420
void setIndex(C_INT32 index)
Definition: CNodeK.cpp:425
~CNodeK()
Definition: CNodeK.cpp:96
std::string mName
Definition: CNodeK.h:122
char getSubtype() const
Definition: CNodeK.cpp:335
C_INT32 mOldIndex
Definition: CNodeK.h:132
#define C_INT32
Definition: copasi.h:90
void cleanup()
Definition: CNodeK.cpp:93
C_INT16 isLeftValid() const
Definition: CNodeK.cpp:435
#define N_SUBSTRATE
Definition: CNodeK.h:78
char getType() const
Definition: CNodeK.cpp:330
std::string getName() const
Definition: CNodeK.cpp:356
C_FLOAT64 getConstant() const
Definition: CNodeK.cpp:375
#define DESTRUCTOR_TRACE
Definition: copasi.h:206
C_INT16 isNumber() const
Definition: CNodeK.cpp:445
void setOldIndex(C_INT32 oldindex)
Definition: CNodeK.cpp:430
C_INT16 isIdentifier() const
Definition: CNodeK.cpp:450
#define N_OPERATOR
Definition: CNodeK.h:36
#define N_FUNCTION
Definition: CNodeK.h:38
void setName(const std::string &name)
Definition: CNodeK.cpp:415
#define C_INT16
Definition: copasi.h:91
C_INT32 getIndex() const
Definition: CNodeK.cpp:380
C_FLOAT64 mConstant
Definition: CNodeK.h:117
C_INT32 mIndex
Definition: CNodeK.h:127
Definition: CNodeK.h:84
void setType(const char ype)
Definition: CNodeK.cpp:385
#define C_FLOAT64
Definition: copasi.h:92
void setSubtype(const char subtype)
Definition: CNodeK.cpp:390
#define N_NOP
Definition: CNodeK.h:33
CNodeK * mLeft
Definition: CNodeK.h:107
#define N_KCONSTANT
Definition: CNodeK.h:81
#define N_VOLUME
Definition: CNodeK.h:82
#define N_PRODUCT
Definition: CNodeK.h:79
void setRight(CNodeK &right)
Definition: CNodeK.cpp:405
C_INT16 isOperator() const
Definition: CNodeK.cpp:467
C_INT32 getVariable(const std::string &name, const std::string &type, void *pout, CReadConfig::Mode mode=CReadConfig::NEXT)
Definition: CReadConfig.cpp:81
CNodeK * mRight
Definition: CNodeK.h:112
char mSubtype
Definition: CNodeK.h:102
C_INT16 leftPrecedence() const
Definition: CNodeK.cpp:472
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
#define N_MODIFIER
Definition: CNodeK.h:80
CNodeK()
Definition: CNodeK.cpp:31
#define N_NUMBER
Definition: CNodeK.h:40
C_INT32 load(CReadConfig &configbuffer)
Definition: CNodeK.cpp:101