![]() |
Blitz Support : |
From: Julian C. Cummings (cummings_at_[hidden])
Date: 2003-07-30 12:35:53
Hello Ides,
If you are using the current cvs repository version of blitz, then you need
to change your cast notation slightly. Using the "new" expression template
machinery, I made what I hope is an improvement in notation. Instead of
cast(foo, int())
you can now say simply
cast<int>(foo)
I think this style is more similar to the C++ cast functions. Try making
the corresponding change in your code and let me know if you still have a
problem. I'm sorry that the old blitz documentation has not been updated.
Regards, Julian C.
Dr. Julian C. Cummings
Staff Scientist, CACR/Caltech
(626) 395-2543
cummings_at_[hidden]
> -----Original Message-----
> From: blitz-support-bounces_at_[hidden]
> [mailto:blitz-support-bounces_at_[hidden]] On Behalf Of
> van den Bosch
> Sent: Wednesday, July 30, 2003 10:01 AM
> To: blitz-support_at_[hidden]
> Subject: [Blitz-support] cast problem
>
>
> Hello,
>
> I'm trying to cast an Array<double> to Array<int> but it
> doesn't work. The
> (stripped to a minimum) code piece is:
>
> #include <fstream>
> #include <blitz/array.h>
> #include <blitz/ops.h>
>
> using namespace blitz;
>
> #include "mesh.h"
> ...
> MESH.triangles = cast(triangles_tmp(Range::all(), Range(0,
> 2)), int()); ...
>
> and the error message is:
>
> > gretry.emic.ucl.ac.be:C++/devel> gnumake Zmain_mn
> > g++ -c -O3 -I/home/denbosch/blitz++/include create_mesh.cpp
> > create_mesh.cpp: In function `int create_mesh(mesh&)':
> > create_mesh.cpp:79: no matching function for call to
> > `cast(blitz::Array<double, 2>, int)'
> > gnumake: *** [create_mesh.o] Error 1
> > gretry.emic.ucl.ac.be:C++/devel>
>
> Anyone a clue? Thanks,
>
> Ides
>
>
> --
> Ir Idesbald van den Bosch
> PhD Student
> 3, Place du Levant - Bātiment Maxwell
> 1348 Louvain-la-Neuve
> tel.: +32 (0)10 47 81 06
> fax : +32 (0)10 47 87 05
> _______________________________________________
> Blitz-support mailing list
> Blitz-support_at_[hidden]
> http://www.oonumerics.org/mailman/listinfo.cgi> /blitz-support
>