- /* sreal.h by K.Tsuru */
- /*******************************
- RealSize and SCalcInfo class
- ********************************/
- #ifndef S_REAL_H
- #define S_REAL_H
- class RealSize : public virtual SNManager {
- enum { EFF_FIG = 0, HIDDEN_FIG, REAL_MAX_SIZE, BIN_DEC_MAX_SIZE};
- uint size[4];
- void Save(){
- size[EFF_FIG] = effFigures;
- size[HIDDEN_FIG] = hidden;
- size[REAL_MAX_SIZE] = maxSize[REAL];
- size[BIN_DEC_MAX_SIZE] = maxSize[BIN_DEC];
- }
- void Restore(){
- effFigures = size[EFF_FIG];
- hidden = size[HIDDEN_FIG];
- maxSize[REAL] = size[REAL_MAX_SIZE];
- maxSize[BIN_DEC] = size[BIN_DEC_MAX_SIZE];
- size[0] = size[1] = size[2] = size[3] = 0;
- }
- // cannot use
- RealSize(const RealSize&);
- RealSize& operator=(const RealSize&);
- public:
- /************************************************************************
- If PROPER bit is ON, set an efficient size for memory and FFT.
- TEMP_EXTEND bit should be ON when you temporaly extend effective figures.
- If PREF_SPEED bit is ON, set SNManager::preferSpeed = ON.
- See : SDouble::ProperUpPrec()
- *************************************************************************/
- uint SetEffFig(uint eff_fig, int proper = 0);
- RealSize(){ size[0] = size[1] = size[2] = size[3] = 0; }
- enum { PROPER = 1, TEMP_EXTEND = 2, PREF_SPEED = 4};
- RealSize(uint ef, int p = 0){
- size[0] = size[1] = size[2] = size[3] = 0;
- SetEffFig(ef, p); // includes Save()
- }
- ~RealSize(); // includes Restore()
- };
-
- /************************************************
- stucture for infomation of series and iteration
- all members are public
- *************************************************/
- struct SCalcInfo {
- static int iterationCount; // number of ireration in Newton method, etc.
- static ulong upToTerm; // number of summing up terms in series
-
- int ItrCounts() const {
- int it = iterationCount;
- iterationCount = 0; // reset
- return it;
- }
- ulong UpToTerm() const {
- ulong ut = upToTerm;
- upToTerm = 0; // reset
- return ut;
- }
- };
- #endif // S_REAL_H
sreal.h : last modifiled at 2016/09/04 14:21:36(2,053 bytes)
created at 2016/04/11 11:18:59
The creation time of this html file is 2017/10/11 16:07:52 (Wed Oct 11 16:07:52 2017).