I may found a way to avoid licensing problems or the need to <br>convince the meschach developers to change there license<br>to be compatible with the gpl.<br><br>We can use parts of the ccmath library.<br><a href="http://freshmeat.net/projects/ccmath/">http://freshmeat.net/projects/ccmath/</a><br>
<br>The ccmath library is licensed under the LGPL,<br>and i hope we don't face any problems with this license?<br><br>To replace the nr code in grass we need:<br><br>* a fast lu decomposition with pivoting<br>* computation of eigen values and eigen vectors <br>
* singular value decomposition<br><br>Here a cite from the ccmath matrix library documentation:<br><br>
#######################################################<br><br> The matrix algebra library contains functions that<br> perform the standard computations of linear algebra.<br> General areas covered are:<br>
<br> o Solution of Linear Systems<br> o Matrix Inversion<br> o Eigensystem Analysis<br> o Matrix Utility Operations<br> o Singular Value Decomposition<br>
...<br><br> o Solving and Inverting Linear Systems:<br><br> solv --------- solve a general system of real linear equations.<br> solvps ------- solve a real symmetric linear system.<br> solvru ------- solve a real right upper triangular linear system.<br>
solvtd ------- solve a tridiagonal real linear system.<br><br> minv --------- invert a general real square matrix.<br> psinv -------- invert a real symmetric matrix.<br> ruinv -------- invert a right upper triangular matrix.<br>
<br>...<br><br> o Eigensystem Analysis:<br><br> eigen ------ extract all eigen values and vectors of a real<br> symmetric matrix.<br> eigval ----- extract the eigen values of a real symmetric matrix.<br>
evmax ------ compute the eigen value of maximum absolute magnitude<br> and its corresponding vector for a symmetric matrix.<br><br>...<br><br> o Singular Value Decomposition:<br><br> svdval ----- compute the singular values of a m by n real matrix.<br>
sv2val ----- compute the singular values of a real matrix<br> efficiently for m >> n.<br> svduv ------ compute the singular values and the transformation<br> matrices u and v for a real m by n matrix.<br>
sv2uv ------ compute the singular values and transformation<br> matrices efficiently for m >> n.<br> svdu1v ----- compute the singular values and transformation<br> matrices u1 and v, where u1 overloads the input<br>
with the first n column vectors of u.<br> sv2u1v ----- compute the singular values and the transformation<br> matrices u1 and v efficiently for m >> n.<br><br>end<br>#######################################################<br>
<br>So the ccmath library provides all the algorithms we need to replace the nr code in grass.<br><br>I would suggest to extract the needed parts from ccmath and integrate <br>them in the gmath library structure i already created (take a look at the patch i provided). <br>
I would suggest an extraction of needed parts because the ccmath library ships a lot of algorithms we don't need and<br>the source code is not well documented and difficult to read.<br>We only need the matrix computation algorithm including documentation and tests.<br>
<br>I will keep my sparse matrix solver and matrix-vector algorithm in gmath and extend them, <br>(more sparse matrix and sparse vector operations ... inspired from meschach),<br>to implement in the future a sparse ILU and LU factorisation with minimal fill in.<br>
This is needed for huge sparse linear equation systems with bad condition. Such linear equation systems<br>can not be solved with the sparse matrix solver i implemented.<br><br>Things to be done (very roughly estimated):<br>
<br>* extraction of the needed algorithm from ccmath <br>* Implementation of a wrapper around these functions, so a user can replace the grass ccmath extraction with <br> a distribution or self compiled version of the ccmath library.<br>
* integration of the documentation and the tests of ccmath matrix into gmath<br>* integration of the ccmath solver in the gmath solver structure. This may result in a modification of the current matrix<br> access methods and a rewrite of the blas 1, 2 and 3 functions i implemented.<br>
* replacing the nr code which results in the modification of all dependent gmath code and grass modules<br>* writing tests for all depended modules<br>* improving the grass sparse matrix algorithms and solver<br><br>Well i guess i will need at least another year to code this. <br>
...<br><br>So, how about this approach? Any hints, suggestions or criticism?<br>Did i over see an issue?<br><br><br>Best regards<br>Soeren<br><br><br><br><br><div class="gmail_quote">2009/1/15 Glynn Clements <span dir="ltr"><<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>
Moritz Lennert wrote:<br>
<br>
> > I don't really see a problem with it. It's a "you do not have the<br>
> > freedom to make this program less free" restriction, similar to the<br>
> > restrictions imposed by the GPL.<br>
><br>
> Well, the first paragraphe of the DFSG is:<br>
><br>
> "Free Redistribution<br>
><br>
> The license of a Debian component may not restrict any party from<br>
> selling or giving away the software as a component of an aggregate<br>
> software distribution containing programs from several different sources."<br>
><br>
> So, forbidding to sell seems against the DFSG...<br>
<br>
</div>The meschach licence doesn't prohibit selling an aggregation of which<br>
meschach is a component.<br>
<br>
That makes the problematic clause even more pointless. You could sell<br>
a CD containing meschach and a two-line script, on the basis that<br>
meschach is free but the script costs $50k.<br>
<div class="Ih2E3d"><br>
> > Essentially, it's a question of how to resolve competing freedoms, and<br>
> > the meschach licence took a different view to the GPL. It's just a<br>
> > different (and incompatible) sort of "free".<br>
><br>
> There seems to be a possibility of exceptions for these situations in<br>
> the GPL[1]:<br>
<br>
</div>Only the copyright holder can provide such an exemption.<br>
<br>
The author can release their code under any licence they choose,<br>
including e.g. GPL-but-you-can-link-against-meschach (KDE provided<br>
such an exemption for Qt before it was available under the GPL).<br>
<br>
But you can't provide such an exemption for anyone else's GPL code. So<br>
you couldn't distribute a binary linked against e.g. both meschach and<br>
readline. I don't know if this would apply on a module-by-module basis<br>
or to GRASS as a whole. IOW, whether you can claim that GRASS is a<br>
"mere aggregation" of its components or a single work. I suspect the<br>
latter.<br>
<div class="Ih2E3d"><br>
> So, we might be able to do this, but AFAICT this would need the<br>
> agreement of all people holding copyright over GRASS code.<br>
<br>
</div>Yes. Including any GPL libraries (e.g. readline).<br>
<div><div></div><div class="Wj3C7c"><br>
--<br>
Glynn Clements <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>><br>
_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
</div></div></blockquote></div><br>