~ubuntu-branches/ubuntu/utopic/blitz++/utopic

« back to all changes in this revision

Viewing changes to blitz/matref.h

  • Committer: Package Import Robot
  • Author(s): Christophe Trophime
  • Date: 2012-07-06 09:15:30 UTC
  • mfrom: (11.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120706091530-vzrb8zf0vpbf8tp9
Tags: 1:0.10-1
* New upstream release
  Closes: #679407
* debian/rules:
  - update for new release
  - add override_dh_auto_test target
  - regenerate configure and Makefile.am
* debian/control:
  - add libtool, automake to BuildDepends
* debian/libblitz-doc.install
  - modify path for html files
* remove uneeded patches
* add examples.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 * blitz/matref.h      Declaration of the _bz_MatrixRef<P_numtype, P_structure>
3
 
 *                     class.
4
 
 *
5
 
 * $Id: matref.h,v 1.4 2003/12/11 03:44:22 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_MATREF_H
28
 
#define BZ_MATREF_H
29
 
 
30
 
#ifndef BZ_MATEXPR_H
31
 
 #error <blitz/matref.h> must be included via <blitz/matexpr.h>
32
 
#endif // BZ_MATEXPR_H
33
 
 
34
 
BZ_NAMESPACE(blitz)
35
 
 
36
 
template<typename P_numtype, typename P_structure>
37
 
class _bz_MatrixRef {
38
 
 
39
 
public:
40
 
    typedef P_numtype T_numtype;
41
 
 
42
 
    _bz_MatrixRef(const Matrix<P_numtype, P_structure>& m)
43
 
        : matrix_(&m)
44
 
    { }
45
 
 
46
 
    T_numtype operator()(unsigned i, unsigned j) const
47
 
    { return (*matrix_)(i,j); }
48
 
 
49
 
    unsigned rows(unsigned) const
50
 
    { return matrix_->rows(); }
51
 
 
52
 
    unsigned cols(unsigned) const
53
 
    { return matrix_->cols(); }
54
 
 
55
 
private:
56
 
    _bz_MatrixRef() { } 
57
 
 
58
 
    const Matrix<P_numtype, P_structure>* matrix_;
59
 
};
60
 
 
61
 
BZ_NAMESPACE_END
62
 
 
63
 
#endif // BZ_MATREF_H