2
/***************************************************************************
3
* blitz/prettyprint.h Format object for pretty-printing of
6
* $Id: prettyprint.h,v 1.5 2004/03/09 23:23:43 julianc Exp $
8
* Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org>
10
* This program is free software; you can redistribute it and/or
11
* modify it under the terms of the GNU General Public License
12
* as published by the Free Software Foundation; either version 2
13
* of the License, or (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* Suggestions: blitz-dev@oonumerics.org
21
* Bugs: blitz-bugs@oonumerics.org
23
* For more information, please see the Blitz++ Home Page:
24
* http://oonumerics.org/blitz/
26
***************************************************************************/
28
#ifndef BZ_PRETTYPRINT_H
29
#define BZ_PRETTYPRINT_H
33
class prettyPrintFormat {
36
prettyPrintFormat(const bool terse = false)
37
: tersePrintingSelected_(terse)
39
arrayOperandCounter_ = 0;
40
scalarOperandCounter_ = 0;
41
dumpArrayShapes_ = false;
44
void setDumpArrayShapesMode() { dumpArrayShapes_ = true; }
45
char nextArrayOperandSymbol()
47
return static_cast<char>('A' + ((arrayOperandCounter_++) % 26));
49
char nextScalarOperandSymbol()
51
return static_cast<char>('s' + ((scalarOperandCounter_++) % 26));
54
bool tersePrintingSelected() const { return tersePrintingSelected_; }
55
bool dumpArrayShapesMode() const { return dumpArrayShapes_; }
58
bool tersePrintingSelected_;
59
bool dumpArrayShapes_;
60
int arrayOperandCounter_;
61
int scalarOperandCounter_;
66
#endif // BZ_PRETTYPRINT_H