📄 inoututil.h
字号:
//****************************************************************************// InOutUtil.h Input-Output utilities//****************************************************************************#ifndef INOUTUTIL_H#define INOUTUTIL_H#include "common.h"#include "Interval.h"#include "Hedge.h"#include "ArrayTree.h"/************************** Interval *****************************************/ostream &operator<<(ostream &, const Interval &); // output interval as a columnistream &operator>>(istream &, Interval &); // read into I from a streamvoid PrintToFile(const Interval &I, const char *filename); // print to file as columnvoid ReadFromFile(Interval &I, const char *filename); // read data from file into I // assumption: I.beg and I.end set, I.origin allocated /***************************** HedgePer *************************************/ostream &operator<<(ostream &output, const HedgePer &H); // output hedge's data as one long columnistream &operator>>(istream &input, HedgePer &H); // read into H from input stream // assumptions: Hedge completely allocated void PrintToFile(const HedgePer &H, const char *filename); // print to file as one long columnvoid coutLevels(const HedgePer &H); // print levels of H to screenvoid ReadFromFile(HedgePer &H, const char *filename); // read data from file into H // assumption: Hedge completely allocated void PrintLevelsToFile(const HedgePer &H, const char *filename); // print levels of H as one column/***************************** HedgeAper *************************************/ostream &operator<<(ostream &output, const HedgeAper &H); // output hedge's data as one long columnistream &operator>>(istream &input, HedgeAper &H); // read into H from input stream // assumptions: H completely allocated void PrintToFile(const HedgeAper &H, const char *filename); // print to file as one long columnvoid ReadFromFile(HedgeAper &H, const char *filename); // read data from file into H // assumptions: H completely allocated void coutLevels(const HedgeAper &H); // print levels of H to screenvoid PrintLevelsToFile(const HedgeAper &H, const char *filename); // print levels of H as one column/***************************** ArrayTreePer **********************************/ostream &operator<<(ostream &output, const ArrayTreePer &A); // output A as one long column, level after levelistream &operator>>(istream &input, ArrayTreePer &A); // read into A from input stream, level after level // assumption: A completely allocated void PrintToFile(const ArrayTreePer &A, const char *filename); // print to file as one long column, level after levelvoid ReadFromFile(ArrayTreePer &A, const char *filename); // read data from file into A // assumption: A.maxlevel and A.dim set, A.origin allocated /***************************** ArrayTreeAper *********************************/ostream &operator<<(ostream &output, const ArrayTreeAper &A); // output A as one long column, level after levelistream &operator>>(istream &input, ArrayTreeAper &A); // read into A from input stream, level after level // assumptions: A completely allocated void PrintToFile(const ArrayTreeAper &A, const char *filename); // print to file as one long column, level after levelvoid ReadFromFile(ArrayTreeAper &A, const char *filename); // read data from file into A // assumption: A completely allocated // and all intervals have beg and end defined and origins allocated // assumption: file has enough data to fill out A #endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -