Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Why not use valarray<valarray<T> > ?

Reply
Thread Tools

Why not use valarray<valarray<T> > ?

 
 
Jim West
Guest
Posts: n/a
 
      12-22-2003

The GNU implementation of the valarray header (g++ version 3.3.2)
includes the comment:

// This complication is so to make valarray<valarray<T> > work
// even though it is not required by the standard. Nobody should
// be saying valarray<valarray<T> > anyway. See the specs.

Unfortunately, "See the specs" does not give me a whole lot of insight
to why this is a Bad Idea(tm). Can someone please enlighten me?
 
Reply With Quote
 
 
 
 
Buster
Guest
Posts: n/a
 
      12-23-2003
"Jim West" wrote

> The GNU implementation of the valarray header (g++ version 3.3.2)
> includes the comment:
>
> // This complication is so to make valarray<valarray<T> > work
> // even though it is not required by the standard. Nobody should
> // be saying valarray<valarray<T> > anyway. See the specs.
>
> Unfortunately, "See the specs" does not give me a whole lot of insight
> to why this is a Bad Idea(tm). Can someone please enlighten me?


You use slices to make multidimensional arrays with valarray. See the
standard or a good textbook.

Regards,
Buster.


 
Reply With Quote
 
 
 
 
Jim West
Guest
Posts: n/a
 
      12-23-2003
In article <bs82kj$199$(E-Mail Removed)>, Buster wrote:
> "Jim West" wrote
>
>> The GNU implementation of the valarray header (g++ version 3.3.2)
>> includes the comment:
>>
>> // This complication is so to make valarray<valarray<T> > work
>> // even though it is not required by the standard. Nobody should
>> // be saying valarray<valarray<T> > anyway. See the specs.
>>
>> Unfortunately, "See the specs" does not give me a whole lot of insight
>> to why this is a Bad Idea(tm). Can someone please enlighten me?

>
> You use slices to make multidimensional arrays with valarray. See the
> standard or a good textbook.


Thanks for the response. I do indeed use slices (or Blitz) when using
multidimensional arrays. The nature of the comment made me think that
there might be some non-obvious reason why valarray<valarray<T> > would
give incorrect results, rather than just be inefficient.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why :: ? Why not : ? Why not . ? <- less clutter ?!? Skybuck Flying C++ 16 08-25-2007 09:48 PM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
why why why does function not work Horace Nunley ASP .Net 1 09-27-2006 09:52 PM
Why use a JavaBean? Why not just classes in a jar file? Tom Dyess Java 2 01-20-2005 09:52 AM



Advertisments