source: XMLIO_V2/external/include/blitz/tinymatexpr.h @ 73

Last change on this file since 73 was 73, checked in by ymipsl, 14 years ago
  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1// -*- C++ -*-
2/***************************************************************************
3 * blitz/tinymatexpr.h   Tiny Matrix Expressions
4 *
5 * $Id: tinymatexpr.h,v 1.5 2005/05/07 04:17:56 julianc Exp $
6 *
7 * Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * Suggestions:          blitz-dev@oonumerics.org
20 * Bugs:                 blitz-bugs@oonumerics.org
21 *
22 * For more information, please see the Blitz++ Home Page:
23 *    http://oonumerics.org/blitz/
24 *
25 ***************************************************************************/
26
27#ifndef BZ_TINYMATEXPR_H
28#define BZ_TINYMATEXPR_H
29
30#ifndef BZ_TINYMAT_H
31 #error <blitz/tinymatexpr.h> must be included via <blitz/tinymat.h>
32#endif
33
34BZ_NAMESPACE(blitz)
35
36template<typename T_expr>
37class _bz_tinyMatExpr {
38public:
39    typedef _bz_typename T_expr::T_numtype T_numtype;
40
41    static const int
42        rows = T_expr::rows,
43        columns = T_expr::columns;
44
45    _bz_tinyMatExpr(T_expr expr)
46        : expr_(expr)
47    { }
48
49    _bz_tinyMatExpr(const _bz_tinyMatExpr<T_expr>& x)
50        : expr_(x.expr_)
51    { }
52
53    T_numtype operator()(int i, int j) const
54    { return expr_(i,j); }
55
56protected:
57    T_expr expr_;
58};
59
60BZ_NAMESPACE_END
61
62#endif // BZ_TINYMATEXPR_H
63
Note: See TracBrowser for help on using the repository browser.