// File Automatically generated by eLiSe
#include "StdAfx.h"
#include "cREgDistDxDy_Ebner.h"


cREgDistDxDy_Ebner::cREgDistDxDy_Ebner():
    cElCompiledFonc(2)
{
   AddIntRef (cIncIntervale("Intr",0,15));
   Close(false);
}



void cREgDistDxDy_Ebner::ComputeVal()
{
   double tmp0_ = mLocEbner_State_0_0 * mLocEbner_State_0_0;
   double tmp1_ = tmp0_ * 0.666667;
   double tmp2_ = mLocRegDistxy1_y * mLocRegDistxy1_y;
   double tmp3_ = tmp2_ - tmp1_;
   double tmp4_ = mLocRegDistxy1_x * mLocRegDistxy1_x;
   double tmp5_ = tmp4_ - tmp1_;
   double tmp6_ = mCompCoord[3];
   double tmp7_ = 1 + tmp6_;
   double tmp8_ = mCompCoord[4];
   double tmp9_ = mCompCoord[5];
   double tmp10_ = tmp9_ * 2;
   double tmp11_ = mCompCoord[6];
   double tmp12_ = mCompCoord[7];
   double tmp13_ = mCompCoord[9];
   double tmp14_ = mLocRegDistxy2_y * mLocRegDistxy2_y;
   double tmp15_ = tmp14_ - tmp1_;
   double tmp16_ = mCompCoord[11];
   double tmp17_ = mLocRegDistxy2_x * mLocRegDistxy2_x;
   double tmp18_ = tmp17_ - tmp1_;
   double tmp19_ = mCompCoord[13];
   double tmp20_ = mLocRegDistxy3_y * mLocRegDistxy3_y;
   double tmp21_ = tmp20_ - tmp1_;
   double tmp22_ = mLocRegDistxy3_x * mLocRegDistxy3_x;
   double tmp23_ = tmp22_ - tmp1_;
   double tmp24_ = mLocRegDistxy4_y * mLocRegDistxy4_y;
   double tmp25_ = tmp24_ - tmp1_;
   double tmp26_ = mLocRegDistxy4_x * mLocRegDistxy4_x;
   double tmp27_ = tmp26_ - tmp1_;
   double tmp28_ = mLocRegDistxy1_x * mLocRegDistxy1_y;
   double tmp29_ = 1 - tmp6_;
   double tmp30_ = mLocRegDistxy2_x * mLocRegDistxy2_y;
   double tmp31_ = tmp11_ * 2;
   double tmp32_ = mCompCoord[8];
   double tmp33_ = mCompCoord[10];
   double tmp34_ = mCompCoord[12];
   double tmp35_ = mCompCoord[14];
   double tmp36_ = mLocRegDistxy3_x * mLocRegDistxy3_y;
   double tmp37_ = mLocRegDistxy4_x * mLocRegDistxy4_y;

  mVal[0] = (((tmp7_) * mLocRegDistxy1_x + tmp8_ * mLocRegDistxy1_y) - tmp10_ * (tmp5_) + tmp11_ * tmp28_ + tmp12_ * (tmp3_) + tmp13_ * mLocRegDistxy1_x * (tmp3_) + tmp16_ * mLocRegDistxy1_y * (tmp5_) + tmp19_ * (tmp5_) * (tmp3_) + ((tmp7_) * mLocRegDistxy2_x + tmp8_ * mLocRegDistxy2_y) - tmp10_ * (tmp18_) + tmp11_ * tmp30_ + tmp12_ * (tmp15_) + tmp13_ * mLocRegDistxy2_x * (tmp15_) + tmp16_ * mLocRegDistxy2_y * (tmp18_) + tmp19_ * (tmp18_) * (tmp15_)) - (((tmp7_) * mLocRegDistxy3_x + tmp8_ * mLocRegDistxy3_y) - tmp10_ * (tmp23_) + tmp11_ * tmp36_ + tmp12_ * (tmp21_) + tmp13_ * mLocRegDistxy3_x * (tmp21_) + tmp16_ * mLocRegDistxy3_y * (tmp23_) + tmp19_ * (tmp23_) * (tmp21_) + ((tmp7_) * mLocRegDistxy4_x + tmp8_ * mLocRegDistxy4_y) - tmp10_ * (tmp27_) + tmp11_ * tmp37_ + tmp12_ * (tmp25_) + tmp13_ * mLocRegDistxy4_x * (tmp25_) + tmp16_ * mLocRegDistxy4_y * (tmp27_) + tmp19_ * (tmp27_) * (tmp25_));

  mVal[1] = (((tmp29_) * mLocRegDistxy1_y + tmp8_ * mLocRegDistxy1_x + tmp9_ * tmp28_) - tmp31_ * (tmp3_) + tmp32_ * (tmp5_) + tmp33_ * mLocRegDistxy1_y * (tmp5_) + tmp34_ * mLocRegDistxy1_x * (tmp3_) + tmp35_ * (tmp5_) * (tmp3_) + ((tmp29_) * mLocRegDistxy2_y + tmp8_ * mLocRegDistxy2_x + tmp9_ * tmp30_) - tmp31_ * (tmp15_) + tmp32_ * (tmp18_) + tmp33_ * mLocRegDistxy2_y * (tmp18_) + tmp34_ * mLocRegDistxy2_x * (tmp15_) + tmp35_ * (tmp18_) * (tmp15_)) - (((tmp29_) * mLocRegDistxy3_y + tmp8_ * mLocRegDistxy3_x + tmp9_ * tmp36_) - tmp31_ * (tmp21_) + tmp32_ * (tmp23_) + tmp33_ * mLocRegDistxy3_y * (tmp23_) + tmp34_ * mLocRegDistxy3_x * (tmp21_) + tmp35_ * (tmp23_) * (tmp21_) + ((tmp29_) * mLocRegDistxy4_y + tmp8_ * mLocRegDistxy4_x + tmp9_ * tmp37_) - tmp31_ * (tmp25_) + tmp32_ * (tmp27_) + tmp33_ * mLocRegDistxy4_y * (tmp27_) + tmp34_ * mLocRegDistxy4_x * (tmp25_) + tmp35_ * (tmp27_) * (tmp25_));

}


void cREgDistDxDy_Ebner::ComputeValDeriv()
{
   double tmp0_ = mLocEbner_State_0_0 * mLocEbner_State_0_0;
   double tmp1_ = tmp0_ * 0.666667;
   double tmp2_ = mLocRegDistxy1_y * mLocRegDistxy1_y;
   double tmp3_ = tmp2_ - tmp1_;
   double tmp4_ = mLocRegDistxy1_x * mLocRegDistxy1_x;
   double tmp5_ = tmp4_ - tmp1_;
   double tmp6_ = mCompCoord[3];
   double tmp7_ = 1 + tmp6_;
   double tmp8_ = mCompCoord[4];
   double tmp9_ = mCompCoord[5];
   double tmp10_ = tmp9_ * 2;
   double tmp11_ = mCompCoord[6];
   double tmp12_ = mCompCoord[7];
   double tmp13_ = mCompCoord[9];
   double tmp14_ = mLocRegDistxy2_y * mLocRegDistxy2_y;
   double tmp15_ = tmp14_ - tmp1_;
   double tmp16_ = mCompCoord[11];
   double tmp17_ = mLocRegDistxy2_x * mLocRegDistxy2_x;
   double tmp18_ = tmp17_ - tmp1_;
   double tmp19_ = mCompCoord[13];
   double tmp20_ = mLocRegDistxy3_y * mLocRegDistxy3_y;
   double tmp21_ = tmp20_ - tmp1_;
   double tmp22_ = mLocRegDistxy3_x * mLocRegDistxy3_x;
   double tmp23_ = tmp22_ - tmp1_;
   double tmp24_ = mLocRegDistxy4_y * mLocRegDistxy4_y;
   double tmp25_ = tmp24_ - tmp1_;
   double tmp26_ = mLocRegDistxy4_x * mLocRegDistxy4_x;
   double tmp27_ = tmp26_ - tmp1_;
   double tmp28_ = mLocRegDistxy1_x * mLocRegDistxy1_y;
   double tmp29_ = mLocRegDistxy2_x * mLocRegDistxy2_y;
   double tmp30_ = mLocRegDistxy3_x * mLocRegDistxy3_y;
   double tmp31_ = mLocRegDistxy4_x * mLocRegDistxy4_y;
   double tmp32_ = 1 - tmp6_;
   double tmp33_ = tmp11_ * 2;
   double tmp34_ = mCompCoord[8];
   double tmp35_ = mCompCoord[10];
   double tmp36_ = mCompCoord[12];
   double tmp37_ = mCompCoord[14];
   double tmp38_ = -(1);
   double tmp39_ = mLocRegDistxy1_x + mLocRegDistxy2_x;
   double tmp40_ = mLocRegDistxy3_x + mLocRegDistxy4_x;
   double tmp41_ = (tmp39_) - (tmp40_);
   double tmp42_ = tmp28_ + tmp29_;
   double tmp43_ = tmp30_ + tmp31_;
   double tmp44_ = (tmp42_) - (tmp43_);
   double tmp45_ = mLocRegDistxy1_y * (tmp5_);
   double tmp46_ = mLocRegDistxy2_y * (tmp18_);
   double tmp47_ = tmp45_ + tmp46_;
   double tmp48_ = mLocRegDistxy3_y * (tmp23_);
   double tmp49_ = mLocRegDistxy4_y * (tmp27_);
   double tmp50_ = tmp48_ + tmp49_;
   double tmp51_ = (tmp47_) - (tmp50_);
   double tmp52_ = mLocRegDistxy1_x * (tmp3_);
   double tmp53_ = mLocRegDistxy2_x * (tmp15_);
   double tmp54_ = tmp52_ + tmp53_;
   double tmp55_ = mLocRegDistxy3_x * (tmp21_);
   double tmp56_ = mLocRegDistxy4_x * (tmp25_);
   double tmp57_ = tmp55_ + tmp56_;
   double tmp58_ = (tmp54_) - (tmp57_);
   double tmp59_ = (tmp5_) * (tmp3_);
   double tmp60_ = (tmp18_) * (tmp15_);
   double tmp61_ = tmp59_ + tmp60_;
   double tmp62_ = (tmp23_) * (tmp21_);
   double tmp63_ = (tmp27_) * (tmp25_);
   double tmp64_ = tmp62_ + tmp63_;
   double tmp65_ = (tmp61_) - (tmp64_);

  mVal[0] = (((tmp7_) * mLocRegDistxy1_x + tmp8_ * mLocRegDistxy1_y) - tmp10_ * (tmp5_) + tmp11_ * tmp28_ + tmp12_ * (tmp3_) + tmp13_ * mLocRegDistxy1_x * (tmp3_) + tmp16_ * mLocRegDistxy1_y * (tmp5_) + tmp19_ * (tmp5_) * (tmp3_) + ((tmp7_) * mLocRegDistxy2_x + tmp8_ * mLocRegDistxy2_y) - tmp10_ * (tmp18_) + tmp11_ * tmp29_ + tmp12_ * (tmp15_) + tmp13_ * mLocRegDistxy2_x * (tmp15_) + tmp16_ * mLocRegDistxy2_y * (tmp18_) + tmp19_ * (tmp18_) * (tmp15_)) - (((tmp7_) * mLocRegDistxy3_x + tmp8_ * mLocRegDistxy3_y) - tmp10_ * (tmp23_) + tmp11_ * tmp30_ + tmp12_ * (tmp21_) + tmp13_ * mLocRegDistxy3_x * (tmp21_) + tmp16_ * mLocRegDistxy3_y * (tmp23_) + tmp19_ * (tmp23_) * (tmp21_) + ((tmp7_) * mLocRegDistxy4_x + tmp8_ * mLocRegDistxy4_y) - tmp10_ * (tmp27_) + tmp11_ * tmp31_ + tmp12_ * (tmp25_) + tmp13_ * mLocRegDistxy4_x * (tmp25_) + tmp16_ * mLocRegDistxy4_y * (tmp27_) + tmp19_ * (tmp27_) * (tmp25_));

  mCompDer[0][0] = 0;
  mCompDer[0][1] = 0;
  mCompDer[0][2] = 0;
  mCompDer[0][3] = tmp41_;
  mCompDer[0][4] = (mLocRegDistxy1_y + mLocRegDistxy2_y) - (mLocRegDistxy3_y + mLocRegDistxy4_y);
  mCompDer[0][5] = (-(2 * (tmp5_)) + -(2 * (tmp18_))) - (-(2 * (tmp23_)) + -(2 * (tmp27_)));
  mCompDer[0][6] = tmp44_;
  mCompDer[0][7] = (tmp3_ + tmp15_) - (tmp21_ + tmp25_);
  mCompDer[0][8] = 0;
  mCompDer[0][9] = tmp58_;
  mCompDer[0][10] = 0;
  mCompDer[0][11] = tmp51_;
  mCompDer[0][12] = 0;
  mCompDer[0][13] = tmp65_;
  mCompDer[0][14] = 0;
  mVal[1] = (((tmp32_) * mLocRegDistxy1_y + tmp8_ * mLocRegDistxy1_x + tmp9_ * tmp28_) - tmp33_ * (tmp3_) + tmp34_ * (tmp5_) + tmp35_ * mLocRegDistxy1_y * (tmp5_) + tmp36_ * mLocRegDistxy1_x * (tmp3_) + tmp37_ * (tmp5_) * (tmp3_) + ((tmp32_) * mLocRegDistxy2_y + tmp8_ * mLocRegDistxy2_x + tmp9_ * tmp29_) - tmp33_ * (tmp15_) + tmp34_ * (tmp18_) + tmp35_ * mLocRegDistxy2_y * (tmp18_) + tmp36_ * mLocRegDistxy2_x * (tmp15_) + tmp37_ * (tmp18_) * (tmp15_)) - (((tmp32_) * mLocRegDistxy3_y + tmp8_ * mLocRegDistxy3_x + tmp9_ * tmp30_) - tmp33_ * (tmp21_) + tmp34_ * (tmp23_) + tmp35_ * mLocRegDistxy3_y * (tmp23_) + tmp36_ * mLocRegDistxy3_x * (tmp21_) + tmp37_ * (tmp23_) * (tmp21_) + ((tmp32_) * mLocRegDistxy4_y + tmp8_ * mLocRegDistxy4_x + tmp9_ * tmp31_) - tmp33_ * (tmp25_) + tmp34_ * (tmp27_) + tmp35_ * mLocRegDistxy4_y * (tmp27_) + tmp36_ * mLocRegDistxy4_x * (tmp25_) + tmp37_ * (tmp27_) * (tmp25_));

  mCompDer[1][0] = 0;
  mCompDer[1][1] = 0;
  mCompDer[1][2] = 0;
  mCompDer[1][3] = (tmp38_ * mLocRegDistxy1_y + tmp38_ * mLocRegDistxy2_y) - (tmp38_ * mLocRegDistxy3_y + tmp38_ * mLocRegDistxy4_y);
  mCompDer[1][4] = tmp41_;
  mCompDer[1][5] = tmp44_;
  mCompDer[1][6] = (-(2 * (tmp3_)) + -(2 * (tmp15_))) - (-(2 * (tmp21_)) + -(2 * (tmp25_)));
  mCompDer[1][7] = 0;
  mCompDer[1][8] = (tmp5_ + tmp18_) - (tmp23_ + tmp27_);
  mCompDer[1][9] = 0;
  mCompDer[1][10] = tmp51_;
  mCompDer[1][11] = 0;
  mCompDer[1][12] = tmp58_;
  mCompDer[1][13] = 0;
  mCompDer[1][14] = tmp65_;
}


void cREgDistDxDy_Ebner::ComputeValDerivHessian()
{
  ELISE_ASSERT(false,"Foncteur cREgDistDxDy_Ebner Has no Der Sec");
}

void cREgDistDxDy_Ebner::SetEbner_State_0_0(double aVal){ mLocEbner_State_0_0 = aVal;}
void cREgDistDxDy_Ebner::SetRegDistxy1_x(double aVal){ mLocRegDistxy1_x = aVal;}
void cREgDistDxDy_Ebner::SetRegDistxy1_y(double aVal){ mLocRegDistxy1_y = aVal;}
void cREgDistDxDy_Ebner::SetRegDistxy2_x(double aVal){ mLocRegDistxy2_x = aVal;}
void cREgDistDxDy_Ebner::SetRegDistxy2_y(double aVal){ mLocRegDistxy2_y = aVal;}
void cREgDistDxDy_Ebner::SetRegDistxy3_x(double aVal){ mLocRegDistxy3_x = aVal;}
void cREgDistDxDy_Ebner::SetRegDistxy3_y(double aVal){ mLocRegDistxy3_y = aVal;}
void cREgDistDxDy_Ebner::SetRegDistxy4_x(double aVal){ mLocRegDistxy4_x = aVal;}
void cREgDistDxDy_Ebner::SetRegDistxy4_y(double aVal){ mLocRegDistxy4_y = aVal;}



double * cREgDistDxDy_Ebner::AdrVarLocFromString(const std::string & aName)
{
   if (aName == "Ebner_State_0_0") return & mLocEbner_State_0_0;
   if (aName == "RegDistxy1_x") return & mLocRegDistxy1_x;
   if (aName == "RegDistxy1_y") return & mLocRegDistxy1_y;
   if (aName == "RegDistxy2_x") return & mLocRegDistxy2_x;
   if (aName == "RegDistxy2_y") return & mLocRegDistxy2_y;
   if (aName == "RegDistxy3_x") return & mLocRegDistxy3_x;
   if (aName == "RegDistxy3_y") return & mLocRegDistxy3_y;
   if (aName == "RegDistxy4_x") return & mLocRegDistxy4_x;
   if (aName == "RegDistxy4_y") return & mLocRegDistxy4_y;
   return 0;
}


cElCompiledFonc::cAutoAddEntry cREgDistDxDy_Ebner::mTheAuto("cREgDistDxDy_Ebner",cREgDistDxDy_Ebner::Alloc);


cElCompiledFonc *  cREgDistDxDy_Ebner::Alloc()
{  return new cREgDistDxDy_Ebner();
}


