From: Alexander Frink Date: Mon, 21 Feb 2000 23:04:07 +0000 (+0000) Subject: several more workarounds to make cint work with ginac X-Git-Tag: release_0-5-3~11 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=06a2f420f295976355884d8eb2de5ae79f90c1bc;hp=0cc840f49d87e01b31ad5a848a8bf5470ea43275;ds=sidebyside several more workarounds to make cint work with ginac recognize constants as a return value --- diff --git a/cint/dummies.h b/cint/dummies.h index a616740d..08095215 100644 --- a/cint/dummies.h +++ b/cint/dummies.h @@ -822,3 +822,17 @@ inline ex rhs(basic const & x) { inline bool is_zero(basic const & x) { return is_zero(ex(x)); } +// fixes for simp_lor lor_g(x,y) +inline simp_lor lor_g(ex const & x, basic const & y) { + return lor_g((x),ex(y)); +} +inline simp_lor lor_g(basic const & x, ex const & y) { + return lor_g(ex(x),(y)); +} +inline simp_lor lor_g(basic const & x, basic const & y) { + return lor_g(ex(x),ex(y)); +} + +inline simp_lor lor_vec(const string & x, const basic & y) { + return lor_vec((x),ex(y)); +} diff --git a/cint/dummies.pl b/cint/dummies.pl index 8557032c..69828728 100644 --- a/cint/dummies.pl +++ b/cint/dummies.pl @@ -198,6 +198,10 @@ inline_function_1p('ex','lhs'); inline_function_1p('ex','rhs'); inline_function_1p('bool','is_zero'); +# fixes for simp_lor.h +inline_function_2p('simp_lor','lor_g'); +inline_single_function_2p('simp_lor','lor_vec','const string &','','const basic &','ex'); + close OUT; # Create a file containing stubs that may be necessary because Cint always diff --git a/cint/ginaccint.bin.cpp b/cint/ginaccint.bin.cpp index b903ca68..38d3daee 100644 --- a/cint/ginaccint.bin.cpp +++ b/cint/ginaccint.bin.cpp @@ -115,6 +115,7 @@ void process_tempfile(string const & command) { #ifdef OBSCURE_CINT_HACK static G__value ref_symbol = exec_tempfile("symbol ginac_cint_internal_symbol; ginac_cint_internal_symbol;"); + static G__value ref_constant = exec_tempfile("constant ginac_cint_internal_constant; ginac_cint_internal_constant;"); static G__value ref_function = exec_tempfile("sin(ginac_cint_internal_symbol);"); static G__value ref_power = exec_tempfile("power(ex(ginac_cint_internal_symbol),ex(ginac_cint_internal_symbol));"); static G__value ref_numeric = exec_tempfile("numeric ginac_cint_internal_numeric; ginac_cint_internal_numeric;"); @@ -151,12 +152,14 @@ void process_tempfile(string const & command) +"LAST="+varname+";\n" +"cout << \""+varname+" = \" << "+varname+" << endl << endl;"); } else if (TYPES_EQUAL(retval,ref_symbol)|| + TYPES_EQUAL(retval,ref_constant)|| TYPES_EQUAL(retval,ref_function)|| TYPES_EQUAL(retval,ref_power)|| TYPES_EQUAL(retval,ref_numeric)) { if (!basic_type_warning_already_displayed) { - cout << "WARNING: The return value of the last expression you entered was a symbol," << endl - << "function, power or numeric, which cannot be safely displayed." << endl + cout << endl + <<"WARNING: The return value of the last expression you entered was a symbol," << endl + << "constant, function, power or numeric, which cannot be safely displayed." << endl << "To force the output, cast it explicitly to type 'ex' or use 'cout'," << endl << "for example (assume 'x' is a symbol):" << endl << PROMPT "ex(x);" << endl