quad_supp_func< K > Class Template Reference

#include <qsc_approximation_fcts.hpp>

List of all members.

Public Member Functions


Detailed Description

template<class K>
class mmx::shape::quad_supp_func< K >

Definition at line 1046 of file qsc_approximation_fcts.hpp.


Constructor & Destructor Documentation

quad_supp_func (  )  [inline]

Definition at line 1049 of file qsc_approximation_fcts.hpp.

01049 {} ;

quad_supp_func ( support_function< K >  h,
normal_vector< K >  n 
) [inline]

Definition at line 1072 of file qsc_approximation_fcts.hpp.

References support_function< K >::eval(), support_function< K >::eval_diff(), normal_vector< K >::eval_unit(), mmx::linear::LUsolve(), normal_vector< K >::middle(), mmx::shape::N, mmx::pow(), and VECT.

01073 {
01074   // mmout << "b\n";
01075   VECT N[3];
01076   N[0]=n.eval_unit(0);
01077   N[1]=n.eval_unit(1);
01078   N[2]=n.middle();
01079   // mmout << "c\n";
01080   K Vh[5]; // the values of h and its derivative at the control points
01081   K Mq[25]; // the values of q and its derivative at the control points (expressed in the base of the unknown we want to find
01082   for (int i=0; i<3; i++) 
01083     {
01084       VECT nn=N[i]; // 3 first lines : values at n0, n1, n1/2 
01085       Vh[i]=h.eval(nn);
01086       Mq[5*i]=std::pow(nn[0],2); // x^2
01087       Mq[5*i+1]=std::pow(nn[1],2); // y^2
01088       Mq[5*i+2]=nn[0]*nn[1]; // x*y CHANGE *2 ??
01089       Mq[5*i+3]=nn[0]; // x
01090       Mq[5*i+4]=nn[1]; // y
01091     }
01092   // mmout << "d\n";
01093   for (int i=3; i<5; i++) 
01094     {
01095       VECT nn=N[i-3]; // 2 last lines : derivative at n0, n1
01096       Vh[i]=h.eval_diff(nn);
01097       Mq[5*i+0]=-2*nn[0]*nn[1]; // -2*x*y
01098       Mq[5*i+1]=2*nn[0]*nn[1]; // 2*x*y
01099       Mq[5*i+2]=(std::pow(nn[0],2)-std::pow(nn[1],2)); // x^2-y^2 CHANGE *2 ?
01100       Mq[5*i+3]=-nn[1]; // -y
01101       Mq[5*i+4]=nn[0]; // x
01102     }
01103 
01104   linear::LUsolve(q,Mq,Vh,5); // Mq*q=Vh ; size 5
01105   // output : q[0]*x^2+q[1]*y^2+q[2]*x*y+q[3]*x+q[4]*y
01106 
01107   std::cout << "Valeur de Vh et Mq" << "\n";
01108   for (int i=0; i<5; i++){
01109     std::cout << Vh[i] << " = ";
01110     for (int j=0; j<5; j++)
01111       std::cout << Mq[5*i+j] << " ";
01112     std::cout << "\n";}
01113     std::cout << "\n";
01114 
01115 }


Member Function Documentation

Seq< K > Cq (  )  [inline]

Definition at line 1059 of file qsc_approximation_fcts.hpp.

01060 {
01061   // mmout << "z\n";
01062   Seq<K> Q;
01063   // mmout << Q << "\n";
01064   for (int i=0; i<5; i++) 
01065     {
01066       Q << q[i];
01067     }
01068   return Q;
01069 }


The documentation for this class was generated from the following file:

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1