uBLAS, Inverse of Matrices -- Urgent
Dear all, Am I missing anything? Isn't there any mechinary in uBLAS which can compute the inverse of a matrix? That being the case, isn't that hilarious? Or, if there is, what's that? All of the Best, --Hossein ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
Hello everybody out there ! Hossein Haeri wrote:
Dear all,
Am I missing anything? Isn't there any mechinary in uBLAS which can compute the inverse of a matrix? That being the case, isn't that hilarious? Or, if there is, what's that?
If you want to, I can give you a code which give the inverse of an non sigular matrix, the pseudo-inverse if the matrix is not inversible. It use the Pan and Rieff algorithm and it works with uBlas. But, well, there is many times a better way than inverse the matrix. What do you want to do ? Best regards. Yoann LE BARS
Yoann,
If you want to, I can give you a code which give the inverse of an non sigular matrix, the pseudo-inverse if the matrix is not inversible. It use the Pan and Rieff algorithm and it works with uBlas.
Sure! Cool! I mean, for the moment being, that seems nice. Could you please bother doing that ASAP? And one remained point: Does that take after Boost, and, more specifically, uBLAS? (Although I'd understand that as soon as I see the code.)
But, well, there is many times a better way than inverse the matrix. What do you want to do ?
Hmmm... This time, it was the vague of a general system of n equations to be solved for n variables. But that just made me curious to find it in the Boost. And that's not why I'm likely to need it in the future. That is, if you want to know the reason, you should wait until I use them in a more real problem. However, as I told previously, I find lack of it a big shame for a high-brough developped library such as Boost. Consider further the lack of determinat, etc. All of the Best, --Hossein ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
Hello everybody out there ! Hossein Haeri a écrit :
Sure! Cool! I mean, for the moment being, that seems nice. Could you please bother doing that ASAP?
And one remained point: Does that take after Boost, and, more specifically, uBLAS? (Although I'd understand that as soon as I see the code.)
Well, pardon me but my mother toungue is not english, so I do not understand all idiomatics expressions. I mean : I am not sure of the meaning of what you write down. What I can tell you is that my implementation of matrix inversion use uBlas and take matrix_expression as data. I will send you the code in a while.
This time, it was the vague of a general system of n equations to be solved for n variables.
I am implementing a solver tools, for general linears systems, non-singulars ones, singulars ones, square or unsquare. It also use uBlas. It use restarted GMRES algorithm and least square method. I am planing to implement such a tools for non-linear equations soon. Best regards. Yoann LE BARS
Yoann,
And one remained point: Does that take after Boost, and, more specifically, uBLAS? (Although I'd understand that as soon as I see the code.)
Well, pardon me but my mother toungue is not english,
Nor is it mine.
so I do not understand all idiomatics expressions. I mean : I am not sure of the meaning of what you write down.
Hmmm... Here is a snipet from Oxford Advanced Dictionary 2004: (Hope it works.) "take after sb [nopassive] 1 (not used in the progressive tenses) to look or behave like an older member of your family, especially your mother or father: Your daughter doesn't take after you at all."
What I can tell you is that my implementation of matrix inversion use uBlas and take matrix_expression as data. I will send you the code in a while.
Good! And I'll let you know whether I find it taking after uBLAS or not. ;)
I am implementing a solver tools, for general linears systems, non-singulars ones, singulars ones, square or unsquare. It also use uBlas. It use restarted GMRES algorithm and least square method. I am planing to implement such a tools for non-linear equations soon.
Waw! Great! I'll be waiting to see the result... :D (Does it include comments in English? Or, is everything there in French? Wait a moment, my French is not so good.) TIA, --Hossein ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
Hello everybody out there ! Hossein Haeri a écrit :
Hmmm... Here is a snipet from Oxford Advanced Dictionary 2004: (Hope it works.)
"take after sb [nopassive] 1 (not used in the progressive tenses) to look or behave like an older member of your family, especially your mother or father: Your daughter doesn't take after you at all."
Thank you. Now I understand much better what you have write.
Waw! Great! I'll be waiting to see the result... :D
Actually, my linear solver is not totally finished, because I am trying to add the possibility of preconditionning matrices. I will send you some exemples as soon as I can, probably today.
(Does it include comments in English? Or, is everything there in French? Wait a moment, my French is not so good.)
All comments are in english. Best regards. Yoann LE BARS
Yoann,
Thank you. Now I understand much better what you have write.
You're welcome man! No need to thanks ;)
Waw! Great! I'll be waiting to see the result... :D
Actually, my linear solver is not totally finished, because I am trying to add the possibility of preconditionning matrices. I will send you some exemples as soon as I can, probably today.
And I'll keep waiting. :)
(Does it include comments in English? Or, is everything there in French? Wait a moment, my French is not so good.)
Thank God! :) (I was starting to warry.) Wishes, --Hossein Send instant messages to your online friends http://uk.messenger.yahoo.com
Toon,
Am I missing anything? Isn't there any mechinary in uBLAS which can compute the inverse of a matrix? That being the case, isn't that hilarious? Or, if there is, what's that?
Care to elaborate why exactly you find that hilarious?
Pardon? Are you asking me whether I'm intersted in implementing that for Boost? If yes, not a bad offer... There are some other things I found hilarious when I saw uBLAS lacks them. Consider determinant, for example. (Does it?) Other rough ideas also sprang into mind; such as diagonal iterator which simply iterates the matrix along its diaginal. In case I haven't misunderstood your question, let me know if your offer is serious -- I should think of it. (I presume that you're of the authorities of uBLAS, are you?) (And that well means that uBLAS misses it, right?) All of the Best, --Hossein ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
Hello everybody out there ! Hossein Haeri a écrit :
There are some other things I found hilarious when I saw uBLAS lacks them.
Just consider that : Blas means Basic Linear Algebra Set. uBlas purpose is to give basics methods for linear algebra, not to implement every algebrical algorithms. But I am not a member of the Boost project, so I can be wrong. Best regards. Yoann LE BARS
Yoann,
Just consider that : Blas means Basic Linear Algebra Set. uBlas purpose is to give basics methods for linear algebra, not to implement every algebrical algorithms.
Sure. And, I find it hilarious that they are not assummed as of the basic linear algebraic project.
But I am not a member of the Boost project, so I can be wrong.
I see. Then, any of members of the project? Wishes, --Hossein ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
Hello everybody out there ! Hossein Haeri a écrit :
Sure. And, I find it hilarious that they are not assummed as of the basic linear algebraic project.
Well, inversing a matrix, computing its determinant or its SVD, for instance, are not basic algorithms. Best regards. Yoann LE BARS
Yoann,
Sure. And, I find it hilarious that they are not assummed as of the basic linear algebraic project.
Well, inversing a matrix, computing its determinant or its SVD, for instance, are not basic algorithms.
True. They are not basic "algorithms", there are however algorithms in basic "linear algebra". And that's what BLAS standands for. It does not stand for basic "algorithms" in linear algebra. Wishes, --Hossein ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
Hossein Haeri wrote:
True. They are not basic "algorithms", there are however algorithms in basic "linear algebra". And that's what BLAS standands for. It does not stand for basic "algorithms" in linear algebra.
Quote from `` BLAS Frequently Asked Questions'' (http://www.netlib.org/blas/faq.html): `` 1.1) What are the BLAS? The BLAS (Basic Linear Algebra Subprograms) are high quality "building block" routines for performing basic vector and matrix operations. Level 1 BLAS do vector-vector operations, Level 2 BLAS do matrix-vector operations, and Level 3 BLAS do matrix-matrix operations. Because the BLAS are efficient, portable, and widely available, they're commonly used in the development of high quality linear algebra software, LINPACK and LAPACK for example.'' fres
G'day all.
Quoting Hossein Haeri
Sure. And, I find it hilarious that they are not assummed as of the basic linear algebraic project.
Not really. The reason is that while there is only one "obvious" way to multiply two general matrices (taking shortcuts for matrices which exhibit certain structure), but given a general matrix, it's often not "obvious" how to invert it, or even if inverting it is a good idea. Gaussian elimination, LU decomposition and Cramer's rule (to name but three) are all ways to invert a general matrix, each of which has different efficiency and stability properties, and which return different answers on the same floating point hardware. This means that if you want to invert a matrix, you have to pick an algorithm appropriate to your problem. It's therefore impossible to supply an operation of the form inverse(m) which is generally useful. I can't speak for the developers of uBLAS (or BLAS, for that matter), but the philosophy seems to be that if there's more than one possible algorithm for something, and using different algorithms make sense under different circumstances, and it's not obvious how to choose between those ways automatically (e.g. using iterator categories or the like), then it's not "basic". Cheers, Andrew Bromage
Hello everybody out there ! ajb@spamcop.net a écrit :
The reason is that while there is only one "obvious" way to multiply two general matrices
Well... Not really : there is many algorithms which purpose is to speed up matrices multiplications, such as Coppersmith and Winnograd algorithm.
Gaussian elimination, LU decomposition and Cramer's rule (to name but three) are all ways to invert a general matrix, each of which has different efficiency and stability properties, and which return different answers on the same floating point hardware. This means that if you want to invert a matrix, you have to pick an algorithm appropriate to your problem. It's therefore impossible to supply an operation of the form inverse(m) which is generally useful.
I totaly agree with it. Best regards. Yoann LE BARS
G'day all. I wrote:
The reason is that while there is only one "obvious" way to multiply two general matrices
Quoting Le Farfadet Spatial
Well... Not really : there is many algorithms which purpose is to speed up matrices multiplications, such as Coppersmith and Winnograd algorithm.
I maintain that there is only one "obvious" way. :-) Cheers, Andrew Bromage
Andrew,
Sure. And, I find it hilarious that they are not assummed as of the basic linear algebraic project.
Not really.
The reason is that while there is only one "obvious" way to multiply two general matrices (taking shortcuts for matrices which exhibit certain structure), but given a general matrix, it's often not "obvious" how to invert it, or even if inverting it is a good idea.
Assuming it is...
Gaussian elimination, LU decomposition and Cramer's rule (to name but three) are all ways to invert a general matrix, each of which has different efficiency and stability properties, and which return different answers on the same floating point hardware.
Yeap, I'm remembering things... :(
This means that if you want to invert a matrix, you have to pick an algorithm appropriate to your problem.
And that's, AFAIK, what Policy-Based Design (PBD) is for.
It's therefore impossible to supply an operation of the form inverse(m) which is generally useful.
But this is possible: (Assuming that the design is PBD) inverse<crammer>(m);
I can't speak for the developers of uBLAS (or BLAS, for that matter), but the philosophy seems to be that if there's more than one possible algorithm for something, and using different algorithms make sense under different circumstances, and it's not obvious how to choose between those ways automatically (e.g. using iterator categories or the like), then it's not "basic".
Sorry, but I'm not with you at all. In fact, I'm about to give the same answer I gave to Yoann; BLAS, generally, stands for "basic linear algebraic" algorithms, and not for "basic algoirthms" of "linear algebra". Got the point? Am I right? Or, am I missing anything? Wishes, --Hossein ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
Hello everybody out there ! Hossein Haeri a écrit :
Sorry, but I'm not with you at all. In fact, I'm about to give the same answer I gave to Yoann; BLAS, generally, stands for "basic linear algebraic" algorithms, and not for "basic algoirthms" of "linear algebra". Got the point? Am I right? Or, am I missing anything?
I think you mixed up with LINPACK and ARPACK, which gives many linear algorithms, just like comput eigen values and so on. Then, the question must not be : why is it not in uBLAS, which is a reimplementation of the BLAS library. The question probably got to be : why not reimplement LINPACK and ARPACK in Boost ? As far as I am concern, this is a good idea and if the project is starting, I will be glad to give the help I can. But this probably got to be debated on developers list. Best regards. Yoann LE BARS
Yoann,
Sorry, but I'm not with you at all. In fact, I'm about to give the same answer I gave to Yoann; BLAS, generally, stands for "basic linear algebraic" algorithms, and not for "basic algoirthms" of "linear algebra". Got the point? Am I right? Or, am I missing anything?
I think you mixed up with LINPACK and ARPACK, which gives many linear algorithms, just like comput eigen values and so on.
Then, the question must not be : why is it not in uBLAS, which is a reimplementation of the BLAS library. The question probably got to be : why not reimplement LINPACK and ARPACK in Boost ? As far as I am concern, this is a good idea and if the project is starting, I will be glad to give the help I can. But this probably got to be debated on developers list.
In case I've correctly understood what you mean, I agree, and am ready to take part as well. Developpers? Best, --Wishes ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
Yoann,
Developpers?
This list is the list for the ones who are using Boost. There is an other list where are posting those who are developing Boost : the developers list.
Oops! (And don't they happen to read this mailing list?) Wishes, --Hossein ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
G'day all. I wrote:
This means that if you want to invert a matrix, you have to pick an algorithm appropriate to your problem.
Quoting Hossein Haeri
And that's, AFAIK, what Policy-Based Design (PBD) is for.
The purpose of Policy-Based Design, as I understand it, is to cleanly separate mechanism and policy, even in places where mechanism needs to call on policy. In the case of inverting matrices, policy can be perfectly well implemented as a layer above (e.g. LAPACK), so BLAS doesn't need to know about it.
Sorry, but I'm not with you at all. In fact, I'm about to give the same answer I gave to Yoann; BLAS, generally, stands for "basic linear algebraic" algorithms, and not for "basic algoirthms" of "linear algebra". Got the point? Am I right? Or, am I missing anything?
BLAS officially stands for Basic Linear Algebra Subprograms. A little history might help here. (Note: I've taken liberties with the "history" that follows, because I'm not a historian and the purpose of what follows is not to be an accurate chronicle, but rather to talk about the purpose of BLAS.) BLAS dates from the early days of numeric supercomputing. Supercomputers have various capabilities (vector pipelines and so forth) which are not easily used by a compiler for a general-purpose language like Fortran. A lot of research has gone into automatically finding opportunities to use these hardware features with varying degrees of success, but no real guarantees. So rather than wait for Sufficiently Smart Compilers to appear, people used a standard library instead. This library is BLAS. Supercomputer vendors might ship their own version BLAS, tuned to take advantage of the available hardware and do the rest in software. In other words, BLAS is really, really Basic. An analogy is that base-level OpenGL is really, really basic too. In fact, it's not terribly useful by itself; at the very least, you generally want GLU as well. Cheers, Andrew Bromage
Andrew,
The purpose of Policy-Based Design, as I understand it, is to cleanly separate mechanism and policy, even in places where mechanism needs to call on policy. In the case of inverting matrices, policy can be perfectly well implemented as a layer above (e.g. LAPACK), so BLAS doesn't need to know about it.
Seems perfectly reasonable.
BLAS officially stands for Basic Linear Algebra Subprograms. A little history might help here. (Note: I've taken liberties with the "history" that follows, because I'm not a historian and the purpose of what follows is not to be an accurate chronicle, but rather to talk about the purpose of BLAS.)
I see.
BLAS dates from the early days of numeric supercomputing. Supercomputers have various capabilities (vector pipelines and so forth) which are not easily used by a compiler for a general-purpose language like Fortran. A lot of research has gone into automatically finding opportunities to use these hardware features with varying degrees of success, but no real guarantees.
So rather than wait for Sufficiently Smart Compilers to appear, people used a standard library instead. This library is BLAS. Supercomputer vendors might ship their own version BLAS, tuned to take advantage of the available hardware and do the rest in software. In other words, BLAS is really, really Basic.
And that's basic in the sense of algorithms, not the sense of linear algebra. I think, I got it. Thanks! :) Sorry, I'm in a hurry for going lunch. I'll be back afterwards. Best Wishes, --Hossein ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
Hello everybody out there ! I have send the code of my matrix inversion stuff to Hossein. I can leave it downloadable for anyone, if there is some way to do that. Best regards. Yoann LE BARS
Le Farfadet Spatial wrote:
Hello everybody out there !
I have send the code of my matrix inversion stuff to Hossein. I can leave it downloadable for anyone, if there is some way to do that.
You can upload it here. It's best is you use the Boost Software License (http://www.boost.org/more/license_info.html)
Best regards.
Yoann LE BARS
Jonathan
Hello everybody out there ! Jonathan Turkanis a écrit :
You can upload it here.
Does it mean that I may send an email with the code as an attach file ?
It's best is you use the Boost Software License (http://www.boost.org/more/license_info.html)
Nowadays I have use LGPL license but I will make a Boost Software License before I upload it. Best regards. Yoann LE BARS
Hello everybody out there ! I wrote :
Nowadays I have use LGPL license but I will make a Boost Software License before I upload it.
I meant : I will make a Boost Software License version before upload the code. And this is done. So, if it is confirm that I can send it as an attached file, I can send it now. Best regards. Yoann LE BARS
Le Farfadet Spatial wrote:
Hello everybody out there !
I wrote :
Nowadays I have use LGPL license but I will make a Boost Software License before I upload it.
I meant : I will make a Boost Software License version before upload the code. And this is done. So, if it is confirm that I can send it as an attached file, I can send it now.
Jonathan Turkanis wrote:
You can upload it here.
Sorry, I forgot to paste in the url. Here it is: http://boost-sandbox.sourceforge.net/vault/ You click "Login" and after that I gather it is fairly self explanatory.
Best regards.
Yoann LE BARS
Jonathan
Hello everybody out there ! Jonathan Turkanis wrote :
Here it is: http://boost-sandbox.sourceforge.net/vault/
You click "Login" and after that I gather it is fairly self explanatory.
So, I have upload my code. The file name is inverse.tar.gz, a gzip compress tar archive. Everything had been tested with gcc. I hope you will like it. There is three files : panrieff_implementation.hpp is the implementation of the Pan and Rieff's algorithm (!), panrieff.hpp is the interface and exemple.cpp is a little program to show how to use this stuff. Are you interessed on my solving stuff ? Best regards. Yoann LE BARS
Le Farfadet Spatial wrote:
Hello everybody out there !
Jonathan Turkanis wrote :
Here it is: http://boost-sandbox.sourceforge.net/vault/
You click "Login" and after that I gather it is fairly self explanatory.
So, I have upload my code. The file name is inverse.tar.gz, a gzip compress tar archive. Everything had been tested with gcc. I hope you will like it.
There is three files : panrieff_implementation.hpp is the implementation of the Pan and Rieff's algorithm (!), panrieff.hpp is the interface and exemple.cpp is a little program to show how to use this stuff.
Are you interessed on my solving stuff ?
I'd suggest you post a description to the developers list to see if anyone is interested.
Best regards.
Yoann LE BARS
Jonathan
Hello everybody out there ! Jonathan Turkanis a écrit :
Are you interessed on my solving stuff ?
I'd suggest you post a description to the developers list to see if anyone is interested.
All right. I have to subscribe to developers list before ! I will be away for one or two days, I will subscribe and discribe it when I am back. Best regards. Yoann LE BARS
Hello everybody out there ! I have send Hossein a new version of my code which inverse matrices : there is still the Pan and Rieff algorithm and I add another algorithm, the Greville's algorithm. If anyone is interessted by this, I would be glad to send it to anyone. The whole code is under Boost licence. Best regards. Yoann LE BARS
Hello Yoann, I would be interested in seeing that code if you do not mind sending me a copy. Thanks and best wishes, Jon Agiato, MCAD.NET Jon@agiato.net http://www.agiato.net -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Le Farfadet Spatial Sent: Wednesday, January 26, 2005 10:25 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] uBLAS, Inverse of Matrices -- Urgent Hello everybody out there ! I have send Hossein a new version of my code which inverse matrices : there is still the Pan and Rieff algorithm and I add another algorithm, the Greville's algorithm. If anyone is interessted by this, I would be glad to send it to anyone. The whole code is under Boost licence. Best regards. Yoann LE BARS _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hello everybody out there ! I wrote :
I have send Hossein a new version of my code which inverse matrices : there is still the Pan and Rieff algorithm and I add another algorithm, the Greville's algorithm. If anyone is interessted by this, I would be glad to send it to anyone. The whole code is under Boost licence.
I have upload it on the Boost Sandbox. The name of the file is : inverse-01262005.tar.gz. Best regards. Yoann LE BARS
participants (7)
-
ajb@spamcop.net
-
Hossein Haeri
-
Jon Agiato
-
Jonathan Turkanis
-
Kresimir Fresl
-
Le Farfadet Spatial
-
Toon Knapen