Help with numpy.linalg.solve
Is there any function in 2Geom to handle this: http://www.mathsisfun.com/algebra/systems-linear-equations-matrices.html or the same :python numpy.linalg.solve
Thanks in advance, Jabier.
(copying lib2geom maillist on this)
On 7-4-2014 22:06, Jabiertxo Arraiza Cenoz wrote:
Is there any function in 2Geom to handle this: http://www.mathsisfun.com/algebra/systems-linear-equations-matrices.html or the same :python numpy.linalg.solve
Thanks in advance, Jabier.
Hi Jabier, I think there is, have a look at 2geom/numeric/linear_system.h I have never used it, and know nothing about it. But it's there :-)
cheers, Johan
On Mon, Apr 07, 2014 at 11:08:18PM +0200, Johan Engelen wrote:
(copying lib2geom maillist on this)
On 7-4-2014 22:06, Jabiertxo Arraiza Cenoz wrote:
Is there any function in 2Geom to handle this: http://www.mathsisfun.com/algebra/systems-linear-equations-matrices.html or the same :python numpy.linalg.solve
Thanks in advance, Jabier.
Hi Jabier, I think there is, have a look at 2geom/numeric/linear_system.h I have never used it, and know nothing about it. But it's there :-)
Jabier, Johan,
Yes, though I wonder whether we would be better off using something like Eigen for our numerics, as this was something that someone (marco? jan?) stuck in for a specific problem. There are better libraries for linear algebra, and we shouldn't reinvent the wheel there.
njh
Yes, though I wonder whether we would be better off using something like Eigen for our numerics, as this was something that someone (marco? jan?) stuck in for a specific problem. There are better libraries for linear algebra, and we shouldn't reinvent the wheel there.
Hi Nathan, my knoweledge of c++ and maths is very limitted to propose and argument a new library for Inkscape, for the moment i attemp to use Johan way, and in the future, if another lineas algebra library is added, i could update my code to use it.
Thanks very much for your response, best regards, Jabier.
Thanks very much Johan! Best regards.
El lun, 07-04-2014 a las 23:08 +0200, Johan Engelen escribió:
(copying lib2geom maillist on this)
On 7-4-2014 22:06, Jabiertxo Arraiza Cenoz wrote:
Is there any function in 2Geom to handle this: http://www.mathsisfun.com/algebra/systems-linear-equations-matrices.html or the same :python numpy.linalg.solve
Thanks in advance, Jabier.
Hi Jabier, I think there is, have a look at 2geom/numeric/linear_system.h I have never used it, and know nothing about it. But it's there :-)
cheers, Johan
Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test & Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Finaly, for the moment, i use the GSL - GNU Scientific Library whith the help of this link: http://www.gnu.org/software/gsl/manual/html_node/Linear-Algebra-Examples.htm... Its the same library used by 2GEOM in "linear_sistem.h"
Thanks very much for the help I get.
Regards, Jabier.
Jabier,
Can you give some information about the type of problem you're trying to solve? The LU decomposition approach is fine for general matrix inversions, but there are much faster algorithms available for sparse matrices.
AV
On 8 April 2014 19:47, Jabiertxo Arraiza Cenoz <jabier.arraiza@...2893...> wrote:
Finaly, for the moment, i use the GSL - GNU Scientific Library whith the help of this link: http://www.gnu.org/software/gsl/manual/html_node/Linear-Algebra-Examples.htm... Its the same library used by 2GEOM in "linear_sistem.h"
Thanks very much for the help I get.
Regards, Jabier.
Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test & Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Fri, 2014-04-11 at 12:02 +0100, Alex Valavanis wrote:
Jabier,
Can you give some information about the type of problem you're trying to solve? The LU decomposition approach is fine for general matrix inversions, but there are much faster algorithms available for sparse matrices.
Alex,
What would you recommend for sparse matrices? I have a long term Inkscape project that needs this.
Thanks,
Tav
Well, it depends on the format of the matrix. If it can be arranged into a tridiagonal form, then it can be inverted much faster using [1].
If it's a general sparse matrix (i.e., there is some data away from the three main diagonals), then unfortunately there's nothing available in GSL.
Armadillo supports eigenvalue searches in sparse matrices (although you can only get selected eigenvalues) but doesn't support sparse matrix inversions yet.
There are a couple of older libraries like libsparse++ and arpack++ that may be useful although their API is the stuff of nightmares!
Let me know what the maths looks like and I'll see if I can find something useful :)
AV
[1] http://www.gnu.org/software/gsl/manual/html_node/Tridiagonal-Systems.html#Tr...
On 11 April 2014 12:18, Tavmjong Bah <tavmjong@...8...> wrote:
On Fri, 2014-04-11 at 12:02 +0100, Alex Valavanis wrote:
Jabier,
Can you give some information about the type of problem you're trying to solve? The LU decomposition approach is fine for general matrix inversions, but there are much faster algorithms available for sparse matrices.
Alex,
What would you recommend for sparse matrices? I have a long term Inkscape project that needs this.
Thanks,
Tav
Ok, if it's just a 3x3, it probably won't make much difference in terms of computation time. Might be worth trying the tridiagonal solver from gsl if you find the existing method too slow.
AV On 11 Apr 2014 15:09, "Jabiertxo Arraiza Cenoz" <jabier.arraiza@...2893...> wrote:
Hi again:
Well, it depends on the format of the matrix. If it can be arranged into
a
tridiagonal form, then it can be inverted much faster using [1].
In my case is a bidimensional array: double* A[3][3] double* B[3] Regards.
What about umfpack (http://www.cise.ufl.edu/research/sparse/umfpack/ )? Already being used in GEGL.
Thanks, Partha
On Fri, Apr 11, 2014 at 7:34 AM, Alex Valavanis <valavanisalex@...400...>wrote:
Well, it depends on the format of the matrix. If it can be arranged into a tridiagonal form, then it can be inverted much faster using [1].
If it's a general sparse matrix (i.e., there is some data away from the three main diagonals), then unfortunately there's nothing available in GSL.
Armadillo supports eigenvalue searches in sparse matrices (although you can only get selected eigenvalues) but doesn't support sparse matrix inversions yet.
There are a couple of older libraries like libsparse++ and arpack++ that may be useful although their API is the stuff of nightmares!
Let me know what the maths looks like and I'll see if I can find something useful :)
AV
[1] http://www.gnu.org/software/gsl/manual/html_node/Tridiagonal-Systems.html#Tr...
On 11 April 2014 12:18, Tavmjong Bah <tavmjong@...8...> wrote:
On Fri, 2014-04-11 at 12:02 +0100, Alex Valavanis wrote:
Jabier,
Can you give some information about the type of problem you're trying to solve? The LU decomposition approach is fine for general matrix inversions, but there are much faster algorithms available for sparse matrices.
Alex,
What would you recommend for sparse matrices? I have a long term Inkscape project that needs this.
Thanks,
Tav
Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test & Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Fri, Apr 11, 2014 at 12:34:38PM +0100, Alex Valavanis wrote:
Armadillo supports eigenvalue searches in sparse matrices (although you can only get selected eigenvalues) but doesn't support sparse matrix inversions yet.
I don't think anyone does sparse exact inversion - too much infill. It's an interesting question what eps approximate sparse inverses there are, the rank-k inverse made using the sparse svd algorithms would be the L2 solution (USV -> V^T (1/S) U^T). But there are possibly better choices (e.g. L1). I don't know if there are any eps inverses which are not outer products.
(yes, for 3x3 a dense inverse is fine.)
njh
participants (6)
-
Alex Valavanis
-
Jabiertxo Arraiza Cenoz
-
Johan Engelen
-
Nathan Hurst
-
Partha Bagchi
-
Tavmjong Bah