diff --git a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Jet_fitting_operator_leftshift.tex b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Jet_fitting_operator_leftshift.tex new file mode 100644 index 00000000000..1641a2dc0e3 --- /dev/null +++ b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Jet_fitting_operator_leftshift.tex @@ -0,0 +1,50 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: Jet_fitting_operator_leftshift.tex +% +------------------------------------------------------------------------+ +% | 09.02.2006 Marc Pouget and Frédéric Cazals +% | Package: Jet_fitting_3 +% | +\RCSdef{\RCSJetfittingoperatoristreamRev}{$Id$} +\RCSdefDate{\RCSJetfittingoperatoristreamDate}{$Date$} +% | +%%RefPage: end of header, begin of main body +% +------------------------------------------------------------------------+ + + +%\ccHtmlNoClassLinks +\begin{ccRefFunction}{operator<<} +\label{refJet_fitting_operator_leftshift} + +\ccDefinition + +This operator writes the data of the classes +\ccc{Monge_form_condition_numbers} or \ccc{Monge_form} to the output stream +\ccc{out}. The output is in ASCII format. + + +\ccInclude{CGAL/Monge_via_jet_fitting.h} + +\ccGlobalFunction{template +ostream& operator<<( ostream& out, + const Monge_form_condition_numbers& monge_form_cd);} +{Gives the condition number of the matrix involved in the fitting, the +eigenvalues and eigenvectors of the principal componant analysis of +the points used for the fitting} + +\ccGlobalFunction{template +ostream& operator<<( ostream& out, + const Monge_form& monge_form);} +{Gives the Monge coordinate system (the origin and an orthonormal +basis) and the coefficients of the Monge form in this system.} + + +\ccSeeAlso +\ccc{Monge_form_condition_numbers} +\ccc{Monge_form} + +\end{ccRefFunction} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +% EOF +% +------------------------------------------------------------------------+ diff --git a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Lapack.tex b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Lapack.tex index 2456876ffdc..3ab6d5c904f 100644 --- a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Lapack.tex +++ b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Lapack.tex @@ -17,14 +17,10 @@ \ccDefinition -The class \ccRefName\ stores the Monge representation, i.e. the Monge -coordinate system and the coefficients of the Monge form in this -system. The -\ccc{DataKernel} template parameter must be the -same for the classes \ccc{Monge_form} and -\ccc{Monge_via_jet_fitting}. +The class \ccRefName\ provides an algorithm to solve in the least +square sense a linear system. -\ccInclude{CGAL/Monge_via_jet_fitting.h} +\ccInclude{CGAL/Lapack/Linear_algebra_lapack.h} \ccIsModel \ccc{LinAlgTraits} @@ -32,80 +28,26 @@ same for the classes \ccc{Monge_form} and \ccTypes % +-------------------------------------------------------------- %\ccNestedType{TYPE}{some nested types} -\ccTypedef{ typedef typename DataKernel::FT FT; }{} -\ccGlue -\ccTypedef{ typedef typename DataKernel::Point_3 Point_3; }{} -\ccGlue -\ccTypedef{ typedef typename DataKernel::Vector_3 Vector_3;}{} -\ccGlue - - +\ccTypedef{ typedef Lapack_matrix Matrix; }{} \ccCreation % +-------------------------------------------------------------- -\ccCreationVariable{monge_form} %% choose variable name +\ccCreationVariable{lapack} %% choose variable name -\ccConstructor{Monge_form();}{default constructor.} - -\ccAccessFunctions -% +-------------------------------------------------------------- - -\ccMemberFunction{const Point_3 origin_pt();}{Point on the fitted surface where -differential quantities are computed} -\ccGlue -\ccMemberFunction{Point_3& origin_pt();}{} - -The basis \ccc{(d1, d2, n)} is direct orthonormal. -\ccMemberFunction{const Vector_3 d1();}{maximal principal direction} -\ccGlue -\ccMemberFunction{Vector_3& d1(); }{} -\ccMemberFunction{const Vector_3 d2();}{minimal principal direction} -\ccGlue -\ccMemberFunction{Vector_3& d2();}{} -\ccMemberFunction{const Vector_3 n();}{normal direction} -\ccGlue -\ccMemberFunction{Vector_3& n();}{} -\ccMemberFunction{const std::vector coefficients();}{coeff = k1, k2 (principal curvatures); - b0, b1, b2, b3 (third order coefficients); c0, c1, c2, c3, c4 (fourth - order coefficients). If the degree of the Monge representation is 1 there - is no coefficient.} -\ccGlue -\ccMemberFunction{std::vector& coefficients();}{} +\ccConstructor{Lapack();}{default constructor.} \ccOperations % +-------------------------------------------------------------- -\ccMemberFunction{void set_up(int degree);}{Set the number of coefficients according -to the degree of the Monge representation given. The -$(degree+1)(degree+2)/2-4$ coefficients are set to 0.} -\ccMemberFunction{void comply_wrt_given_normal(const Vector_3 given_normal);} -{ change principal basis and Monge coefficients so that the -given\_normal and the Monge normal make an acute angle.\\ If -given\_normal.monge\_normal $< 0$ then change the orientation~: if -$z=g(x,y)$ in the basis (d1,d2,n) then in the basis (d2,d1,-n) -$z=h(x,y)=-g(y,x)$. } -\ccMemberFunction{void dump_verbose(std::ofstream& out_stream);} -{ Outputs the data in a human readable way.} -\ccMemberFunction{void dump_4ogl(std::ofstream& out_stream, const FT scale);} -{ Outputs the data for further visualization with successively~: the -coordinates of m\_origin\_pt, the coordinates of m\_d1 scaled by scale, -the coordinates of m\_d2 scaled by scale, the maximal principal -curvature, the minimal principal curvature.} +\ccMemberFunction{ void solve_ls_svd_algo(Matrix& M, double* B, double &cond_nb); +}{Solve MX=B using SVD and give the condition number of M. The +solution is stored in B.} \ccSeeAlso -\ccc{Monge_via_jet_fitting}, +\ccc{LinAlgTraits}, +\ccc{Lapack_matrix}. %\ccc{some_other_function}. -%\ccExample - - -%\begin{ccExampleCode} -%void your_example_code() { -%} -%\end{ccExampleCode} - -%%% \ccIncludeExampleCode{Jet_fitting_3/Monge_rep.C} - \end{ccRefClass} % +------------------------------------------------------------------------+ diff --git a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Lapack_matrix.tex b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Lapack_matrix.tex new file mode 100644 index 00000000000..e2fb6362874 --- /dev/null +++ b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Lapack_matrix.tex @@ -0,0 +1,67 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: Lapack_matrix.tex +% +------------------------------------------------------------------------+ +% | 09.02.2006 Marc Pouget and Frédéric Cazals +% | Package: Jet_fitting_3 +% | +\RCSdef{\RCSLapack_matrixRev}{$Id$} +\RCSdefDate{\RCSLapack_matrixDate}{$Date$} +% | +%%RefPage: end of header, begin of main body +% +------------------------------------------------------------------------+ + +\begin{ccRefClass}{Lapack_matrix} %%add template arg's if necessary + +%% \ccHtmlCrossLink{} %% add further rules for cross referencing links +%% \ccHtmlIndexC[class]{} %% add further index entries + +\ccDefinition + +The class \ccRefName\ is a wrapper that enables matricial computations +with the algorithm of the class \ccc{Lapack} and usual data access to +its elements. (Note : in clapack matrices are one-dimensional arrays +and elements are column-major ordered) + +\ccInclude{CGAL/Lapack/Linear_algebra_lapack.h} + +\ccIsModel +\ccc{LinAlgTraits::Matrix} + + +\ccCreation +% +-------------------------------------------------------------- +\ccCreationVariable{lapack_matrix} %% choose variable name + +\ccConstructor{Lapack_matrix(size_t n1, size_t n2);} +{Create a matrix with n1 lines and n2 columns} + +\ccAccessFunctions +% +-------------------------------------------------------------- +\ccMemberFunction{const double* matrix();} +{gives access to matrix data usable by clapack. (Note~: in clapack +matrices are one-dimensional arrays and elements are column-major +ordered)} +\ccGlue +\ccMemberFunction{double* matrix(); }{} + + +\ccMemberFunction{void set_elt(size_t i, size_t j, const double value);} +{sets the element at the line i and column j.} +\ccGlue +\ccMemberFunction{double get_elt(size_t i, size_t j);} +{gets the element at the line i and column j.} + + +\ccSeeAlso + +\ccc{LinAlgTraits}, +\ccc{Lapack}. +%\ccc{some_other_function}. + +\end{ccRefClass} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +% EOF +% +------------------------------------------------------------------------+ + diff --git a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_form.tex b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_form.tex index 7635adb8e1a..92e244e01b2 100644 --- a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_form.tex +++ b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_form.tex @@ -1,11 +1,11 @@ % +------------------------------------------------------------------------+ -% | Reference manual page: Monge_rep.tex +% | Reference manual page: Monge_form.tex % +------------------------------------------------------------------------+ % | 09.02.2006 Marc Pouget and Frédéric Cazals % | Package: Jet_fitting_3 % | -\RCSdef{\RCSMongerepRev}{$Id$} -\RCSdefDate{\RCSMongerepDate}{$Date$} +\RCSdef{\RCSMongeformRev}{$Id$} +\RCSdefDate{\RCSMongeformDate}{$Date$} % | %%RefPage: end of header, begin of main body % +------------------------------------------------------------------------+ diff --git a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_form_condition_numbers.tex b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_form_condition_numbers.tex index ea17655f3ba..7fc179fa299 100644 --- a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_form_condition_numbers.tex +++ b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_form_condition_numbers.tex @@ -1,5 +1,5 @@ % +------------------------------------------------------------------------+ -% | Reference manual page: Monge_info.tex +% | Reference manual page: Monge_form_condition_numbers.tex % +------------------------------------------------------------------------+ % | 09.02.2006 Marc Pouget and Frédéric Cazals % | Package: Jet_fitting_3 @@ -11,7 +11,7 @@ % +------------------------------------------------------------------------+ -\begin{ccRefClass}{Monge_info} %% add template arg's if necessary +\begin{ccRefClass}{Monge_form_condition_numbers >} %% add template arg's if necessary %% \ccHtmlCrossLink{} %% add further rules for cross referencing links %% \ccHtmlIndexC[class]{} %% add further index entries @@ -21,43 +21,38 @@ The class \ccRefName\ stores informations on the numerical issues of the computations performed by the class \ccc{Monge_via_jet_fitting}. The \ccc{LocalKernel} template parameter must be the same for the -classes \ccc{Monge_info} and \ccc{Monge_via_jet_fitting}. +classes \ccc{Monge_form_condition_numbers} and \ccc{Monge_via_jet_fitting}. \ccInclude{CGAL/Monge_via_jet_fitting.h} \ccTypes % +-------------------------------------------------------------- -\ccTypedef{ typedef typename LocalKernel::FT LFT;}{} +\ccTypedef{ typedef typename LocalKernel::FT FT;}{} \ccGlue -\ccTypedef{ typedef typename LocalKernel::Vector_3 LVector;}{} +\ccTypedef{ typedef typename LocalKernel::Vector_3 Vector_3;}{} \ccGlue \ccCreation % +-------------------------------------------------------------- -\ccCreationVariable{monge_info} %% choose variable name +\ccCreationVariable{monge_form_condition_numbers} %% choose variable name -\ccConstructor{Monge_info();}{default constructor.} +\ccConstructor{Monge_form_condition_numbers();}{default constructor.} \ccAccessFunctions % +-------------------------------------------------------------- -\ccMemberFunction{const LFT* pca_eigen_vals();}{Eigenvalues of the PCA of the +\ccMemberFunction{const FT* pca_eigen_vals();}{Eigenvalues of the PCA of the input points, sorted in descending order.} \ccGlue -\ccMemberFunction{LFT* pca_eigen_vals();}{} -\ccMemberFunction{const LVector* pca_eigen_vecs();}{Eigenvectors of the PCA +\ccMemberFunction{FT* pca_eigen_vals();}{} +\ccMemberFunction{const Vector_3* pca_eigen_vecs();}{Eigenvectors of the PCA are sorted in accordance.} \ccGlue -\ccMemberFunction{LVector* pca_eigen_vecs();}{} -\ccMemberFunction{const LFT cond_nb();}{Condition number of the least square system.} +\ccMemberFunction{Vector_3* pca_eigen_vecs();}{} +\ccMemberFunction{const FT cond_nb();}{Condition number of the least square system.} \ccGlue -\ccMemberFunction{LFT& cond_nb();}{} +\ccMemberFunction{FT& cond_nb();}{} -\ccOperations - -\ccMethod{void dump_verbose(std::ofstream& out_stream);} - {Outputs the data in a human readable way.} - \ccSeeAlso % +-------------------------------------------------------------- \ccc{Monge_via_jet_fitting}. diff --git a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_via_jet_fitting.tex b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_via_jet_fitting.tex index debae035843..db5ad7e9cd1 100644 --- a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_via_jet_fitting.tex +++ b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/Monge_via_jet_fitting.tex @@ -11,7 +11,7 @@ % +------------------------------------------------------------------------+ -\begin{ccRefClass}{Monge_via_jet_fitting} +\begin{ccRefClass}{Monge_via_jet_fitting, LinAlgTraits = Lapack>} %% add template arg's if necessary %% \ccHtmlCrossLink{} %% add further rules for cross referencing links @@ -25,17 +25,9 @@ through an iterator ---and its past the end, it is assumed the point where the calculation is carried out is the first point provided by the iterator. %% -The results are stored in instances of the classes \ccc{Monge_rep} and -\ccc{Monge_info}, the particular informations returned depending on -the degrees specified for the polynomial fitting and for the Monge -representation. - -%This point is the first point amongst the input points given by two -%iterators on points. -%% -%According to the specified degrees for the polynomial fitting and for -%the Monge representation, it outputs the results through two classes -%\ccc{Monge_rep} and \ccc{Monge_info}. +The results are stored in instances of the classes \ccc{Monge_form} and +\ccc{Monge_form_condition_numbers}, the particular information returned depending on +the degrees specified for the polynomial fitting and for the Monge form. \ccInclude{CGAL/Monge_via_jet_fitting.h} @@ -44,9 +36,9 @@ representation. The class \ccRefName\ has three template parameters. Parameter \ccc{DataKernel} provides the geometric classes and tools corresponding to the input points, and also selected members of the -\ccc{Monge_rep} class. Parameter \ccc{LocalKernel} provides +\ccc{Monge_form} class. Parameter \ccc{LocalKernel} provides the geometric classes and tools required by local -computations. Pparameter \ccc{LinAlgTraits} features the linear +computations. Parameter \ccc{LinAlgTraits} features the linear algebra algorithms required by the fitting method. \ccTypes @@ -59,21 +51,22 @@ algebra algorithms required by the fitting method. \ccTypedef{ typedef typename std::vector::iterator Range_Iterator; }{} \ccGlue -\ccTypedef{ typedef Monge_rep Monge_rep;}{} +\ccTypedef{ typedef Monge_form Monge_form;}{} \ccGlue -\ccTypedef{ typedef Monge_info Monge_info;}{} +\ccTypedef{ typedef Monge_form_condition_numbers Monge_form_condition_numbers;}{} \ccCreation \ccCreationVariable{monge_fitting} %% choose variable name, given by \ccVar \ccConstructor{Monge_via_jet_fitting(Range_Iterator begin, Range_Iterator end, -int d, int dprime, Monge_rep &monge_rep, Monge_info &monge_info);} -{The constructor performs all the computations. The $N$ input points -are given by the \ccc{Range_Iterators}, \ccc{d} is the degree of the +int d, int dprime, Monge_form &monge_form, +Monge_form_condition_numbers &monge_form_condition_numbers);} {The +constructor performs all the computations. The $N$ input points are +given by the \ccc{Range_Iterators}, \ccc{d} is the degree of the fitted polynomial, \ccc{dprime} is the degree of the expected Monge -coefficients, outputs are stored in \ccc{monge_rep} and -\ccc{monge_info}. -\ccPrecond $N \geq N_d=(d+1)(d+2)/2$, $1 \leq d$, $dprime \leq d$, $1 +coefficients, outputs are stored in \ccc{monge_form} and +\ccc{monge_form_condition_numbers}. +\ccPrecond $N \geq N_d:=(d+1)(d+2)/2$, $1 \leq d$, $dprime \leq d$, $1 \leq dprime \leq 4$ } %\ccOperations @@ -82,8 +75,9 @@ coefficients, outputs are stored in \ccc{monge_rep} and \ccSeeAlso -\ccc{Monge_rep}, -\ccc{Monge_info}. +\ccc{Monge_form}, +\ccc{Monge_form_condition_numbers} +\ccc{Lapack}. %\ccExample diff --git a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/intro.tex b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/intro.tex index adb820c0ff1..652f3eaead0 100644 --- a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/intro.tex +++ b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/intro.tex @@ -37,15 +37,15 @@ The following picture illustrates the template dependencies. \ccRequirements -The three classes \ccc{Monge_rep}, \ccc{Monge_info} and +The three classes \ccc{Monge_form}, \ccc{Monge_form_condition_numbers} and \ccc{Monge_via_jet_fitting} are designed to be used simultaneously. The \ccc{DataKernel} template parameter must be the -same for the classes \ccc{Monge_rep} and +same for the classes \ccc{Monge_form} and \ccc{Monge_via_jet_fitting}. The \ccc{LocalKernel} template parameter -must be the same for the classes \ccc{Monge_info} and -\ccc{Monge_via_jet_fitting}. +must be the same for the classes \ccc{Monge_form_condition_numbers} and +\ccc{Monge_via_jet_fitting} its default value is \ccc{Cartesian}. \subsection*{Concepts} \ccRefConceptPage{DataKernel} \\ @@ -53,9 +53,21 @@ must be the same for the classes \ccc{Monge_info} and \ccRefConceptPage{LinAlgTraits} \\ \subsection*{Classes} -\ccRefIdfierPage{CGAL::Monge_rep}\\ -\ccRefIdfierPage{CGAL::Monge_info}\\ -\ccRefIdfierPage{CGAL::Monge_via_jet_fitting}\\ +\ccRefIdfierPage{CGAL::Monge_form}\\ +\ccRefIdfierPage{CGAL::Monge_form_condition_numbers >}\\ +\ccRefIdfierPage{CGAL::Monge_via_jet_fitting, LinAlgTraits = Lapack>}\\ +\ccRefIdfierPage{CGAL::Lapack_matrix}\\ +\ccRefIdfierPage{CGAL::Lapack}\\ + + + +\subsection*{Global Functions} +The insert operator is overloaded for the classes \ccc{Monge_form} and +\ccc{Monge_form_condition_numbers}. + +\ccRefIdfierPage{CGAL::operator<<}\\ + + % +------------------------------------------------------------------------+ %%RefPage: end of main body, begin of footer diff --git a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/main.tex b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/main.tex index d4c5eb614c4..76f01ca8c60 100644 --- a/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/main.tex +++ b/Jet_fitting_3/doc_tex/Jet_fitting_3_ref/main.tex @@ -8,10 +8,13 @@ \input{Jet_fitting_3_ref/intro.tex} \input{Jet_fitting_3_ref/DataKernel.tex} +\input{Jet_fitting_3_ref/Jet_fitting_operator_leftshift.tex} +\input{Jet_fitting_3_ref/Lapack_matrix.tex} +\input{Jet_fitting_3_ref/Lapack.tex} \input{Jet_fitting_3_ref/LinAlgTraits.tex} \input{Jet_fitting_3_ref/LocalKernel.tex} -\input{Jet_fitting_3_ref/Monge_info.tex} -\input{Jet_fitting_3_ref/Monge_rep.tex} +\input{Jet_fitting_3_ref/Monge_form_condition_numbers.tex} +\input{Jet_fitting_3_ref/Monge_form.tex} \input{Jet_fitting_3_ref/Monge_via_jet_fitting.tex} %% EOF