symbol_factory.h

Go to the documentation of this file.
00001 // Copyright (C) 2006-2009 Kent-Andre Mardal and Simula Research Laboratory.
00002 // Licensed under the GNU GPL Version 2, or (at your option) any later version.
00003 
00004 #ifndef SYMBOL_FACTORY_IS_INCLUDED
00005 #define SYMBOL_FACTORY_IS_INCLUDED
00006 
00007 #include <string>
00008 
00009 #include <ginac/ginac.h>
00010 
00011 namespace SyFi
00012 {
00013 
00014         // TODO: make a class SymbolSpace or something
00015         /*
00016         class SpaceSymbols
00017         {
00018         public:
00019           SpaceSymbols(int nsd_, const std::string & base_name);
00020 
00021         int nsd() const;
00022         GiNaC::symbol x(int i) const;
00023         GiNaC::symbol t() const;
00024         };
00025 
00026         ex diff(e, i, ss=default_ss, ss2=default_ss2);
00027         ex div(e, ss=default_ss, ss2=default_ss2);
00028         ex grad(e, ss=default_ss, ss2=default_ss2);
00029         */
00030 
00031         // Initialize global variables of SyFi
00032         void initSyFi(unsigned int nsd);
00033 
00034         // spacial variables, used by differential operators
00035         extern unsigned int nsd;
00036         extern GiNaC::symbol x;
00037         extern GiNaC::symbol y;
00038         extern GiNaC::symbol z;
00039         extern GiNaC::symbol t;
00040         extern GiNaC::lst    p;
00041 
00042         // utility symbols
00043         extern GiNaC::symbol infinity;
00044         extern GiNaC::symbol DUMMY;
00045 
00046         // ===== symbol factory
00047 
00048         // TODO: is it useful to make a singleton for this?
00049 
00050         bool symbol_exists(const std::string & name);
00051 
00052         // TODO: we don't need the const & ?
00053         const GiNaC::symbol & get_symbol(const std::string & name);
00054 
00055         const GiNaC::symbol & isymb(const std::string & a, int b);
00056         const GiNaC::symbol & isymb(const std::string & a, int b, int c);
00057 
00058         GiNaC::ex get_symbolic_vector(int m, const std::string & basename);
00059 
00060         GiNaC::ex get_symbolic_matrix(int m, int n, const std::string & basename);
00061 
00062 }                                                                // namespace SyFi
00063 #endif

Generated on Mon Aug 31 16:16:49 2009 for SyFi by  doxygen 1.5.9