Re: valarray

From: Maxim Nikulin <nikulin_at_gorodok.net>
Date: Fri, 28 Oct 2005 14:25:25 +0700


Dear Tomasz and Edmond,

Thank you very much for the hints. I appreciate your help.

Edmond Offermann wrote:
>
> You will find what you need in:
>
> AddElemMult, AddElemDiv, ElementMult and ElementDiv .
>
> Have also a look at the the Use function which allows you to assign an
> array to a TVector without copying .

Tomasz Bold wrote:

 >
 >    Yes you are right operator* is doing scalar product.
 >    I have found in the TVectorD.h
 >
 > TVectorD  &ElementMult  (TVectorD &target, const TVectorD  &source);

These methods do what I was looking for. However since these functions modify the first argument it seems more natural to define them as class methods. In my opinion non-member function should return new vectors instead of updating existing ones.

Otto Schaile wrote:

 >
 > this work  for me:
 >
 > root [0] Double_t x[2] = { 2,2}
 > root [1] Double_t y[2] = { 2,2}
 > root [2] TVectorD vx(2,x);
 > root [3] TVectorD vy(2,y);
 > root [4] vx*vy
 > (Double_t)8.00000000000000000e+00

Otto, this is not the function I was searching. Anyway thank you.

-- 
Yours faithfully,
Maxim Nikulin
Received on Fri Oct 28 2005 - 09:25:38 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:13 MET