blitz  Version 0.9
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
prettyprint.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  * blitz/prettyprint.h Format object for pretty-printing of
4  * array expressions
5  *
6  * $Id: prettyprint.h,v 1.5 2004/03/09 23:23:43 julianc Exp $
7  *
8  * Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org>
9  *
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.
14  *
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.
19  *
20  * Suggestions: blitz-dev@oonumerics.org
21  * Bugs: blitz-bugs@oonumerics.org
22  *
23  * For more information, please see the Blitz++ Home Page:
24  * http://oonumerics.org/blitz/
25  *
26  ***************************************************************************/
27 
28 #ifndef BZ_PRETTYPRINT_H
29 #define BZ_PRETTYPRINT_H
30 #include <cstdlib>
31 
32 BZ_NAMESPACE(blitz)
33 
35 
36 public:
37  prettyPrintFormat(const bool terse = false)
38  : tersePrintingSelected_(terse)
39  {
40  arrayOperandCounter_ = 0;
41  scalarOperandCounter_ = 0;
42  dumpArrayShapes_ = false;
43  }
44 
45  void setDumpArrayShapesMode() { dumpArrayShapes_ = true; }
46  char nextArrayOperandSymbol()
47  {
48  return static_cast<char>('A' + ((arrayOperandCounter_++) % 26));
49  }
50  char nextScalarOperandSymbol()
51  {
52  return static_cast<char>('s' + ((scalarOperandCounter_++) % 26));
53  }
54 
55  bool tersePrintingSelected() const { return tersePrintingSelected_; }
56  bool dumpArrayShapesMode() const { return dumpArrayShapes_; }
57 
58 private:
63 };
64 
66 
67 #endif // BZ_PRETTYPRINT_H