lambda for mat_function



There is a program in the file diag.mac that has the effect of binding
"k" to something. When you compute x^k, it refers to that k.

I suggest you try

mat_function(lambda([x],x^kkkk),A)

to see this.

There are many common names used in diag.mac that may cause
interference, including
possibly f,z,i,j,ii,n,p,L1,L2,b,tempmat,siftmat,a.

RJF


Xiang Liu wrote:
>
> _Function:_ *mat_function*/ (f,mat)/
>
>     Returns /f(mat)/, where f is an analytic function and mat a matrix.
>
> I have tried:
>
> load(diag);
>
>
> A:matrix([4,1,2],[0,2,-4],[0,1,6]);
>
>
> mat_function(lambda([x],x^k),A);
>
>
> fpow(x):=block([k],declare(k,integer),x^k);
>
>
> mat_function(fpow,A);
>
>
> The question is: why lambda expression doesn't work here?
>
> -- 
> Tel: 023-66936158
> ------------------------------------------------------------------------
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>