亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mtl.h

?? Matrix_Template_Library.rar c++矩陣模塊庫函數
?? H
?? 第 1 頁 / 共 5 頁
字號:
// -*- c++ -*-//// Copyright 1997, 1998, 1999 University of Notre Dame.// Authors: Andrew Lumsdaine, Jeremy G. Siek, Lie-Quan Lee//// This file is part of the Matrix Template Library//// You should have received a copy of the License Agreement for the// Matrix Template Library along with the software;  see the// file LICENSE.  If not, contact Office of Research, University of Notre// Dame, Notre Dame, IN  46556.//// Permission to modify the code and to distribute modified code is// granted, provided the text of this NOTICE is retained, a notice that// the code was modified is included with the above COPYRIGHT NOTICE and// with the COPYRIGHT NOTICE in the LICENSE file, and that the LICENSE// file is distributed with the modified code.//// LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.// By way of example, but not limitation, Licensor MAKES NO// REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY// PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS// OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS// OR OTHER RIGHTS.////===========================================================================#ifndef _MTL_MTL_H_#define _MTL_MTL_H_#include <functional>#include <iostream>#include "mtl/mtl_limits.h"#include "mtl/mtl_complex.h"#include "mtl/fast.h"#include "mtl/dense1D.h"#include "mtl/mtl_exception.h"#include "mtl/matrix_traits.h"#include "mtl/transform_iterator.h"#include "mtl/scaled1D.h"#include "mtl/abs.h"#ifdef USE_DOUBLE_DOUBLE#include "contrib/double_double/double_double.h"#endif#if USE_BLAIS#include "mtl/blais.h"#endif#include "mtl/matrix.h"/*  This is a nasty hack necessitated by several things:  1. C++ does not allow temporaries to be passed    into a reference argument.  2. Many MTL expressions result in temporaries  3. Some MTL matrix classes (static matrix) can    not be passed by value for the output argument    since they are not handles. */#define MTL_OUT(X) const X&namespace mtl {template <class T>inline T sign(const T& x) { return (x < 0) ? T(-1) : T(1); }template <class T>inline T xfer_sign(const T& x, const T& y){  return (y < 0) ? -MTL_ABS(x) : MTL_ABS(x);}//: for tri_solve and others//!noindex:class right_side { };//: for tri_solve and others//!noindex:class left_side { };#include "mtl/dim_calc.h"template <class Vector> inlinetypename linalg_traits<Vector>::value_typesum__(const Vector& x, fast::count<0>){  typedef typename linalg_traits<Vector>::value_type vt;  return mtl_algo::accumulate(x.begin(), x.end(), vt());}#if USE_BLAIStemplate <class Vector, int N> inlinetypename linalg_traits<Vector>::value_typesum__(const Vector& x, fast::count<N>){  typedef typename linalg_traits<Vector>::value_type vt;  return fast::accumulate(x.begin(), fast::count<N>(), vt());}#endif//: Sum:  <tt>s <- sum_i(x(i))</tt>//!category: algorithms//!component: function//!definition: mtl.h//!example: vec_sum.cc//!complexity: linear//!typereqs: The addition operator must be defined for <TT>Vector::value_type</TT>.// The sum of all of the elements in the container.template <class Vector> inlinetypename linalg_traits<Vector>::value_typesum(const Vector& x){  return sum__(x, dim_n<Vector>::RET());}#include "mtl/mtl_set.h"template <class S, class T, class R>struct mtl_multiplies : std::binary_function<S, T, R> {  typedef S first_argument_type;  typedef T second_argument_type;  typedef R result_type;  R operator () (const S& x, const T& y) const { return x * y; }};template <class Vector, class T> inlinevoidoned_scale(Vector& x, const T& alpha, fast::count<0>){  typedef typename Vector::value_type VT;  mtl_algo::transform(x.begin(), x.end(), x.begin(),                      std::bind1st(mtl_multiplies<T,VT,VT>(), alpha));}#if USE_BLAIStemplate <class Vector, class T, int N> inlinevoidoned_scale(Vector& x, const T& alpha, fast::count<N>){  typedef typename Vector::value_type VT;  fast::transform(x.begin(), fast::count<N>(), x.begin(),                  std::bind1st(mtl_multiplies<T,VT,VT>(), alpha));}#endiftemplate <class Vector, class T> inlinevoidscale_dim(Vector& x, const T& alpha, oned_tag){  oned_scale(x, alpha, dim_n<Vector>::RET());}template <class Matrix, class T>inline voidscale_dim(Matrix& A, const T& alpha, twod_tag){  typename Matrix::iterator i;  typename Matrix::OneD::iterator j, jend;  for (i = A.begin(); i != A.end(); ++i) {    j = (*i).begin(); jend = (*i).end();    for (; j != jend; ++j)      *j *= alpha;  }}//: Scale:  <tt>A <- alpha*A or x <- alpha x</tt>//// Multiply all the elements in <tt>A</tt> (or <tt>x</tt>) by// <tt>alpha</tt>.// //!category: algorithms//!component: function//!example: vec_scale_algo.cc//!complexity: O(n)//!definition: mtl.h//!typereqs: <TT>Vector</TT> must be mutable//!typereqs: <TT>T</TT> is convertible to <TT>Vector</TT>'s <TT>value_type</TT>//!typereqs: The multiplication operator must be defined for <TT>Vector::value_type</TT> and <tt>T</tt>template <class LinalgObj, class T>inline voidscale(MTL_OUT(LinalgObj) A, const T& alpha){  typedef typename linalg_traits<LinalgObj>::dimension Dim;  scale_dim(const_cast<LinalgObj&>(A), alpha, Dim());  }//: Set Diagonal:  <tt>A(i,i) <- alpha</tt>//// Set the value of the elements on the main diagonal of A to alpha.////!category: algorithms//!component: function//!definition: mtl.h//!example: tri_pack_sol.cc//!typereqs: <tt>T</tt> must be convertible to <tt>Matrix::value_type</tt>.//!complexity: O(min(m,n)) for dense matrices, O(nnz) for sparse matrices (except envelope, which is O(m))template <class Matrix, class T>inline voidset_diagonal(MTL_OUT(Matrix) A_, const T& alpha){  Matrix& A = const_cast<Matrix&>(A_);  typedef typename mtl::matrix_traits<Matrix>::size_type Int;  if (! A.is_unit())    for (Int i = 0; i < A.nrows() && i < A.ncols(); ++i)      A(i,i) = alpha;}//: add absolute value//!noindex:struct abs_add {  template <class T, class U>  T operator()(const T& a, const U& b) {    return a + MTL_ABS(b);  }};template <class Vector>inline typename linalg_traits<Vector>::magnitude_typeoned_one_norm(const Vector& x, fast::count<0>){  typedef typename linalg_traits<Vector>::magnitude_type T;  return mtl_algo::accumulate(x.begin(), x.end(), T(), abs_add());}#if USE_BLAIStemplate <class Vector, int N>inline typename linalg_traits<Vector>::magnitude_typeoned_one_norm(const Vector& x, fast::count<N>){  typedef typename     number_traits<typename Vector::value_type>::magnitude_type T;  return fast::accumulate(x.begin(), fast::count<N>(), T(), abs_add());}#endiftemplate <class Vector>inline typename linalg_traits<Vector>::magnitude_typeone_norm(const Vector& x, oned_tag){  return oned_one_norm(x, dim_n<Vector>::RET());}//: add square//!noindex:struct sqr_add {   template <class T, class U>  T operator()(const T& a, const U& b) {    return a + MTL_ABS(b * b);  }};template <class Vector>inline typename linalg_traits<Vector>::magnitude_typeoned_two_norm(const Vector& x, fast::count<0>){  typedef typename Vector::value_type T;  typedef typename number_traits<T>::magnitude_type M;  using std::sqrt;  return ::sqrt(mtl_algo::accumulate(x.begin(), x.end(), M(), sqr_add()));}#if USE_BLAIStemplate <class Vector, int N>inline typename linalg_traits<Vector>::magnitude_typeoned_two_norm(const Vector& x, fast::count<N>){  typedef typename Vector::value_type T;  typedef typename number_traits<T>::magnitude_type M;  using std::sqrt;  return ::sqrt(fast::accumulate(x.begin(), fast::count<N>(), M(), sqr_add()));}#endif//: Two Norm: <tt>s <- sqrt(sum_i(|x(i)^2|))</tt>////  The square root of the sum of the squares of the elements of the container.////!category: algorithms//!component: function//!definition: mtl.h//!example: vec_two_norm.cc//!complexity: O(n)//!typereqs: <tt>Vector</tt> must have an associated magnitude_type that is the type of the absolute value of <tt>Vector::value_type</tt>.//!typereqs: There must be <tt>abs()</tt> defined for <tt>Vector::value_type</tt>.//!typereqs: The addition must be defined for magnitude_type.//!typereqs: <tt>sqrt()</tt> must be defined for magnitude_type.template <class Vector>inline typename linalg_traits<Vector>::magnitude_typetwo_norm(const Vector& x){  return oned_two_norm(x, dim_n<Vector>::RET());}//: add square//!noindex:struct sqr_ {   template <class T, class U>  T operator()(const T& a, const U& b) {    return a + MTL_ABS(b * b);  }};//: Sum of the Squares////!category: algorithms//!component: function//!definition: mtl.h//!complexity: O(n)template <class Vector>inline typename linalg_traits<Vector>::value_typesum_squares(const Vector& x){  typedef typename linalg_traits<Vector>::value_type T;  return mtl_algo::accumulate(x.begin(), x.end(), T(), sqr_add());}//: compare absolute values//!noindex:struct abs_cmp { template <class T>bool operator()(const T& a, const T& b) {  return MTL_ABS(a) < MTL_ABS(b);}};template <class Vec>inline typename linalg_traits<Vec>::magnitude_typeinfinity_norm(const Vec& x, oned_tag){  return MTL_ABS(*mtl_algo::max_element(x.begin(), x.end(), abs_cmp()));}//: use by one and inf norm//!noindex:template <class Matrix>inline typename linalg_traits<Matrix>::magnitude_typemajor_norm__(const Matrix& A){  typedef typename linalg_traits<Matrix>::magnitude_type T;  typedef typename matrix_traits<Matrix>::size_type Int;  T norm = 0;  T sum = 0;  typename Matrix::const_iterator i;  typename Matrix::OneD::const_iterator j;  i = A.begin();  /* get the first sum */  if (i != A.end()) {    j = (*i).begin();    sum = T(0);    for (; j != (*i).end(); ++j)      sum = sum + MTL_ABS(*j);    norm = sum;    ++i;  }  for (; i != A.end(); ++i) {    j = (*i).begin();    if (A.is_unit() && Int(i.index()) < MTL_MIN(A.nrows(), A.ncols()))      sum = T(1);    else sum = T(0);    for (; j != (*i).end(); ++j)      sum = sum + MTL_ABS(*j);    norm = MTL_MAX(MTL_ABS(norm), MTL_ABS(sum));  }  return norm;}//: used by one and inf norm//!noindex:template <class Matrix>inline typename linalg_traits<Matrix>::magnitude_typeminor_norm__(const Matrix& A){  typedef typename linalg_traits<Matrix>::magnitude_type T;  typedef typename matrix_traits<Matrix>::size_type Int;  typename Matrix::const_iterator i;  typename Matrix::OneD::const_iterator j, jend;  dense1D<T> sums(A.minor(), T());  if (A.is_unit()) {    for (Int x = 0; x < MTL_MIN(A.nrows(), A.ncols()); ++x)      sums[x] = T(1);  }  for (i = A.begin(); i != A.end(); ++i) {    j = (*i).begin(); jend = (*i).end();    for (; j != jend; ++j)      sums[j.index()] += MTL_ABS(*j);  }  return infinity_norm(sums, oned_tag());}/* this handles both the major and minor norm for symmetric matrices */template <class Matrix>inline typename linalg_traits<Matrix>::magnitude_typesymmetric_norm(const Matrix& A, row_tag){  typedef typename linalg_traits<Matrix>::magnitude_type T;  typename Matrix::const_iterator i;  typename Matrix::OneD::const_iterator j, jend;    dense1D<T> sums(A.minor(), T(0));  for (i = A.begin(); i != A.end(); ++i) {    j = (*i).begin();    jend = (*i).end();    if (A.is_upper()) { /* handle the diagonal elements */      sums[j.row()] += MTL_ABS(*j);      ++j;    } else      --jend;    for (; j != jend; ++j) {      sums[j.row()] += MTL_ABS(*j);      sums[j.column()] += MTL_ABS(*j);    }    if (A.is_lower())      sums[j.row()] += MTL_ABS(*j);  }  return infinity_norm(sums, oned_tag());}template <class Matrix>inline typename linalg_traits<Matrix>::magnitude_typesymmetric_norm(const Matrix& A, column_tag){  typedef typename linalg_traits<Matrix>::magnitude_type T;  typename Matrix::const_iterator i;  typename Matrix::OneD::const_iterator j, jend;    dense1D<T> sums(A.minor(), T(0));  for (i = A.begin(); i != A.end(); ++i) {    j = (*i).begin();    jend = (*i).end();    if (A.is_lower()) { /* handle the diagonal elements */      sums[j.row()] += MTL_ABS(*j);      ++j;    } else      --jend;    for (; j != jend; ++j) {      sums[j.row()] += MTL_ABS(*j);      sums[j.column()] += MTL_ABS(*j);    }    if (A.is_upper())      sums[j.row()] += MTL_ABS(*j);  }  return infinity_norm(sums, oned_tag());}template <class Matrix>inline typename linalg_traits<Matrix>::magnitude_typesymmetric_norm(const Matrix& A){  typedef typename matrix_traits<Matrix>::orientation Orien;  return symmetric_norm(A, Orien());}template <class Matrix>inline typename linalg_traits<Matrix>::magnitude_typediagonal_one_norm(const Matrix& A){  typedef typename linalg_traits<Matrix>::magnitude_type T;  typename Matrix::const_iterator i;  typename Matrix::OneD::const_iterator j, jend;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩限制级电影在线观看| 欧美精品视频www在线观看 | 欧美色综合网站| 91在线国内视频| av网站一区二区三区| 国产sm精品调教视频网站| 国产高清精品在线| 丁香天五香天堂综合| 99久久久国产精品免费蜜臀| 91蜜桃婷婷狠狠久久综合9色| 99综合电影在线视频| 91麻豆国产福利精品| 欧美制服丝袜第一页| 欧美日韩一区视频| 欧美精品三级日韩久久| 欧美一级在线视频| 久久久亚洲午夜电影| 日本一二三四高清不卡| 一区精品在线播放| 亚洲va国产天堂va久久en| 免费在线一区观看| 成人av免费在线| 91社区在线播放| 欧美一区二区三区人| 久久久三级国产网站| 亚洲精品国产a| 久久er99精品| 99久久99久久精品免费看蜜桃| 日本高清免费不卡视频| 欧美一区中文字幕| 国产精品毛片大码女人| 婷婷亚洲久悠悠色悠在线播放| 久久 天天综合| 欧洲国内综合视频| 久久久亚洲精品一区二区三区| 亚洲色图制服丝袜| 久久不见久久见中文字幕免费| 风间由美性色一区二区三区| 欧美日韩国产一二三| 国产亚洲成年网址在线观看| 香蕉久久一区二区不卡无毒影院 | 婷婷一区二区三区| 高清久久久久久| 欧美一区二区大片| 亚洲视频一区二区在线| 国产精品亚洲第一| 51精品视频一区二区三区| 国产精品女同一区二区三区| 人人狠狠综合久久亚洲| 91猫先生在线| 国产精品狼人久久影院观看方式| 日本免费新一区视频| 日本韩国一区二区| 中文字幕欧美一| 国产精品1区二区.| 日韩一二三四区| 性久久久久久久久久久久| 一本一道久久a久久精品| 久久久久久一二三区| 久久99久久精品| 欧美久久久久久蜜桃| 亚洲图片欧美视频| 99re66热这里只有精品3直播| 精品国产乱码久久久久久久久 | 蜜臀av性久久久久蜜臀av麻豆| 成人小视频免费观看| 狠狠色狠狠色综合系列| 欧美二区在线观看| 久久九九久久九九| 久久99国产精品久久99| 精品久久久久久久人人人人传媒 | 久久久亚洲午夜电影| 色哟哟一区二区| 精品一区二区三区免费毛片爱| 国产欧美日韩精品a在线观看| 91久久线看在观草草青青| 麻豆精品精品国产自在97香蕉| 欧美国产日韩a欧美在线观看| 欧美性色黄大片手机版| 高清不卡一区二区在线| 五月激情综合网| 亚洲少妇30p| 久久天天做天天爱综合色| 欧美性xxxxxx少妇| 成人福利在线看| 另类小说欧美激情| 亚洲一区二区三区在线| 国产精品视频一二三区| 欧美不卡一二三| 欧美日韩国产一级片| 91麻豆swag| 风流少妇一区二区| 国产在线播精品第三| 午夜精品视频在线观看| 综合自拍亚洲综合图不卡区| 精品国产123| 91精品国产91久久久久久最新毛片 | 麻豆91免费看| 视频一区中文字幕国产| 亚洲精品成人在线| 国产精品久久久久久久久免费樱桃 | 亚洲成人先锋电影| 最新国产精品久久精品| 国产亚洲福利社区一区| 2022国产精品视频| 日韩一卡二卡三卡四卡| 欧美一区二区三区精品| 欧美综合久久久| 在线观看亚洲专区| 日本精品视频一区二区三区| 色偷偷久久一区二区三区| 成人国产电影网| 国产黄色精品网站| 国产精品夜夜嗨| 国产精品一区二区不卡| 国产乱子伦视频一区二区三区| 国产一区二区三区免费| 黄页视频在线91| 激情成人午夜视频| 国产精品996| av不卡免费在线观看| 91亚洲国产成人精品一区二三| 99久久久国产精品| 日本精品一级二级| 欧美三级资源在线| 这里只有精品视频在线观看| 日韩精品一区二区三区在线播放| 欧美一级日韩一级| 久久夜色精品国产噜噜av| 国产三级一区二区三区| 国产精品成人一区二区三区夜夜夜| 中文字幕一区二区在线播放| 亚洲欧美区自拍先锋| 亚洲sss视频在线视频| 欧美bbbbb| 国产成人综合亚洲网站| av亚洲精华国产精华精华 | 亚洲成人中文在线| 麻豆精品一区二区av白丝在线| 国产精品一区二区三区99| 国产成人在线观看| 欧美视频一区二区三区四区| 欧美一区二区精品在线| 国产精品无遮挡| 亚洲制服丝袜av| 久久福利视频一区二区| av中文字幕不卡| 欧美久久久一区| 国产精品午夜免费| 日韩精品五月天| 成人高清视频在线| 56国语精品自产拍在线观看| 国产精品丝袜91| 秋霞影院一区二区| 91丨九色丨蝌蚪富婆spa| 欧美夫妻性生活| 国产精品美女久久久久高潮| 婷婷成人激情在线网| 成人黄色网址在线观看| 欧美一卡在线观看| 日韩一区欧美小说| 激情丁香综合五月| 欧美人成免费网站| 中文字幕一区二区三区视频| 人人狠狠综合久久亚洲| 91麻豆6部合集magnet| 日韩久久免费av| 亚洲国产成人高清精品| 成人午夜免费视频| 精品久久99ma| 亚洲午夜免费福利视频| 成人av在线资源网| 欧美成人精品福利| 亚洲成人在线网站| 91免费版在线| 国产精品嫩草久久久久| 久久国产精品免费| 8x8x8国产精品| 亚洲五码中文字幕| 91在线播放网址| 国产精品理伦片| 国产成人精品免费| 精品国产一区二区三区久久影院| 亚洲一区免费视频| 色综合网站在线| 亚洲特黄一级片| av电影在线观看一区| 久久综合色天天久久综合图片| 日韩国产欧美在线播放| 欧美色图片你懂的| 亚洲国产精品一区二区久久恐怖片 | 国产麻豆精品久久一二三| 91精品国模一区二区三区| 亚洲自拍偷拍麻豆| 91久久精品一区二区二区| 亚洲六月丁香色婷婷综合久久| 成人网在线播放| 国产精品久久久久精k8 | 欧美一级片免费看| 天天影视色香欲综合网老头|