blitz
Version 1.0.2
Loading...
Searching...
No Matches
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$
7
*
8
* Copyright (C) 1997-2011 Todd Veldhuizen <tveldhui@acm.org>
9
*
10
* This file is a part of Blitz.
11
*
12
* Blitz is free software: you can redistribute it and/or modify
13
* it under the terms of the GNU Lesser General Public License
14
* as published by the Free Software Foundation, either version 3
15
* of the License, or (at your option) any later version.
16
*
17
* Blitz is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU Lesser General Public License for more details.
21
*
22
* You should have received a copy of the GNU Lesser General Public
23
* License along with Blitz. If not, see <http://www.gnu.org/licenses/>.
24
*
25
* Suggestions: blitz-devel@lists.sourceforge.net
26
* Bugs: blitz-support@lists.sourceforge.net
27
*
28
* For more information, please see the Blitz++ Home Page:
29
* https://sourceforge.net/projects/blitz/
30
*
31
***************************************************************************/
32
33
#ifndef BZ_PRETTYPRINT_H
34
#define BZ_PRETTYPRINT_H
35
36
#include <
blitz/blitz.h
>
37
38
namespace
blitz
{
39
40
class
prettyPrintFormat
{
41
42
public
:
43
prettyPrintFormat
(
const
bool
terse =
false
)
44
:
tersePrintingSelected_
(terse)
45
{
46
arrayOperandCounter_
= 0;
47
scalarOperandCounter_
= 0;
48
dumpArrayShapes_
=
false
;
49
}
50
51
void
setDumpArrayShapesMode
() {
dumpArrayShapes_
=
true
; }
52
char
nextArrayOperandSymbol
()
53
{
54
return
static_cast<
char
>
(
'A'
+ ((
arrayOperandCounter_
++) % 26));
55
}
56
char
nextScalarOperandSymbol
()
57
{
58
return
static_cast<
char
>
(
's'
+ ((
scalarOperandCounter_
++) % 26));
59
}
60
61
bool
tersePrintingSelected
()
const
{
return
tersePrintingSelected_
; }
62
bool
dumpArrayShapesMode
()
const
{
return
dumpArrayShapes_
; }
63
64
private
:
65
bool
tersePrintingSelected_
;
66
bool
dumpArrayShapes_
;
67
int
arrayOperandCounter_
;
68
int
scalarOperandCounter_
;
69
};
70
71
}
72
73
#endif
// BZ_PRETTYPRINT_H
blitz.h
blitz::prettyPrintFormat::nextArrayOperandSymbol
char nextArrayOperandSymbol()
Definition
prettyprint.h:52
blitz::prettyPrintFormat::scalarOperandCounter_
int scalarOperandCounter_
Definition
prettyprint.h:68
blitz::prettyPrintFormat::dumpArrayShapesMode
bool dumpArrayShapesMode() const
Definition
prettyprint.h:62
blitz::prettyPrintFormat::dumpArrayShapes_
bool dumpArrayShapes_
Definition
prettyprint.h:66
blitz::prettyPrintFormat::arrayOperandCounter_
int arrayOperandCounter_
Definition
prettyprint.h:67
blitz::prettyPrintFormat::prettyPrintFormat
prettyPrintFormat(const bool terse=false)
Definition
prettyprint.h:43
blitz::prettyPrintFormat::tersePrintingSelected
bool tersePrintingSelected() const
Definition
prettyprint.h:61
blitz::prettyPrintFormat::tersePrintingSelected_
bool tersePrintingSelected_
Definition
prettyprint.h:65
blitz::prettyPrintFormat::setDumpArrayShapesMode
void setDumpArrayShapesMode()
Definition
prettyprint.h:51
blitz::prettyPrintFormat::nextScalarOperandSymbol
char nextScalarOperandSymbol()
Definition
prettyprint.h:56
blitz
Definition
array-impl.h:66
blitz
prettyprint.h
Generated by
1.13.1