<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello Samuel,</p>
    <p>Thank you for your answers.<br>
    </p>
    <p>- <b>Building toolboxes</b>: I did not know that tbx_make() was
      functional, it seems the way to go in the future indeed. At the
      moment, it seems to be a bit unstable though and produced a
      segfault in my case,<br>
    </p>
    <p>terminate called after throwing an instance of
      'GiwsException::JniCallMethodException'<br>
        what():  Exception when calling Java method : <br>
      Segmentation fault (core dumped)<br>
    </p>
    <p>- <b>Using 'error()' in overloading functions</b>: I'm not sure
      to understand what you mean?</p>
    <p>To overload the extraction for both 1 and multiple indexes (as
      matrices), e.g. a(1), a(1,2), I used,<br>
    </p>
    <blockquote>
      <p><font size="-1">function out = %myType_e(varargin)</font></p>
      <p><font size="-1">// the object is always varargin($),</font></p>
      <p><font size="-1">// the indexes are varargin(1:$-1)<br>
        </font></p>
      <p><font size="-1">endfunction</font><br>
      </p>
    </blockquote>
    <p>to cover all the cases in one function. This actually works, but
      using error(' ') within this function does no longer display the
      error message, instead, it says that the overloading is not
      defined.<br>
    </p>
    <p>- <b>Performances for solving A*x = b</b>: On Scilab 5, the code</p>
    <blockquote>
      <p><font size="-1">n = 100; A = rand(n,n);b = rand(n,1);x = A\b;</font></p>
    </blockquote>
    <p>leads to a segfault for n >= 18 (maybe a problem with the
      package in ubuntu?). Hence I did not really test the performances.<br>
    </p>
    <br>
    - <b>Equivalent to x = clear('x') in Scilab 6</b>: I see., I 'll
    stick with empty variables for the moment.<br>
    <br>
    <br>
    Best regards,<br>
    <br>
    Pierre<br>
    <br>
    PS: I understand. I just did not want to spam the list with multiple
    questions.<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Le 16/02/2017 à 22:20, Samuel Gougeon a
      écrit :<br>
    </div>
    <blockquote cite="mid:eaa028ec-e540-158c-7c52-333bc7b7bfa9@free.fr"
      type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Hello Pierre,<br>
        <br>
        That's right. The changes about the library generation was
        emphasized on the forum on 2015 summer (please see <a
          moz-do-not-send="true"
href="http://mailinglists.scilab.org/lib-unavailable-on-YaSp-tp4032576p4032578.html">here</a>
        for instance).<br>
        By the way, even before these changes, the example shown in the
        lib page is awful. The only proper way to build a library is
        using genlib(). This example is clearly outdated.<br>
        <br>
        <blockquote type="cite">I would like to avoid using 'genlib' as
          it does not recursively goes through subdirectories</blockquote>
        <br>
        So, it is time to try using tbx_make() with proper flags.<br>
        <br>
        <blockquote type="cite">--> a = mlist(['myType']);<br>
          <br>
          --> function %myType_e(varargin)<br>
            >    error('My error msg')<br>
            > endfunction<br>
          <br>
          --> a(1)<br>
          at line     2 of function %myType_e <br>
          <br>
          Function not defined for given argument type(s),<br>
            check arguments or define function %l_e for overloading.<br>
        </blockquote>
        <br>
        This is because the prototype of a extraction overload for
        A(i1,i2,..,iN) is<br>
        function R = %typeOfA_e(i1,i2,...,iN,A)<br>
        The last input argument is the object from which you want to
        extract some component.<br>
        If you specify varargin, varargin is a list(), and so you get
        the given error message.<br>
        <br>
        <br>
        <br>
        Le 16/02/2017 à 18:37, Pierre Vuillemin a écrit :<br>
      </div>
      <blockquote
        cite="mid:4da87406-ca3a-f371-2e3b-d71e0d7d5e96@pierre-vuillemin.fr"
        type="cite">
        <blockquote> - I'm not sure that this is specific to Scilab 6,
          but I've noticed a large difference in performance for solving
          linear systems A*x = b in comparison to Octave and Matlab. For
          instance,<br>
          <blockquote><font size="-1">n = 100;</font><br>
            <font size="-1">N = 1000;</font><br>
            <font size="-1">T = 0;</font><br>
            <font size="-1">for i = 1:n</font><br>
            <font size="-1">   A = rand(N,N);</font><br>
            <font size="-1">   b = rand(N,1);</font><br>
            <font size="-1">   tic();</font><br>
            <font size="-1">   x = A\b;</font><br>
            <font size="-1">   T = T + toc();</font><br>
            <font size="-1">end</font><br>
            <font size="-1">disp(T/n)</font><br>
          </blockquote>
          <br>
          is (significantly) slower with Scilab (binaries for linux
          64bits) than with Octave. Is it due to the way the underlying
          lapack library is compiled?<br>
        </blockquote>
      </blockquote>
      <br>
      Did you benchmark and compare Scilab 5.5.2 an Scilab 6.0.0
      performance for this example?<br>
      <br>
      <blockquote
        cite="mid:4da87406-ca3a-f371-2e3b-d71e0d7d5e96@pierre-vuillemin.fr"
        type="cite">
        <blockquote> <br>
          <br>
          - In Scilab 5, given a variable 'x', the expression <br>
          <br>
          <blockquote><font size="-1">x = clear('x') </font><br>
          </blockquote>
          <br>
          was allowed and would clean the variable 'x'. Used together
          with 'resume' in a function, that allowed to clean variables
          from the above environment. While it might not be a very safe
          coding practice, is there a way to reproduce this behaviour in
          Scilab 6 ? <br>
        </blockquote>
      </blockquote>
      <br>
      Actually, it was formerly possible to delete a variable by
      assigning a null variable to it.<br>
      And primitives without output arguments -- like clear -- returned
      such an object of type==0.<br>
      But the definition and the management of objects of type==0 have
      actually changed. In my opinion, the new management is not yet
      mature. <a moz-do-not-send="true"
        href="https://codereview.scilab.org/#/c/19105/">I am updating
        the type() help page</a>, and i think that discussions are not
      over about this question :)<br>
      <br>
      AFAIK, in Scilab 6, a null object can only be an undefined
      component of a list:<br>
      L = list("abc", , %z);<br>
      type(L(2))<br>
      x = L(2) // should do the same than x = clear("x") (that actually
      looks like a hack :/)<br>
      <br>
      <br>
      Regards<br>
      Samuel<br>
      <br>
      PS : one single topic per thread is always better for mailing
      lists archives<br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>