<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    ----- Message d'origine ----- <br>
    De : Sam Mathew <br>
    Date : 08/11/2010 05:10:
    <blockquote
      cite="mid:AANLkTinhEq2xv5B=sQdrwyTLDH=o=4EF7hg81AtAnHnY@mail.gmail.com"
      type="cite">Thanks Samuel for that solution. Just that I'm not
      able to figure out the explanation for the last part:<br>
      <br>
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div>
            <br>
            <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
              0.8ex; border-left: 1px solid rgb(204, 204, 204);
              padding-left: 1ex;">
              Is it possible to also perform such transformations if a
              function is of two<br>
              variables x and y, and the coordinate axes undergo
              different transformations<br>
              (translation, rotation, etc.).<br>
            </blockquote>
            <br>
          </div>
          <u>It could be, whether the polynomial could be applied to a<br>
            matrix (it can) in a matrix way. But it is not the case :<br>
            horner() works on a matrix only in a element-wise way.</u><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
    You are right, it is a bit obscure, and somewhat useless. <br>
    I was just wondering about a way to implement<br>
    bi-variate polynomials with matrices.<br>
    // Let<br>
    x=grand(4,1,"uin",0,9)<br>
    // be the coefficients of p(x)<br>
     x  = <br>
        2.  <br>
        2.  <br>
        4.  <br>
        5.  <br>
    // and <br>
    y=grand(1,3,"uin",0,9)<br>
    // be the coefficients of q(y)<br>
     y  = <br>
        4.    1.    9.  <br>
    // Then, the coefficients of P(x,y)=p(x).q(y) are in the matrix x*y<br>
    P=x*y<br>
     P  =<br>
        8.     2.    18.  <br>
        8.     2.    18.  <br>
        16.    4.    36.  <br>
        20.    5.    45.  <br>
    // where P(i,j) is the coeff of the x^(i-1).y^(j-1) term<br>
    <br>
    From there, it should be possible to write a library of matrix-based
    <br>
    functions implementing operations between bi-variates polynomials,<br>
    or even N-variates polynomials (through hypermatrices).<br>
    <br>
    Then, the evaluation of such polynomials could not be done with any<br>
    horner() algo, that does not fit for that, even if it could be
    called in<br>
    a matrix-oriented way.<br>
    <br>
    For instance, for x=2 and y=3, the following would be required:<br>
    <br>
    [X,Y] = ndgrid(x^(0:size(P,1)-1),y^(0:size(P,2)-1))<br>
    Result = sum(P.*X.*Y)  // evaluates P(x=2,y=3)<br>
    <br>
    Other functions would be required for multiplying by-variate
    polynomials<br>
    with each others, etc<br>
    <br>
    Besides all this stuff, it could be worthwhile to implement a
    horner() <br>
    release applicable in a matrix-wise way, instead of a element-wise
    one.<br>
    But this has nothing to do with multivariate polynomials.<br>
     <br>
    Samuel<br>
    <br>
  </body>
</html>