Re: [ROOT] Problem with code including TMatrixRow

From: Perfetto Francesco (Francesco.Perfetto@na.infn.it)
Date: Tue Dec 17 2002 - 20:36:34 MET


Hi Rene,
I have changed the exstension of my file from .C in .O0, and the example
that I send you work now, but the change of extension again don't work on
my complete script.
Now I sent you my complete script:

{
#include "TMatrix.h"
#include "TVector.h"

TMatrix combi(15,6);

Int_t ii=1;

for(Int_t jj=2; jj<7; jj++)
{
  Int_t kk=2;
  Int_t ll=2;
  Int_t pippo=1;
  while ( pippo != 0 )
    {
      if ( kk != jj )
	{
	  while( ll < 7 )
	    {
	      if ( ll != jj && ll != kk )
		{
		  pippo=1;
		  Int_t mm=2;
		  Int_t nn=2;
		  while( pippo != 0 )
		    {
		      if( mm != jj && mm != kk && mm != ll )
			{
			  if( nn != jj && nn != kk && nn != ll && nn != mm
)
			    {
			      TVector indic(6);

			      indic(0)=ii;
			      indic(1)=jj;
			      indic(2)=kk;
			      indic(3)=ll;
			      indic(4)=mm;
			      indic(5)=nn;

			      TMatrixRow(combi,0)=indic;<--THIS IS LINE 40

			      pippo=0;
			    }
			  else
			    nn=nn+1;

			}
		      else
			mm=mm+1;

		    }

		}
	      ll=ll+1;
	    }
	}
      else
	kk=kk+1;

    }



}

}
The output is the following:
root [0] .x prova.O0
Error: improper lvalue FILE:prova.O0 LINE:40
*** Interpreter error recovered ***

Thank for your help
  Francesco


On Tue, 17 Dec 2002, Rene Brun wrote:

> Hi Francesco,
>
> This seems to be a CINT optimisation problem. Masa will investigate.
> If you run with optimisation off (.O0) results will be OK.
>
> Rene Brun
>
> On Tue, 17 Dec 2002, Perfetto Francesco wrote:
>
> > Hi All,
> >
> > I have a problem with following code:
> >
> > {
> > #include "TMatrix.h"
> > #include "TVector.h"
> >
> >
> > TMatrix combi(15,6);
> > TVector indice(6);
> >
> > Int_t ii=1;
> > for (Int_t jj=2; jj<7; jj++)
> >   {
> >     Int_t kk=2;
> >     Int_t ll=2;
> >     Int_t mm=2;
> >     Int_t nn=2;
> >     Int_t pippo=1;
> >
> >     if( (kk) != (jj) )  //<<<------- this is the problem
> >       {
> > 	indice(0)=ii;
> > 	indice(1)=jj;
> > 	indice(2)=kk;
> > 	indice(3)=ll;
> > 	indice(4)=mm;
> > 	indice(5)=nn;
> >
> > 	indice.Print();
> >
> > 	TMatrixRow(combi,0)=indice;  // this is line 29
> >
> > 	combi.Print();
> > 	pippo = 0;
> >       }
> >     else
> >       kk=kk+1;
> >
> >   }
> >
> > }
> >
> > If kk is greater than the starting jj (i.e. 2 in the example), the program
> > runs. If I set kk=2 the program won't run. The output is the following:
> >
> > Error: improper lvalue FILE:prova3.C LINE:29
> > *** Interpreter error recovered ***
> >
> > It seems that if the conditions is satisfied at least once then everything
> > is fine. If it's false on the first loop iteration the program exit.
> >
> > Thank for your help
> >   Francesco
> >
> >
>
>



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:24 MET