<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Le 26/11/2019 à 03:43, Chin Luh Tan a
      écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:16ea597e31c.e8f5e7dc99311.1774696429608657223@bytecode-asia.com">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <div style="font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 10pt;">
        <div>Hi, <br>
        </div>
        <div><br>
        </div>
        <div>from the first glance on the documentation you show: <br>
        </div>
        <div><br>
        </div>
        <div>"Beside this function, you can also use sparse() primitive
          to build a block diagonal sparse matrix."<br>
        </div>
        <div><br>
        </div>
        <div>it sound to me that this statement said the sparse could be
          used to create block diagonal matrix with the similar inputs
          to sysdiag.<br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>But after a trying to stare at it again... I think it might
          mean:</div>
        <div><br>
        </div>
        <div>" to convert the <b>block diagonal matrix</b> to <b>block
            diagonal <i>sparse </i>matrix "</b></div>
        <br>
        <div data-zbluepencil-ignore="true" style="" class="zmail_extra">which
          likely is the one shown in the example: <br>
        </div>
        <div class="refsection">
          <div class="programlisting">
            <table width="100%" border="0">
              <tbody>
                <tr>
                  <td width="98%">
                    <pre class="scilabcode"><span class="scilabid">S</span><span class="scilaboperator">=</span><span class="scilabmacro">sysdiag</span><span class="scilabopenclose">([</span><span class="scilabnumber">1</span> <span class="scilabnumber">2</span><span class="scilabdefault">;</span> <span class="scilabnumber">3</span> <span class="scilabnumber">4</span><span class="scilabopenclose">]</span><span class="scilabdefault">,</span> <span class="scilabopenclose">[</span><span class="scilabnumber">5</span> <span class="scilabnumber">6</span><span class="scilabdefault">;</span> <span class="scilabnumber">7</span> <span class="scilabnumber">8</span><span class="scilabopenclose">]</span><span class="scilabdefault">,</span> <span class="scilabopenclose">[</span><span class="scilabnumber">9</span> <span class="scilabnumber">10</span><span class="scilabdefault">;</span> <span class="scilabnumber">11</span> <span class="scilabnumber">12</span><span class="scilabopenclose">]</span><span class="scilabdefault">,</span> <span class="scilabopenclose">[</span><span class="scilabnumber">13</span> <span class="scilabnumber">14</span><span class="scilabdefault">;</span> <span class="scilabnumber">15</span> <span class="scilabnumber">16</span><span class="scilabopenclose">])</span>
<span class="scilabid">S</span><span class="scilaboperator">=</span><a href="sparse.html" class="scilabcommand" target="_blank" moz-do-not-send="true">sparse</a><span class="scilabopenclose">(</span><span class="scilabid">S</span><span class="scilabopenclose">)</span>
</pre>
                    <div>which simply to say that we could use sparse to
                      convert the full matrix created by sysdiag to
                      sparse?<br>
                    </div>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </blockquote>
    <p><br>
    </p>
    <p>Chin Luh,<br>
    </p>
    <p>You are right.<br>
      <br>
      Yesterday evening i posted a<a moz-do-not-send="true"
        href="http://bugzilla.scilab.org/show_bug.cgi?id=16257"> wish to
        improve sysdiag</a>(), and also to rename it <i>blockdiag</i>()
      (but both aspects are distinct). I have rewritten sysdiag() as
      indicated in the wish, and made an additional improvement, that
      is: When at least one input is sparse, the result is built as a
      sparse<i> from the beginning</i>, instead of only when the first
      sparse input is met and included in the result. Hence, the
      probability of a memory issue is decreased.<br>
      <br>
      Best regards<br>
      Samuel<br>
      <br>
    </p>
  </body>
</html>