Cadabra
Computer algebra system for field theory problems
Kernel.hh
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <functional>
5 #include "Props.hh"
6 
12 
13 namespace cadabra {
14 
15  class Kernel {
16  public:
17  Kernel(bool inject_defaults=true);
18  Kernel(const Kernel& other) = delete;
19  ~Kernel();
20 
22  void inject_property(property *prop, std::shared_ptr<Ex> pattern, std::shared_ptr<Ex> property_arguments);
23 
25  std::shared_ptr<Ex> ex_from_string(const std::string&);
26 
27 
29 
34 
35 
36  const static std::string version;
37  const static std::string build ;
38 
39  // Warnings
40  enum class warn_t {
41  notset = 0,
42  debug = 10,
43  info = 20,
44  warning = 30,
45  error = 40,
46  critical = 50
47  };
49  std::function<void(const std::string&)> warning_callback;
50  void warn(const std::string& msg, warn_t level = warn_t::warning) const;
51  };
52 
53  }
cadabra::Kernel::properties
Properties properties
Definition: Kernel.hh:28
cadabra::Kernel::scalar_backend_t::mathematica
@ mathematica
cadabra::Kernel::warn_t::warning
@ warning
cadabra::Kernel::inject_property
void inject_property(property *prop, std::shared_ptr< Ex > pattern, std::shared_ptr< Ex > property_arguments)
Inject a property into the system and attach it to the given pattern.
Definition: Kernel.cc:107
cadabra::Kernel
Definition: Kernel.hh:15
cadabra::Kernel::scalar_backend_t
scalar_backend_t
Settings.
Definition: Kernel.hh:31
cadabra::Kernel::version
const static std::string version
Definition: Kernel.hh:36
cadabra::Kernel::warn_t::debug
@ debug
cadabra::Kernel::build
const static std::string build
Definition: Kernel.hh:37
cadabra::Kernel::scalar_backend
enum cadabra::Kernel::scalar_backend_t scalar_backend
cadabra::Kernel::warn_t
warn_t
Definition: Kernel.hh:40
cadabra::Kernel::warn_t::error
@ error
cadabra::Kernel::warn_t::info
@ info
cadabra::Kernel::display_fractions
bool display_fractions
Definition: Kernel.hh:33
cadabra::Properties
Definition: Props.hh:233
cadabra::Kernel::warning_level
warn_t warning_level
Definition: Kernel.hh:48
cadabra::Kernel::call_embedded_python_functions
bool call_embedded_python_functions
Definition: Kernel.hh:32
cadabra::Kernel::Kernel
Kernel(bool inject_defaults=true)
Definition: Kernel.cc:26
cadabra::property
FIXME: the above two need to be merged, because parse may need access to the actual pattern tree,...
Definition: Props.hh:126
Props.hh
cadabra::pattern
Definition: Props.hh:38
cadabra::Kernel::scalar_backend_t::sympy
@ sympy
cadabra
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83
cadabra::Kernel::warn_t::notset
@ notset
cadabra::Kernel::~Kernel
~Kernel()
Definition: Kernel.cc:102
cadabra::Kernel::warning_callback
std::function< void(const std::string &)> warning_callback
Definition: Kernel.hh:49
cadabra::Kernel::ex_from_string
std::shared_ptr< Ex > ex_from_string(const std::string &)
Create an Ex expression object from a string, which will be parsed.
Definition: Kernel.cc:121
cadabra::Kernel::warn
void warn(const std::string &msg, warn_t level=warn_t::warning) const
Definition: Kernel.cc:133
cadabra::Kernel::warn_t::critical
@ critical