<div dir="ltr"><div>Dear José Santos<br></div><div>What you describe looks like a bug in lisplab since eigenvalues should basically just call dgeev. <br><br></div><div>The reason for for the bug is probably that lisplab has some functionality to switch between native and foreign implementations when both are present. In the case of eigenvalues, there is no native lisp implementation, but it might be that it thinks that it exists. <br>
<br></div><div>The matlisp code is, as the name implies, basically taken from Matlisp. Unfortunately I have not put much emphasis on testing it and making high-level interface functions. Hence it is prone to get bugs. <br>
</div><div><br></div><div>Best Regards<br></div><div>Jørn Inge Vestgården<br></div><div><br></div><div><span class=""><font color="#888888"></font></span></div><span class=""><font color="#888888"></font></span></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/3/15 José Santos <span dir="ltr"><<a href="mailto:jsmpereira@gmail.com" target="_blank">jsmpereira@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<div><br></div><div>After trying out GSLL, Clem, also FemLisp, Lisplab managed to get me</div><div>the functionality I needed with the least trouble.</div><div><br></div><div>I'm trying to get the connectivity of a graph (second smallest eigen value) from eigenvalues.</div>
<div><br></div><div>Given the fully connected 4x4 adjacency matrix:</div><div><br></div><div><div>#md(( 0.000 1.000 1.000 1.000 )</div><div> ( 1.000 0.000 1.000 1.000 )</div><div> ( 1.000 1.000 0.000 1.000 )</div>
<div> ( 1.000 1.000 1.000 0.000 ))</div></div><div><br></div><div>I compute the diagonal matrix of the vector sum of the adjacency matrix and then</div><div>subtract the adjacency matrix from it to get the laplacian matrix.</div>
<div><br></div><div>I'm unable to call (lisplab:eigenvalues) on that matrix, despite being a #md matrix.</div><div>I can see that the function calls for LISPLAB::MATRIX-FOREIGN-DGE. However other functions</div><div>
that call for the same type seem to work when called with #md, namely FFT1.</div>
<div><br></div><div>As a workaround, I'm using this call to get the eigenvalues:</div><div><br></div><div>(lisplab::dgeev (laplacian-matrix *adj-matrix* *diag-matrix*) nil nil) and I get:</div><div><br></div><div><div>
(</div><div>#md(( 4.000 )</div><div> (-1.1102d-16)</div><div> ( 4.000 )</div><div> ( 4.000 ))</div><div> NIL NIL)</div></div><div><br></div><div>Is this appropriate?</div><div><br></div><div><div>I'm curious however about different results I get from Matlab.</div>
</div><div>I get the same results up until the call to </div><div><br></div><div>>> eig(diag(sum(A)) - A)</div><div><br></div><div>which gives me</div><div><br></div><div><div>ans =</div><div><br></div><div> 0.0000</div>
<div> 4.0000</div><div> 4.0000</div><div> 4.0000</div></div><div><br></div><div>Any comment I can get on this would be awsome. Am I going about this right?</div><div>What might I be missing? </div><div><br></div>
<div>Sorry about the lengthy email.</div><div><br></div><div>Thanks!</div><span class="HOEnZb"><font color="#888888"><div>José Santos</div>
</font></span><br>_______________________________________________<br>
lisplab-devel mailing list<br>
<a href="mailto:lisplab-devel@common-lisp.net">lisplab-devel@common-lisp.net</a><br>
<a href="http://lists.common-lisp.net/cgi-bin/mailman/listinfo/lisplab-devel" target="_blank">http://lists.common-lisp.net/cgi-bin/mailman/listinfo/lisplab-devel</a><br>
<br></blockquote></div><br></div>