Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

hash_entry Class Reference

This class provides a container for expressions to be stored in hash tables. More...

#include <hash_entry.h>

List of all members.

Public Member Functions

 hash_entry (const GiNaC::ex &cd, const GiNaC::ex &sd, const GiNaC::ex &rd, unsigned rkey)
void archive (GiNaC::archive_node &node) const
void read_archive (const GiNaC::archive_node &node, GiNaC::lst &sym_lst)
unsigned return_type (void) const
void print (const GiNaC::print_context &c, unsigned level=0) const
unsigned precedence (void) const
GiNaC::ex eval (int level=0) const
GiNaC::ex subs (const GiNaC::exmap &m, unsigned options=0) const
GiNaC::ex return_value (const GiNaC::ex &obj_data) const
GiNaC::ex hash_data (void) const
GiNaC::ex subst_data (void) const

Protected Member Functions

GiNaC::ex eval_ncmul (const GiNaC::exvector &v) const
GiNaC::ex derivative (const GiNaC::symbol &s) const
unsigned calchash (void) const

Protected Attributes

GiNaC::ex compare_data
GiNaC::ex replace_data
GiNaC::ex return_data
unsigned rtti_key


Detailed Description

This class provides a container for expressions to be stored in hash tables.

The class hash_entry is designed to be stored as the second entry in a hash map. The map would be of type map<unsigned, ex> and the ex would always refer to an object of type hash_entry.

The class hash_entry has four data members: compare_data, replace_data, return_data and rtti_key.

The member compare_data can be accessed via the method hash_data(void) and is used to verify exactly if the entry stored in the map is equivalent to the object which is being looked up. "Is equivalent" can mean "is exactly identical" or "is identical up to simple substitutions".

The member replace_data specifies the components of the return_data which have to be substituted.

The method return_value(obj_data) takes the subst_data from the object looked up and substitutes it into the return_data. If the rtti_key is zero, it is assumed that no substitutions are necesarry and the return_data is returned directly.

Classes which are supposed to be stored in the hash table, have to provide four methods: unsigned get_key(void) ex hash_data(void) ex subst_data(void) ex get_template(void)

get_key is the key for the first entry in the hash map. If the key is found in the hash map, hash_data is used to verify if the entry is equivalent to the class being looked up. subst_data() provides the part which has to specialized. If substitutions are required, get_template() returns the "raw" form for the specific instance of a class.


Member Function Documentation

ex eval int  level = 0  )  const
 

No automatic simplifications

ex eval_ncmul const GiNaC::exvector &  v  )  const [protected]
 

No automatic simplifications

ex hash_data void   )  const
 

Returns the member compare_data.

ex return_value const GiNaC::ex &  obj_data  )  const
 

The method return_value(obj_data) takes the subst_data from the object looked up and substitutes it into the return_data. The way substitutions are performed depends on the rtti_key.

If the rtti_key is zero, it is assumed that no substitutions are necesarry and the return_data is returned directly.

If the rtti_key is one, the obj_data is substituted for the replace_data.

The default is to return the return_data directly.

ex subst_data void   )  const
 

Returns the member replace_data.


The documentation for this class was generated from the following files:
Generated on Wed Jun 10 22:59:11 2009 for Nestedsums library by doxygen 1.3.7