Why not use valarray<valarray<T> > ?

Discussion in 'C++' started by Jim West, Dec 22, 2003.

  1. Jim West

    Jim West Guest

    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?
    Jim West, Dec 22, 2003
    #1
    1. Advertising

  2. Jim West

    Buster Guest

    "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.
    Buster, Dec 23, 2003
    #2
    1. Advertising

  3. Jim West

    Jim West Guest

    In article <bs82kj$199$>, 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.
    Jim West, Dec 23, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Horace Nunley

    why why why does function not work

    Horace Nunley, Sep 27, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    452
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Sep 27, 2006
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    863
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,769
    Smokey Grindel
    Dec 2, 2006
  4. Skybuck Flying
    Replies:
    16
    Views:
    663
    tragomaskhalos
    Aug 25, 2007
  5. Daniel Pitts
    Replies:
    0
    Views:
    329
    Daniel Pitts
    Jun 14, 2008
Loading...

Share This Page