
Ublas : 
From: John Woods (aciel_at_[hidden])
Date: 20070411 17:29:33
Hey folks,
I know that Fortran takes column major lower or upper triangular
matrices (as symmetric matrices) for DSYEV and SSYEV. I had initially
thought that it would be best to pass in a symmetric_matrix<double,
lower, column_major, vector<double> > to avoid unnecessary copies.
However, I notice that this type is represented in the same way as a
symmetric_matrix<double, upper, row_major, vector<double> > (correct?).
Clearly if I take the product of two matrices, it's not going to matter
so much how the data is stored. But for passing into Fortran functions
(e.g. through syev), it does matter. Or does it? Is it copied regardless
of how I store it? What about the work array I pass in?
A related question:
That fourth template argument for symmetric_matrix can be
bounded_array<T>, unbounded_array<T>, or std::vector<T>. Vector, for
example, has a second template argument, the size. Would a symmetric
matrix be stored as a single vector of size n(n+1)/2? Does this save
anything, to give that template a size?
I realize these are pretty trivial questions and that I could write code
to test nearly all of them. Actually, I'm not looking for specific
answers (except about syev)I'd much prefer a general explanation on
the design of these libraries that would enable me to answer them myself.
Thanks for your time.
Cheers,
John Woods