473,419 Members | 4,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

Why not use valarray<valarray<T> > ?


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?
Jul 22 '05 #1
2 2172
"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.
Jul 22 '05 #2
In article <bs**********@news6.svr.pol.co.uk>, 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.
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Busin | last post by:
How to save a valarray<bool> object in a file and how to read it back into a valarray<bool> object? Thanks!
2
by: Steven T. Hatton | last post by:
I believe the answer is that the language doesn't support the ability to retain a reference to a std::indirect_array<>, and would be illadvised to try, but I figure I'll ask just to be sure. What...
1
by: Dack | last post by:
Hi, I want to track memory leaks in my application (that is using <valarray>). I used the following code: #define _CRTDBG_MAP_ALLOC #include <stdlib.h> #include <crtdbg.h> But then, when I...
43
by: john | last post by:
Hi, in TC++PL 3 on pages 674-675 it is mentioned: "Maybe your first idea for a two-dimensional vector was something like this: class Matrix { valarray< valarray<doublev; public: // ... };
1
by: Alex Vinokur | last post by:
Is it possible to add an element to valarray<T>? Is there something like push_back() for valarray<T>? Alex Vinokur email: alex DOT vinokur AT gmail DOT com...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.