resizing triangular ?

Jan Ramon <[email protected]> Wed, 3 Aug 2005 17:41:16 +0200 (CEST)
Newsgroups gmane.comp.lib.mtl.devel
Message-ID <[email protected]>
Hi,


I downloaded mtl just yesterday.  It looks like a very useful and
well-constructed library.  I'm using Fedora Linux 4 with g++4.0.1 (though
I try things that go wrong also with g++3.2 as docs say not everything
has been adapted to 4.x).  Docs advise me to use KAI C++, but that link
points to Intel, so I also downloaded intel's icc 8.1.


There are a few things I don't find in the docs.  I would appreciate get
some help on this list.  My first problem is to set the size of a matrix.
I can do that with the constructor, but that's not always convenient.
For
	matrix<double>::type m;
I tried to do
	m.resize(N,M);
and that works nicely (also in the resize.cc example).  However, for
	mtl::matrix<real, mtl::triangle<mtl::upper>,
	mtl::banded<>, mtl::row_major >::type m;
I can't do
	m.resize(N,N);
as this gives the following errors:

g++ -O0 -g -Wall -I/home/janr/cw/lib/mtl/include/mtl mytest.C -o mytest4
/home/janr/cw/lib/mtl/include/mtl/mtl/mtl/mtl/dense2D.h: In member
function void mtl::dense2D<T, OffsetGen, MM, NN>::resize(typename
mtl::generic_dense2D<std::vector<T, std::allocator<_CharT> >,
mtl::refcnt_ptr<std::vector<T, std::allocator<_CharT> > >, OffsetGen, MM,
NN>::size_type, typename mtl::generic_dense2D<std::vector<T,
std::allocator<_CharT> >, mtl::refcnt_ptr<std::vector<T,
std::allocator<_CharT> > >, OffsetGen, MM, NN>::size_type) [with T =
double, OffsetGen = mtl::gen_packed_offset<0, 0>, int MM = 0, int NN = 0]:
/home/janr/cw/lib/mtl/include/mtl/mtl/mtl/mtl/matrix_implementation.h:616:
instantiated from void mtl::row_matrix<TwoDGen,
IndexerGen>::resize(typename mtl::matrix_implementation<TwoDGen,
IndexerGen>::size_type, typename mtl::matrix_implementation<TwoDGen,
IndexerGen>::size_type) [with TwoDGen = mtl::gen_dense2D<double,
mtl::gen_packed_offset<0, 0>, 0, 0>, IndexerGen =
mtl::gen_banded_indexer<mtl::row_orien, 0, 0, size_t>]
mytest.C:8:   instantiated from here
/home/janr/cw/lib/mtl/include/mtl/mtl/mtl/mtl/dense2D.h:548: error:
mtl::dimension<size_t, 0, 0> mtl::packed_offset<size_t, 0, 0>::dim is
private
/home/janr/cw/lib/mtl/include/mtl/mtl/mtl/mtl/dense2D.h:1235: error:
within this context
/home/janr/cw/lib/mtl/include/mtl/mtl/mtl/mtl/dense2D.h:1236: error: class
mtl::packed_offset<size_t, 0, 0> has no member named ld
m
[janr@pcpjwr lib]$ cat mytest.C

#include <mtl/mtl.h>

typedef mtl::matrix< double, mtl::triangle<mtl::lower>, mtl::packed<>,
mtl::row_major>::type RT;

int main() {
  RT x;
  x.resize(5,5);
  return 0;
}

I find in the docs methods to query the matrix dimensions, but not to
set them.
BTW: What is the difference between packed, dense and array ?

Jan




+-------------------------------------------------------+
|  Jan Ramon                                            |
|  Department Of Computerscience K.U.Leuven             |
|  Celestijnenlaan 200 L 00.10                          |
|  3001 Heverlee                                        |
|  Belgium                                              |
|  [email protected]; [email protected]  |
|  http://www.cs.kuleuven.ac.be/~janr/                  |
|  +32-16-327560 (L00.10)                               |
|  +32-16-327552 (Secretary deptcw)                     |
|  +32-486-968518 (Mobile)                              |
|  fax: +32-16-327996                                   |
+-------------------------------------------------------+


_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/