Blitz logo

Blitz Support :

From: van den Bosch (vandenbosch_at_[hidden])
Date: 2003-11-04 08:54:01


Hello,

I have a problem for multiplying a TinyMatrix with a double. Here is the code:

#include <iostream>
#include <complex>
#include <blitz/array.h>
#include <blitz/tinyvec-et.h>
#include <blitz/tinymat.h>

using namespace blitz;

int main (void) {
  double a = 3.0;
  TinyMatrix<double, 3, 3> A, B;
  TinyVector<double, 3> x, y, z;
  A = 1.0, -2.0, 0.0,
      2.0, 1.0, 0.0,
      0.0, 0.0, 1.0;
  cout << A << endl;
  B = A * a;
  cout << B << endl;

  x = 2.0, 3.0, 4.0;
  cout << x << endl;

  y = product(A, x);
  cout << y << endl;
  z = y*2.0;
  cout << z << endl;
}

and here is the error compilation message :

[denbosch_at_lorentz TinyMatrix]$ make
g++ -c -O3 -I../../../blitz++/include tiny.cpp
tiny.cpp: In function `int main()':
tiny.cpp:20: no match for `blitz::TinyMatrix<double, 3, 3>& * double&'
operator
../../../blitz++/include/blitz/vecbops.cc:3736: candidates are:
   blitz::_bz_VecExpr<blitz::_bz_VecExprOp<blitz::_bz_VecExprConstant<long
   double>, blitz::Range, blitz::_bz_Multiply<long double, int> > >
   blitz::operator*(long double, blitz::Range)
../../../blitz++/include/blitz/vecbops.cc:3651:
   blitz::_bz_VecExpr<blitz::_bz_VecExprOp<blitz::_bz_VecExprConstant<double>,
   blitz::Range, blitz::_bz_Multiply<double, int> > > blitz::operator*(double,
   blitz::Range)
../../../blitz++/include/blitz/vecbops.cc:3566:
   blitz::_bz_VecExpr<blitz::_bz_VecExprOp<blitz::_bz_VecExprConstant<float>,
   blitz::Range, blitz::_bz_Multiply<float, int> > > blitz::operator*(float,
   blitz::Range)
../../../blitz++/include/blitz/vecbops.cc:3237:
   blitz::_bz_VecExpr<blitz::_bz_VecExprOp<blitz::Range,
   blitz::_bz_VecExprConstant<long double>, blitz::_bz_Multiply<int, long
   double> > > blitz::operator*(blitz::Range, long double)
../../../blitz++/include/blitz/vecbops.cc:3220:
   blitz::_bz_VecExpr<blitz::_bz_VecExprOp<blitz::Range,
   blitz::_bz_VecExprConstant<double>, blitz::_bz_Multiply<int, double> > >
   blitz::operator*(blitz::Range, double)
../../../blitz++/include/blitz/vecbops.cc:3203:
   blitz::_bz_VecExpr<blitz::_bz_VecExprOp<blitz::Range,
   blitz::_bz_VecExprConstant<float>, blitz::_bz_Multiply<int, float> > >
   blitz::operator*(blitz::Range, float)
../../../blitz++/include/blitz/vecbops.cc:3169:
   blitz::_bz_VecExpr<blitz::_bz_VecExprOp<blitz::Range, blitz::Range,
   blitz::_bz_Multiply<int, int> > > blitz::operator*(blitz::Range,
   blitz::Range)
../../../blitz++/include/blitz/meta/metaprog.h:58: T
   blitz::operator*(const T&, blitz::_bz_meta_nullOperand) [with T =
   blitz::TinyMatrix<double, 3, 3>]
make: *** [tiny.o] Error 1
[denbosch_at_lorentz TinyMatrix]$

Anyone has a clue about what's wrong in my code ? 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