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 #include <cstdlib>
00031
00032 BZ_NAMESPACE(blitz)
00033
00034 class prettyPrintFormat {
00035
00036 public:
00037 prettyPrintFormat(const bool terse = false)
00038 : tersePrintingSelected_(terse)
00039 {
00040 arrayOperandCounter_ = 0;
00041 scalarOperandCounter_ = 0;
00042 dumpArrayShapes_ = false;
00043 }
00044
00045 void setDumpArrayShapesMode() { dumpArrayShapes_ = true; }
00046 char nextArrayOperandSymbol()
00047 {
00048 return static_cast<char>('A' + ((arrayOperandCounter_++) % 26));
00049 }
00050 char nextScalarOperandSymbol()
00051 {
00052 return static_cast<char>('s' + ((scalarOperandCounter_++) % 26));
00053 }
00054
00055 bool tersePrintingSelected() const { return tersePrintingSelected_; }
00056 bool dumpArrayShapesMode() const { return dumpArrayShapes_; }
00057
00058 private:
00059 bool tersePrintingSelected_;
00060 bool dumpArrayShapes_;
00061 int arrayOperandCounter_;
00062 int scalarOperandCounter_;
00063 };
00064
00065 BZ_NAMESPACE_END
00066
00067 #endif // BZ_PRETTYPRINT_H