Cint limitation: reference

Hi,

I want to pass a 3d array to a class for being valued, and use this array afterward, out of the class.

[code]#ifndef DPRC_H_
#define DPRC_H_

#include
#include “TH1D.h”
#include "TObject.h"
using namespace std;

class dprc : public TObject
{
private:
Double_t (&tparameters)[10][10];
Double_t (&fparameters)[10][10][10];
Double_t (&lparameters)[10][10][10];

public:
dprc( Double_t (&tpara)[10][10], Double_t (&fpara)[10][10][10], Double_t (&lpara)[10][10][10])
:tparameters(tpara), fparameters(fpara), lparameters(lpara)
{
}

string getfunction();

ClassDef(dprc,1)
};
#endif[/code]

But I get this information:

[quote]Error in : Dictionary generation failed with a core dump!
Info in : Invoking compiler to check macro’s validity
Info in : The compiler has not found any problem with your macro.
Probably your macro uses something rootcint can’t parse.
Check root.cern.ch/viewvc/trunk/cint/doc/limitati.txt for Cint’s limitations.
[/quote]

I also find this http://root.cern.ch/root/html/cint/limitati.html

[quote]

Reference member

Reference type member is not supported

class A {
 private:
  int& refa; // Limitation
};

Array reference

Array reference is not supported by Cint.

void func(int (&ary)[5]); // Limitation[/quote]

Am I right that I could not pass an array to a class, and use it out of the class? If so, what is the better way I could do such things under the limitation?

Thanks.
yjc

[quote=“yjc”]
Am I right that I could not pass an array to a class, and use it out of the class? If so, what is the better way I could do such things under the limitation?
Thanks.
yjc[/quote]

If I understand correctly, your class is not the owner - these arrays are somehow declared somewhere else and they live longer than object of your class?
Well, if CINT has such limitations … why not using a trivial pointer to double instead? Sure, info about object size will be lost :frowning: … Well, you can use std::vector in this case. While it’s quite ugly, you can even use vectors of vectors if you do not want to do arithmetics yourself (converting 2d/3d indices into the 1d index - in case you “emulate” 2d/3d arrays with one array like p[i * rowSize + j]).

[quote=“tpochep”][quote=“yjc”]
Am I right that I could not pass an array to a class, and use it out of the class? If so, what is the better way I could do such things under the limitation?
Thanks.
yjc[/quote]

  1. Do you really need a classdef/classimp? I do not think you want to serialize your class.
  2. If I understand correctly, your class is not the owner - these arrays are somehow declared somewhere else and they live longer than object of your class?
    Well, if CINT has such limitations … why not using a trivial pointer to double instead? Sure, info about object size will be lost :frowning: … Well, you can use std::vector in this case. While it’s quite ugly, you can even use vectors of vectors if you do not want to do arithmetics yourself (converting 2d/3d indices into the 1d index - in case you “emulate” 2d/3d arrays with one array like p[i * rowSize + j]).[/quote]

thank you for your help.
1)You are right. I do not need a classdef. Right now , I just want to use it. That is all.
2)The way I wrote codes is just as you guess. I will think about your suggestion. For now, I have changed the whole structure of the code, and “keep” these arrays only inside of this class.

yjc