00001 #ifndef TOOLS_IS_INCLUDED
00002 #define TOOLS_IS_INCLUDED
00003
00004 #include <ginac/ginac.h>
00005 #include <iostream>
00006 #include <stdio.h>
00007 #include <stdlib.h>
00008 #include <math.h>
00009 #include <string>
00010 #include <sstream>
00011 #include <algorithm>
00012 #include <map>
00013 #include <stdexcept>
00014 #include <vector>
00015
00016
00017
00018 using namespace GiNaC;
00019 using namespace std;
00020
00021 extern symbol x;
00022 extern symbol y;
00023 extern symbol z;
00024 extern numeric nsd;
00025 extern symbol infinity;
00026 extern symbol DUMMY;
00027
00028
00029 typedef vector<ex> ex_vector;
00030
00031
00032 typedef map<ex,ex, ex_is_less> ex_ex_map;
00033 typedef map<ex,int, ex_is_less> ex_int_map;
00034
00035
00036 typedef map<ex,ex>::iterator ex_ex_it;
00037 typedef map<ex,int>::iterator ex_int_it;
00038
00039
00040 typedef vector<exvector> ex_vector_vector;
00041
00042
00043
00044 ex inner(exvector& v1, exvector& v2);
00045 ex inner(lst v1, lst v2);
00046 lst cross(lst& v1, lst& v2);
00047
00048
00049
00050 ex pol(int order, int nsd, const string a);
00051
00052 lst polv(int order, int nsd, const string a);
00053
00054 ex polb(int order, int nsd, const string a);
00055
00056 lst polbv(int order, int nsd, const string a);
00057
00058
00059
00060 lst matvec(matrix& M, lst& x);
00061
00062
00063
00064
00065 exvector coeff(ex pol);
00066 lst coeffs(ex pol);
00067 lst coeffs(lst pols);
00068
00069 ex_ex_map pol2basisandcoeff(ex e);
00070
00071
00072
00073 ex div(exvector& v);
00074 ex div(lst& v);
00075 lst grad(ex f);
00076
00077
00078 void print(exvector& v);
00079 void print(lst& l);
00080 void print(ex_ex_map m);
00081 void print(ex_int_map m);
00082
00083
00084 int dirac(int i, int j);
00085
00086
00087 lst ex2equations(ex rel);
00088 lst collapse(lst l);
00089
00090 matrix equations2matrix (const ex &eqns, const ex &symbols);
00091
00092 lst lst_equals(ex a, ex b);
00093 ex lst_to_matrix2(const lst & l);
00094 lst matrix_to_lst2(const ex & m );
00095
00096
00097 int find(ex e, lst list);
00098 void check_visitor(ex e, lst& exlist);
00099 void visitor_subst_pow(ex e, ex_ex_map& map, ex_int_map& intmap, string a);
00100
00101 string istr(string a, int b);
00102
00103 bool compare(ex e, string s);
00104
00105 void EQUAL_OR_DIE(ex e, char* s);
00106
00107
00108 #endif
00109
00110
00111
00112