![]() |
Blitz Support : |
From: Inge.Viken_at_[hidden]
Date: 2005-03-01 11:33:02
Hi all,
I would have thought that the following code should have
compiled (I'm using Visual Studio.Net 2003, Blitz++ 0.8):
#include <iostream>
#include "blitz/array.h"
int main(int argc, char *argv[])
{
blitz::Array<double, 1> a(3), b(2);
a = 1, 2, 3;
// Compiles OK:
b = a(blitz::tensor::i);
// Compiles OK:
b = a(blitz::Range(1, 2));
// Should do the same as the above line,
// shouldn't it?
// Does not compile:
b = a(blitz::tensor::i + 1);
std::cout << a;
std::cout << b;
exit(0);
}
The compilation error message is included at the bottom of this mail.
Presumably it means that 'blitz::tensor::i + 1' will
evaluate to a BzBinaryExprResult<...>::T_result,
for which there is no Array::operator() (based on
interpreting the message and quickly checking the Blitz++ implementation).
Am i doing something wrong, or is the above code simply not supported?
Best regards
Inge Viken (novice Blitz++ user)
******************* Error message **************************
c:\usr\tmp\emsea\bugdemo\bugdemo.cpp(18) : error C2664:
'blitz::Array<P_numtype,N_rank>::T_array
blitz::Array<P_numtype,N_rank>::operator ()(blitz::Range) const' : cannot
convert parameter 1 from 'blitz::BzBinaryExprResult<OP,O1,O2>::T_result' to
'blitz::Range'
with
[
P_numtype=double,
N_rank=1
]
and
[
OP=blitz::Add,
O1=blitz::IndexPlaceholder<0>,
O2=int
]
No constructor could take the source type, or constructor overload
resolution was ambiguous
_____________________________
Neither the confidentiality nor the integrity of this message can be
guaranteed following transmission on the Internet. The addressee should
consider this risk and take full responsibility for use of this message.
This e-mail has been swept by Norman antivirus software.