00001 /*! 00002 \mainpage 00003 <!----------------------------------------------------------------------------> 00004 <!----------------------------------------------------------------------------> 00005 <!----------------------------------------------------------------------------> 00006 <hr><hr> 00007 <h2>What's new?</h2> 00008 <p> 00009 [Mar. 27th 2010] 00010 "cpplapack-2010.03.27" has been released. 00011 This release is only for the users who don't like to use svn. 00012 (We still recomend users to use svn.:)) 00013 Not only "tar.gz" but also "rpm" and "deb" packages were prepared. 00014 See the logs of svn to get the "ChangeLog". 00015 </p> 00016 00017 <p> 00018 [Sep. 25th 2006] 00019 "cpplapack-2006_09_25" has been released. 00020 The general sparse matrix(dgsmatrix, zgsmatrix) and symmetric or hermitial sparse matrix(dssmatrix,zhsmatrix) were formally added. 00021 This release also contains some bug fixes. 00022 See "ChangeLog" for the detail. 00023 </p> 00024 00025 <p> 00026 [Mar. 25th 2005] 00027 "cpplapack-2005_03_25" has been released. 00028 This release contains some bug fixes and modification. 00029 See "ChangeLog" for the detail. 00030 It also contains the alpha version of sparse matrix classes (dssmatrix and zssmatrix). 00031 These classes are still so buggy, but it is OK as long as you don't use these classes in your code. 00032 </p> 00033 00034 <p> 00035 [Oct. 15th 2004] 00036 Mr. Ueshima wrote a tutorial of CPPLapack in Japanese. 00037 "cpplapack-2004_04_24" has been released. 00038 It is very useful for beginners of CPPLapack. 00039 The HTML version is available at 00040 <a href="http://cpplapack.sourceforge.net/tutorial/japanese/index.html"> 00041 http://cpplapack.sourceforge.net/tutorial/japanese/index.html</a>, 00042 and the PDF version is available at 00043 <a href="http://cpplapack.sourceforge.net/tutorial/japanese/CPPLapack_Tutorial-Japanese.pdf">http://cpplapack.sourceforge.net/tutorial/japanese/CPPLapack_Tutorial-Japanese.pdf</a> 00044 </p> 00045 00046 <p> 00047 [Apr. 24th 2004] 00048 "cpplapack-2004_04_24" has been released. 00049 OpenMP macros (<code>\#pragma omp parallel for private(j,k)</code>) 00050 are added to all triple for-loops. 00051 The search engine for this documentation is added. 00052 This search engine is case-sensitive. 00053 </p> 00054 00055 <p> 00056 [Apr. 1st 2004] 00057 "cpplapack-2004_04_01" has been released. 00058 The complex double-precision matrix and vector classes 00059 (zgematrix, zgbmatrix, zhematrix, zcovector, zrovector) 00060 are newly added. 00061 </p> 00062 00063 <!----------------------------------------------------------------------------> 00064 <!----------------------------------------------------------------------------> 00065 <!----------------------------------------------------------------------------> 00066 <hr><hr> 00067 <h2>Introduction</h2> 00068 <p> 00069 CPPLapack is a C++ class wrapper for BLAS and LAPACK. 00070 </p> 00071 00072 <p> 00073 The interfaces of Fortran BLAS, LAPACK, CBLAS, and CLAPACK 00074 are not user-friendly, and induce a lot of coding mistakes 00075 not only for LAPACK beginners but also experienced programmers. 00076 Because of its difficult interface, BLAS functions are not widely used 00077 for simple matrix calculations such as "+", "-", "*", and so on 00078 even though these calculations are frequently required. 00079 If there is a user-friendly library using BLAS and LAPACK in the background, 00080 it is really useful to minimize the program development time 00081 and computational time at the same time. 00082 Existing matrix libraries, however, are not sufficient as far as we know. 00083 </p> 00084 00085 <p> 00086 CPPLapack has a very user-friendly interface 00087 as same as ordinary C++ matrix libraries. 00088 Moreover, CPPLapack uses BLAS and LAPACK functions in the background 00089 though programmers just need to write simple codes 00090 such as <code>"A=B*C;"</code>, <code>"A.dgesv(y);"</code>, and so on. 00091 </p> 00092 00093 <p> 00094 The advantage of using CPPLapack are not only user-friendly interface 00095 and fast computational speed but also saving memory space. 00096 In case of large-size matrix calculation, 00097 the number of copy times of objects affects required memory space 00098 and computational time materially. 00099 CPPLapack has a mechanism called "Smart-Temporary" system 00100 to minimize the number of copy times. 00101 The "Smart-Temporary" system is also hidden in CPPLapack library 00102 so that programmers don't need to pay any attention for this system. 00103 (CPPLapack used to employed "to_return" system. 00104 Now CPPLapack uses this system to realize the same purpose 00105 with keeping the compatibility with old versions.) 00106 </p> 00107 00108 <p> 00109 This program is designed for large matrix calculation. 00110 If you don't have mind to handle large matrices, 00111 to use another matrix library is recommended. 00112 </p> 00113 00114 <p> 00115 CPPLapack is still a beta program so far. 00116 It is a shame but there are a few bugs 00117 and unsupported BLAS and LAPACK functions. 00118 If you are going to use CPPLapack, please be aware this situation. 00119 Of course, it is very nice if you help us to develop CPPLapack. 00120 </p> 00121 00122 00123 <!----------------------------------------------------------------------------> 00124 <!----------------------------------------------------------------------------> 00125 <!----------------------------------------------------------------------------> 00126 <hr> 00127 <h2>Special Features</h2> 00128 <ul> 00129 <li> 00130 User-friendly interface<br> 00131 </li> 00132 <li> 00133 Hi-speed matrix calculations using BLAS and LAPACK<br> 00134 </li> 00135 <li> 00136 Minimized number of copy times of objects using "Smart-Temporary" system<br> 00137 </li> 00138 </ul> 00139 All of the features are hidden in C++ class library 00140 so that programmers are not required to do any special programming. 00141 00142 00143 <!----------------------------------------------------------------------------> 00144 <!----------------------------------------------------------------------------> 00145 <!----------------------------------------------------------------------------> 00146 <hr> 00147 <h2>Where to Get</h2> 00148 <p> 00149 The official distribution site of CPPLapack is 00150 <a href="http://sourceforge.net/projects/cpplapack/">here</a>. 00151 </p> 00152 00153 00154 <!----------------------------------------------------------------------------> 00155 <!----------------------------------------------------------------------------> 00156 <!----------------------------------------------------------------------------> 00157 <hr> 00158 <h2>How to Install</h2> 00159 <p> 00160 Actually, you don't need to install CPPLapack. 00161 CPPLapack is a bunch of C++ header files. 00162 Just expand the package at somewhere you like, 00163 and write a include path in your "Makefile". 00164 All you need to include is only "cpplapack.h". 00165 </p> 00166 00167 <p> 00168 But CPPLapack needs BLAS and LAPACK written in Fortran installed. 00169 Just make sure these two libraries are installed 00170 and modify "Makefile" to include and link to them. 00171 In stead of original BLAS and LAPACK packages, 00172 bender-supplied libraries such as Intel math kernel library(MKL), 00173 Compaq extended math library(CXML), and so on are also acceptable. 00174 </p> 00175 00176 <p> 00177 What BLAS and LAPACK need to link depends on your platform. 00178 Some examples of "Makefile" are prepared. 00179 See \ref pg-makefile. 00180 </p> 00181 00182 <p> 00183 For Cygwin users, a simple instructions on 00184 how to install ATLAS and LAPACK is prepared. 00185 See \ref pg-cygwin. 00186 </p> 00187 00188 <!----------------------------------------------------------------------------> 00189 <!----------------------------------------------------------------------------> 00190 <!----------------------------------------------------------------------------> 00191 <hr> 00192 <h2>Important Specification</h2> 00193 <ul> 00194 <li> 00195 The namespace for CPPLapack is "CPPL". 00196 </li> 00197 <li> 00198 You should not and don't need to use underscored matrix classes. 00199 These classes are not for project codes. 00200 The underscored classes are called "Smart-Temporary" classes. 00201 The detail of "Smart-Temporary" system is explained in \ref pg-nt. 00202 </li> 00203 <li> 00204 The numbering system of the matrix component is NOT 1-based but 0-based. 00205 In case of m x n matrix, 00206 the element number at the upper left is (0,0), 00207 and the element number at the lower right is (m-1,n-1). 00208 See \ref pg-bandmatrix for information of a band matrix. 00209 </li> 00210 <li> 00211 The matrix arrays are stored in column-major style. 00212 although most of C programmers like to use row-major style. 00213 This is because of the conventional Fortran LAPACK style. 00214 </li> 00215 <li> 00216 The matrix and vector member objects m, n, l, and array are the const reference objects so that they can be used to obtain the data but cannot be overwritten. 00217 </li> 00218 <li> 00219 LAPACK member functions implemented in CPPLapack, such as A.dgesv(y), overwrite the matrix A. 00220 When you need to keep the original matrix A, you have to make a copy of the matrix A before using LAPACK member functions. 00221 </li> 00222 <li> 00223 For easy debugging, "CPPL_VERBOSE" and "CPPL_DEBUG" macros are prepared. 00224 When "-DCPPL_VERBOSE" is specified in compilation commands, every called function outputs its function name to stderr. 00225 When "-DCPPL_DEBUG" is specified in compilation commands, matrix bounds checking are enabled. 00226 We recommend you to enable these macros during the program testing, 00227 then recompile codes without these macros for CPPLapack's best performance. 00228 </li> 00229 <li> 00230 It is important NOT to leave out the returned object. 00231 The calculated and returned object must be substituted to an object. 00232 For example, <code>A+B;</code> is not good. 00233 For another example, when 00234 <code>"dcovector f(const dcovector& x){ return 2*x; }"</code>, 00235 <code>f(x);</code> is also not good. 00236 These are because of the "Smart-Temporary" system. 00237 See \ref pg-nt. 00238 </li> 00239 </ul> 00240 00241 <!----------------------------------------------------------------------------> 00242 <!----------------------------------------------------------------------------> 00243 <!----------------------------------------------------------------------------> 00244 <hr> 00245 <h2>Test Programs</h2> 00246 Test programs to check the operations are there in "test" directory. 00247 They are also easy examples for you to learn how to use CPPLapack. 00248 00249 <!----------------------------------------------------------------------------> 00250 <!----------------------------------------------------------------------------> 00251 <!----------------------------------------------------------------------------> 00252 <hr> 00253 <h2>Benchmark Programs</h2> 00254 <p> 00255 Some programs to estimate the speed of CPPLapack are prepared 00256 in "benchmark" directory. 00257 </p> 00258 00259 <p> 00260 The performance of CPPLapack is almost the same as the performance of original BLAS and LAPACK. 00261 However, some of arguments of BLAS and LAPACK functions such as ALPHA, BETA, TRANS, and so on are fixed at certain values. 00262 When you want to make the full-use of BLAS and LAPACK functions, you can call their functions directory in codes of CPPLapack as usual. 00263 </p> 00264 00265 <!----------------------------------------------------------------------------> 00266 <!----------------------------------------------------------------------------> 00267 <!----------------------------------------------------------------------------> 00268 <hr> 00269 <h2>FAQ</h2> 00270 <p> 00271 (Q)I found my program using CPPLapack consuming the memory larger and larger 00272 in a loop. Why does this happen? 00273 <br> 00274 (A)Most likely, you leave out some returned matrix or vector object in the loop. 00275 Please read "Important Specification" section carefully. 00276 </p> 00277 00278 00279 <p> 00280 (Q)When I print components of a matrix or vector, 00281 I sometimes see "nan" printed. What is the possible reason? 00282 <br> 00283 (A)First of all, please make sure that your objects are initialized. 00284 The constructor with size arguments such as 00285 <code>"CPPL::dgematrix A(5,10);"</code> 00286 does NOT initialize its array components. 00287 The "resize" function does NOT initialize, neither. 00288 Please initialize objects using substitutions, 00289 or use "identity" or "zero" function to initialize them. 00290 </p> 00291 00292 00293 <!----------------------------------------------------------------------------> 00294 <!----------------------------------------------------------------------------> 00295 <!----------------------------------------------------------------------------> 00296 <hr> 00297 <h2>License</h2> 00298 CPPLapack is an open-source, free, and unguaranteed software. 00299 00300 <!----------------------------------------------------------------------------> 00301 <!----------------------------------------------------------------------------> 00302 <!----------------------------------------------------------------------------> 00303 <hr> 00304 <h2>Author and Cooperators</h2> 00305 Author: 00306 Yuki ONISHI<br> 00307 Cooperator: 00308 Masafumi IAI, 00309 Toshiyasu SHIMIZU, 00310 Masashi UESHIMA 00311 00312 <!----------------------------------------------------------------------------> 00313 <!----------------------------------------------------------------------------> 00314 <!----------------------------------------------------------------------------> 00315 <hr> 00316 <h2>Bug Report</h2> 00317 Please send bug reports to 00318 <a href="mailto:yuki.onishi@nifty.com">yuki.onishi@nifty.com</a>. 00319 I also welcome any kind of comments. 00320 00321 <!----------------------------------------------------------------------------> 00322 <!----------------------------------------------------------------------------> 00323 <!----------------------------------------------------------------------------> 00324 <hr> 00325 <h2>Links</h2> 00326 CPPLapack Documents in Japanese: 00327 <ul> 00328 <li><a target="_blank" href="../main_page/Japanese.html"> 00329 CPPLapack Document in Japanese</a></li> 00330 <li><a target="_blank" href="http://cpplapack.sourceforge.net/tutorial/japanese/index.html"> 00331 CPPLapack Tutorial in Japanese</a></li> 00332 <li><a href="http://cpplapack.sourceforge.net/tutorial/japanese/CPPLapack_Tutorial-Japanese.pdf">PDF of CPPLapack Tutorial in Japanese</a> 00333 </ul> 00334 00335 The sister project of CPPLapack: 00336 <ul> 00337 <li><a target="_blank" href="http://sourceforge.net/projects/cppscalapack/"> 00338 CPPScaLapack</a></li> 00339 </ul> 00340 00341 CPPLapack is based on and thanks to: 00342 <ul> 00343 <li><a target="_blank" href="http://netlib.caspur.it/blas/"> 00344 BLAS</a></li> 00345 <li><a target="_blank" href="http://netlib.caspur.it/atlas/"> 00346 ATLAS</a></li> 00347 <li><a target="_blank" href="http://www.netlib.org/lapack/"> 00348 LAPACK</a></li> 00349 </ul> 00350 00351 <ul> 00352 <li><a target="_blank" href="http://developer.intel.com/software/products/compilers/"> 00353 Intel C++ Compiler (ICC)</a></li> 00354 <li><a target="_blank" href="http://developer.intel.com/software/products/mkl/index.htm"> 00355 Intel Math Kernel Library (MKL)</a></li> 00356 <li><a target="_blank" href="http://h30097.www3.hp.com/linux/compaq_cxx/"> 00357 HP(Compaq) C++ Compiler for Linux Alpha (CXX)</a></li> 00358 <li><a target="_blank" href="http://h18000.www1.hp.com/math/"> 00359 HP(Compaq) Math Libraries (CPML, CXML)</a></li> 00360 <li><a target="_blank" href="http://www.mpack.com/"> 00361 NEC MathKeisan Library (MPACK)</a></li> 00362 <li><a target="_blank" href="http://www.sgi.com/developers/devtools/apis/scsl.html"> 00363 SGI Scientific Computing Software Library (SCSL)</a></li> 00364 <li><a target="_blank" href="http://www.amd.com/home/dev01"> 00365 AMD Core Math Library (ACML)</a></li> 00366 </ul> 00367 <!----------------------------------------------------------------------------> 00368 <!----------------------------------------------------------------------------> 00369 <!----------------------------------------------------------------------------> 00370 <center><h3>Have fun.</h3></center> 00371 */