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

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

?? compressed1d.h

?? Matrix_Template_Library.rar c++矩陣模塊庫函數
?? H
字號:
// -*- 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_COMPRESSED1D_H#define MTL_COMPRESSED1D_H#include <vector>#include <algorithm>#include "mtl/mtl_config.h"#include "mtl/entry.h"#include "mtl/compressed_iter.h"#include "mtl/reverse_iter.h"#include "mtl/matrix_traits.h"#include "mtl/refcnt_ptr.h"#include "mtl/scaled1D.h"#include "mtl/light1D.h"#include "mtl/dense1D.h" /* for VC++ workaround -JGS */namespace mtl {using std::lower_bound;using std::find;//: Compressed Sparse Vector//// The compressed1D Vector is a sparse vector implemented with// a pair of parallel arrays. One array is for the element values,// and the other array is for the indices of those elements.// The elements are ordered by their index as they are inserted// into the compressed1D. compressed1D's can be used to build// matrices with the array storage format, and they can also// be used on their own.//// <pre>// [ (1.2, 3), (4.6, 5), (1.0, 10), (3.7, 32) ] A Sparse Vector//// [ 1.2, 4.6, 1.0, 3.7 ]  Value Array// [  3,   5,  10,  32 ]   Index Array// </pre>//// <p>The <tt>compressed1D::iterator</tt> dereferences (<tt>*i</tt>) to// return the element value. One can access the index of that element// with the <tt>i.index()</tt> function. One can also access// the array of indices through the <tt>nz_struct()</tt> method.//// <p>One particularly useful fact is that one can perform// scatters and gathers of sparse elements by using the// <tt>mtl::copy(x,y)</tt> function with a sparse and a// dense vector.////!category: containers//!component: type//!models: Vector//!definition: compressed1D.h//!tparam: T - the element type//!tparam: SizeType - the type for the stored indices - int//!tparam: IND_OFFSET - To handle indexing from 0 or 1 - index_from_zero//!example: gather_scatter.cc, array2D.cc, sparse_copy.cctemplate <class T, class SizeType = int, int IND_OFFSET = index_from_zero>class compressed1D {  typedef std::vector<T> values_vec;  typedef std::vector<SizeType> indices_vec;  typedef indices_vec indices_t;  typedef values_vec  values_t;  typedef refcnt_ptr< values_vec > values_ptr;  typedef refcnt_ptr< indices_vec > indices_ptr;  typedef compressed1D<T,SizeType,IND_OFFSET> self;  typedef typename indices_vec::iterator index_iterator;  typedef typename values_vec::iterator value_iterator;  typedef typename indices_vec::const_iterator index_const_iterator;  typedef typename values_vec::const_iterator value_const_iterator;  friend class elt_ref<self>;  friend class const_elt_ref<self>;public:  /**@name Type Definitions */  enum { N = 0 };  //: This is a sparse vector    typedef sparse_tag sparsity;  //: This is a 1D container  typedef oned_tag dimension;  //: Scaled type of this vector  typedef scaled1D< self > scaled_type;  //: Element type  typedef typename values_t::value_type value_type;#if defined(_MSVCPP_)  typedef value_type* pointer;#else  //: A pointer to the element type  typedef typename values_t::pointer pointer;#endif  //: Unsigned integral type for dimensions and indices  typedef SizeType size_type;  //: Integral type for differences in iterators  typedef typename values_t::difference_type difference_type;  //: Reference to the value type  typedef elt_ref<self> reference;  //: Const reference to the value type  typedef const_elt_ref<self> const_reference;  //: Iterator type  typedef compressed_iter<0,values_vec, indices_vec,IND_OFFSET> iterator;  //: Const iterator type  typedef compressed_iter<1,values_vec, indices_vec,IND_OFFSET> const_iterator;  //: Reverse iterator type  typedef reverse_iter<iterator> reverse_iterator;  //: The const reverse iterator type  typedef reverse_iter<const_iterator> const_reverse_iterator;  //: Reference to the index array  typedef const indices_vec& IndexArrayRef;   //: The type for the index array  typedef const indices_t IndexArray;   //: The type for the subrange vector  typedef self subrange_type; /* JGS need to think about this */    /**@name Constructors */    //: Default Constructor  inline compressed1D()    : values(new values_t(0)),       indices(new indices_t(0)),       size_(0) { }        //: Length N Constructor  inline compressed1D(size_type n)    : values(new values_t(0)),       indices(new indices_t(0)),       size_(n) { }  //: Copy Constructor  inline compressed1D(const self& x)    : values(x.values), indices(x.indices), size_(x.size_) { }  //: Index Array Constructor  template <class IndexIter>  inline compressed1D(IndexIter first, IndexIter last,  size_type n)    : values(new values_t(n)),      indices(new indices_t(n)),      size_(n)  {     std::copy(first, last, indices->begin());  }  //: Assignment Operator  inline self& operator=(const self& x) {    values = x.values;    indices = x.indices;    size_ = x.size_;    return *this;  }  /**@name Access Methods */    /**@name Iterator Access Methods */    //: Return an iterator pointing to the beginning of the vector  //!wheredef: Container  inline iterator begin() {    return iterator(values->begin(), indices->begin(), 0);  }  //: Return an iterator pointing past the end of the vector  //!wheredef: Container  inline iterator end() {    return iterator(values->begin(), indices->begin(), indices->size());  }  //: Return a const iterator pointing to the begining of the vector  //!wheredef: Container  inline const_iterator begin() const {    return const_iterator(values->begin(), indices->begin(), 0);   }  //: Return a const iterator pointing past the end of the vector  //!wheredef: Container  inline const_iterator end() const {     return const_iterator(values->begin(), indices->begin(), indices->size());  }  //: Return a reverse iterator pointing to the last element of the vector  //!wheredef: Reversible Container  inline reverse_iterator rbegin() {    return reverse_iterator(end());  }  //: Return a reverse iterator pointing past the end of the vector  //!wheredef: Reversible Container  inline reverse_iterator rend() {    return reverse_iterator(begin());  }  //: Return a const reverse iterator pointing to the last element of the vector  //!wheredef: Reversible Container  inline const_reverse_iterator rbegin() const {    return const_reverse_iterator(end());  }  //: Return a const reverse iterator pointing past the end of the vector  //!wheredef: Reversible Container  inline const_reverse_iterator rend() const {     return const_reverse_iterator(begin());  }    /**@name Element Access Methods */    //: Access the element with index i  inline reference operator[](size_type i) MTL_THROW_ASSERTION {    MTL_ASSERT(i < size(), "compressed1D::operator[]");    return reference(*this, i);  }  //: Access the element with index i  inline const_reference operator[](size_type i) const MTL_THROW_ASSERTION {    MTL_ASSERT(i < size(), "compressed1D::operator[]");    return const_reference(*this, i);  }    //for BEAM only  value_type& get_ref(size_type i) {    iterator iter = find(i);    if ( iter != end() ) {       if ( iter.index() != i )	iter = insert(iter, i, T(0));    } else       iter = insert(iter, i, T(0));    return *iter;  }    /*   * list operations   */  /* OneD required insert method: */  //: Insert val into the vector at index i  inline iterator insert(size_type i, const T& val) MTL_THROW_ASSERTION {    MTL_ASSERT(i < size(), "compressed1D::insert");    index_iterator index_iter = lower_bound(indices->begin(),                                            indices->end(),                                             i - IND_OFFSET);/* F to C */    index_iter = indices->insert(index_iter, i - IND_OFFSET); /* F to C */    size_type n = index_iter - indices->begin();    value_iterator val_iter = values->insert(values->begin() + n, val);    return iterator(index_iter, val_iter);  }  //: Push back, warning: must insert elements ordered by index.  // This method does not change the size() of the vector.  inline void push_back(size_type i,  const T& val) MTL_THROW_ASSERTION {    MTL_ASSERT(i < size(), "compressed1D::push_back");    values->push_back(val);    indices->push_back(i);  }    //: Erase the vector  inline void clear() { indices->clear(); values->clear(); }  //: The size of the vector (including non-zeroes)  inline size_type size() const { return size_; }  //: The number of non-zero elements (the number stored)  inline size_type nnz() const { return values->size(); }  //: Resize the vector to size n  inline void resize(size_type n) {     size_ = n;  }  //: Reserve storage for n non-zero elements  inline void reserve(size_type n) {    values->reserve(n);    indices->reserve(n);  }  //: Returns the array of indices  inline IndexArrayRef nz_struct() const {    return *indices;  }  //: Returns the array of indices  inline IndexArrayRef nz_struct() {    return *indices;  }protected:  inline iterator find(size_type i) {    index_iterator iter = lower_bound(indices->begin(), indices->end(),                                       i - IND_OFFSET); /* F to C */    size_type n = iter - indices->begin();    return iterator(values->begin(), indices->begin(), n);  }  inline const_iterator find(size_type i) const {    index_const_iterator iter = lower_bound(indices->begin(), indices->end(),                                    i - IND_OFFSET); /* F to C */    size_type n = iter - indices->begin();    return const_iterator(values->begin(), indices->begin(), n);  }  inline iterator insert(iterator iter, size_type i, T v) {    index_iterator ind = indices->insert(iter.index_iter(),                                  i - IND_OFFSET); /* F to C */    values->insert(iter.value_iter(), v);    size_type n = ind - indices->begin();    return iterator(values->begin(), indices->begin(), n);  }  protected:  values_ptr values;  indices_ptr indices;  size_type size_;};} /* namespace mtl */#endif#if 0  class elt_inserter {  public:    inline elt_inserter(const elt_inserter& x) : val(x.val), ind(x.ind) { }    inline elt_inserter(T& v, size_type& i) : val(v), ind(i) { }    void operator=(const twod_elt<T,size_type>& elt) {      val = elt.val();      ind = elt.minor();    }  protected:    T& val;    size_type& ind;  };  class insert_iterator {    typedef values_vec::iterator val_iter_t;    typedef indices_vec::iterator ind_iter_t;    typedef insert_iterator self;  public:    inline insert_iterator(const val_iter_t& v, const ind_iter_t& i)      : val_iter(v), ind_iter(i) { }    inline elt_inserter operator * () {       return elt_inserter(*val_iter, *ind_iter);     }    inline self& operator ++ () { ++val_iter; ++ind_iter; return *this; }    inline self& operator ++ (int) {       self t = *this; ++val_iter; ++ind_iter; return t;    }  protected:    val_iter_t val_iter;    ind_iter_t ind_iter;  };  inline insert_iterator inserter() {     return insert_iterator(values->begin(), indices->begin());  }#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区在线| 26uuu另类欧美亚洲曰本| 亚洲123区在线观看| 精品国产一区二区三区不卡| 成人动漫视频在线| 中文乱码免费一区二区| 色播五月激情综合网| 亚洲国产精品一区二区久久恐怖片 | 26uuu成人网一区二区三区| 风流少妇一区二区| 亚洲一区二区视频| 国产丝袜美腿一区二区三区| 欧美综合色免费| 国产综合一区二区| 亚洲精品中文字幕乱码三区| 日韩一级高清毛片| 99精品视频在线观看| 久久精品免费观看| 亚洲综合丁香婷婷六月香| 久久精品在线观看| 欧美日产国产精品| www.欧美日韩国产在线| 日韩和欧美一区二区| 中文字幕日韩精品一区 | 91视视频在线观看入口直接观看www| 日韩国产一区二| 亚洲欧美另类久久久精品| 精品国产髙清在线看国产毛片| 91国偷自产一区二区三区成为亚洲经典 | 国产夜色精品一区二区av| 欧美日韩国产综合一区二区 | 亚洲综合成人在线视频| 欧美精品一区二区高清在线观看 | 欧美在线观看视频在线| 久久99久久99| 亚洲r级在线视频| 亚洲视频你懂的| 欧美激情一区二区三区四区| 日韩网站在线看片你懂的| 在线视频观看一区| 波多野结衣亚洲| 国产精品2024| 国产在线国偷精品免费看| 首页亚洲欧美制服丝腿| 一区二区三区四区在线播放| 国产精品国产精品国产专区不蜜 | 国产精品传媒视频| 久久久久久久一区| 日韩欧美色综合网站| 91精品国产综合久久精品app| 色哟哟一区二区在线观看| 99久久精品免费| 国产91综合一区在线观看| 精品在线你懂的| 日本中文一区二区三区| 视频在线观看国产精品| 亚洲国产成人va在线观看天堂| 亚洲男人的天堂在线观看| 亚洲色欲色欲www| 国产精品久久网站| 国产精品久久久久一区| 中文字幕免费不卡| 久久久久久久久99精品| 精品久久久久香蕉网| 欧美一区二区在线看| 欧美日韩精品系列| 在线中文字幕不卡| 欧美日精品一区视频| 欧美老肥妇做.爰bbww视频| 欧美日韩高清在线| 欧美一区二区三区在线| 亚洲精品在线网站| 久久精品亚洲国产奇米99| 欧美激情一区二区在线| 成人免费在线播放视频| 亚洲综合男人的天堂| 天天综合日日夜夜精品| 免费久久精品视频| 国产精品一区二区不卡| 成人国产精品免费观看动漫| 99re成人在线| 欧美日韩中文国产| 欧美xxxxxxxxx| 国产日韩欧美精品电影三级在线| 国产精品美女久久福利网站| 一区二区三区产品免费精品久久75| 亚洲成av人片一区二区| 蜜臀精品久久久久久蜜臀| 久久精品国产精品青草| 国产 欧美在线| 色视频一区二区| 日韩欧美在线不卡| 国产日产欧美一区二区视频| 樱桃视频在线观看一区| 青青草视频一区| 国产成人高清视频| 欧美这里有精品| 日韩小视频在线观看专区| 日本一区二区三级电影在线观看 | 日韩精品专区在线| 中文字幕制服丝袜一区二区三区| 亚洲综合自拍偷拍| 极品少妇xxxx偷拍精品少妇| 波波电影院一区二区三区| 欧美性猛片xxxx免费看久爱| 欧美精品久久久久久久多人混战| 日韩欧美一级在线播放| 国产精品久久久久久一区二区三区 | 精品国产不卡一区二区三区| 亚洲三级在线看| 五月综合激情婷婷六月色窝| 国产在线不卡一区| 欧美怡红院视频| 国产区在线观看成人精品 | 国产精品视频一二三区 | 久久久av毛片精品| 午夜欧美电影在线观看| 成人黄色软件下载| 日韩一级二级三级精品视频| 国产精品国产自产拍高清av| 蜜桃av一区二区| 欧美在线制服丝袜| 国产精品美女一区二区在线观看| 奇米精品一区二区三区四区| 国产成人夜色高潮福利影视| 欧美美女一区二区三区| 久久亚洲精精品中文字幕早川悠里 | 久久精品国内一区二区三区| 日本韩国欧美一区| 国产精品久久久久久妇女6080| 日av在线不卡| 成人av网站免费观看| 精品日韩一区二区三区免费视频| 亚洲成人777| 色偷偷久久一区二区三区| 国产精品午夜在线| 国产精品一线二线三线精华| 欧美在线影院一区二区| 自拍偷拍欧美激情| www.成人网.com| 国产亚洲欧美在线| 激情另类小说区图片区视频区| 欧美精品aⅴ在线视频| 一区二区成人在线观看| eeuss鲁片一区二区三区在线观看| 欧美v日韩v国产v| 午夜精品久久久久久久| 欧美网站大全在线观看| 一区二区久久久| 99精品1区2区| 国产精品五月天| www.综合网.com| 中文字幕亚洲一区二区av在线| 国产91精品在线观看| 久久久久国产精品麻豆ai换脸 | 日韩高清欧美激情| 777午夜精品视频在线播放| 亚洲成人资源在线| 欧美三区免费完整视频在线观看| 一区二区三区蜜桃| 成人动漫一区二区在线| 自拍偷拍欧美激情| 欧美中文字幕亚洲一区二区va在线 | 毛片一区二区三区| 成人av网站免费| 亚洲已满18点击进入久久| 日韩一区二区三区免费看 | 日韩不卡一区二区三区| 久久久av毛片精品| 91小视频免费观看| 天天爽夜夜爽夜夜爽精品视频| 欧美成人vps| 91猫先生在线| 美女视频一区二区| 国产精品乱码一区二区三区软件| 欧美综合一区二区三区| 寂寞少妇一区二区三区| 怡红院av一区二区三区| 精品美女一区二区| 色成年激情久久综合| 紧缚奴在线一区二区三区| 亚洲欧美区自拍先锋| 日韩精品专区在线影院重磅| 色综合久久天天| 国产麻豆成人传媒免费观看| 玉米视频成人免费看| 欧美成人a∨高清免费观看| 91在线无精精品入口| 久久国产精品99久久久久久老狼| 亚洲三级在线免费观看| 精品久久久久久久久久久久久久久 | 一本在线高清不卡dvd| 国产真实乱子伦精品视频| 亚洲精品成人在线| 久久久影院官网| 在线综合+亚洲+欧美中文字幕| 国产大片一区二区| 美国十次综合导航| 亚洲一区二区三区四区五区中文| 国产精品每日更新|