1
/***************************************************************************
2
* blitz/matref.h Declaration of the _bz_MatrixRef<P_numtype, P_structure>
5
* $Id: matref.h,v 1.4 2003/12/11 03:44:22 julianc Exp $
7
* Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org>
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.
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.
19
* Suggestions: blitz-dev@oonumerics.org
20
* Bugs: blitz-bugs@oonumerics.org
22
* For more information, please see the Blitz++ Home Page:
23
* http://oonumerics.org/blitz/
25
***************************************************************************/
31
#error <blitz/matref.h> must be included via <blitz/matexpr.h>
32
#endif // BZ_MATEXPR_H
36
template<typename P_numtype, typename P_structure>
40
typedef P_numtype T_numtype;
42
_bz_MatrixRef(const Matrix<P_numtype, P_structure>& m)
46
T_numtype operator()(unsigned i, unsigned j) const
47
{ return (*matrix_)(i,j); }
49
unsigned rows(unsigned) const
50
{ return matrix_->rows(); }
52
unsigned cols(unsigned) const
53
{ return matrix_->cols(); }
58
const Matrix<P_numtype, P_structure>* matrix_;