/[GiNaC]/ginac/numeric.h
ViewVC logotype

Diff of /ginac/numeric.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.70 by kreckel, Sun May 1 18:23:27 2005 UTC revision 1.71 by vollinga, Thu Nov 10 14:36:28 2005 UTC
# Line 27  Line 27 
27  #include "ex.h"  #include "ex.h"
28    
29  #include <stdexcept>  #include <stdexcept>
30    #include <vector>
31    
32  #include <cln/complex.h>  #include <cln/complex.h>
33    
# Line 39  Line 40 
40    
41  namespace GiNaC {  namespace GiNaC {
42    
43    /** Function pointer to implement callbacks in the case 'Digits' gets changed.
44     *  Main purpose of such callbacks is to adjust look-up tables of certain
45     *  functions to the new precision. Parameter contains the signed difference
46     *  between new Digits and old Digits. */
47    typedef void (* digits_changed_callback)(long);
48    
49  /** This class is used to instantiate a global singleton object Digits  /** This class is used to instantiate a global singleton object Digits
50   *  which behaves just like Maple's Digits.  We need an object rather   *  which behaves just like Maple's Digits.  We need an object rather
51   *  than a dumber basic type since as a side-effect we let it change   *  than a dumber basic type since as a side-effect we let it change
# Line 56  public: Line 63  public:
63          _numeric_digits& operator=(long prec);          _numeric_digits& operator=(long prec);
64          operator long();          operator long();
65          void print(std::ostream &os) const;          void print(std::ostream &os) const;
66            void add_callback(digits_changed_callback callback);
67  // member variables  // member variables
68  private:  private:
69          long digits;                        ///< Number of decimal digits          long digits;                        ///< Number of decimal digits
70          static bool too_late;               ///< Already one object present          static bool too_late;               ///< Already one object present
71            // Holds a list of functions that get called when digits is changed.
72            std::vector<digits_changed_callback> callbacklist;
73  };  };
74    
75    

Legend:
Removed from v.1.70  
changed lines
  Added in v.1.71

Christian Bauer">Christian Bauer
ViewVC Help
Powered by ViewVC 1.1.15