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  }
Definition: Kernel.hh:15
bool call_embedded_python_functions
Definition: Kernel.hh:32
scalar_backend_t
Settings.
Definition: Kernel.hh:31
Properties properties
Definition: Kernel.hh:28
static const std::string version
Definition: Kernel.hh:36
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
static const std::string build
Definition: Kernel.hh:37
std::function< void(const std::string &)> warning_callback
Definition: Kernel.hh:49
Kernel(bool inject_defaults=true)
Definition: Kernel.cc:26
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
~Kernel()
Definition: Kernel.cc:102
void warn(const std::string &msg, warn_t level=warn_t::warning) const
Definition: Kernel.cc:133
bool display_fractions
Definition: Kernel.hh:33
Kernel(const Kernel &other)=delete
warn_t warning_level
Definition: Kernel.hh:48
enum cadabra::Kernel::scalar_backend_t scalar_backend
warn_t
Definition: Kernel.hh:40
Class holding a collection of properties attached to expressions.
Definition: Props.hh:237
Definition: Props.hh:39
Base class for all properties, handling argument parsing and defining the interface.
Definition: Props.hh:127
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83