linear algebra library... again

"Yeah, well... I'm gonna go build my own theme park, with blackjack and hookers. In fact, forget the park!" it seems the previous message has not reached the list i hope this will i present you an almost finished linear algebra library called BIBLAL there are some aspects of matrix algebra implemented as well the sources and docs are in the vault:/linalg/ http://www.boostpro.com/vault/index.php?direction=0&order=&directory=linalg& to this moment the core of the library is fully working it turned out to be almost 100% the way i originally intended so i'm very happy about it there are some minor details to implement as well as some usefull features to add but this seems trivial when the core is finished although i think a linear algebra lib should never be part of the standard, the boost collection of libraries will certainly benefit from its inclusion to complement ublas i'm open to questions, criticism and suggestions -- Pavel

DE wrote:
Helo Pavel, I've taken a look at your documentation, but I guess my original question still stands: how does it complement uBLAS? All I can find is the addition of an overload for operator*, for which patches are available for uBLAS, and quite a smaller number of types of containers. What's in it for us? Kind regards, Rutger

on 02.02.2010 at 23:20 Rutger ter Borg wrote :
Helo Pavel,
unswering your question: i (re)designed the core of the lib so both any number of containers, concepts and algorithms could be introduced easily and intagrated seamlessly. the complement part is that the user may choose between ublas and natural notation linalg lib (such as this one). some comparison to ublas: it's hard for me to quickly inspect ublas documentation because i'm used to the doxygen style documentation (or qt style to which doxygen is similar). as far as i can tell now the lib i propose provide a broader variety of concepts such as shape of the matrix (rectangular. symmetric etc.). this implies that a product of symmetric matrix is symmetric and so on. matrix<double, symmetric> m1, m2, m; //... m = m1*m2; or you can provide different implementations of a particular operation for different shapes so the user need not write process_symmetric(m); but only process(m); in general i did my best to provide very strict relationships and interface so that nonsensical code will not compile at all. additionally i tried to make the generic handling of all that concept combinations as easy as possible. furthermore vectors can be implicitly converted to matrices depending on their orientation (column/row) like m = v; or m = transpose(v1)*v2; //here matrix multiplication is involved which is pretty useful i think. -- Pavel

DE wrote:
What does this last statement do in case m1 and m2 don't have the same size? Does it throw an exception, or does it simply use the smaller of the two sizes? Same question for the case that m1*m2 is not symmetric, as in the following example: m1 = 0 1 1 0 m2 = 1 0 0 2 m1*m2 = 0 2 1 0 Does it throw an exception, or does it silently set m= 0 2 2 0 (or m= 0 1 1 0) ? Regards, Thomas

on 04.02.2010 at 2:06 Thomas Klimpel wrote :
at this moment it sets the product to be [0 2] [2 0] i must have missed something thanks for your reply in fact a product of symmetric matrices is rarely symmetric i don't know where i got that stuff (wikipedia says that, given symmetric A and B, A*B is symmetric if A and B commute; maybe i were misled by this fact) i'll remove that operation and rewrite documentation so the example above may be read m = m1 + m2; //or 'm1 - m2' fortunately a product of triangular matrices is triangular -- Pavel

forgot to answer: it throws an exception
DE wrote: triggering a static assert makes more sense as the type of matrix is known at CT -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35

Thomas Klimpel wrote:
But the size is not part of the type in this case (because it is dynamic), so a static assert is not an option.
Oh, i misread, I thought it was a wase of shape mismatch -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35

on 04.02.2010 at 20:46 joel falcou wrote :
if you meant that we try to assign to a symmetric matrix a matrix that is not symmetric as in the example m = m1*m2; //m is symmetric then the code does not compile to force the assignment we can write m = reshape<symmetric>(m1*m2); or m = reshape<symmetric, lower_tr>(m1*m2); to get mirrored lower triangular part -- Pavel
participants (4)
-
DE
-
joel falcou
-
Rutger ter Borg
-
Thomas Klimpel