Thread: [Lapackpp-devel] Appreciation and suggestion
Status: Beta
Brought to you by:
cstim
From: Aosheng R. <ro...@gm...> - 2006-08-17 21:29:42
|
Many thanks go to Dr.Stimming for adding the inverse of complex-value matrix to lapackpp. As Dr. Stimming said that many times we could ignore the inverse of a matrix and re-arrange algorithms for the same purpose. But for some cases, we are lazy to do so and rely on a direct inverse of the matrix. LAPACKPP is definitely one of the most useful packages for engineering applications. Right now, I have a random thought that may increase the significant efforts of Dr. Stimming. Also I am not sure if such a thought makes sense to the other people. My thought is Just for discussion. Thought: I wonder If the COMPLEX type in LAPACKPP is identical with the complex<double> in GNU C++. Right now, the Complex type in LAPACKPP is the structure - type, instead of class - type, as in C++. Within the LAPACKPP class, Class-Type COMPLEX in C++ is converted to the Structure-Type COMPLEX, compatible with Fortran LAPACK. The direct benifit from such a definition of Class-Type COMPLEX is that one can do operations on the product and division using complex<double> type in GNU C++, once results are obtained from the LAPACKPP. With the present definition of COMPLEX, we have to do term-by-term calculation based on the decomposition of real and imaginary parts. I appreciate the wonderful job of Dr. Stimming who brings us an easy to implement interface of LAPACK with C++. Regards, ------------- Rong |
From: Christian S. <sti...@tu...> - 2006-08-18 08:12:11
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Aosheng Rong schrieb: > Many thanks go to Dr.Stimming for adding the inverse of complex-value > matrix to lapackpp. Did you actually retrieve the code from CVS and test it? If yes, please confirm so that we can be sure this code is working correctly. > Thought: I wonder If the COMPLEX type in LAPACKPP is identical with > the complex<double> in GNU C++. No, it is not. http://lapackpp.sourceforge.net/html/lacomplex_8h.html http://lapackpp.sourceforge.net/html/classla_1_1complex.html > Right now, the Complex type in > LAPACKPP is the structure - type, instead of class - type, as in C++. > Within the LAPACKPP class, Class-Type COMPLEX in C++ is converted to the > Structure-Type COMPLEX, compatible with Fortran LAPACK. The direct > benifit from such a definition of Class-Type COMPLEX is that one can do > operations on the product and division using complex<double> type in > GNU C++, once results are obtained from the LAPACKPP. With the present > definition of COMPLEX, we have to do term-by-term calculation based on > the decomposition of real and imaginary parts. You need to manually convert the COMPLEX values into a LaComplex value, which will then have the automatic conversion operators to std::complex<double>, as follows: std::complex<double> z; z = z * LaComplex( myMatrix(0, 2) ); which will do the automatic conversion for you. (At least I *thought* this should work.) Christian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQCVAwUBROV2QmXAi+BfhivFAQJZ7wP+P9fEOrujLVMwi5vDQ+KnGvydX/8sYeQK sWjDpFgaaNkM0ECQsOhDtJBNC48NETdV57Z9T0nJ0Y1nsLKtbZHGBaTvAFnkPgpc L6upCNCM+KYOhU4HOD5qO8veuHLuwce+7OXIpsQ5EmsQuiWJyNU05AyL3kqXXLzx n9fdzjh02mM= =mk4V -----END PGP SIGNATURE----- |
From: Aosheng R. <ro...@gm...> - 2006-08-18 14:10:04
|
Christaian, Yes, I VCS lapackpp 2.4.12 with an addition of inverse of the complex-value matrix. I tested that it works on linux. But I have trouble on windows. I compiled lapackpp 2.4.12 on windows and run your tGenSolve with Testing Dir. It works. But when I compile my application that is transplanted into Windows from Linux, I got the following compiling errors(See below). My application has been succefully compiled under Linux using lapackpp 2.4.12. -------------------------------------------------------------Compiling Error Messages------------------------------------------------------------------------- 1>------ Build started: Project: Test5, Configuration: Debug Win32 ------ 1>Compiling... 1>SplitPowerPlane_driver.cc 1>e:\gnu\lapackpp-2.4.12\include\gmc.h(101) : warning C4251: 'LaGenMatComplex::v' : class 'VectorComplex' needs to have dll-interface to be used by clients of class 'LaGenMatComplex' 1> e:\gnu\lapackpp-2.4.12\include\vc.h(58) : see declaration of 'VectorComplex' 1>e:\gnu\lapackpp-2.4.12\include\gmc.h(665) : error C2375: 'operator <<' : redefinition; different linkage 1> e:\gnu\lapackpp-2.4.12\include\gmc.h(580) : see declaration of 'operator <<' 1>e:\gnu\lapackpp-2.4.12\include\gfqrc.h(54) : warning C4251: 'LaGenQRFactComplex::_tau' : class 'LaVectorComplex' needs to have dll-interface to be used by clients of class 'LaGenQRFactComplex' 1> e:\gnu\lapackpp-2.4.12\include\lavc.h(51) : see declaration of 'LaVectorComplex' 1>e:\gnu\lapackpp-2.4.12\include\gfqrc.h(56) : warning C4251: 'LaGenQRFactComplex::_work' : class 'LaVectorComplex' needs to have dll-interface to be used by clients of class 'LaGenQRFactComplex' 1> e:\gnu\lapackpp-2.4.12\include\lavc.h(51) : see declaration of 'LaVectorComplex' 1>e:\gnu\lapackpp-2.4.12\include\laexcp.h(51) : warning C4275: non dll-interface class 'std::runtime_error' used as base for dll-interface class 'LaException' 1> d:\microsoft visual studio\vc\include\stdexcept(149) : see declaration of 'std::runtime_error' 1> e:\gnu\lapackpp-2.4.12\include\laexcp.h(50) : see declaration of 'LaException' 1>SplitPowerPlane.cc 1>e:\gnu\lapackpp-2.4.12\include\gmc.h(101) : warning C4251: 'LaGenMatComplex::v' : class 'VectorComplex' needs to have dll-interface to be used by clients of class 'LaGenMatComplex' 1> e:\gnu\lapackpp-2.4.12\include\vc.h(58) : see declaration of 'VectorComplex' 1>e:\gnu\lapackpp-2.4.12\include\gmc.h(665) : error C2375: 'operator <<' : redefinition; different linkage 1> e:\gnu\lapackpp-2.4.12\include\gmc.h(580) : see declaration of 'operator <<' 1>e:\gnu\lapackpp-2.4.12\include\gfqrc.h(54) : warning C4251: 'LaGenQRFactComplex::_tau' : class 'LaVectorComplex' needs to have dll-interface to be used by clients of class 'LaGenQRFactComplex' 1> e:\gnu\lapackpp-2.4.12\include\lavc.h(51) : see declaration of 'LaVectorComplex' 1>e:\gnu\lapackpp-2.4.12\include\gfqrc.h(56) : warning C4251: 'LaGenQRFactComplex::_work' : class 'LaVectorComplex' needs to have dll-interface to be used by clients of class 'LaGenQRFactComplex' 1> e:\gnu\lapackpp-2.4.12\include\lavc.h(51) : see declaration of 'LaVectorComplex' 1>e:\gnu\lapackpp-2.4.12\include\laexcp.h(51) : warning C4275: non dll-interface class 'std::runtime_error' used as base for dll-interface class 'LaException' 1> d:\microsoft visual studio\vc\include\stdexcept(149) : see declaration of 'std::runtime_error' 1> e:\gnu\lapackpp-2.4.12\include\laexcp.h(50) : see declaration of 'LaException' 1>Generating Code... 1>Build log was saved at " file://f:\SplitPowerPlane\Test5\Test5\Debug\BuildLog.htm<file:///f:/SplitPowerPlane/Test5/Test5/Debug/BuildLog.htm> " 1>Test5 - 2 error(s), 8 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== --------------------------------------------------------------End of Error Messages ---------------------------------------------------------------------------- It seems that gmc.h has problem with complex operators. I need more tests to make sure where the errors come from: lapackpp or my application. Regards, ------------- Aosheng |
From: Christian S. <sti...@tu...> - 2006-08-18 15:08:49
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Aosheng Rong schrieb: > I compiled lapackpp 2.4.12 on windows and run your tGenSolve with > Testing Dir. It works. But when I compile my application that is > transplanted into Windows from Linux, I got the following compiling > errors(See below). My application has been succefully compiled under > Linux using lapackpp 2.4.12. > > 1>e:\gnu\lapackpp-2.4.12\include\gmc.h(665) : error C2375: 'operator <<' > : redefinition; different linkage > 1> e:\gnu\lapackpp- 2.4.12\include\gmc.h(580) : see declaration > of 'operator <<' Any error about "linkage" on Windows refers to missing "DLLIMPORT" macros. In this case the error says that in gmc.h:665 the operator<< is defined *with* DLLIMPORT whereas in gmc.h:580 it is defined without it. Solution: Change line 580 so that it reads friend DLLIMPORT std::ostream& operator<<(std::ostream&, const LaGenMatComplex&); I've changed this in CVS, so if you simply make a "cvs update" in your existing copy from CVS, then you will get this change already. Christian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQCVAwUBROXX8WXAi+BfhivFAQJUkQP/a+u+MTkX+lHjk3eLd6KOYT/EKimNiXaZ EcDA0IsN5lGJM2DWF3RZrH8LVDQsg3DLiSaTFFJSN5p/GcPym/Uu4WEC3BGxso70 FR1LSizTyGlvdx8K7/1tvaE+HqEV1bqm/LT5XfJa4eTmrqEY/8uozRzG6UMsYxTk Jb4mB8+eJhM= =yk1S -----END PGP SIGNATURE----- |
From: Aosheng R. <ro...@gm...> - 2006-08-18 15:38:26
|
What I have done with CVS. Basically I follow your instructions and CVS. These are what I did: ********************************************************************** 1) Visit https://sourceforge.net/cvs/?group_id=99696 When I am required to CVS, I choose the packagename as lapackpp. 2) ./autogen.sh ./configure make dist 3) Move lapackpp 2.4.12.tar.gz from Linux to Windows 4) Unpack .tar.gz and Compile it. The Compiling of lapackpp package on window looks successful. I get dynamic library lapackpp.dll and static library lapackpp.lib. I compile tGenSolve.cc under Testing dir and run it. The results look correct. The problem right now may be related to complex-value matrix. The error messages also indicate the errors come from the complex-value matrix in gmc.h. BTW, I use the same lapackpp package and the same application program for testing on Linux and Windows. I would do more tests and try to find the problems. I would report my testing status. Regards, |