help-octave
[Top][All Lists]
Advanced

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

Re: behaviour different when loaded as toolbox


From: withaar
Subject: Re: behaviour different when loaded as toolbox
Date: Thu, 15 Jan 2015 20:42:59 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

Hi Mike,

Thanks for trying to duplicate. The behaviour goes away when I have only one version installed, so perhaps it has something to do with the system having a class definition shadowed?

There is no PKG_ADD script or anything I can find that is specific to the quaternion package.

Willem


On 2015-01-15 07:42 PM, Mike Miller wrote:
On Thu, Jan 15, 2015 at 15:20:58 -0800, withaar wrote:
Hi all,

I am working on the quaternion toolbox and an running into odd behaviour. I
like making my own folder somewhere and work on functions, possibly
shadowing the original. In my case I originally did not have the quaternion
toolbox installed - at the moment I do but the result is the same.

Question: does pkg does something special when loading/installing a toolbox?
In general, yes a package may have a PKG_ADD script that is executed
when it is loaded each time using "pkg load". And installing a package
may do several things as well, such as compiling oct-files.

q = quaternion(randn(2,3,4),randn(2,3,4),randn(2,3,4),randn(2,3,4));
q.w(1,1,1)
q.w(1,1,1) = 0

error: a cs-list cannot be further indexed
error: invalid assignment to cs-list outside multiple assignment
#------------------------------------------------

Where does the difference in behaviour come from? For the alternate version
subsref/subsassgn never get called.
I can't reproduce this, attempting to do the same thing that I think you
are, so I'm not sure. I guess the obvious question is, is this the same
version of the quaternion package? Or is it possibly an older version
and you are simply seeing a bug that has been fixed in 2.2.2?

Here's what I did:

   $ hg clone https://bitbucket.org/paramaniac/quaternion
   $ cd quaternion/src
   $ mkoctfile is_real_array.cc
   $ cd ..
   $ octave
   octave:1> addpath ([pwd "/inst"]);
   octave:2> addpath ([pwd "/src"]);
   octave:3> q = 
quaternion(randn(2,3,4),randn(2,3,4),randn(2,3,4),randn(2,3,4));
   octave:4> q.w(1,1,1)
   ans = -0.033714
   octave:5> q.w(1,1,1) = 0;
   octave:6> q.w(1,1,1)
   ans = 0





reply via email to

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