fill.hpp

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

HPP
31
字号
// 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_FILL_INCLUDE#define MTL_FILL_INCLUDE#include <algorithm>namespace mtl {// Sets all values of a matrixtemplate <class Matrix>void fill(Matrix& ma, typename Matrix::value_type value){    std::fill(ma.elements(), ma.elements()+ma.num_elements(), value);}// Temporary solution// will be replaced by sequences and cursors generated by begin<all>(ma) and end<all>(ma)// Using segmented cursors, matrices with non-contigous element storing can be handled} // namespace mtl#endif // MTL_FILL_INCLUDE

⌨️ 快捷键说明

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