Thread: [Lapackpp-devel] LaLinearSolve overloading Question
Status: Beta
Brought to you by:
cstim
From: Terrrance O'R. <to...@us...> - 2004-12-18 02:30:57
|
Hello everyone, I am just beginning to use Lapackpp. So far I am able to create LaGenMatDouble and LaVectorDouble objects and use them with LaLinearSolve to solve a set of linear equations. Now I want to use LaSymmMatDouble (and eventually banded for drift-diffusion) with LaLinearSolve. However, when I do this I get this error: C:/DOCUME~1/TERRAN~1/LOCALS~1/Temp/ccQLbaaa.o(.text+0x316):possoin.cpp: undefined reference to `LaLinearSolve(LaSymmMatDouble const&, LaGenMatDouble&, LaGenMatDouble&)' I thought LaLinearSolve is overloaded such that I can use different objects and it automatically chooses which inversion scheme is appropriate? Is there another header file I need to include? These are the header files I am using now: #include "lafnames.h" #include LA_GEN_MAT_DOUBLE_H #include LA_VECTOR_DOUBLE_H #include LA_SYMM_MAT_DOUBLE_H #include LA_SOLVE_DOUBLE_H #include LA_EXCEPTION_H #include LA_UTIL_H Also, I am working from documentation from Lapack++ v.1.1. Things seem to have changed a bit in the newer versions, is there any more up to date documentation. Thanks for the help, Terrance |
From: Christian S. <sti...@tu...> - 2004-12-18 12:09:10
|
Dear Terrance, Am Samstag, 18. Dezember 2004 03:29 schrieb Terrrance O'Regan: > Hello everyone, I am just beginning to use Lapackpp. So far I am able to > create LaGenMatDouble and LaVectorDouble objects and use them with > LaLinearSolve to solve a set of linear equations. Now I want to use > LaSymmMatDouble (and eventually banded for drift-diffusion) with > LaLinearSolve. I started the lapackpp-2 project a year ago because I needed the (complex-valued) general matrices. Therefore I was only able to double-check the code related to these general matrices. The point with all more specialized matrices is that their code is untested in the lapackpp-2 context -- I cannot tell whether they work and whether they work correctly. Of course, it wouldn't help to only make sure that the functions are there. I also would have to check numerically whether the results are actually the promised results. As you intend to use LaLinearSolve with LaSymmMatDouble, you just ran over such an untested area of lapackpp. > However, when I do this I get this error: > > C:/DOCUME~1/TERRAN~1/LOCALS~1/Temp/ccQLbaaa.o(.text+0x316):possoin.cpp: > undefined reference to `LaLinearSolve(LaSymmMatDouble const&, > LaGenMatDouble&, LaGenMatDouble&)' > > I thought LaLinearSolve is overloaded such that I can use different objects > and it automatically chooses which inversion scheme is appropriate? Is > there another header file I need to include? These are the header files I > am using now: The header files are fine, otherwise you would have gotten a compiler error like "LaLinearSolve(LaSymmMatDouble ...) is undefined, candidates are: ...". But the header files seem fine. The error message is a linker error, which means that the header file contained the declaration for such a function, but the definition (the "function body") could not be found inside the lapackpp library. This is an error in lapackpp. I just checked this out a bit more, and it turns out that the function body had been disabled in the original lapack++-1.1 package. I have no idea why, although the code was slightly broken, too. I fixed this now, so that these functions are accessible again and the testing code in testing/tSymmSolve.cc works without errors. I checked this into CVS, so you can use this by checking out the code from anonymus CVS, see the website http://sf.net/projects/lapackpp on how to do this. (Note: There's a 24 hour delay until the code is available in anonymous CVS. If you need it faster, I can only send a .tar.gz file to you privately.) Are you familiar enough with compiling from CVS? If not, then you would have to wait until I can make a new release, which I don't have time for before next Wednesday. HOWEVER: I have no idea whether these functions are really doing correctly what they claim to do. Please please please check now whether the calculations are actually correct. As I said, I don't use non-general matrices, so I have no test case to verify these. > Also, I am working from documentation from Lapack++ v.1.1. Things seem to > have changed a bit in the newer versions, is there any more up to date > documentation. The only up to date documentation is the one generated from source code. A copy is on http://lapackpp.sf.net and you can create your local copy by "make srcdoc", if you have doxygen installed. There is no other "user guide" that is up to date, sorry. I'm using lapackpp as an auxiliary library, too, so I cannot spend extra time on writing user documentation. If anyone contributes something like this, I would happily publish it along with the lapackpp sources, including the proper credits. Christian |
From: Jacob \(Jack\) G. <jg...@cs...> - 2004-12-18 23:59:24
|
Hi, The function: void LaSVD_IP(LaGenMatDouble& A, LaVectorDouble &Sigma); When run on a 3x3 matrix, doesn't seem to work, it gives some sort of error about parameter 7 to the lapack call has an invalid parameter. (Probably lwork again). For now, I'm just using the call that stores U, Sigma and VT. Sorry I can't be more specific at the moment, I didn't get a chance to report this when I found the problem. Jack |
From: Christian S. <sti...@tu...> - 2004-12-19 13:46:57
|
Am Sonntag, 19. Dezember 2004 00:59 schrieb Jacob (Jack) Gryn: > The function: > > void LaSVD_IP(LaGenMatDouble& A, LaVectorDouble &Sigma); > > When run on a 3x3 matrix, doesn't seem to work, it gives some sort of error > about parameter 7 to the lapack call has an invalid parameter. (Probably > lwork again). For now, I'm just using the call that stores U, Sigma and > VT. The parameter 7 is &U(0,0), i.e. the pointer to the temporary U. I thought that one will not be referenced at all. Nevertheless, there might be an error if U is defined with 0x0 dimension, so that accessing the first element gives some weird results. I just changed the code in CVS so that the temporary U and VT have dimension 1x1, so that U(0,0) will return the reference to a valid memory location. Hopefully that should fix it. Christian |
From: Jacob \(Jack\) G. <jg...@cs...> - 2004-12-19 17:02:42
|
Hi, At the time I wrote the e-mail, I didn't have the error output infront of me, so I was only trying to get it from memory. The error was actually as follows: ** On entry to DGESDD parameter number 8 had an illegal value Jack -----Original Message----- From: Christian Stimming [mailto:sti...@tu...] Sent: Sunday, December 19, 2004 8:39 AM To: Jacob (Jack) Gryn; lap...@li... Subject: Re: [Lapackpp-devel] LaSVD_IP() Error for only 'sigma' matrix Am Sonntag, 19. Dezember 2004 00:59 schrieb Jacob (Jack) Gryn: > The function: > > void LaSVD_IP(LaGenMatDouble& A, LaVectorDouble &Sigma); > > When run on a 3x3 matrix, doesn't seem to work, it gives some sort of error > about parameter 7 to the lapack call has an invalid parameter. (Probably > lwork again). For now, I'm just using the call that stores U, Sigma and > VT. The parameter 7 is &U(0,0), i.e. the pointer to the temporary U. I thought that one will not be referenced at all. Nevertheless, there might be an error if U is defined with 0x0 dimension, so that accessing the first element gives some weird results. I just changed the code in CVS so that the temporary U and VT have dimension 1x1, so that U(0,0) will return the reference to a valid memory location. Hopefully that should fix it. Christian |
From: Christian S. <sti...@tu...> - 2004-12-19 21:12:02
|
Weird. The parameter number 8 is "LDU: The leading dimension for the array U." and the parameter description of "man dgesdd" explains that this parameter is active only if "jobz", i.e. the mode of operation, is unequal to "N", but in this particular function we've set it to that value. The workspace size would be parameter #12. The formula for the workspace size is not the same as in my documentation, but it results in a much larger array anyway. So this shouldn't be a problem.. or maybe you can play around with it a little bit. Christian Am Sonntag, 19. Dezember 2004 18:02 schrieb Jacob (Jack) Gryn: > Hi, > > At the time I wrote the e-mail, I didn't have the error output infront of > me, so I was only trying to get it from memory. The error was actually as > follows: > > ** On entry to DGESDD parameter number 8 had an illegal value > > Jack > > -----Original Message----- > From: Christian Stimming [mailto:sti...@tu...] > Sent: Sunday, December 19, 2004 8:39 AM > To: Jacob (Jack) Gryn; lap...@li... > Subject: Re: [Lapackpp-devel] LaSVD_IP() Error for only 'sigma' matrix > > Am Sonntag, 19. Dezember 2004 00:59 schrieb Jacob (Jack) Gryn: > > The function: > > > > void LaSVD_IP(LaGenMatDouble& A, LaVectorDouble &Sigma); > > > > When run on a 3x3 matrix, doesn't seem to work, it gives some sort of > > error > > > about parameter 7 to the lapack call has an invalid parameter. (Probably > > lwork again). For now, I'm just using the call that stores U, Sigma and > > VT. > > The parameter 7 is &U(0,0), i.e. the pointer to the temporary U. I thought > that one will not be referenced at all. Nevertheless, there might be an > error > if U is defined with 0x0 dimension, so that accessing the first element > gives > some weird results. > > I just changed the code in CVS so that the temporary U and VT have > dimension > > 1x1, so that U(0,0) will return the reference to a valid memory location. > Hopefully that should fix it. > > Christian > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > lapackpp-devel mailing list > lap...@li... > https://lists.sourceforge.net/lists/listinfo/lapackpp-devel |