Accelerated C++: [1,rows] Not so fast

  • Thread starter Steven T. Hatton
  • Start date
S

Steven T. Hatton

E. Mark Ping said:
E. Mark Ping said:
My apologies for being too terse. I've never seen standard
nomenclature for [a,a), but it makes sense in this case to define it
as the empty set, since that means the union property holds:

[a,a) U [a,b) = [a,b)

Similarly, 0! is commenly defined as 1 becuase it's most useful with
that definition in combinatorics, but AFAIK it's not a universally
accepted definition.
I have a serious reservation about accepting the idea of [a,a) = {}.
After thinking it over, it seems to me that [a,a) carries more information
than
{}.

Well of course it does. 0! carries more information that 1.
In order for [a,a) = {} to be true, [a,a) = [b,b) where a != b; I'm
not sure I'm willing to accept that proposition.

I don't know why not. Note the equivalence:

[a,a) U [a,b) = [a,b)
[b,b) U [a,b) = [a,b)

Definining [a,a) = {} is just as useful as defining 0! = 1.
In particular, I'm not sure I'm willing to extend it to the concept
of indexing of memory locations.

Why not?

while (p!=q)
{
*p++ = *q++;
}

Is meaningful for p and q even if p==q at the beginning of the loop.

If I am discussing a finite range of indices [0,n) and choose some index m
such that 0 < m < n, I can write [m,m) to signify an empty sequence
beginning at m. Hence I can indicate the mth element with the notation
[m,m+1). If I assume [m,m) = [p,p) where p!=m, I am in effect saying
[m,m+1) = [p,p+1) which is false.
--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell
 
E

E. Mark Ping

E. Mark Ping said:
In order for [a,a) = {} to be true, [a,a) = [b,b) where a != b; I'm
not sure I'm willing to accept that proposition.
If I am discussing a finite range of indices [0,n) and choose some
index m such that 0 < m < n, I can write [m,m) to signify an empty
sequence beginning at m. Hence I can indicate the mth element with
the notation [m,m+1). If I assume [m,m) = [p,p) where p!=m, I am in
effect saying [m,m+1) = [p,p+1) which is false.

Okay, that makes sense that [a,a) != [b,b) but that just means that
[a,a) != {}. It's not the empty set, it's /an/ empty /sequence/,
starting at a. That's how it's used typically anyway.
 
D

Dave Townsend

E. Mark Ping said:
E. Mark Ping said:
In order for [a,a) = {} to be true, [a,a) = [b,b) where a != b; I'm
not sure I'm willing to accept that proposition.
If I am discussing a finite range of indices [0,n) and choose some
index m such that 0 < m < n, I can write [m,m) to signify an empty
sequence beginning at m. Hence I can indicate the mth element with
the notation [m,m+1). If I assume [m,m) = [p,p) where p!=m, I am in
effect saying [m,m+1) = [p,p+1) which is false.

Okay, that makes sense that [a,a) != [b,b) but that just means that
[a,a) != {}. It's not the empty set, it's /an/ empty /sequence/,
starting at a. That's how it's used typically anyway.
--
Mark Ping
(e-mail address removed)
Okay, that makes sense that [a,a) != [b,b) but that just means that
[a,a) != {}. It's not the empty set, it's /an/ empty /sequence/,
starting at a. That's how it's used typically anyway.

Surely [a,a) == [b,b) = {} in the same way that {1} ^ { 2 } = {} = {duck } ^
{ fox },etc ,
ie, any number of expression may evaluate to the empty set, even if the
expressions
have little relationship with each other.

I'm not following why this is such a big deal, the notation [) makes perfect
sense
when dealing with ranges, as Andrew Koenig pointed out.
 
S

Steven T. Hatton

Dave said:
Okay, that makes sense that [a,a) != [b,b) but that just means that
[a,a) != {}. It's not the empty set, it's /an/ empty /sequence/,
starting at a. That's how it's used typically anyway.
Surely [a,a) == [b,b) = {} in the same way that {1} ^ { 2 } = {} = {duck }
^
{ fox },etc ,
ie, any number of expression may evaluate to the empty set, even if the
expressions
have little relationship with each other.

I don't know what you mean here. The point I was making, and which Mark
seems to agree with is that [a,a) != [b,b).
I'm not following why this is such a big deal, the notation [) makes
perfect sense when dealing with ranges, as Andrew Koenig pointed out.

I marked the thread OT because I didn't find the topic overly relevant to
the general topic of C++, but it seemed to be something others were
interested in. I agree that the notation works for ranges, and calling
[a,a) the empty sequence (or interval) beginning at /a/ makes sense. It is
actually a fairly useful concept. For example, the notation \< in Emacs
regular expression syntax denotes the empty string at the beginning of a
word. My point was one of mathematical rigor. I don't believe Accelerated
C++ actually says [a,a) denotes the empty /set/. That wording arose in the
context of this discussion.

--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell
 
A

Andrew Koenig

I don't know what you mean here. The point I was making, and which Mark
seems to agree with is that [a,a) != [b,b).

The question is whether you want to talk about equality of ranges in terms
of their bounds, or in terms of the elements they represent. Both ways of
viewing ranges are useful in different contexts, so it's a matter of choice.

The usual mathematical usage is to talk about ranges solely in terms of
their elements, because there are other ways of talking about the bounds if
that's what you want. So the usual usage is to note that, for example, [3,
3) and [5, 5) are two different representations of the empty set. The
representations are different, but they represent the same set.
 
S

Steven T. Hatton

Andrew said:
I don't know what you mean here. The point I was making, and which Mark
seems to agree with is that [a,a) != [b,b).

The question is whether you want to talk about equality of ranges in terms
of their bounds, or in terms of the elements they represent. Both ways of
viewing ranges are useful in different contexts, so it's a matter of
choice.

Understood. The ultimate test of a mathematical proposition is consistency
with the axioms assumed. Unfortunately, much of mathematical literature is
not as clear about fundamental assumptions as it should be. I have
discovered that, not infrequently, mathematicians tend to operate on the
basis of preconceived and nebulous foundations, deriving from these
foundations what I hold to be axiomatic, or assuming things which I derive
to be axiomatic.
The usual mathematical usage is to talk about ranges solely in terms of
their elements, because there are other ways of talking about the bounds
if
that's what you want. So the usual usage is to note that, for example,
[3,
3) and [5, 5) are two different representations of the empty set. The
representations are different, but they represent the same set.

I will have to leave my opinion unformed on this matter since I don't have
time to investigate a sufficient number of resources to form a conclusion.
I certainly will grant that defining [a,a) === {} is likely to be
consistent with a substantial mathematical theory. I find attempting to
represent such expressions in software to be an interesting exercise. For
example, what is it that we are actually saying is 'empty'? The set of
indices, or the set of things to which these indices refer?

--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell
 
A

Andre Dajd

E. Mark Ping said:
Especially that the union of the two intervals:

[a,b) U [b,c)

is also a half-open interval: [a,c)

See: http://mathworld.wolfram.com/Half-ClosedInterval.html
We are specifically interested in the case of [a,a) i.e., [a,b) where
b = a.

My apologies for being too terse. I've never seen standard
nomenclature for [a,a), but it makes sense in this case to define it
as the empty set, since that means the union property holds:

[a,a) U [a,b) = [a,b)

The nomenclature is quite trivial actually. You start with endowing R
with a topology, ie specifying which sets are open. In the standard
topology, sets (a,b), a<=b, (a,a) "denoting" empty set (same as
0.9999.... denotes 1). These sets are well and constructively defined
based on the aximos reals and set theoretic operations: we take two
ordered points a,b, consdier set {x| a<=x<=b} and then define (a,b) =
{x| a<=x<=b}\{a, b}. Existence of such x follows from the
Dedekind-completeness (continuity) axiom.

Now, first, we see that (a,a) = {}, simply by construction.

Furthermore, we introduce "nomenclature"

[a,b) = {a} U (a,b) = [a] U (a,b),

and

[a,b] = [a,b) U {b}

which implies that [a,a) = {a}, as (a,a) = {}, and that {a} = [a, a].
Similarly, 0! is commenly defined as 1 becuase it's most useful with
that definition in combinatorics, but AFAIK it's not a universally
accepted definition.

Well, x! is a manning from naturals. You can simply extend it to
nonnegatives.

d
 
S

Steven T. Hatton

Andre said:
(e-mail address removed) (E. Mark Ping) wrote in message
E. Mark Ping wrote:
Especially that the union of the two intervals:

[a,b) U [b,c)

is also a half-open interval: [a,c)

See: http://mathworld.wolfram.com/Half-ClosedInterval.html
We are specifically interested in the case of [a,a) i.e., [a,b) where
b = a.

My apologies for being too terse. I've never seen standard
nomenclature for [a,a), but it makes sense in this case to define it
as the empty set, since that means the union property holds:

[a,a) U [a,b) = [a,b)

The nomenclature is quite trivial actually. You start with endowing R
with a topology, ie specifying which sets are open. In the standard
topology, sets (a,b), a<=b, (a,a) "denoting" empty set (same as
0.9999.... denotes 1). These sets are well and constructively defined
based on the aximos reals and set theoretic operations: we take two
ordered points a,b, consdier set {x| a<=x<=b} and then define (a,b) =
{x| a<=x<=b}\{a, b}. Existence of such x follows from the
Dedekind-completeness (continuity) axiom.

Now, first, we see that (a,a) = {}, simply by construction.

Furthermore, we introduce "nomenclature"

[a,b) = {a} U (a,b) = [a] U (a,b),

and

[a,b] = [a,b) U {b}

which implies that [a,a) = {a}, as (a,a) = {}, and that {a} = [a, a].


My caution in accepting this is that it seems to neglect the concept of
position. There are two approaches to describing tensors which I believe
are relevant to this discussion. One approach is to talk about vectors as
simply the n-tuples of ordered sets which remain invariant under
transformations of coordinates. Another approach maintains that a tensor
is a function of position, and hence it is not meaningful to discuss them
without reference to the location in space where their components are
evaluated.

I can accept that mathematicians do use the definitions you are using to
construct dominant theories. That doesn't mean that other equally
successfull axioms cannot be posited as the foundations of a consistent and
useful theory.

Just as a simple example involving memory addressing, consider the
alternative approaches available for determining the equivalence of two
ranges. We could define the ranges using objects like this:

class range{
float* _lb;
float* _ub;
public:

range(float* lb_, float* ub_):_lb(lb_), _ub(ub_){}
//... populate with data

bool operator==(const range& r){
if(_ub - _lb != r._ub - r._lb) {
throw std::domain_error("comparing incongruent ranges");
}

float* p = _lb;
float* pr = r._lb;

while(p < _ub) {
if(*p++ != *pr++) {return false;}
}
return true;
}

};

Alternatively we could write the equivalence operator as follows:
bool operator==(const range& r){ return (_ub == _lb && r._ub == r._lb); }

--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell
 
A

Andre Dajd

Steven T. Hatton said:
Andre Dajd wrote: [snip]
My caution in accepting this is that it seems to neglect the concept of
position. There are two approaches to describing tensors which I believe
are relevant to this discussion. One approach is to talk about vectors as
simply the n-tuples of ordered sets which remain invariant under
transformations of coordinates. Another approach maintains that a tensor
is a function of position, and hence it is not meaningful to discuss them
without reference to the location in space where their components are
evaluated.

I can accept that mathematicians do use the definitions you are using to
construct dominant theories. That doesn't mean that other equally
successfull axioms cannot be posited as the foundations of a consistent and
useful theory.

Sure they can. What are talking about here are vector spaces (in
which tensors are defined) and affine spaces. The latter differs from
the former, effectively, by removing "0", ie loosing the notion of
"beginning", hence making only the notion of "difference" = "relative
position" meaningful. This is simply a different object from "vector
space", having specific properties and useful in corresponding fields.

http://mathworld.wolfram.com/AffineSpace.html

So, one should only be clear what he is talking about and then there
will be no ambiguities

:)

d
 
S

Steven T. Hatton

Andre said:
Steven T. Hatton said:
Andre Dajd wrote: [snip]
My caution in accepting this is that it seems to neglect the concept of
position. There are two approaches to describing tensors which I believe
are relevant to this discussion. One approach is to talk about vectors
as simply the n-tuples of ordered sets which remain invariant under
transformations of coordinates. Another approach maintains that a tensor
is a function of position, and hence it is not meaningful to discuss them
without reference to the location in space where their components are
evaluated.

I can accept that mathematicians do use the definitions you are using to
construct dominant theories. That doesn't mean that other equally
successfull axioms cannot be posited as the foundations of a consistent
and useful theory.

Sure they can. What are talking about here are vector spaces (in
which tensors are defined) and affine spaces. The latter differs from
the former, effectively, by removing "0", ie loosing the notion of
"beginning", hence making only the notion of "difference" = "relative
position" meaningful. This is simply a different object from "vector
space", having specific properties and useful in corresponding fields.

http://mathworld.wolfram.com/AffineSpace.html

So, one should only be clear what he is talking about and then there
will be no ambiguities

:)

d

No. I'm talking about a vector being defined as an n-valued function of the
coordinate system.
--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,202
Latest member
MikoOslo

Latest Threads

Top