source: XMLIO_V2/external/include/blitz/prettyprint.h @ 80

Last change on this file since 80 was 80, checked in by ymipsl, 14 years ago

ajout lib externe

  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
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
31BZ_NAMESPACE(blitz)
32
33class prettyPrintFormat {
34
35public:
36    prettyPrintFormat(const bool terse = false)
37        : tersePrintingSelected_(terse) 
38    {
39        arrayOperandCounter_ = 0;
40        scalarOperandCounter_ = 0;
41        dumpArrayShapes_ = false;
42    }
43
44    void setDumpArrayShapesMode()  { dumpArrayShapes_ = true; }
45    char nextArrayOperandSymbol() 
46    { 
47        return static_cast<char>('A' + ((arrayOperandCounter_++) % 26)); 
48    }
49    char nextScalarOperandSymbol() 
50    { 
51        return static_cast<char>('s' + ((scalarOperandCounter_++) % 26)); 
52    }
53
54    bool tersePrintingSelected() const { return tersePrintingSelected_; }
55    bool dumpArrayShapesMode()   const { return dumpArrayShapes_; }
56
57private:
58    bool tersePrintingSelected_;
59    bool dumpArrayShapes_;
60    int arrayOperandCounter_;
61    int scalarOperandCounter_;
62};
63
64BZ_NAMESPACE_END
65
66#endif // BZ_PRETTYPRINT_H
Note: See TracBrowser for help on using the repository browser.