TMV

Template matrix/vector library for C++
Download

TMV Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Mike Jarvis
  • Publisher web site:
  • Operating Systems:
  • Mac OS X
  • File Size:
  • 1.7 MB

TMV Tags


TMV Description

Template matrix/vector library for C++ TMV is a free and open source linear algebra library that uses operator overloading, views and delayed evaluation to simplify vector and matrix expressions in C++. TMV is well documented and can optionally call optimized BLAS/LAPACK for faster execution times. Here are some key features of "TMV": · Operator overloading: An expression like v2 = x * m * v1 should produce correct and fast code. (No temporaries) · Complex types: Mixing complex and real types in an arithmetic statement should be legal. · Decompositions: Division should mean solving a matrix equation, automatically performing an LU, QR, Cholesky, or singular value decomposition to do so. · Speed: The code should be fast for large matrices. Typically, this means calling BLAS and LAPACK routines behind the scenes. · Delayed evaluation: (aka lazy evaluation) The expression v2 = x * m * v1 for example inlines directly to MultMV(x,m,v1,v2) which does the actual calculation, so there is no performance hit from the legibility of the operators. · Templates: As the name TMV indicates, the type of the elements in a vector or matrix is a template. So you can have Matrix, Matrix, Matrix, or even use some user-defined type (eg. Quad for some 16 byte quad-precision class) Matrix. · Views: There are both constant and mutable views into a vector or matrix. So expressions like m.row(3) += 4. * m.row(0) and m2 *= m.Transpose() do the obvious things. · Matrix division: The expression x = b/A can be used to solve the matrix equation Ax = b. Control methods for A can be used to tell it which decomposition to use to find the solution. There are also controls to save the decomposition for later repeated use, and even to do the decomposition in place to save on storage. · Flexible storage: A matrix may be declared either row-major or column-major. Band matrices also allow for diagonal-major storage. · Flexible indexing: You can specify that you want to access a matrix using either the normal C convention (0-based indexing) or the Fortran convention (1-based indexing). · Alias checking: Many matrix packages calculate m *= m incorrectly. TMV automatically checks if two objects in a calculation use the same storage and creates temporaries as needed. It only checks the address of the first element, so you can still screw up. But most of the time this is good enough. · BLAS/LAPACK: The library can be compiled to call BLAS and/or LAPACK routines. But if you don't have them, the internal code will also work. Most of the internal algorithms are as fast as LAPACK. But optimized BLAS routines are generally significantly faster. So compiling with at least a BLAS library is recommended if speed is important for you. What's New in This Release: · Corrected an error with m.DivIsSet(); · Corrected the documentation regarding the m.SVD() access, especially that S is now a DiagMatrix, rather than a Vector. · Changed behavior of methods like m.SVD(). Now, if SV has not been set already, then it will set it, rather than give an error. · Added ListInit method for initializing a vector or matrix. · Improved SmallMatrix class. Now it is not derived from GenMatrix (or even BaseMatrix), thus removing the virtual table. This greatly speeds up a lot of calculations. I also specialized some routines for 2x2 and 3x3 matrices, like Det and Inverse. The caveat is that some things that used to be possible with SmallMatrix are not now. Most importantly, arithmetic results can not be automatically instantiated any more. They need to be assigned to a location, either SmallMatrix or Matrix. I also inlined all the division routines, rather than have it call the regular Matrix division routines. · Removed some ViewOf commands that are clearer with a different notation. · Fixed problems with LAPACK functions dstegr and sstegr. Now TMV can detect when stegr fails and run the alternate stedc instead. · Added scons installation option. · Added ability to use Fortran versions of BLAS and LAPACK. · Include CMakeLists.txt files for cmake installations. · Include .vcproj and .vcsln files for Visual C++ installations.


TMV Related Software