00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef BZ_PRETTYPRINT_H
00029 #define BZ_PRETTYPRINT_H
00030
00031 BZ_NAMESPACE(blitz)
00032
00033 class prettyPrintFormat {
00034
00035 public:
00036 prettyPrintFormat(const bool terse = false)
00037 : tersePrintingSelected_(terse)
00038 {
00039 arrayOperandCounter_ = 0;
00040 scalarOperandCounter_ = 0;
00041 dumpArrayShapes_ = false;
00042 }
00043
00044 void setDumpArrayShapesMode() { dumpArrayShapes_ = true; }
00045 char nextArrayOperandSymbol()
00046 {
00047 return static_cast<char>('A' + ((arrayOperandCounter_++) % 26));
00048 }
00049 char nextScalarOperandSymbol()
00050 {
00051 return static_cast<char>('s' + ((scalarOperandCounter_++) % 26));
00052 }
00053
00054 bool tersePrintingSelected() const { return tersePrintingSelected_; }
00055 bool dumpArrayShapesMode() const { return dumpArrayShapes_; }
00056
00057 private:
00058 bool tersePrintingSelected_;
00059 bool dumpArrayShapes_;
00060 int arrayOperandCounter_;
00061 int scalarOperandCounter_;
00062 };
00063
00064 BZ_NAMESPACE_END
00065
00066 #endif // BZ_PRETTYPRINT_H