Hi,
  Okay then we'll have to agree to disagree :-) Since octave-forge is
the place where extra packages for Octave get developed, this mailing
list really isn't the right place for this discussion. I guess you
should bring this up at the octave maintainers list, but I still don't
think your approach is good.

Søren

man, 04 02 2008 kl. 17:34 +0330, skrev hossein sajjadi:
> Hi,
> I read your previous mail.
> I agree that if we get a(b)=7 then a=[4,7,6] that Octave acts:
> a(b(1))=7
> a(b(2))=7
> a(b(3))=7
> a(b(4))=7
> this means we four times assign 7 to a(2) thus a(2)=7and a = [4, 7, 6]
> the logic of the language when a(b)=a(b)+1 is obvious
> first octave computes right hand side of equation
> temp1=a(b)=[5 5 5 5]
> then octave computes temp2=temp1+1=[6 6 6 6]
> [but the right hand side of equation must not be confused with the left side]
> then octave performs assigning the value to the variable four times that 
> means:
> a(b(1))=temp2(1)=6
> a(b(2))=temp2(2)=6
> a(b(3))=temp2(3)=6
> a(b(4))=temp2(4)=6
> then we have
> >>a(b) = a(b) + 1
> a=
> 4 6 6
> 
> but for computing a(b)++ octave first computes
>  unique(b) and then computes a(unique(b))++
> that is with its own overflow.I can use hist function
> for computing one dimensional histograms but if I want to
> compute Nd histograms the problem is still open. also if you claim
> that this efficient method is not consistent with the rest of the
> language I should
> say that the ++ operator is not consistent with the rest of  the
> language and if you think
> a++ is a shorthand for a=a+1 we agree in our thinking that ++ operator
> is not efficient.
> yes, a++ is a shorthand for a=a+1 but for low level language such as c++ but 
> in
> array processing languages we can use array processing capabilities and
> improve other aspects.
> Thanks,
> Hossein
> 
> 
> 
> On 2/4/08, Søren Hauberg <[EMAIL PROTECTED]> wrote:
> > Hi,
> >   Did you read my previous mail? I can understand the logic behind the
> > behaviour that you'd like Octave to have, but I just don't think such a
> > change would be consistent with the rest of the language. If you want a
> > way to create histograms, just use the 'hist' function.
> >
> > Søren
> >
> > man, 04 02 2008 kl. 10:31 +0330, skrev hossein sajjadi:
> > > Hello
> > > When we perform
> > > >a(b)
> > > Octave engine acts in the following manner:
> > > 1 create an empty array ,say "temp",with its size equals size(b)=[1 4]
> > > 2 temp(1)=a(b(1))
> > > 3 temp(2)=a(b(2))
> > > 4 temp(3)=a(b(3))
> > > 5 temp(4)=a(b(4))
> > > when we perform a(b)++ current implementation of Octave,that ignores
> > > repetitions, acts:
> > > 1 temp=unique(b)
> > > 2 a(temp)++
> > > this means a(2)++ thus 'a' becomes [4 6 6]
> > > but if it behave in efficient way it acts:
> > > 1 a(b(1))++ that equals a(2)++  and because a(2) was 5 then we have
> > > a=[4  6  6]
> > > 2 a(b(2))++ that equals a(2)++  and because a(2) was 6 then we have
> > > a=[4  7  6]
> > > 3 a(b(3))++ that equals a(2)++  and because a(2) was 7 then we have
> > > a=[4  8  6]
> > > 4 a(b(4))++ that equals a(2)++  and because a(2) was 9 then we have
> > > a=[4  9  6]
> > > this efficient way is very useful for creating 'histograms'.
> > > Thanks,
> > > Hossein
> >
> >


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to