help-octave
[Top][All Lists]
Advanced

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

Rebuild Oct file does not change the executable


From: Thomas D. Dean
Subject: Rebuild Oct file does not change the executable
Date: Thu, 27 Apr 2017 19:43:29 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

I rebuild an .oct file but, execution does not change the results.

#include <octave/oct.h>
#include <octave/oct-map.h>

DEFUN_DLD (create_struct_array, , ,
                   "example of struct array")
{
  octave_idx_type n = 3;

  Cell avals (n, 1);
  Cell bvals (n, 1);

  for (octave_idx_type i = 0; i < n; i++)
        {
          avals(i) = i*7;
          bvals(i) = i+1;
        }

  octave_map m;

  m.assign ("a", avals);
  m.assign ("b", bvals);

  return octave_value (m);
}

The above courtsey of jwe

mkoctfile create_struct_array.cpp

creates create_struct_array.oct

octave:124> m=create_struct_array()
m =

  3x1 struct array containing the fields:

    a
    b

Changing the value of n to n = 8 and saving the file,

mkoctfile create_struct_array.cpp

creates create_struct_array.oct with a new timestamp

octave:125> m=create_struct_array()
warning: library /home/tomdean/Math/Octave/work/create_struct_array.oct not reloaded due to existing references
m =

  3x1 struct array containing the fields:

    a
    b

Seems like octave is keeping the old version in a buffer?

If I delete the .oct file and within octave try to call it, I get the expected error message. Then, recompiling uses the new version.

Any ideas?



reply via email to

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