1 / 5

CLHEP / Evaluator Class

CLHEP / Evaluator Class. Evgueni Tcherniaev IT / API LHC++ meeting CERN, 2 November 2000. New class in CLHEP 1.6. CLHEP 1.6: Alist, String, Combination have been disabled as obsolete;

cherie
Download Presentation

CLHEP / Evaluator Class

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CLHEP / Evaluator Class Evgueni Tcherniaev IT / API LHC++ meeting CERN, 2 November 2000

  2. New class in CLHEP 1.6 • CLHEP 1.6: • Alist, String, Combination have been disabled as obsolete; • Added Evaluator of arithmetic expressions with an extendable dictionary. • Expression may contain numbers, variables, functions separated by arithmetic (+, -, /, *, ^, **) and logical operators (==, !=, >, >=, <, <=, &&, ||). • User can add new variables and functions to the dictionary.

  3. Evaluator: Member functions I • Constructor: • HepTool::Evaluator() • Main functions: • double evaluate(const char* expression) • void setVariable(const char* name, double value) void setVariable(const char* name, const char* expression) • void setFunction(const char* name, double (*fun)()) void setFunction(const char* name, double (*fun)(double)) void setFunction(const char* name, double (*fun)(double, double)) ...

  4. Evaluator: Member functions II • Other functions: • int status() • int error_position() • void print_error() • bool findVariable(const char* name) • bool findFunction(const char* name, int npar) • void removeVariable(const char* name) • void removeFunction(const char* name, int npar) • void clear()

  5. Evaluator: Member functions III • Special functions: • void setStdMath() • void setSystemOfUnits(double meter = 1, double kilogram = 1, double second = 1, double ampere = 1, double kelvin = 1, double mole = 1, double candela = 1)

More Related