Boost logo

Boost Users :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2004-09-03 03:36:15


yanyaqin wrote:

> 1. In ublas::vector, there's 3 constructions:
>
> |vector ()| Allocates an uninitialized |vector| that holds zero elements.
> |vector (size_type size)| Allocates an uninitialized |vector| that holds
> |size| elements.
> |vector (const vector &v)|
>
> but how can i construct a vector with the default value like std::vector( n, value )
>
>

You can't AFAICT. What you can do is
ublas::vector< double > v(10) ;
std::fill( v.begin(), v.end(), value ) ;

>
> 2. How to make ublas more efficiency?
>
> I tried to comment some mac define of check in ublas/config.hpp, and found it make some sense.
>
> I wonder if some one has more experience to share.
>
>

Most important is that you define NDEBUG to avoid all assertions.

I suggest to use the ublas-dev mailing list in the future (I will CC:
that list for now)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net