fix manual, added lapack and operator<<

This commit is contained in:
Marc Pouget 2006-06-28 15:47:30 +00:00
parent 5f9c8bf1ef
commit 36474933a2
8 changed files with 186 additions and 123 deletions

View File

@ -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 <class Kernel>
ostream& operator<<( ostream& out,
const Monge_form_condition_numbers<Kernel>& 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 <class Kernel>
ostream& operator<<( ostream& out,
const Monge_form<Kernel>& 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
% +------------------------------------------------------------------------+

View File

@ -17,14 +17,10 @@
\ccDefinition \ccDefinition
The class \ccRefName\ stores the Monge representation, i.e. the Monge The class \ccRefName\ provides an algorithm to solve in the least
coordinate system and the coefficients of the Monge form in this square sense a linear system.
system. The
\ccc{DataKernel} template parameter must be the
same for the classes \ccc{Monge_form} and
\ccc{Monge_via_jet_fitting}.
\ccInclude{CGAL/Monge_via_jet_fitting.h} \ccInclude{CGAL/Lapack/Linear_algebra_lapack.h}
\ccIsModel \ccIsModel
\ccc{LinAlgTraits} \ccc{LinAlgTraits}
@ -32,80 +28,26 @@ same for the classes \ccc{Monge_form} and
\ccTypes \ccTypes
% +-------------------------------------------------------------- % +--------------------------------------------------------------
%\ccNestedType{TYPE}{some nested types} %\ccNestedType{TYPE}{some nested types}
\ccTypedef{ typedef typename DataKernel::FT FT; }{} \ccTypedef{ typedef Lapack_matrix Matrix; }{}
\ccGlue
\ccTypedef{ typedef typename DataKernel::Point_3 Point_3; }{}
\ccGlue
\ccTypedef{ typedef typename DataKernel::Vector_3 Vector_3;}{}
\ccGlue
\ccCreation \ccCreation
% +-------------------------------------------------------------- % +--------------------------------------------------------------
\ccCreationVariable{monge_form} %% choose variable name \ccCreationVariable{lapack} %% choose variable name
\ccConstructor{Monge_form();}{default constructor.} \ccConstructor{Lapack();}{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<FT> 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<FT>& coefficients();}{}
\ccOperations \ccOperations
% +-------------------------------------------------------------- % +--------------------------------------------------------------
\ccMemberFunction{void set_up(int degree);}{Set the number of coefficients according \ccMemberFunction{ void solve_ls_svd_algo(Matrix& M, double* B, double &cond_nb);
to the degree of the Monge representation given. The }{Solve MX=B using SVD and give the condition number of M. The
$(degree+1)(degree+2)/2-4$ coefficients are set to 0.} solution is stored in B.}
\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.}
\ccSeeAlso \ccSeeAlso
\ccc{Monge_via_jet_fitting}, \ccc{LinAlgTraits},
\ccc{Lapack_matrix}.
%\ccc{some_other_function}. %\ccc{some_other_function}.
%\ccExample
%\begin{ccExampleCode}
%void your_example_code() {
%}
%\end{ccExampleCode}
%%% \ccIncludeExampleCode{Jet_fitting_3/Monge_rep.C}
\end{ccRefClass} \end{ccRefClass}
% +------------------------------------------------------------------------+ % +------------------------------------------------------------------------+

View File

@ -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
% +------------------------------------------------------------------------+

View File

@ -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 % | 09.02.2006 Marc Pouget and Frédéric Cazals
% | Package: Jet_fitting_3 % | Package: Jet_fitting_3
% | % |
\RCSdef{\RCSMongerepRev}{$Id$} \RCSdef{\RCSMongeformRev}{$Id$}
\RCSdefDate{\RCSMongerepDate}{$Date$} \RCSdefDate{\RCSMongeformDate}{$Date$}
% | % |
%%RefPage: end of header, begin of main body %%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+ % +------------------------------------------------------------------------+

View File

@ -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 % | 09.02.2006 Marc Pouget and Frédéric Cazals
% | Package: Jet_fitting_3 % | Package: Jet_fitting_3
@ -11,7 +11,7 @@
% +------------------------------------------------------------------------+ % +------------------------------------------------------------------------+
\begin{ccRefClass}{Monge_info<LocalKernel>} %% add template arg's if necessary \begin{ccRefClass}{Monge_form_condition_numbers<LocalKernel = Cartesian<double> >} %% add template arg's if necessary
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links %% \ccHtmlCrossLink{} %% add further rules for cross referencing links
%% \ccHtmlIndexC[class]{} %% add further index entries %% \ccHtmlIndexC[class]{} %% add further index entries
@ -21,43 +21,38 @@
The class \ccRefName\ stores informations on the numerical issues of The class \ccRefName\ stores informations on the numerical issues of
the computations performed by the class \ccc{Monge_via_jet_fitting}. the computations performed by the class \ccc{Monge_via_jet_fitting}.
The \ccc{LocalKernel} template parameter must be the same for the 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} \ccInclude{CGAL/Monge_via_jet_fitting.h}
\ccTypes \ccTypes
% +-------------------------------------------------------------- % +--------------------------------------------------------------
\ccTypedef{ typedef typename LocalKernel::FT LFT;}{} \ccTypedef{ typedef typename LocalKernel::FT FT;}{}
\ccGlue \ccGlue
\ccTypedef{ typedef typename LocalKernel::Vector_3 LVector;}{} \ccTypedef{ typedef typename LocalKernel::Vector_3 Vector_3;}{}
\ccGlue \ccGlue
\ccCreation \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 \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.} input points, sorted in descending order.}
\ccGlue \ccGlue
\ccMemberFunction{LFT* pca_eigen_vals();}{} \ccMemberFunction{FT* pca_eigen_vals();}{}
\ccMemberFunction{const LVector* pca_eigen_vecs();}{Eigenvectors of the PCA \ccMemberFunction{const Vector_3* pca_eigen_vecs();}{Eigenvectors of the PCA
are sorted in accordance.} are sorted in accordance.}
\ccGlue \ccGlue
\ccMemberFunction{LVector* pca_eigen_vecs();}{} \ccMemberFunction{Vector_3* pca_eigen_vecs();}{}
\ccMemberFunction{const LFT cond_nb();}{Condition number of the least square system.} \ccMemberFunction{const FT cond_nb();}{Condition number of the least square system.}
\ccGlue \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 \ccSeeAlso
% +-------------------------------------------------------------- % +--------------------------------------------------------------
\ccc{Monge_via_jet_fitting}. \ccc{Monge_via_jet_fitting}.

View File

@ -11,7 +11,7 @@
% +------------------------------------------------------------------------+ % +------------------------------------------------------------------------+
\begin{ccRefClass}{Monge_via_jet_fitting<DataKernel,LocalKernel,LinAlgTraits>} \begin{ccRefClass}{Monge_via_jet_fitting<DataKernel, LocalKernel = Cartesian<double>, LinAlgTraits = Lapack>}
%% add template arg's if necessary %% add template arg's if necessary
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links %% \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 where the calculation is carried out is the first point provided by
the iterator. the iterator.
%% %%
The results are stored in instances of the classes \ccc{Monge_rep} and The results are stored in instances of the classes \ccc{Monge_form} and
\ccc{Monge_info}, the particular informations returned depending on \ccc{Monge_form_condition_numbers}, the particular information returned depending on
the degrees specified for the polynomial fitting and for the Monge the degrees specified for the polynomial fitting and for the Monge form.
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}.
\ccInclude{CGAL/Monge_via_jet_fitting.h} \ccInclude{CGAL/Monge_via_jet_fitting.h}
@ -44,9 +36,9 @@ representation.
The class \ccRefName\ has three template parameters. Parameter The class \ccRefName\ has three template parameters. Parameter
\ccc{DataKernel} provides the geometric classes and tools \ccc{DataKernel} provides the geometric classes and tools
corresponding to the input points, and also selected members of the 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 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. algebra algorithms required by the fitting method.
\ccTypes \ccTypes
@ -59,21 +51,22 @@ algebra algorithms required by the fitting method.
\ccTypedef{ typedef typename std::vector<typename \ccTypedef{ typedef typename std::vector<typename
Data_Kernel::Point_3>::iterator Range_Iterator; }{} Data_Kernel::Point_3>::iterator Range_Iterator; }{}
\ccGlue \ccGlue
\ccTypedef{ typedef Monge_rep<Data_Kernel> Monge_rep;}{} \ccTypedef{ typedef Monge_form<Data_Kernel> Monge_form;}{}
\ccGlue \ccGlue
\ccTypedef{ typedef Monge_info<Local_Kernel> Monge_info;}{} \ccTypedef{ typedef Monge_form_condition_numbers<Local_Kernel> Monge_form_condition_numbers;}{}
\ccCreation \ccCreation
\ccCreationVariable{monge_fitting} %% choose variable name, given by \ccVar \ccCreationVariable{monge_fitting} %% choose variable name, given by \ccVar
\ccConstructor{Monge_via_jet_fitting(Range_Iterator begin, Range_Iterator end, \ccConstructor{Monge_via_jet_fitting(Range_Iterator begin, Range_Iterator end,
int d, int dprime, Monge_rep &monge_rep, Monge_info &monge_info);} int d, int dprime, Monge_form &monge_form,
{The constructor performs all the computations. The $N$ input points Monge_form_condition_numbers &monge_form_condition_numbers);} {The
are given by the \ccc{Range_Iterators}, \ccc{d} is the degree of 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 fitted polynomial, \ccc{dprime} is the degree of the expected Monge
coefficients, outputs are stored in \ccc{monge_rep} and coefficients, outputs are stored in \ccc{monge_form} and
\ccc{monge_info}. \ccc{monge_form_condition_numbers}.
\ccPrecond $N \geq N_d=(d+1)(d+2)/2$, $1 \leq d$, $dprime \leq d$, $1 \ccPrecond $N \geq N_d:=(d+1)(d+2)/2$, $1 \leq d$, $dprime \leq d$, $1
\leq dprime \leq 4$ } \leq dprime \leq 4$ }
%\ccOperations %\ccOperations
@ -82,8 +75,9 @@ coefficients, outputs are stored in \ccc{monge_rep} and
\ccSeeAlso \ccSeeAlso
\ccc{Monge_rep}, \ccc{Monge_form},
\ccc{Monge_info}. \ccc{Monge_form_condition_numbers}
\ccc{Lapack}.
%\ccExample %\ccExample

View File

@ -37,15 +37,15 @@ The following picture illustrates the template dependencies.
\ccRequirements \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 \ccc{Monge_via_jet_fitting} are designed to be used
simultaneously. simultaneously.
The \ccc{DataKernel} template parameter must be the 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 \ccc{Monge_via_jet_fitting}. The \ccc{LocalKernel} template parameter
must be the same for the classes \ccc{Monge_info} and must be the same for the classes \ccc{Monge_form_condition_numbers} and
\ccc{Monge_via_jet_fitting}. \ccc{Monge_via_jet_fitting} its default value is \ccc{Cartesian<double>}.
\subsection*{Concepts} \subsection*{Concepts}
\ccRefConceptPage{DataKernel} \\ \ccRefConceptPage{DataKernel} \\
@ -53,9 +53,21 @@ must be the same for the classes \ccc{Monge_info} and
\ccRefConceptPage{LinAlgTraits} \\ \ccRefConceptPage{LinAlgTraits} \\
\subsection*{Classes} \subsection*{Classes}
\ccRefIdfierPage{CGAL::Monge_rep<DataKernel>}\\ \ccRefIdfierPage{CGAL::Monge_form<DataKernel>}\\
\ccRefIdfierPage{CGAL::Monge_info<LocalKernel>}\\ \ccRefIdfierPage{CGAL::Monge_form_condition_numbers<LocalKernel = Cartesian<double> >}\\
\ccRefIdfierPage{CGAL::Monge_via_jet_fitting<DataKernel,LocalKernel,LinAlgTraits>}\\ \ccRefIdfierPage{CGAL::Monge_via_jet_fitting<DataKernel, LocalKernel = Cartesian<double>, 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 %%RefPage: end of main body, begin of footer

View File

@ -8,10 +8,13 @@
\input{Jet_fitting_3_ref/intro.tex} \input{Jet_fitting_3_ref/intro.tex}
\input{Jet_fitting_3_ref/DataKernel.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/LinAlgTraits.tex}
\input{Jet_fitting_3_ref/LocalKernel.tex} \input{Jet_fitting_3_ref/LocalKernel.tex}
\input{Jet_fitting_3_ref/Monge_info.tex} \input{Jet_fitting_3_ref/Monge_form_condition_numbers.tex}
\input{Jet_fitting_3_ref/Monge_rep.tex} \input{Jet_fitting_3_ref/Monge_form.tex}
\input{Jet_fitting_3_ref/Monge_via_jet_fitting.tex} \input{Jet_fitting_3_ref/Monge_via_jet_fitting.tex}
%% EOF %% EOF