//////////
const add some_add;
-const type_info & typeid_add = typeid(some_add);
+const std::type_info & typeid_add = typeid(some_add);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const add some_add;
-extern const type_info & typeid_add;
+extern const std::type_info & typeid_add;
// utility functions
inline const add &ex_to_add(const ex &e)
unsigned int num_atoms = ar.atoms.size();
write_unsigned(os, num_atoms);
for (unsigned int i=0; i<num_atoms; i++)
- os << ar.atoms[i] << ends;
+ os << ar.atoms[i] << std::ends;
// Write expressions
unsigned int num_exprs = ar.exprs.size();
std::vector<std::string>::const_iterator i = atoms.begin(), iend = atoms.end();
archive_atom id = 0;
while (i != iend) {
- os << " " << id << " " << *i << endl;
+ os << " " << id << " " << *i << std::endl;
i++; id++;
}
}
- os << endl;
+ os << std::endl;
// Dump expressions
os << "Expressions:\n";
std::vector<archived_ex>::const_iterator i = exprs.begin(), iend = exprs.end();
unsigned int index = 0;
while (i != iend) {
- os << " " << index << " \"" << unatomize(i->name) << "\" root node " << i->root << endl;
+ os << " " << index << " \"" << unatomize(i->name) << "\" root node " << i->root << std::endl;
i++; index++;
}
}
- os << endl;
+ os << std::endl;
// Dump nodes
os << "Nodes:\n";
case PTYPE_NODE: os << "node"; break;
default: os << "<unknown>"; break;
}
- os << " \"" << a.unatomize(i->name) << "\" " << i->value << endl;
+ os << " \"" << a.unatomize(i->name) << "\" " << i->value << std::endl;
i++;
}
}
//////////
const basic some_basic;
-const type_info & typeid_basic=typeid(some_basic);
+const std::type_info & typeid_basic = typeid(some_basic);
//////////
// global variables
// global constants
extern const basic some_basic;
-extern const type_info & typeid_basic;
+extern const std::type_info & typeid_basic;
// global variables
//////////
const clifford some_clifford;
-const type_info & typeid_clifford=typeid(some_clifford);
+const std::type_info & typeid_clifford = typeid(some_clifford);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const clifford some_clifford;
-extern const type_info & typeid_clifford;
+extern const std::type_info & typeid_clifford;
// utility functions
inline const clifford &ex_to_clifford(const ex &e)
//////////
const color some_color;
-const type_info & typeid_color=typeid(some_color);
+const std::type_info & typeid_color = typeid(some_color);
//////////
// friend functions
// global constants
extern const color some_color;
-extern const type_info & typeid_color;
+extern const std::type_info & typeid_color;
// global functions
inline const color &ex_to_color(const ex &e)
//////////
const coloridx some_coloridx;
-const type_info & typeid_coloridx=typeid(some_coloridx);
+const std::type_info & typeid_coloridx = typeid(some_coloridx);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const coloridx some_coloridx;
-extern const type_info & typeid_coloridx;
+extern const std::type_info & typeid_coloridx;
// utility functions
inline const coloridx &ex_to_coloridx(const ex &e)
//////////
const constant some_constant;
-const type_info & typeid_constant=typeid(some_constant);
+const std::type_info & typeid_constant = typeid(some_constant);
/** Pi. (3.14159...) Diverts straight into CLN for evalf(). */
const constant Pi("Pi", PiEvalf);
// global constants
extern const constant some_constant;
-extern const type_info & typeid_constant;
+extern const std::type_info & typeid_constant;
extern const constant Pi;
extern const constant Catalan;
// global constants
extern const ${CONTAINER} some_${CONTAINER};
-extern const type_info & typeid_${CONTAINER};
+extern const std::type_info & typeid_${CONTAINER};
// utility functions
inline const ${CONTAINER} &ex_to_${CONTAINER}(const ex &e)
//////////
const ${CONTAINER} some_${CONTAINER};
-const type_info & typeid_${CONTAINER}=typeid(some_${CONTAINER});
+const std::type_info & typeid_${CONTAINER} = typeid(some_${CONTAINER});
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// double test makes it easier to set a breakpoint...
if (!is_ex_exactly_of_type((*it_last).rest,numeric)||
!is_ex_exactly_of_type((*it).rest,numeric)) {
- printpair(cout,*it_last,0);
- cout << ">";
- printpair(cout,*it,0);
- cout << "\n";
- cout << "pair1:" << std::endl;
- (*it_last).rest.printtree(cout);
- (*it_last).coeff.printtree(cout);
- cout << "pair2:" << std::endl;
- (*it).rest.printtree(cout);
- (*it).coeff.printtree(cout);
+ printpair(std::clog,*it_last,0);
+ std::clog << ">";
+ printpair(std::clog,*it,0);
+ std::clog << "\n";
+ std::clog << "pair1:" << std::endl;
+ (*it_last).rest.printtree(std::clog);
+ (*it_last).coeff.printtree(std::clog);
+ std::clog << "pair2:" << std::endl;
+ (*it).rest.printtree(std::clog);
+ (*it).coeff.printtree(std::clog);
return 0;
}
}
//////////
const expairseq some_expairseq;
-const type_info & typeid_expairseq=typeid(some_expairseq);
+const std::type_info & typeid_expairseq = typeid(some_expairseq);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const expairseq some_expairseq;
-extern const type_info & typeid_expairseq;
+extern const std::type_info & typeid_expairseq;
// utility functions
inline const expairseq &ex_to_expairseq(const ex &e)
//////////
const fail some_fail;
-const type_info & typeid_fail=typeid(some_fail);
+const std::type_info & typeid_fail = typeid(some_fail);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const fail some_fail;
-extern const type_info & typeid_fail;
+extern const std::type_info & typeid_fail;
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const function some_function;
-extern const type_info & typeid_function;
+extern const std::type_info & typeid_function;
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
//////////
const function some_function;
-const type_info & typeid_function=typeid(some_function);
+const std::type_info & typeid_function=typeid(some_function);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
//////////
const idx some_idx;
-const type_info & typeid_idx=typeid(some_idx);
+const std::type_info & typeid_idx = typeid(some_idx);
//////////
// other functions
// global constants
extern const idx some_idx;
-extern const type_info & typeid_idx;
+extern const std::type_info & typeid_idx;
// utility functions
inline const idx &ex_to_idx(const ex &e)
//////////
const indexed some_indexed;
-const type_info & typeid_indexed=typeid(some_indexed);
+const std::type_info & typeid_indexed = typeid(some_indexed);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const indexed some_indexed;
-extern const type_info & typeid_indexed;
+extern const std::type_info & typeid_indexed;
// utility functions
inline const indexed &ex_to_indexed(const ex &e)
matrix solution;
try {
solution = sys.solve(vars,rhs);
- } catch (const runtime_error & e) {
+ } catch (const std::runtime_error & e) {
// Probably singular matrix or otherwise overdetermined system:
// It is consistent to return an empty list
return lst();
ex recur;
for (numeric p; p<=m; ++p)
recur += log(arg+p);
- cout << recur << endl;
return (lgamma(arg+m+_ex1())-recur).series(rel, order, options);
}
class ex;
/** Set the input string to be parsed by ginac_yyparse() (used internally). */
-extern void set_lexer_string(const string &s);
+extern void set_lexer_string(const std::string &s);
/** Set the list of predefined symbols for the lexer (used internally). */
extern void set_lexer_symbols(ex l);
ex parsed_ex;
// Last error message returned by parser
-static string parser_error;
+static std::string parser_error;
%}
/* Tokens (T_LITERAL means a literal value returned by the parser, but not
try {
parsed_ex = $1;
YYACCEPT;
- } catch (exception &e) {
- parser_error = e.what();
+ } catch (std::exception &err) {
+ parser_error = err.what();
YYERROR;
}
}
%%
// Get last error encountered by parser
-string get_parser_error(void)
+std::string get_parser_error(void)
{
return parser_error;
}
// Error print routine (store error string in parser_error)
int ginac_yyerror(char *s)
{
- parser_error = string(s) + " at " + string(ginac_yytext);
+ parser_error = std::string(s) + " at " + std::string(ginac_yytext);
}
//////////
const isospin some_isospin;
-const type_info & typeid_isospin=typeid(some_isospin);
+const std::type_info & typeid_isospin = typeid(some_isospin);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const isospin some_isospin;
-extern const type_info & typeid_isospin;
+extern const std::type_info & typeid_isospin;
// utility functions
inline const isospin &ex_to_isospin(const ex &e)
//////////
const lorentzidx some_lorentzidx;
-const type_info & typeid_lorentzidx=typeid(some_lorentzidx);
+const std::type_info & typeid_lorentzidx = typeid(some_lorentzidx);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const lorentzidx some_lorentzidx;
-extern const type_info & typeid_lorentzidx;
+extern const std::type_info & typeid_lorentzidx;
// utility functions
inline const lorentzidx &ex_to_lorentzidx(const ex &e)
//////////
const lortensor some_lortensor;
-const type_info & typeid_lortensor=typeid(some_lortensor);
+const std::type_info & typeid_lortensor = typeid(some_lortensor);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const lortensor some_lortensor;
-extern const type_info & typeid_lortensor;
+extern const std::type_info & typeid_lortensor;
// utility functions
//////////
const matrix some_matrix;
-const type_info & typeid_matrix=typeid(some_matrix);
+const std::type_info & typeid_matrix = typeid(some_matrix);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const matrix some_matrix;
-extern const type_info & typeid_matrix;
+extern const std::type_info & typeid_matrix;
// wrapper functions around member functions
inline unsigned nops(const matrix & m)
{ return m.nops(); }
-inline ex expand(const matrix & m, unsigned options=0)
+inline ex expand(const matrix & m, unsigned options = 0)
{ return m.expand(options); }
inline bool has(const matrix & m, const ex & other)
{ return m.has(other); }
-inline ex eval(const matrix & m, int level=0)
+inline ex eval(const matrix & m, int level = 0)
{ return m.eval(level); }
-inline ex evalf(const matrix & m, int level=0)
+inline ex evalf(const matrix & m, int level = 0)
{ return m.evalf(level); }
inline unsigned rows(const matrix & m)
//////////
const mul some_mul;
-const type_info & typeid_mul = typeid(some_mul);
+const std::type_info & typeid_mul = typeid(some_mul);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const mul some_mul;
-extern const type_info & typeid_mul;
+extern const std::type_info & typeid_mul;
// utility functions
inline const mul &ex_to_mul(const ex &e)
//////////
const ncmul some_ncmul;
-const type_info & typeid_ncmul=typeid(some_ncmul);
+const std::type_info & typeid_ncmul = typeid(some_ncmul);
//////////
// friend functions
// global constants
extern const ncmul some_ncmul;
-extern const type_info & typeid_ncmul;
+extern const std::type_info & typeid_ncmul;
// friend funtions
int deg_b = b.degree(*(it->sym));
it->deg_a = deg_a;
it->deg_b = deg_b;
- it->max_deg = max(deg_a, deg_b);
+ it->max_deg = std::max(deg_a,deg_b);
it->ldeg_a = a.ldegree(*(it->sym));
it->ldeg_b = b.ldegree(*(it->sym));
it++;
numeric rgc = gc.inverse();
ex p = a * rgc;
ex q = b * rgc;
- int maxdeg = max(p.degree(x), q.degree(x));
-
+ int maxdeg = std::max(p.degree(x),q.degree(x));
+
// Find evaluation point
- numeric mp = p.max_coefficient(), mq = q.max_coefficient();
+ numeric mp = p.max_coefficient();
+ numeric mq = q.max_coefficient();
numeric xi;
if (mp > mq)
xi = mq * _num2() + _num2();
// Cancel trivial common factor
int ldeg_a = var->ldeg_a;
int ldeg_b = var->ldeg_b;
- int min_ldeg = min(ldeg_a, ldeg_b);
+ int min_ldeg = std::min(ldeg_a,ldeg_b);
if (min_ldeg > 0) {
ex common = power(x, min_ldeg);
//std::clog << "trivial common factor " << common << endl;
//////////
const numeric some_numeric;
-const type_info & typeid_numeric=typeid(some_numeric);
+const std::type_info & typeid_numeric = typeid(some_numeric);
/** Imaginary unit. This is not a constant but a numeric since we are
* natively handing complex numbers anyways. */
const numeric I = numeric(::complex(cl_I(0),cl_I(1)));
extern const numeric some_numeric;
extern const numeric I;
-extern const type_info & typeid_numeric;
+extern const std::type_info & typeid_numeric;
extern _numeric_digits Digits;
//#define is_a_numeric_hash(x) ((x)==HASHVALUE_NUMERIC)
//////////
const power some_power;
-const type_info & typeid_power=typeid(some_power);
+const std::type_info & typeid_power=typeid(some_power);
// helper function
// global constants
extern const power some_power;
-extern const type_info & typeid_power;
+extern const std::type_info & typeid_power;
// utility functions
inline const power &ex_to_power(const ex &e)
// Global constants
const pseries some_pseries;
-const type_info & typeid_pseries = typeid(some_pseries);
+const std::type_info & typeid_pseries = typeid(some_pseries);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const pseries some_pseries;
-extern const type_info & typeid_pseries;
+extern const std::type_info & typeid_pseries;
/** Return a reference to the pseries object embedded in an expression.
* The result is undefined if the expression does not contain a pseries
//////////
const relational some_relational;
-const type_info & typeid_relational=typeid(some_relational);
+const std::type_info & typeid_relational = typeid(some_relational);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const relational some_relational;
-extern const type_info & typeid_relational;
+extern const std::type_info & typeid_relational;
// utility functions
inline const relational &ex_to_relational(const ex &e)
//////////
const simp_lor some_simp_lor;
-const type_info & typeid_simp_lor = typeid(some_simp_lor);
+const std::type_info & typeid_simp_lor = typeid(some_simp_lor);
//////////
// friend functions
const spmapkey & k=(*cit).first;
std::cerr << "item key=((" << k.first.first
<< "," << k.first.second << "),";
- k.second.printraw(cerr);
- cerr << ") value=" << (*cit).second << std::endl;
+ k.second.printraw(std::cerr);
+ std::cerr << ") value=" << (*cit).second << std::endl;
}
}
}
};
-typedef map<spmapkey,ex,spmapkey_is_less> spmap;
+typedef std::map<spmapkey,ex,spmapkey_is_less> spmap;
class simp_lor;
// global constants
extern const simp_lor some_simp_lor;
-extern const type_info & typeid_simp_lor;
+extern const std::type_info & typeid_simp_lor;
// utility functions
inline const simp_lor &ex_to_simp_lor(const ex &e)
//////////
const structure some_structure;
-const type_info & typeid_structure=typeid(some_structure);
+const std::type_info & typeid_structure = typeid(some_structure);
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
// global constants
extern const structure some_structure;
-extern const type_info & typeid_structure;
+extern const std::type_info & typeid_structure;
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
//////////
const symbol some_symbol;
-const type_info & typeid_symbol=typeid(some_symbol);
+const std::type_info & typeid_symbol = typeid(some_symbol);
//////////
// subclass assigned_ex_info
// global constants
extern const symbol some_symbol;
-extern const type_info & typeid_symbol;
+extern const std::type_info & typeid_symbol;
// utility functions
inline const symbol &ex_to_symbol(const ex &e)