|
Boost : |
From: jhrwalter (walter_at_[hidden])
Date: 2001-12-06 03:55:12
--- In boost_at_y..., Toon Knapen <toon.knapen_at_s...> wrote:
> some questions on ublas :
>
> in the documentation (matrix.htm), the constructor matrix
(size1,size2)
> is documented to hold *at most* size1 rows of size2 elements. I
guess
> this is intended to read : ... *at least* ...
Documentation error, should read:
"to hold size1 rows of size2 elements".
I'll correct that.
> what's the complexity guarantee of `resize`. I guess it is intended
to
> reshape a matrix without having to allocate memory.
If possible, yes (the actual implementations are occasionally
suboptimal ;-). It's an open question, whether there is need for a
similar operation which conserves matrix data. Complexity guarantees
depend on operator new, but should be quadratic.
> For instance if I
> need a temporary matrix in a loop, but in every loop the total size
of
> the matrix can be different, I can allocate a matrix with some
maximal
> size and resize it in every loop to something smaller in every
loop in
> constant amortised time ?
Currently not, but it should be possible to change this. May be we
need to differentiate size() and capacity()?
> How should I create a sub-matrix using the matrix<T>.project
member ?
> I can do :
> Matrix::const_matrix_range_type mr( m, numerics::range(0,subsize),
> numerics::range(0,subsize) );
> but the following does not compiler :
> Matrix::const_matrix_range_type mr( m.project(0,subsize, 0,
subsize ) );
A couple of issues. First, member function project is deprecated.
Please use the free function project(m, ...). Second, the usage of
project (m, range(0,subsize), range(0,subsize))
vs.
project(m, 0,subsize, 0,subsize)
is an open interface question: the former describes the intent more
specific (I hope) and is consequently implemented, the latter is
easier to type (and avoids two objects :-). I'd like to deprecate one
of these forms also, but which? Third, typedef's like
const_matrix_range_type are deprecated. BTW, please have a look (and
define) at NUMERICS_DEPRECATED in config.h.
Summarized: I'd prefer to write something like
matrix_range<Matrix> mr(project(m, range(0,subsize), range(0,
subsize ));
Bonus question: what's the best namespace name?
> Most important : I'm curious where the name `ublas` comes from ?
This shall be our small secret ;-) But it's certainly a tribute to
these Fortran guys :-)
> I'm impressed with the functionality so far and with the active
> development.
Thanks.
> Does the sparse matrix also support COO (coordinate) and
> most important CSC (compressed sparse row or Harwell-Boeing)
format ?
No. Our base containers vector, matrix, sparse_vector and
sparse_matrix were designed to use std::vector and std::map as
storage and prove interoperability. CRS and CCS storage formats have
to be implemented. With regard to COO I'm unsure.
> In that case I'm going to deploy it in my own projects ASAP ! Nice !
Sorry, we're not as fast ;-)
Thanks for your feedback, regards
Joerg
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk