* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <iostream>
#include <vector>
#include <stdexcept>
#include "power.h"
#include "matrix.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(mul, expairseq)
//////////
-// default ctor, dctor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
mul::mul()
{
- debugmsg("mul default ctor",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
}
mul::mul(const ex & lh, const ex & rh)
{
- debugmsg("mul ctor from ex,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
overall_coeff = _ex1;
construct_from_2_ex(lh,rh);
mul::mul(const exvector & v)
{
- debugmsg("mul ctor from exvector",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
overall_coeff = _ex1;
construct_from_exvector(v);
mul::mul(const epvector & v)
{
- debugmsg("mul ctor from epvector",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
overall_coeff = _ex1;
construct_from_epvector(v);
mul::mul(const epvector & v, const ex & oc)
{
- debugmsg("mul ctor from epvector,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
overall_coeff = oc;
construct_from_epvector(v);
mul::mul(epvector * vp, const ex & oc)
{
- debugmsg("mul ctor from epvector *,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
GINAC_ASSERT(vp!=0);
overall_coeff = oc;
mul::mul(const ex & lh, const ex & mh, const ex & rh)
{
- debugmsg("mul ctor from ex,ex,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
exvector factors;
factors.reserve(3);
void mul::print(const print_context & c, unsigned level) const
{
- debugmsg("mul print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
inherited::print(c, level);
if (precedence() <= level)
c.s << ")";
+ } else if (is_a<print_python_repr>(c)) {
+ c.s << class_name() << '(';
+ unsigned end = nops();
+ if (end)
+ op(0).print(c);
+ for (unsigned i=1; i<end; ++i) {
+ c.s << ',';
+ op(i).print(c);
+ }
+ c.s << ')';
} else {
if (precedence() <= level) {
* @param level cut-off in recursive evaluation */
ex mul::eval(int level) const
{
- debugmsg("mul eval",LOGLEVEL_MEMBER_FUNCTION);
-
epvector *evaled_seqp = evalchildren(level);
if (evaled_seqp) {
// do more evaluation later
* pointer, if sequence is unchanged. */
epvector * mul::expandchildren(unsigned options) const
{
- epvector::const_iterator last = seq.end();
+ const epvector::const_iterator last = seq.end();
epvector::const_iterator cit = seq.begin();
while (cit!=last) {
const ex & factor = recombine_pair_to_ex(*cit);