octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ideas for auto BSX


From: John W. Eaton
Subject: Re: Ideas for auto BSX
Date: Wed, 14 Dec 2011 13:00:51 -0500

On 14-Dec-2011, Juan Pablo Carbajal wrote:

| 2011/12/14 Jordi Gutiérrez Hermoso <address@hidden>:
| > 2011/12/14 Judd Storrs <address@hidden>:
| >> 2011/10/1 Jordi Gutiérrez Hermoso <address@hidden>:
| >>> As I've said before, I don't see "Matlab compatibility" to be anything
| >>> more than source compatibility. If it runs in Matlab, it should run in
| >>> Octave and produce almost the same result (perhaps slight variation in
| >>> graphics is acceptable, for example). I don't see making everything in
| >>> Octave working and looking exactly like Matlab to be the goal. We
| >>> already have lots of other nice Octave-only language features (e.g.
| >>> being able to define functions interactively without needing a
| >>> separate file for each or being able to index temporaries), and that's
| >>> not lack of Matlab compatibility.
| >>
| >> One thing that just occurred to me is: does it become much more
| >> difficult to automatically translate octave code into code that will
| >> run in matlab?
| >
| > Octave already has a bunch of code that is difficult to automatically
| > translate into Matlab. Unwind-protect? Functions defined in script
| > files as opposed to function files? Generating intermediate variables
| > when indexing temporaries?
| >
| > - Jordi G. H.
| 
| Jordi I do like the auto bsx, but I agree with Judd. It may create
| more problems in translation.
| I am a supporter for having a clear translation table between Octave
| and ML, I collaborate a lot with people that only use ML, and so far
| things are going good with a small translation table, but I think, as
| Judd, that this case would be not so easily detected.
| One thing is to have different code (all the cases you mentioned) that
| can be easily identified (even automatically), but how would you
| recognize
| a - b
| to be
| bsxfun(@minus,a,b)?
| 
| Only a parser with access to the sizes of the variables will be able
| to translate that.

The parser has no knowledge of the sizes of variables.  Those are only
known when the code is interpreted, and they can change from one call
to the next.  So there is no translation from the operator notation to
bsxfun.  But I don't see this as a problem.  If you want your code to
run in Matlab, then you have to use bsxfun when that is the operation
you want.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]