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 | |
---|
34 | BZ_NAMESPACE(blitz) |
---|
35 | |
---|
36 | template<typename T_expr> |
---|
37 | class _bz_tinyMatExpr { |
---|
38 | public: |
---|
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 | |
---|
56 | protected: |
---|
57 | T_expr expr_; |
---|
58 | }; |
---|
59 | |
---|
60 | BZ_NAMESPACE_END |
---|
61 | |
---|
62 | #endif // BZ_TINYMATEXPR_H |
---|
63 | |
---|