34 #pragma package(smart_init)
78 for (
int i=0;i<
Dim1;i++)
81 for (
int j=0;j<
Dim2;j++)
89 if (prscal<zero && prscal.
get_fabs()>c) prscal= -1.;
90 if (prscal>zero && prscal.
get_fabs()>c) prscal= 1.;
91 if (prscal<zero && prscal.
get_fabs()<c) prscal= 0.;
92 if (prscal>zero && prscal.
get_fabs()<c) prscal= 0.;
113 for (
int i=0;i<
Dim1;i++)
116 for (
int j=0;j<
Dim2;j++)
157 for (
int i=0;i<
Dim1;i++)
159 for (
int j=0;j<
Dim2;j++)
170 if (
this==&ot)
return *this ;
178 for (
int i=0;i<
Dim1;i++) {
179 for (
int j=0;j<
Dim2;j++) {
198 if (val1==val2)
continue;
210 for (
int i=0;i<
Dim1;i++)
220 if (
data[i*
Dim2+j].get_fabs()<=prciseion)
234 if (
data[i*
Dim2+j].get_fabs()<=prciseion)
262 std::vector<int> check;
267 std::vector<double2> lig1;
268 for (
int ix1=0;ix1<
Dim2;ix1++) lig1.insert(lig1.end(),
data[i*
Dim2+ix1]);
270 for (
int j=0;j<
Dim2;j++)
275 std::vector<int>trouve;
276 std::vector<double2>valeur;
277 std::vector<double2> lig2;
278 for (
int ix2=0;ix2<
Dim2;ix2++) lig2.insert(lig2.end(),tns(j,ix2));
279 for (
int r=0;r<
Dim2;r++)
286 for (
int s=0;s<
Dim2;s++)
292 if (val==vall&&!
existe(trouve,s,indx1))
294 trouve.insert(trouve.end(),s);
295 valeur.insert(valeur.end(),val);
302 int t_trouve=trouve.size();
305 check.insert(check.end(),j);
314 int t_chek=check.size();
315 if (t_chek==
Dim1)
return 1;
326 for (
unsigned int i=0;i<vct.size();i++)
348 res(i,j)=ot1(i,j)+ot2(i,j);
365 res[i]=
res[i]+ot1(i,j)+v[j];
406 if (
Dim1!=4)
return TMP;
407 if (
Dim2!=4)
return TMP;
413 OT_VECTEUR_4DD x4((*
this)(0,3)/(*
this)(3,3),(*
this)(1,3)/(*
this)(3,3),(*
this)(2,3)/(*
this)(3,3),un);
414 TMP(0,0)=(*this)(0,0);
415 TMP(1,0)=(*this)(0,1);
416 TMP(2,0)=(*this)(0,2);
418 TMP(0,1)=(*this)(1,0);
419 TMP(1,1)=(*this)(1,1);
420 TMP(2,1)=(*this)(1,2);
422 TMP(0,2)=(*this)(2,0);
423 TMP(1,2)=(*this)(2,1);
424 TMP(2,2)=(*this)(2,2);
435 double2 zero(0.),eps(1e-14),un(1.);
440 for (
int i=0;i<n;i++)
441 for (
int j=0;j<n;j++)
442 tinv(i,j)=(*this)(i,j);
444 for (
int l=0;l<n;l++)
447 for (
int k=0;k<n;k++)
448 dd=dd+tinv(l,k)*tinv(l,k);
453 std::vector<int> j(10000);
455 for (
int l=0;l<n;l++)
457 for (
int l=0;l<n;l++)
461 for (
int k=l;k<n;k++)
473 for (
int k=0;k<n;k++)
482 for (
int m=0;
m<n;
m++)
483 tinv(l,
m)=tinv(l,
m)/cc;
484 for (
int m=0;
m<n;
m++)
491 for (
int k=0;k<n;k++)
492 tinv(
m,k)=tinv(
m,k)-cc*tinv(l,k);
497 for (
int l=0;l<n;l++)
512 for (
int k=0;k<n;k++)
528 for (
int i=0;i<
Dim1;i++) {
529 for (
int j=0;j<
Dim2;j++)
531 TMP(j,i)=(*this)(i,j);
545 for (
int i=0;i<dim1;i++)
547 for (
int j=0;j<dim2;j++)
549 for (
int k=0;k<dim3;k++)
550 TMP(i,j)=TMP(i,j)+ot1(i,k)*ot2(k,j);
562 if (dim11!=dim21)
return 0.;
563 if (dim12!=dim22)
return 0.;
566 for (
int i=0;i<dim11;i++)
567 for (
int j=0;j<dim12;j++)
568 res=
res+ot1(i,j)*ot2(i,j);
577 for (
int i=0;i<4;i++)
579 TMP[i]=TMP[i]+ot1(i,0)*ot2[0]+ot1(i,1)*ot2[1]+ot1(i,2)*ot2[2]+ot1(i,3)*ot2[3];
589 for (
int i=0;i<3;i++)
591 TMP[i]=TMP[i]+ot1(i,0)*ot2[0]+ot1(i,1)*ot2[1]+ot1(i,2)*ot2[2];
597 os<<
"------------------------------------------------------------------------------------"<<std::endl;
599 os<<
"------------------------------------------------------------------------------------"<<std::endl;
602 os<<std::setw(18)<<tns(i,j);
606 os<<
"------------------------------------------------------------------------------------"<<std::endl;
615 static const int ITMAX=50;
617 int n1=n-1,n2=1/(n*n),ip1,iq1;
618 double2 tresh,theta,tau,t,sm,s,h,g,c;
622 for (
int ip=0;ip<n;ip++)
624 for (
int iq=0;iq<n;iq++)
628 b[(
unsigned int)ip]=d[(
unsigned int)ip]=
a(ip,ip);
629 z[(
unsigned int)ip]=0.0;
632 for (
int i=1;i<=ITMAX;i++)
635 for (
int ip=0;ip<n1;ip++)
636 for (
int iq=ip+1;iq<n;iq++)
637 sm =sm+(
a(ip,iq)).get_fabs();
644 for (
int ip=0;ip<n1;ip++)
645 for (
int iq=ip+1;iq<n;iq++)
647 g=100*(
a(ip,iq)).get_fabs();
648 if (i>4&&((d[(
unsigned int)ip]+g).get_fabs()==d[(
unsigned int)ip].get_fabs())&&((d[(
unsigned int)iq])+g).get_fabs()==d[(
unsigned int)iq].get_fabs())
650 else if ((
a(ip,iq)).get_fabs()>tresh)
652 h=d[(
unsigned int)iq]-d[(
unsigned int)ip];
653 if (((h).get_fabs()+g)==(h).get_fabs())
657 theta=0.5*h/
a(ip,iq);
658 t=1.0/((theta).get_fabs()+
sqrt(1.0+theta*theta));
659 if (theta<zro)t=zro-t;
665 z[(
unsigned int)ip]=z[(
unsigned int)ip]-h;
666 z[(
unsigned int)iq]=z[(
unsigned int)iq]+h;
667 d[(
unsigned int)ip]=d[(
unsigned int)ip]-h;
668 d[(
unsigned int)iq]=d[(
unsigned int)iq]+h;
672 for (
int j=0;j<=ip1;j++)
676 a(j,ip)=g-s*(h+g*tau);
677 a(j,iq)=h+s*(g-h*tau);
679 for (
int j=ip+1;j<=iq1;j++)
683 a(ip,j)=g-s*(h+g*tau);
684 a(j,iq)=h+s*(g-h*tau);
686 for (
int j=iq+1;j<n;j++)
690 a(ip,j)=g-s*(h+g*tau);
691 a(iq,j)=h+s*(g-h*tau);
693 for (
int j=0;j<n;j++)
697 v(j,ip)=g-s*(h+g*tau);
698 v(j,iq)=h+s*(g-h*tau);
703 for (
int ip=0;ip<n;ip++)
705 b[(
unsigned int)ip]=b[(
unsigned int)ip]+z[(
unsigned int)ip];
706 d[(
unsigned int)ip]=b[(
unsigned int)ip];
707 z[(
unsigned int)ip]=0.0;
726 for (
int i=0;i<list1.size();i++)
733 for (
int k=0;k< list2.size();k++)
738 prcc =prcc/val2.
get_x();
739 if ( fabs(prcc)<prc) {
740 indx.insert(indx.end(),k);
750 for (
int r=0;r<list2.size();r++)
753 for (
int j=0;j<indx.size();j++)
765 prcc =prcc/vval2.
get_x();
767 if (fabs(prcc)<prc&&!exist)
769 indx.insert(indx.end(),r);
779 if (compt==list1.size())
return 1;