Boost::ublas::vector 解析

1 Vector

1.1 Description

The templated class vector<T, A> is the basecontainer adaptor for dense vectors. For an-dimensionalvector and 0 <= i < n every elementvi is mapped to thei-thelement of the container.

1.2 Example
#include <boost/numeric/ublas/vector.hpp>  //生成一般的向量,其内置类型的值为0,在默认的情况下
#include <boost/numeric/ublas/io.hpp>

int main () {
    using namespace boost::numeric::ublas;
    vector<double> v (3);
    for (unsigned i = 0; i < v.size (); ++ i)
        v (i) = i;
    std::cout << v << std::endl;
}

1.3 Definition

Defined in the header vector.hpp.

1.4 Template parameters
Parameter Description Default
T The type of object stored in the vector.  
A The type of the Storage array. [1] unbounded_array<T>
1.5 Model of

Vector,RandomAccessContainer

1.6 Type requirements

None, except for those imposed by the requirements of Vectorand RandomAccessContainer.

1.7 Public base classes

vector_container<vector<T, A> >

1.8 Members
Member Where defined Description
value_type VectorExpression  
reference VectorExpression  
const_reference VectorExpression  
size_type VectorExpression  
difference_type VectorExpression  
const_iterator VectorExpression  
iterator VectorExpression  
const_reverse_iterator VectorExpression  
reverse_iterator VectorExpression  
array_type Vector  
vector () VectorExpression Allocates an uninitialized vector that holds zeroelements.
vector (size_type size) Vector Allocates an uninitialized vector that holdssize elements.
vector (const vector &v)   The copy constructor.
template<class AE>
vector (const vector_expression<AE> &ae)
  The extended copy constructor.
void resize (size_type size, bool preserve =true) Vector R
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值