Cadabra
Computer algebra system for field theory problems
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
cadabra::property Class Referenceabstract

Description

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>

Inheritance diagram for cadabra::property:
cadabra::Accent cadabra::AntiSymmetric cadabra::CommutingAsProduct cadabra::CommutingAsSum cadabra::Coordinate cadabra::DAntiSymmetric cadabra::Depends cadabra::DependsBase cadabra::DependsInherit cadabra::Derivative cadabra::DifferentialFormBase cadabra::DiracBar cadabra::Distributable cadabra::EpsilonTensor cadabra::FilledTableau cadabra::GammaMatrix cadabra::GammaTraceless cadabra::ImaginaryI cadabra::ImplicitIndex cadabra::IndexInherit cadabra::Integer cadabra::InverseMetric cadabra::KroneckerDelta cadabra::labelled_property cadabra::LaTeXForm cadabra::list_property cadabra::Matrix cadabra::Metric cadabra::NumericalFlat cadabra::PartialDerivative cadabra::PropertyInherit cadabra::RiemannTensor cadabra::SatisfiesBianchi cadabra::SelfCommutingBehaviour cadabra::Spinor cadabra::Symbol cadabra::Symmetric cadabra::Tableau cadabra::TableauSymmetry cadabra::Traceless cadabra::WeylTensor

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_
 

Member Enumeration Documentation

Enumerator
no_match 
id_match 
exact_match 

Constructor & Destructor Documentation

property::property ( bool  hidden = false)
virtual cadabra::property::~property ( )
inlinevirtual

Member Function Documentation

property::match_t property::equals ( const property ) const
virtual
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
void property::latex ( std::ostream &  str) 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.

virtual std::string cadabra::property::name ( ) const
pure virtual
bool property::parse ( const Kernel ,
keyval_t keyvals 
)
virtual
bool property::parse_one_argument ( Ex::iterator  arg,
keyval_t keyvals 
)
private
bool property::parse_to_keyvals ( const Ex tr,
keyval_t keyvals 
)
std::string property::unnamed_argument ( ) const
virtual
void property::validate ( const Kernel ,
const Ex  
) const
virtual

Member Data Documentation

bool cadabra::property::hidden_
private

The documentation for this class was generated from the following files: