min.hpp
来自「矩阵运算源码最新版本」· HPP 代码 · 共 57 行
HPP
57 行
// 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_MIN_INCLUDE#define MTL_MIN_INCLUDE#include <iostream>#include <cmath>#include <boost/numeric/mtl/concept/collection.hpp>#include <boost/numeric/mtl/utility/tag.hpp>#include <boost/numeric/mtl/utility/category.hpp>#include <boost/numeric/mtl/vector/reduction.hpp>#include <boost/numeric/mtl/vector/reduction_functors.hpp>namespace mtl { namespace impl { // Do we really need this for matrices? template <unsigned long Unroll, typename Vector> typename Collection<Vector>::value_type inline min(const Vector& vector, tag::vector) { typedef typename Collection<Vector>::value_type result_type; return vector::reduction<Unroll, vector::min_functor, result_type>::apply(vector); } } // namespace impltemplate <unsigned long Unroll, typename Value>typename Collection<Value>::value_typeinline min(const Value& value){ return impl::min<Unroll>(value, typename traits::category<Value>::type());}template <typename Value>typename Collection<Value>::value_typeinline min(const Value& value){ return min<8>(value);}} // namespace mtl#endif // MTL_MIN_INCLUDE
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?