RE: [ROOT] variable size two dimensional array

From: Philippe Canal (pcanal@fnal.gov)
Date: Mon Aug 02 2004 - 23:43:24 MEST


HI Hajime,

Thanks for reporting this issue.
A fix for the original problem will be upload soon.
This mean that you will be able to use TTree::Draw and
TTree::Scan on the member declared as

	int *aa[3]; //[n]

Implementing support for int (*aa)[3]; //[n] is more
complex.  Due to the fact that there are several 
viable alternative (int *aa[3]; //[n] or an std::vector
of std::vector or event int *a; //[n3] (where n3 is another
variable is set by the user to n*3))
This implementation will not have precedence on several
other improvements (new I/O for other stl containers,
member-wise saving of stl containers, etc.).

If this is a problem, please let me know.

Cheers,
Philippe.

-----Original Message-----
From: Hajime Nanjyo [mailto:nanjyo@icepp.s.u-tokyo.ac.jp]
Sent: Monday, July 26, 2004 1:58 AM
To: Rene.Brun@cern.ch; pcanal@fnal.gov
Cc: roottalk@pcroot.cern.ch
Subject: Re: [ROOT] variable size two dimensional array


Dear Rene and Philippe,

This is the similar mail to the mail sent about 3 weeks before.
I am still wating your help. (I understand you are busy.)

Is it possible to make a variable size two dimensional array for ROOT I/O
and to draw it in ROOT session with 'TTree::Draw();'?

A small example was attached to indicate the problem.

I used the ROOT at /afs/cern.ch/sw/root/v4.00.08/rh73_gcc32/root
under Red Hat Linux 7.3 with gcc version 3.2.

Best Regards,
Hajime

P.S 
In a case of variable size one dimensional array,
program codes like below succeed.
-----------------------------------------------------------------
      A.h          |       A.C           |   in ROOT session
-----------------------------------------------------------------
int  *a;     //[n] | a  = new int[n];    | tree->Draw("a[]");
-----------------------------------------------------------------

If a syntax 'int (*aa)[3];//[n]' is supported in rootcint,
similar codes as follows will probably be possible. 
-----------------------------------------------------------------
      A.h          |       A.C           |   in ROOT session
-----------------------------------------------------------------
int (*aa)[3];//[n] | aa = new int[n][3]; | tree->Draw("aa[][]");
-----------------------------------------------------------------
Could you implement this if possible?



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET