SyFi  0.3
SyFi::ExStatsVisitor Class Reference

List of all members.

Public Member Functions

void visit (const power &e)
void visit (const mul &e)
void visit (const add &e)
void visit (const function &e)

Public Attributes

ExStats es

Detailed Description

Definition at line 1327 of file ginac_tools.cpp.


Member Function Documentation

void SyFi::ExStatsVisitor::visit ( const power &  e) [inline]

Definition at line 1337 of file ginac_tools.cpp.

References test_syfi::debug::c.

                {
                        //cout << "pow" << endl;
                        ex b = e.op(1);
                        ex c = b.evalf();
                        if( is_a<numeric>(c) )
                        {
                                numeric nu = ex_to<numeric>(c);
                                int n = (int) to_double(nu);
                                if( is_zero(nu-n) )
                                {
                                        // is an integer power, interpret as a sequence of multiplications
                                        es.muls  += n-1;
                                        es.flops += n-1;
                                }
                        }

                        es.pows++;
                }
void SyFi::ExStatsVisitor::visit ( const mul e) [inline]

Definition at line 1357 of file ginac_tools.cpp.

                {
                        //cout << "mul" << endl;
                        es.muls  += e.nops()-1;
                        es.flops += e.nops()-1;
                }
void SyFi::ExStatsVisitor::visit ( const add e) [inline]

Definition at line 1364 of file ginac_tools.cpp.

                {
                        //cout << "add" << endl;
                        es.adds  += e.nops()-1;
                        es.flops += e.nops()-1;
                }
void SyFi::ExStatsVisitor::visit ( const function &  e) [inline]

Definition at line 1371 of file ginac_tools.cpp.

                {
                        //cout << "func" << endl;
                        es.functions++;
                }

Member Data Documentation

Definition at line 1335 of file ginac_tools.cpp.

Referenced by SyFi::count_ops().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator