Hello,
> De : Federico Miyara
> Envoyé : mardi 24 septembre 2019 17:09
>
> Stéphane,
> Thanks, this is great
Indeed, my own solution proves to be poor because the conversion to a string
causes a drastic truncation.
A quick example with something like P = poly(0.01:0.01:1, "s") shows a great
Stéphane,
Thanks, this is great, the use of eye is the way to go to overcome the
problem of an earlier suggestion which discarded, for instance, A + 2
for not being what Horner expects; but A + 2*eye(A) is!
Thanks also for making me aware of the simplified syntax 2*eye() which
adapts its
Why just not writing Horner's algorithm directly ?
functionout=horner_mat(p,
X)a=coeff(p)out=zeros(X);fork=degree(p):-1:0out=out*X+a(k+1)*eye()endendfunction-->
a=[1 2;3 4]a = 1. 2.3. 4.--> horner_mat(1+%s-%s^2,a)ans =-5. -8. -12.
-17.--> eye() + a - a^2ans =-5. -8. -12. -17.S.
Le
Hi,
I've got some time this morning (-: so this one seems to work and should be a
bit more efficient:
// **
P = %s^2 + 2*%s + 3
C = coeff(P)
n = size(C, "c")
if n > 1 then
stringP = "X1 = x; "
for i = 3:n
stringP = stringP+"X"+string(i-1)+" = X"+string(i-2)+"*x; "
I'm aware that this is an inefficient way to compute the result
but unfortunately, the Horner form of polynomial does not work on matrices:
(A + 2)*A is not the same as A*A + 2*A for Scilab.
It is possible to write a better function manually,
by first calculating the successive powers before
Le 24/09/2019 à 09:29, Antoine Monmayrant a écrit :
Le 23/09/2019 à 23:13, stephane.motte...@utc.fr a écrit :
Hello Antoine,
Before judging that some code is just a "dirty hack" you should first
get into the code and see hows things are written. The implementation
in 5.5.2 was using
Hi,
I agree. The lack of a working solution for parallel computations is a problem
on modern server type machines with many cores. We typically try to work around
this by having scilab functions that generate scilab scripts that are executed
by spawned headless scilab processes. Communication
Hello Frederico,
> De : Federico Miyara
> Envoyé : mardi 24 septembre 2019 00:25
>
> Is there some way of evaluating a polynomial on a square matrix in a
> matrix-wise (not component-wise) fashion?
You can transform your polynomial into a usual external function Then apply it
to a matrix.
e.g.
Le 23/09/2019 à 23:13, stephane.motte...@utc.fr a écrit :
Hello Antoine,
Before judging that some code is just a "dirty hack" you should first
get into the code and see hows things are written. The implementation
in 5.5.2 was using OpenMP so I don't see anything dirty here. The
Hello,
Le 24/09/2019 à 02:48, fujimoto2005 a écrit :
Dear all,
Thanks for a lot of information.
If the documentation contained information on the workable version, it would
be much better for users.
Feel free to help making the documentation better. Scilab is free
software and cannot be
10 matches
Mail list logo