algorithm Class Reference

#include <algorithm.hh>

Inheritance diagram for algorithm:

active_node acanonicalorder all_contractions amnesia assert_or_exit asym asymprop aticksen break_gendelta canonicalise canonicalorder coefficients collect_factors collect_terms combine debracket decompose decompose_product depprint distribute drop drop_keep_weight dualise_tensor einsteinify eliminate_eps eliminate_kronecker eliminate_metric eliminate_vielbein epsprod2gendelta eqn eqs expand expand_power expand_product_shorthand extract_properties factorise fierz frommaple frommath gammasplit generate_indexbracket impose_asym impose_bianchi index_rename indexlist indexsort inner join keep_terms length list_sum listflatten locate lsolve memdump multpauli number_of_terms numerical_flatten order permute pintegrate pop print prodcollectnum prodflatten prodrule prodsort product_shorthand projweyl proplist range ratrewrite reduce reduce_div reduce_gendelta reduce_sub remove_eoms remove_gamma_trace remove_indexbracket remove_vanishing_derivatives remove_weyl_traces rename_dummies replace_match rewrite_diracbar rewrite_indices ricci_identity riemann_index_regroup riemannid run simple_rename spinorsort split_index subseq substitute sumflatten sumsort sym sym_asym tab_basics tabdimension take take_match tree_dump unique_indices unwrap vary weyl_index_order young_project young_project_product young_project_tensor List of all members.

Public Types

enum  result_t { l_no_action, l_applied, l_error }
enum  global_success_t {
  g_not_yet_started = 0, g_arguments_accepted = 1, g_operand_determined = 2, g_applied = 4,
  g_apply_failed = 6
}

Public Member Functions

 algorithm (exptree &, iterator)
virtual ~algorithm ()
virtual bool can_apply (iterator)
virtual bool can_apply (sibling_iterator, sibling_iterator)
virtual result_t apply (iterator &)
virtual result_t apply (sibling_iterator &, sibling_iterator &)
bool apply_recursive (iterator &, bool check_consistency=true, int act_at_level=-1, bool called_by_manipulator=false, bool until_nochange=false)
void apply (unsigned int last_used_equation_number, bool multiple, bool until_nochange, bool make_copy, int act_at_level=-1, bool called_by_manipulator=false)
bool check_consistency (iterator) const
bool check_index_consistency (iterator) const
void report_progress (const std::string &, int todo, int done, int count=2)

Public Attributes

bool expression_modified
iterator subtree
unsigned int equation_number
global_success_t global_success
unsigned int number_of_calls
unsigned int number_of_modifications
bool suppress_normal_output
bool discard_command_node
exptree_output::output_format_t output_format
stopwatch report_progress_stopwatch

Static Public Attributes

static stopwatch index_sw
static stopwatch get_dummy_sw

Protected Types

typedef std::pair< sibling_iterator,
sibling_iterator
range_t
 Finding objects in sets.
typedef std::vector< range_trange_vector_t
typedef std::multimap< exptree,
exptree::iterator, tree_exact_less_no_wildcards_mod_prel_obj
index_map_t
 A map from a pattern to the position where it occurs in the tree.
typedef std::map< exptree::iterator,
int, exptree::iterator_base_less > 
index_position_map_t
 A map from the position of each index to the sequential index.

Protected Member Functions

int index_parity (iterator) const
bool contains (sibling_iterator from, sibling_iterator to, sibling_iterator arg)
void find_argument_lists (range_vector_t &, bool only_comma_lists=true) const
template<class Iter>
range_vector_t::iterator find_arg_superset (range_vector_t &, Iter st, Iter nd)
range_vector_t::iterator find_arg_superset (range_vector_t &, sibling_iterator it)
bool is_single_term (iterator)
bool prod_wrap_single_term (iterator &)
bool prod_unwrap_single_term (iterator &)
void pushup_multiplier (iterator)
void node_zero (iterator)
void node_one (iterator)
void node_integer (iterator, int)
void fill_index_position_map (iterator, const index_map_t &, index_position_map_t &) const
void fill_map (index_map_t &, sibling_iterator, sibling_iterator) const
bool rename_replacement_dummies (iterator, bool still_inside_algo=false)
void print_classify_indices (iterator) const
void determine_intersection (index_map_t &one, index_map_t &two, index_map_t &target, bool move_out=false) const
void classify_add_index (iterator it, index_map_t &ind_free, index_map_t &ind_dummy) const
void classify_indices_up (iterator, index_map_t &ind_free, index_map_t &ind_dummy) const
void classify_indices (iterator, index_map_t &ind_free, index_map_t &ind_dummy) const
int max_numbered_name_one (const std::string &nm, const index_map_t *one) const
int max_numbered_name (const std::string &, const index_map_t *m1, const index_map_t *m2=0, const index_map_t *m3=0, const index_map_t *m4=0, const index_map_t *m5=0) const
exptree get_dummy (const list_property *, const index_map_t *m1, const index_map_t *m2=0, const index_map_t *m3=0, const index_map_t *m4=0, const index_map_t *m5=0) const
exptree get_dummy (const list_property *, iterator) const
exptree get_dummy (const list_property *, iterator, iterator) const

Static Protected Member Functions

static bool less_without_numbers (nset_t::iterator, nset_t::iterator)
static bool equal_without_numbers (nset_t::iterator, nset_t::iterator)

Protected Attributes

unsigned int last_used_equation_number
std::vector< std::pair< sibling_iterator,
sibling_iterator > > 
marks
iterator previous_expression
bool dont_iterate

Private Member Functions

void cancel_modification ()
void copy_expression (exptree::iterator) const
bool prepare_for_modification (bool make_copy)
void propagate_zeroes (post_order_iterator &, const iterator &)
void dumpmap (std::ostream &, const index_map_t &) const
bool cleanup_anomalous_products (exptree &tr, exptree::iterator &it)

Classes

class  constructor_error

Member Typedef Documentation

typedef std::multimap<exptree, exptree::iterator, tree_exact_less_no_wildcards_mod_prel_obj> algorithm::index_map_t [protected]
 

A map from a pattern to the position where it occurs in the tree.

typedef std::map<exptree::iterator, int, exptree::iterator_base_less> algorithm::index_position_map_t [protected]
 

A map from the position of each index to the sequential index.

typedef std::pair<sibling_iterator, sibling_iterator> algorithm::range_t [protected]
 

Finding objects in sets.

typedef std::vector<range_t> algorithm::range_vector_t [protected]
 


Member Enumeration Documentation

enum algorithm::global_success_t
 

Enumerator:
g_not_yet_started 
g_arguments_accepted 
g_operand_determined 
g_applied 
g_apply_failed 

enum algorithm::result_t
 

Enumerator:
l_no_action 
l_applied 
l_error 


Constructor & Destructor Documentation

algorithm::algorithm exptree ,
iterator 
 

algorithm::~algorithm  )  [virtual]
 


Member Function Documentation

void algorithm::apply unsigned int  last_used_equation_number,
bool  multiple,
bool  until_nochange,
bool  make_copy,
int  act_at_level = -1,
bool  called_by_manipulator = false
 

algorithm::result_t algorithm::apply sibling_iterator ,
sibling_iterator
[virtual]
 

Reimplemented in collect_terms, sym, asym, and frommath.

algorithm::result_t algorithm::apply iterator  )  [virtual]
 

Reimplemented in prodrule, remove_indexbracket, distribute, sumsort, prodsort, spinorsort, keep_terms, reduce_sub, prodflatten, sumflatten, listflatten, prodcollectnum, reduce_div, subseq, collect_factors, collect_terms, factorise, canonicalise, reduce, drop, drop_weight, keep_weight, ratrewrite, sym, asym, canonicalorder, acanonicalorder, impose_asym, eqn, indexsort, asymprop, young_project, young_project_tensor, expand_power, permute, frommaple, run, rename_dummies, generate_indexbracket, unique_indices, einsteinify, combine, expand, debracket, eliminate_kronecker, reduce_gendelta, break_gendelta, dualise_tensor, epsprod2gendelta, eliminate_eps, product_shorthand, expand_product_shorthand, remove_eoms, pintegrate, remove_vanishing_derivatives, unwrap, impose_bianchi, all_contractions, join, remove_gamma_trace, gammasplit, projweyl, multpauli, rewrite_diracbar, fierz, lsolve, decompose, length, take, range, inner, list_sum, coefficients, numerical_flatten, tree_dump, memdump, depprint, eqs, proplist, print, indexlist, assert_or_exit, number_of_terms, aticksen, riemannid, extract_properties, eliminate_vielbein, eliminate_metric, rewrite_indices, ricci_identity, weyl_index_order, riemann_index_regroup, remove_weyl_traces, split_index, pop, amnesia, substitute, vary, take_match, replace_match, simple_rename, index_rename, tabdimension, tabcanonicalise, tabstandardform, lr_tensor, young_project_product, and decompose_product.

bool algorithm::apply_recursive iterator ,
bool  check_consistency = true,
int  act_at_level = -1,
bool  called_by_manipulator = false,
bool  until_nochange = false
 

bool algorithm::can_apply sibling_iterator  ,
sibling_iterator 
[virtual]
 

Reimplemented in frommath.

bool algorithm::can_apply iterator   )  [virtual]
 

Reimplemented in prodrule, remove_indexbracket, distribute, sumsort, prodsort, spinorsort, keep_terms, reduce_sub, prodflatten, sumflatten, listflatten, prodcollectnum, reduce_div, subseq, collect_factors, collect_terms, factorise, canonicalise, reduce, drop, drop_keep_weight, ratrewrite, sym_asym, order, impose_asym, eqn, indexsort, asymprop, young_project, young_project_tensor, expand_power, permute, frommaple, run, rename_dummies, generate_indexbracket, unique_indices, einsteinify, combine, expand, debracket, eliminate_kronecker, reduce_gendelta, break_gendelta, dualise_tensor, epsprod2gendelta, eliminate_eps, product_shorthand, expand_product_shorthand, remove_eoms, pintegrate, remove_vanishing_derivatives, unwrap, impose_bianchi, all_contractions, join, remove_gamma_trace, gammasplit, projweyl, multpauli, rewrite_diracbar, fierz, lsolve, decompose, length, take, range, inner, list_sum, coefficients, numerical_flatten, tree_dump, memdump, depprint, eqs, proplist, print, indexlist, assert_or_exit, number_of_terms, aticksen, riemannid, extract_properties, eliminate_vielbein, eliminate_metric, rewrite_indices, ricci_identity, weyl_index_order, riemann_index_regroup, remove_weyl_traces, split_index, pop, amnesia, substitute, vary, take_match, replace_match, simple_rename, index_rename, tabdimension, tabcanonicalise, tabstandardform, lr_tensor, young_project_product, and decompose_product.

void algorithm::cancel_modification  )  [private]
 

bool algorithm::check_consistency iterator   )  const
 

bool algorithm::check_index_consistency iterator   )  const
 

void algorithm::classify_add_index iterator  it,
index_map_t ind_free,
index_map_t ind_dummy
const [protected]
 

void algorithm::classify_indices iterator  ,
index_map_t ind_free,
index_map_t ind_dummy
const [protected]
 

void algorithm::classify_indices_up iterator  ,
index_map_t ind_free,
index_map_t ind_dummy
const [protected]
 

bool algorithm::cleanup_anomalous_products exptree tr,
exptree::iterator &  it
[private]
 

bool algorithm::contains sibling_iterator  from,
sibling_iterator  to,
sibling_iterator  arg
[protected]
 

void algorithm::copy_expression exptree::iterator   )  const [private]
 

void algorithm::determine_intersection index_map_t one,
index_map_t two,
index_map_t target,
bool  move_out = false
const [protected]
 

void algorithm::dumpmap std::ostream &  ,
const index_map_t
const [private]
 

bool algorithm::equal_without_numbers nset_t::iterator  ,
nset_t::iterator 
[static, protected]
 

void algorithm::fill_index_position_map iterator  ,
const index_map_t ,
index_position_map_t
const [protected]
 

void algorithm::fill_map index_map_t ,
sibling_iterator  ,
sibling_iterator 
const [protected]
 

algorithm::range_vector_t::iterator algorithm::find_arg_superset range_vector_t ,
sibling_iterator  it
[protected]
 

template<class Iter>
algorithm::range_vector_t::iterator algorithm::find_arg_superset range_vector_t ,
Iter  st,
Iter  nd
[protected]
 

void algorithm::find_argument_lists range_vector_t ,
bool  only_comma_lists = true
const [protected]
 

exptree algorithm::get_dummy const list_property ,
iterator  ,
iterator 
const [protected]
 

exptree algorithm::get_dummy const list_property ,
iterator 
const [protected]
 

exptree algorithm::get_dummy const list_property ,
const index_map_t m1,
const index_map_t m2 = 0,
const index_map_t m3 = 0,
const index_map_t m4 = 0,
const index_map_t m5 = 0
const [protected]
 

int algorithm::index_parity iterator   )  const [protected]
 

bool algorithm::is_single_term iterator   )  [protected]
 

Take a single non-product node in a sum and wrap it in a product node, so it can be handled on the same footing as a proper product.

bool algorithm::less_without_numbers nset_t::iterator  ,
nset_t::iterator 
[static, protected]
 

int algorithm::max_numbered_name const std::string &  ,
const index_map_t m1,
const index_map_t m2 = 0,
const index_map_t m3 = 0,
const index_map_t m4 = 0,
const index_map_t m5 = 0
const [protected]
 

int algorithm::max_numbered_name_one const std::string &  nm,
const index_map_t one
const [protected]
 

void algorithm::node_integer iterator  ,
int 
[protected]
 

void algorithm::node_one iterator   )  [protected]
 

void algorithm::node_zero iterator   )  [protected]
 

bool algorithm::prepare_for_modification bool  make_copy  )  [private]
 

void algorithm::print_classify_indices iterator   )  const [protected]
 

bool algorithm::prod_unwrap_single_term iterator  )  [protected]
 

bool algorithm::prod_wrap_single_term iterator  )  [protected]
 

void algorithm::propagate_zeroes post_order_iterator ,
const iterator
[private]
 

Given a node with zero multiplier, propagate this zero upwards in the tree. Changes the iterator so that it points to the next node in a post_order traversal (post_order: children first, then node). The second node is the topmost node, beyond which this routine is not allowed to touch the tree (i.e. the 2nd iterator will always remain valid).

void algorithm::pushup_multiplier iterator   )  [protected]
 

bool algorithm::rename_replacement_dummies iterator  ,
bool  still_inside_algo = false
[protected]
 

void algorithm::report_progress const std::string &  ,
int  todo,
int  done,
int  count = 2
 


Member Data Documentation

bool algorithm::discard_command_node
 

bool algorithm::dont_iterate [protected]
 

unsigned int algorithm::equation_number
 

bool algorithm::expression_modified
 

stopwatch algorithm::get_dummy_sw [static]
 

global_success_t algorithm::global_success
 

stopwatch algorithm::index_sw [static]
 

unsigned int algorithm::last_used_equation_number [protected]
 

std::vector<std::pair<sibling_iterator, sibling_iterator> > algorithm::marks [protected]
 

unsigned int algorithm::number_of_calls
 

unsigned int algorithm::number_of_modifications
 

exptree_output::output_format_t algorithm::output_format
 

iterator algorithm::previous_expression [protected]
 

stopwatch algorithm::report_progress_stopwatch
 

iterator algorithm::subtree
 

bool algorithm::suppress_normal_output
 


The documentation for this class was generated from the following files:
Generated on Sat Jul 18 23:03:15 2009 for cadabra by  doxygen 1.4.6