Topic: Standard class name change: vector to array
Author: jk@steel.orel.ru (Eugene Karpachov)
Date: 2000/11/13 Raw View
Mon, 30 Oct 2000 19:49:35 GMT James Dennett =CE=C1=D0=C9=D3=C1=CC:
>> A vector is a one dimensional array of numbers not a container class.
>
>As a (ex-) pure mathematician, I think a vector is just an element of a =
vector
>space, which is defined by a bunch of axioms. It's a theorem that every=
vector
>space has a well-defined dimensionality, which may or may not be finite.=
The
>scalars over which the vector space is defined need to form a "field", a=
gain
>defined by a bunch of axioms.
>
>>From this point of view, it's not easy to define vector/field as templa=
tes. They'd
>be more analogous to STL Concepts.
>
>My point is just that words have overloaded meanings, so whatever we def=
ined
>as vector would offend somebody's idea of a vector.
In other words, words have their namespaces :) Why not to define mathemat=
ical
vectors in their own namespace, for example, math::vector? The standartiz=
ation
commitee could reserve not only std:: namespace, but all the std*::
namespaces; then they could define something like stdmath::vector etc.
Of course, it will be confusing unless fully-qualified form will be used.
>> Standards for vector, matrix, tensor and other numerical class librari=
es
>> (except valarray) should not be specified by ANSI/ISO C++.
>> Numerical class library standards should be left to numerical programm=
ers
>> and the compiler and numerical library developers that cater to them.
--=20
jk
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: Bernd Strieder <strieder@student.uni-kl.de>
Date: Fri, 3 Nov 2000 16:48:23 GMT Raw View
James Dennett wrote:
>
> "E. Robert Tisdale" wrote:
>
>
> OTOH, I don't know of any notion of "vector" outside of C++ which defends
> the idea of adding new elements to a vector on the fly.
Mathematics itself? There are the operations of embedding vectors into
vector-spaces of higher dimension. Removing an item corresponds to
projecting into a vector-space of lower dimension. These operations
cannot always be done by adding or removing elements, but if, then it is
the most efficient way to do the operation. By choosing the right basis
of a vector-space to work in, it is possible to get these operations
done the best way.
>
> > Standards for vector, matrix, tensor and other numerical class libraries
> > (except valarray) should not be specified by ANSI/ISO C++.
> > Numerical class library standards should be left to numerical programmers
> > and the compiler and numerical library developers that cater to them.
There are many kinds of implementations for those classes, AFAIK there
has not been found a universal one, that a majority of the mathematical
crowd likes. So everybody has to look for the best matrix, tensor, or
whatever implementation for her purposes. They cannot have the same
name.
std::vector has grown for some time, it has been understood, problems
were recognized and solved. Probably it is one of the most often used
containers. A majority likes it the way it is.
Finally, it is easy to use std::vector to implement a dense mathematical
vector, it's just some translation of the interface.
But then, isn't there the word tuple, that describes what std::vector
implements, a sequence of items, where order matters, and duplicates are
allowed. Tuples can have elements of different types, so tuple is not
the right one. Sequence? Is already overloaded, std::list is a sequence
as well. So vector seems to be the term that fits best for that what
std::vector implements.
Bernd Strieder.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: Barry Margolin <barmar@genuity.net>
Date: Wed, 1 Nov 2000 23:37:20 GMT Raw View
In article <8tpuil$6mv$02$1@news.t-online.com>,
Sebastian Moleski <smoleski@surakware.com> wrote:
>What is array used for in the standard?
To refer to traditional C-style [] arrays.
--
Barry Margolin, barmar@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: "Sebastian Moleski" <smoleski@surakware.com>
Date: Wed, 1 Nov 2000 23:22:23 GMT Raw View
What is array used for in the standard?
Sebastian Moleski
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: Francis Glassborow <francis.glassborow@ntlworld.com>
Date: Mon, 30 Oct 2000 23:45:42 GMT Raw View
In article <39F9CA3C.FC305B20@evtechnology.com>, James Dennett
<james@evtechnology.com> writes
>Out of interest, can anyone on the C++ Standards Committee comment on why
>this seemingly bizarre name was chosen? Was it just that it was inherited from
>the STL?
I believe the answer to that is 'yes.'
Francis Glassborow Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: Barry Margolin <barmar@genuity.net>
Date: Tue, 31 Oct 2000 00:55:27 GMT Raw View
In article <39F9CA3C.FC305B20@evtechnology.com>,
James Dennett <james@evtechnology.com> wrote:
>OTOH, I don't know of any notion of "vector" outside of C++ which defends
>the idea of adding new elements to a vector on the fly.
Common Lisp has VECTOR-PUSH for doing this.
>
>> Standards for vector, matrix, tensor and other numerical class libraries
>> (except valarray) should not be specified by ANSI/ISO C++.
>> Numerical class library standards should be left to numerical programmers
>> and the compiler and numerical library developers that cater to them.
>
>The choice of the name vector instead of "array" or "extensible_array" is maybe
>unfortunate, but I think we're probably stuck with it.
>
>Out of interest, can anyone on the C++ Standards Committee comment on why
>this seemingly bizarre name was chosen? Was it just that it was inherited from
>the STL?
Isn't it a common computer science term? A vector is a one-dimensional
array.
--
Barry Margolin, barmar@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: Barry Margolin <barmar@genuity.net>
Date: Mon, 30 Oct 2000 19:48:51 GMT Raw View
In article <39F86EF4.E8641BB@netwood.net>,
E. Robert Tisdale <edwin@netwood.net> wrote:
>I propose that the standard class template name vector be changed to array.
>A vector is a one dimensional array of numbers not a container class.
>Standards for vector, matrix, tensor and other numerical class libraries
>(except valarray) should not be specified by ANSI/ISO C++.
>Numerical class library standards should be left to numerical programmers
>and the compiler and numerical library developers that cater to them.
In computer science, the term "vector" is commonly used to refer to
one-dimensional arrays of any type, and "array" refers to arrays of any
number of dimensions. It's true that these terms have different
connotations in mathematics, but that's too bad; this is a general purpose
programming language, not specific to mathematics, so it adopts CS
terminology.
--
Barry Margolin, barmar@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: James Dennett <james@evtechnology.com>
Date: Mon, 30 Oct 2000 19:49:35 GMT Raw View
"E. Robert Tisdale" wrote:
> I propose that the standard class template name vector be changed to array.
Unfortunately that would break so much C++ code that it is almost unthinkable.
> A vector is a one dimensional array of numbers not a container class.
As a (ex-) pure mathematician, I think a vector is just an element of a vector
space, which is defined by a bunch of axioms. It's a theorem that every vector
space has a well-defined dimensionality, which may or may not be finite. The
scalars over which the vector space is defined need to form a "field", again
defined by a bunch of axioms.
>From this point of view, it's not easy to define vector/field as templates. They'd
be more analogous to STL Concepts.
My point is just that words have overloaded meanings, so whatever we defined
as vector would offend somebody's idea of a vector.
OTOH, I don't know of any notion of "vector" outside of C++ which defends
the idea of adding new elements to a vector on the fly.
> Standards for vector, matrix, tensor and other numerical class libraries
> (except valarray) should not be specified by ANSI/ISO C++.
> Numerical class library standards should be left to numerical programmers
> and the compiler and numerical library developers that cater to them.
The choice of the name vector instead of "array" or "extensible_array" is maybe
unfortunate, but I think we're probably stuck with it.
Out of interest, can anyone on the C++ Standards Committee comment on why
this seemingly bizarre name was chosen? Was it just that it was inherited from
the STL?
-- James Dennett <jdennett@acm.org>
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: "E. Robert Tisdale" <edwin@netwood.net>
Date: Fri, 27 Oct 2000 13:27:10 GMT Raw View
I propose that the standard class template name vector be changed to array.
A vector is a one dimensional array of numbers not a container class.
Standards for vector, matrix, tensor and other numerical class libraries
(except valarray) should not be specified by ANSI/ISO C++.
Numerical class library standards should be left to numerical programmers
and the compiler and numerical library developers that cater to them.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: "Sebastian Kapfer" <REMOVE_MEsebastian_kapfer@web.de>
Date: Fri, 27 Oct 2000 17:09:27 GMT Raw View
"E. Robert Tisdale" <edwin@netwood.net> schrieb im Newsbeitrag
news:39F86EF4.E8641BB@netwood.net...
> I propose that the standard class template name vector be changed to
array.
> A vector is a one dimensional array of numbers not a container class.
> Standards for vector, matrix, tensor and other numerical class libraries
> (except valarray) should not be specified by ANSI/ISO C++.
> Numerical class library standards should be left to numerical programmers
> and the compiler and numerical library developers that cater to them.
>
> ---
> [ comp.std.c++ is moderated. To submit articles, try just posting with ]
> [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
> [ --- Please see the FAQ before posting. --- ]
> [ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
> [ Note that the FAQ URL has changed! Please update your bookmarks. ]
>
My words, but now it is too late to change std::vector's name.
sk
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: "Victor Bazarov" <vAbazarov@dAnai.com>
Date: Fri, 27 Oct 2000 18:09:01 GMT Raw View
"E. Robert Tisdale" <edwin@netwood.net> wrote...
> I propose that the standard class template name vector be changed to
array.
> A vector is a one dimensional array of numbers not a container class.
> Standards for vector, matrix, tensor and other numerical class
libraries
> (except valarray) should not be specified by ANSI/ISO C++.
> Numerical class library standards should be left to numerical
programmers
> and the compiler and numerical library developers that cater to them.
I do not agree because the term array is reserved for another language
construct. Maybe you could make your proposal more finalised so that
the changes you think are needed do not interfere with the other parts
of the Standard...
Victor
--
Please remove capital A's from my address when replying by mail
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: the_wid@my-deja.com (Tom)
Date: Fri, 27 Oct 2000 18:09:31 GMT Raw View
On Fri, 27 Oct 2000 13:27:10 GMT, "E. Robert Tisdale"
<edwin@netwood.net> wrote:
>I propose that the standard class template name vector be changed to array.
>A vector is a one dimensional array of numbers not a container class.
>Standards for vector, matrix, tensor and other numerical class libraries
>(except valarray) should not be specified by ANSI/ISO C++.
>Numerical class library standards should be left to numerical programmers
>and the compiler and numerical library developers that cater to them.
>
It's too late. It's not a good idea to overload the word array (look
at the problems "string" causes). It's in namespace std, so what's the
problem?
Tom
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: "Mark Wilden" <mark@pagm.com>
Date: Fri, 27 Oct 2000 20:03:22 GMT Raw View
"Tom" <the_wid@my-deja.com> wrote in message
news:39f9bd8a.11876597@reading.news.pipex.net...
>
> It's too late. It's not a good idea to overload the word array (look
> at the problems "string" causes). It's in namespace std, so what's the
> problem?
Err, what's the problem with string? It's in namespace std, so what's the
problem? :)
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: the_wid@my-deja.com (Tom)
Date: Sat, 28 Oct 2000 17:14:58 GMT Raw View
On Fri, 27 Oct 2000 20:03:22 GMT, "Mark Wilden" <mark@pagm.com> wrote:
>"Tom" <the_wid@my-deja.com> wrote in message
>news:39f9bd8a.11876597@reading.news.pipex.net...
>>
>> It's too late. It's not a good idea to overload the word array (look
>> at the problems "string" causes). It's in namespace std, so what's the
>> problem?
>
>Err, what's the problem with string? It's in namespace std, so what's the
>problem? :)
I was talking about the word string - as in: "I've got an array of
strings." Does that mean: "I've got an array of std::strings", "I've
got an array of null terminated char arrays.", or, with Mr.Tisdale's
suggestion, "I've got a std::array<std::string>" or "I've got a
std::array<char*>", or "I've got an array of null terminated
std::array<char>" or "I've got a std::array</*null
terminated*/std::array<char> >".
With vector, only numerical programmers get confused, and who cares
about them? :)
Tom
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: kanze@gabi-soft.de
Date: Sun, 29 Oct 2000 02:58:30 GMT Raw View
the_wid@my-deja.com (Tom) writes:
|> On Fri, 27 Oct 2000 20:03:22 GMT, "Mark Wilden" <mark@pagm.com> wrote=
:
|> >"Tom" <the_wid@my-deja.com> wrote in message
|> >news:39f9bd8a.11876597@reading.news.pipex.net...
|> >> It's too late. It's not a good idea to overload the word array (lo=
ok
|> >> at the problems "string" causes). It's in namespace std, so what's=
the
|> >> problem?
|> >Err, what's the problem with string? It's in namespace std, so what'=
s the
|> >problem? :)
|> I was talking about the word string - as in: "I've got an array of
|> strings." Does that mean: "I've got an array of std::strings", "I've
|> got an array of null terminated char arrays.",
It means I've got an array of strings. Since the only strings I know of
are in the namespace std, I presume it means an array of std::string.
Written std::vector< std::string >.
When working with several languages, I would normally specify if one of
the types was not native. Thus, when interfacing C++ to C, I may speak
of C style arrays, or pointers to char, or even null terminates char
sequences.
--=20
James Kanze mailto:kanze@gabi-soft.de
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
Ziegelh=FCttenweg 17a, 60598 Frankfurt, Germany Tel. +49(069)63198627
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: Josh Sebastian <curien@earthlink.net>
Date: Sun, 29 Oct 2000 16:34:18 GMT Raw View
On Sun, 29 Oct 2000 02:58:30 GMT, kanze@gabi-soft.de wrote:
>the_wid@my-deja.com (Tom) writes:
>
>|> On Fri, 27 Oct 2000 20:03:22 GMT, "Mark Wilden" <mark@pagm.com> wrote:
>
>|> >"Tom" <the_wid@my-deja.com> wrote in message
>|> >news:39f9bd8a.11876597@reading.news.pipex.net...
>
>|> >> It's too late. It's not a good idea to overload the word array (look
>|> >> at the problems "string" causes). It's in namespace std, so what's the
>|> >> problem?
>
>|> >Err, what's the problem with string? It's in namespace std, so what's the
>|> >problem? :)
>
>|> I was talking about the word string - as in: "I've got an array of
>|> strings." Does that mean: "I've got an array of std::strings", "I've
>|> got an array of null terminated char arrays.",
>
>It means I've got an array of strings. Since the only strings I know of
>are in the namespace std, I presume it means an array of std::string.
>Written std::vector< std::string >.
The standard uses the term "string literal" for literals of the form
"abc" and specifies them as having type const char[].
The standard refers to NTBS, or null-terminated byte strings, which
are sequences of characters terminated by a zero character. The zero
character is included in the NTBS. So an std::string is *not* a NTBS.
Clearly, the standard uses the term "string" to refer to concepts
other than std::string.
>When working with several languages, I would normally specify if one of
>the types was not native. Thus, when interfacing C++ to C, I may speak
>of C style arrays, or pointers to char, or even null terminates char
>sequences.
But arrays and NTBSes *are* native to C++. Just because C++ has
std::string doesn't mean it lacks const char[]. Just because it has
std::vector<T> doesn't mean it lacks T[]. Just because we can use
classes doesn't mean we can't use structs. I could go on and on. In
short, just because there are different ways to do things in C++
doesn't make the old ways any less valid.
Should we make it easy to use the new constructs? By all means, yes.
Should we do so at the cost of making the old constructs harder?
That's a tough question; in most cases, I would say no.
_______
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
Josh Sebastian
<curien@earthlink.net>
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]