![]() |
Blitz Bugs : |
From: Andreas Athanasopoulos (aathanas_at_[hidden])
Date: 2003-02-16 11:10:27
I am writing regarding a possible bug I may have detected in the latest
official release of Blitz++, i.e Version 0.6.
It has to do with the dot fuction. It seems that it does not support
arrays of tiny-vector elements. It may be a bug or just an
unsupported feature. I would be nice if such a feature could
be made to work. A sample code is included at the end of the email,
as well as the error messages during compilation.
Andreas Athanasopoulos
-------------------------------------------------------------------------------------------
#include <blitz/array.h>
#include <blitz/blitz.h>
#include <blitz/tinyvec.h>
#include <blitz/tinyvec-et.h>
# include <stdio.h>
# include <iostream.h>
# include <stdlib.h>
# include <math.h>
# include <malloc.h>
#ifdef BZ_NAMESPACES
using namespace blitz;
#endif
//----------------------------------------------------------------------------------------------------------------
int main( )
{
Array<TinyVector<float , 3>,1> coordinates( Range(1, 100) );
Array<float,1> distance_from_centre_squared( Range(1, 100) );
TinyVector<float , 3> centre;
//---------------------------------------------Bug?----------------------------------------------------------------
distance_from_centre_squared = dot( coordinates, coordinates );
//----------------------------------------------Bug?---------------------------------------------------------------
distance_from_centre_squared = dot( (coordinates - centre ),
(coordinates - centre ) );
return(0);
}
--------------------------------------------------------------------------------
Error messages:
bug001.cpp: In function `int main()':
bug001.cpp:24: no matching function for call to `dot(
blitz::Array<blitz::TinyVector<float, 3>, 1>&,
blitz::Array<blitz::TinyVector<float, 3>, 1>&)'
bug001.cpp:27: no matching function for call to `dot(
blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprOp<blitz::FastArrayIterator<blitz::TinyVector<float,
3>, 1>, blitz::_bz_ArrayExprConstant<blitz::TinyVector<float, 3> >,
blitz::Subtract<blitz::TinyVector<float, 3>, blitz::TinyVector<float,
3> > >
>,
blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprOp<blitz::FastArrayIterator<blitz::TinyVector<float,
3>, 1>, blitz::_bz_ArrayExprConstant<blitz::TinyVector<float, 3> >,
blitz::Subtract<blitz::TinyVector<float, 3>, blitz::TinyVector<float,
3> > >
>)'