Changeset 3572 in Sophya for trunk/SophyaPI/PIext/pawexecut.cc


Ignore:
Timestamp:
Feb 7, 2009, 10:50:34 PM (17 years ago)
Author:
cmv
Message:

char* -> const char* pour regler les problemes de deprecated string const... + comparaison unsigned signed + suppression EVOL_PLANCK rz+cmv 07/02/2009

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pawexecut.cc

    r3551 r3572  
    2323#include "pihisto.h"
    2424
    25 #ifdef SANS_EVOLPLANCK
    26 #include "cvector.h"
    27 #include "matrix.h"
    28 #else
    2925#include "tmatrix.h"
    3026#include "tvector.h"
    31 #endif
    3227
    3328/* Reza + cmv  13/10/99 */
     
    421416string ctyp = typeid(*mobj).name();
    422417
    423 #ifdef SANS_EVOLPLANCK
    424 if(typeid(*mobj)==typeid(Vector))       {Vector*  ob=(Vector*) mobj; ob->Zero();}
    425 else if(typeid(*mobj)==typeid(Matrix))  {Matrix*  ob=(Matrix*) mobj; ob->Zero();}
    426 #else
    427418 if(typeid(*mobj)==typeid(Vector))       {Vector*  ob=(Vector*) mobj; (*ob) = 0.; }
    428419// ob->DataBlock().Reset(0.);}
    429420 else if(typeid(*mobj)==typeid(Matrix))   {Matrix*  ob=(Matrix*) mobj; (*ob) = 0.; }
    430421//ob->DataBlock().Reset(0.);}
    431 #endif
    432422else if(typeid(*mobj)==typeid(Histo))    {Histo* ob=(Histo*)  mobj; ob->Zero();}
    433423else if(typeid(*mobj)==typeid(HProf))    {HProf* ob=(HProf*)  mobj; ob->Zero();}
     
    701691  }
    702692}   // fin du try
    703 #ifdef SANS_EVOLPLANCK
    704 CATCH(merr) {
    705   fflush(stdout); cout<<endl; cerr<<endl;
    706   string es = PeidaExc(merr);
    707   cerr<<"Services2NObjMgr::ComputeExpressions()  Exception :"<<merr<<es;
    708 } ENDTRY;
    709 #else
    710693catch ( PException exc ) {
    711694  fflush(stdout); cout<<endl; cerr<<endl;
    712695  cerr<<"Services2NObjMgr::ComputeExpressions()  Exception :"<<exc.Msg()<<endl;
    713696}
    714 #endif
    715697
    716698if(adel) delete objnt;
     
    13801362r_8 norm=-1.;
    13811363if(tokens.size()>=2) norm = atof(tokens[1].c_str());
    1382 #ifdef SANS_EVOLPLANCK
    1383 Vector* v = dynamic_cast<Vector*>(mobj);
    1384 #else
     1364
    13851365TVector<r_8>* v = dynamic_cast<TVector<r_8>*>(mobj);
    1386 #endif
    13871366
    13881367if(!v)
     
    13901369  return;}
    13911370
    1392 #ifdef SANS_EVOLPLANCK
    1393 uint_4 n = v->NElts();
    1394 #else
    13951371uint_4 n = v->Size();
    1396 #endif
    13971372
    13981373if(n==0)
     
    15071482if(tokens.size()>=2) deriv_option = atoi(tokens[1].c_str());
    15081483
    1509 #ifdef SANS_EVOLPLANCK
    1510 Vector* v = dynamic_cast<Vector*>(mobj);
    1511 #else
    15121484TVector<r_8>* v = dynamic_cast<TVector<r_8>*>(mobj);
    1513 #endif
    15141485
    15151486if(!v)
     
    15171488  return;}
    15181489
    1519 
    1520 #ifdef SANS_EVOLPLANCK
    1521 uint_4 n = v->NElts();
    1522 #else
    15231490uint_4 n = v->Size();
    1524 #endif
    15251491
    15261492if(n==0)
     
    15291495if(n<=1) return;
    15301496
    1531 #ifdef SANS_EVOLPLANCK
    1532 Vector vsave(*v);
    1533 #else
    15341497TVector<r_8> vsave(*v,false);
    1535 #endif
    15361498
    15371499if(deriv_option<0) {
     
    17421704  Vector* h3 = NULL;
    17431705  if( mobjh3 == NULL ) {  // l'objet n'existe pas, on le cree
    1744 #ifdef SANS_EVOLPLANCK
    1745     h3 = new Vector(*h1);
    1746 #else
    17471706    h3 = new Vector(*h1,false);
    1748 #endif
    17491707    *h3 = 0.; omg.AddObj(h3,h3name); mobjh3 = omg.GetObj(h3name);
    17501708  }
     
    17581716  if( oper[0]=='+')      *h3 = *h1 + *h2;
    17591717  else if( oper[0]=='-') *h3 = *h1 - *h2;
    1760 #ifdef SANS_EVOLPLANCK
    1761   else if(oper[0]=='*' || oper[0]=='/')
    1762     cout<<"PAWExecutor::h_oper Error: operation "<<oper[0]
    1763         <<" not implemented for Vector in Peida"<<endl;
    1764 #else
    17651718  else if( oper[0]=='*') {h3->Clone(*h1); h3->MulElt(*h2,*h3);}
    17661719  else if( oper[0]=='/') {h3->Clone(*h1); h3->DivElt(*h2,*h3,false,true);}
    1767 #endif
    17681720
    17691721// Operations on Matrix
     
    17811733  Matrix* h3 = NULL;
    17821734  if( mobjh3 == NULL ) {  // l'objet n'existe pas, on le cree
    1783 #ifdef SANS_EVOLPLANCK
    1784     h3 = new Matrix(*h1);
    1785 #else
    17861735    h3 = new Matrix(*h1,false);
    1787 #endif
    17881736    *h3 = 0.; omg.AddObj(h3,h3name); mobjh3 = omg.GetObj(h3name);
    17891737  }
     
    17981746  if( oper[0]=='+')      *h3 = *h1 + *h2;
    17991747  else if( oper[0]=='-') *h3 = *h1 - *h2;
    1800 #ifdef SANS_EVOLPLANCK
    1801   else if(oper[0]=='*' || oper[0]=='/')
    1802     cout<<"PAWExecutor::h_oper Error: operation "<<oper[0]
    1803         <<" not implemented for Vector in Peida"<<endl;
    1804 #else
    18051748  else if( oper[0]=='*') {h3->Clone(*h1); h3->MulElt(*h2,*h3);}
    18061749  else if( oper[0]=='/') {h3->Clone(*h1); h3->DivElt(*h2,*h3,false,true);}
    1807 #endif
    18081750
    18091751// Doesn't work for other objects
Note: See TracChangeset for help on using the changeset viewer.