Cadabra
Computer algebra system for field theory problems
|
Base class for all properties, handling argument parsing and defining the interface.
Properties can have arguments. Parsing of these is done in the properties object itself, with the use of some helper functions. Parsing is done by implementing the virtual function property::parse(const Kernel&, keyval_t&). The argument is a container class which represents the arguments passed to the property as key/value pairs keyval_t type.
Properties will be asked to check that they can be associated to a given pattern through the virtual property::validate(const Properties&, const Ex&) function. The FIXME: the above two need to be merged, because parse may need access to the actual pattern tree, and once we are there, we may as well do checking. HOWEVER: in TableauSymmetry.cc: FIXME: we get the wrong pattern in case of a list! We should have been fed each individual item in the list, not the list itself.
This suggests that we should be calling once for every pattern, but that is wasteful in case we are just parsing arguments. Can we really avoid calling parse for every pattern?
{A_{m n}, A_{m n p}, A_{m n p q}}::TableauSymmetry(shape={2,1}, indices={0,1,2}).
leads to a problem, because the property needs to setup its internal structures but also verify that these can match all objects in the same way.
Make all identical properties point to the same property object, so that normal and list properties become pretty much identical.
#include <Props.hh>
Public Types | |
enum | match_t { no_match, id_match, exact_match } |
Public Member Functions | |
property (bool hidden=false) | |
virtual | ~property () |
bool | parse_to_keyvals (const Ex &, keyval_t &) |
virtual bool | parse (const Kernel &, keyval_t &keyvals) |
virtual void | validate (const Kernel &, const Ex &) const |
virtual void | latex (std::ostream &) const |
Display the property on the stream. More... | |
virtual std::string | name () const =0 |
virtual std::string | unnamed_argument () const |
virtual match_t | equals (const property *) const |
void | hidden (bool h) |
Properties can be hidden because they only make sense to the system; they will not be printed when the user asks for a list of properties. More... | |
bool | hidden (void) const |
Private Member Functions | |
bool | parse_one_argument (Ex::iterator arg, keyval_t &keyvals) |
Private Attributes | |
bool | hidden_ |
property::property | ( | bool | hidden = false | ) |
|
inlinevirtual |
|
virtual |
Reimplemented in cadabra::Indices, cadabra::CommutingBehaviour, and cadabra::SortOrder.
void property::hidden | ( | bool | h | ) |
Properties can be hidden because they only make sense to the system; they will not be printed when the user asks for a list of properties.
bool property::hidden | ( | void | ) | const |
|
virtual |
Display the property on the stream.
Generate a LaTeX representation of the property, assuming LaTeX is in text mode (so it needs dollar symbols to switch to maths).
Reimplemented in cadabra::Indices, cadabra::Metric, cadabra::TableauSymmetry, cadabra::WeylTensor, cadabra::ImplicitIndex, and cadabra::GammaMatrix.
|
pure virtual |
Implemented in cadabra::PropertyInherit, cadabra::Derivative, cadabra::WeightInherit, cadabra::Accent, cadabra::Integer, cadabra::EpsilonTensor, cadabra::TableauSymmetry, cadabra::AntiSymmetric, cadabra::DifferentialForm, cadabra::NumericalFlat, cadabra::Weight, cadabra::DependsInherit, cadabra::ExteriorDerivative, cadabra::Indices, cadabra::InverseMetric, cadabra::Metric, cadabra::Spinor, cadabra::WeylTensor, cadabra::DAntiSymmetric, cadabra::Diagonal, cadabra::DiracBar, cadabra::Distributable, cadabra::GammaMatrix, cadabra::GammaTraceless, cadabra::ImplicitIndex, cadabra::KroneckerDelta, cadabra::Matrix, cadabra::PartialDerivative, cadabra::SatisfiesBianchi, cadabra::SelfCommuting, cadabra::Tableau, cadabra::Traceless, cadabra::AntiCommuting, cadabra::Commuting, cadabra::CommutingAsProduct, cadabra::CommutingAsSum, cadabra::Coordinate, cadabra::FilledTableau, cadabra::ImaginaryI, cadabra::IndexInherit, cadabra::LaTeXForm, cadabra::NonCommuting, cadabra::SelfAntiCommuting, cadabra::SelfNonCommuting, cadabra::SortOrder, cadabra::Symbol, cadabra::Symmetric, cadabra::RiemannTensor, and cadabra::Depends.
Reimplemented in cadabra::labelled_property, cadabra::WeightInherit, cadabra::Integer, cadabra::DifferentialForm, cadabra::Spinor, cadabra::EpsilonTensor, cadabra::GammaMatrix, cadabra::InverseMetric, cadabra::Metric, cadabra::TableauSymmetry, cadabra::Indices, cadabra::LaTeXForm, cadabra::Weight, cadabra::ImplicitIndex, and cadabra::Depends.
|
private |
|
virtual |
Reimplemented in cadabra::Integer, cadabra::WeightInherit, cadabra::Indices, cadabra::ImplicitIndex, cadabra::LaTeXForm, cadabra::Weight, and cadabra::Depends.
Reimplemented in cadabra::InverseMetric, cadabra::Metric, cadabra::WeylTensor, and cadabra::RiemannTensor.
|
private |