matrix_bracket.hpp

来自「矩阵运算源码最新版本」· HPP 代码 · 共 37 行

HPP
37
字号
// Software License for MTL// // Copyright (c) 2007 The Trustees of Indiana University. All rights reserved.// Authors: Peter Gottschling and Andrew Lumsdaine// // This file is part of the Matrix Template Library// // See also license.mtl.txt in the distribution.#ifndef MTL_MATRIX_BRACKETS_INCLUDE#define MTL_MATRIX_BRACKETS_INCLUDEnamespace mtl { namespace operations {    template <typename Matrix, typename Ref, typename ValueRef>    struct bracket_proxy    {	typedef typename Matrix::value_type   value_type;	typedef typename Matrix::size_type    size_type;	explicit bracket_proxy(Ref matrix, size_type row) : matrix(matrix), row(row) {}	ValueRef operator[] (size_type col)	{	    return matrix(row, col);	}      protected:	Ref         matrix;	size_type   row;    };} // namespace operations} // NAMESPACE mtl#endif // MTL_MATRIX_BRACKETS_INCLUDE

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?