\hypertarget{a00039}{
\section{mln::Gpoint$<$ E $>$ Struct Template Reference}
\label{d3/de7/a00039}\index{mln::Gpoint@{mln::Gpoint}}
}


Base class for implementation of point classes.  




{\ttfamily \#include $<$gpoint.hh$>$}



Inheritance diagram for mln::Gpoint$<$ E $>$:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=250pt]{d8/d63/a03500}
\end{center}
\end{figure}
\subsection*{Related Functions}
(Note that these are not member functions.) \begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename P , typename D $>$ }\\P \hyperlink{a00039_acb50acfc1926d37812cb0fa3d30c1798}{operator+} (const \hyperlink{a00039}{Gpoint}$<$ P $>$ \&p, const \hyperlink{a00037}{Gdpoint}$<$ D $>$ \&dp)
\begin{DoxyCompactList}\small\item\em Add a delta-\/point {\ttfamily rhs} to a grid point {\ttfamily lhs}. \item\end{DoxyCompactList}\item 
{\footnotesize template$<$typename P , typename D $>$ }\\P \& \hyperlink{a00039_a84b1e480c28f257627ff8687cbebbcf4}{operator+=} (\hyperlink{a00039}{Gpoint}$<$ P $>$ \&p, const \hyperlink{a00037}{Gdpoint}$<$ D $>$ \&dp)
\begin{DoxyCompactList}\small\item\em Shift a point {\ttfamily by} a delta-\/point {\ttfamily dp}. \item\end{DoxyCompactList}\item 
{\footnotesize template$<$typename L , typename R $>$ }\\L::delta \hyperlink{a00039_a2ce239db685aaf6b5e53ddeda20f2a4a}{operator-\/} (const \hyperlink{a00039}{Gpoint}$<$ L $>$ \&lhs, const \hyperlink{a00039}{Gpoint}$<$ R $>$ \&rhs)
\begin{DoxyCompactList}\small\item\em Difference between a couple of grid point {\ttfamily lhs} and {\ttfamily rhs}. \item\end{DoxyCompactList}\item 
{\footnotesize template$<$typename P , typename D $>$ }\\P \& \hyperlink{a00039_adc67ae17595aae1994576a31a26b57c3}{operator-\/=} (\hyperlink{a00039}{Gpoint}$<$ P $>$ \&p, const \hyperlink{a00037}{Gdpoint}$<$ D $>$ \&dp)
\begin{DoxyCompactList}\small\item\em Shift a point {\ttfamily by} the negate of a delta-\/point {\ttfamily dp}. \item\end{DoxyCompactList}\item 
{\footnotesize template$<$typename P , typename D $>$ }\\P \hyperlink{a00039_a8d607c2cee9dfb7f6eae7644022fad6f}{operator/} (const \hyperlink{a00039}{Gpoint}$<$ P $>$ \&p, const value::scalar\_\-$<$ D $>$ \&dp)
\begin{DoxyCompactList}\small\item\em Divise a point {\ttfamily by} a scalar {\ttfamily s}. \item\end{DoxyCompactList}\item 
{\footnotesize template$<$typename P $>$ }\\std::ostream \& \hyperlink{a00039_af987e2529986e8caaea70c72d7e5f808}{operator$<$$<$} (std::ostream \&ostr, const \hyperlink{a00039}{Gpoint}$<$ P $>$ \&p)
\begin{DoxyCompactList}\small\item\em Print a grid point {\ttfamily p} into the output stream {\ttfamily ostr}. \item\end{DoxyCompactList}\item 
{\footnotesize template$<$typename L , typename R $>$ }\\bool \hyperlink{a00039_a6f38b0c9e98f9c6fbc00353962221e3f}{operator==} (const \hyperlink{a00039}{Gpoint}$<$ L $>$ \&lhs, const \hyperlink{a00039}{Gpoint}$<$ R $>$ \&rhs)
\begin{DoxyCompactList}\small\item\em Equality comparison between a couple of grid point {\ttfamily lhs} and {\ttfamily rhs}. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename E$>$ struct mln::Gpoint$<$ E $>$}

Base class for implementation of point classes. A point is an element of a space.

For instance, \hyperlink{a01799_aa60d2ccb56ddbe212cce22a6f61e178f}{mln::point2d} is the type of elements defined on the discrete square grid of the 2D plane. 

Definition at line 115 of file gpoint.hh.



\subsection{Friends And Related Function Documentation}
\hypertarget{a00039_acb50acfc1926d37812cb0fa3d30c1798}{
\index{mln::Gpoint@{mln::Gpoint}!operator+@{operator+}}
\index{operator+@{operator+}!mln::Gpoint@{mln::Gpoint}}
\subsubsection[{operator+}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename P , typename D $>$ P operator+ (
\begin{DoxyParamCaption}
\item[{const {\bf Gpoint}$<$ P $>$ \&}]{ p, }
\item[{const {\bf Gdpoint}$<$ D $>$ \&}]{ dp}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}related\mbox{]}}}}
\label{d3/de7/a00039_acb50acfc1926d37812cb0fa3d30c1798}


Add a delta-\/point {\ttfamily rhs} to a grid point {\ttfamily lhs}. 


\begin{DoxyParams}{Parameters}
\item[\mbox{\tt[in]} {\em p}]A grid point. \item[\mbox{\tt[in]} {\em dp}]A delta-\/point.\end{DoxyParams}
The type of {\ttfamily dp} has to compatible with the type of {\ttfamily p}.

\begin{DoxyReturn}{Returns}
A point (temporary object).
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{a00037}{mln::Gdpoint} 
\end{DoxySeeAlso}


Definition at line 385 of file gpoint.hh.

\hypertarget{a00039_a84b1e480c28f257627ff8687cbebbcf4}{
\index{mln::Gpoint@{mln::Gpoint}!operator+=@{operator+=}}
\index{operator+=@{operator+=}!mln::Gpoint@{mln::Gpoint}}
\subsubsection[{operator+=}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename P , typename D $>$ P \& operator+= (
\begin{DoxyParamCaption}
\item[{{\bf Gpoint}$<$ P $>$ \&}]{ p, }
\item[{const {\bf Gdpoint}$<$ D $>$ \&}]{ dp}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}related\mbox{]}}}}
\label{d3/de7/a00039_a84b1e480c28f257627ff8687cbebbcf4}


Shift a point {\ttfamily by} a delta-\/point {\ttfamily dp}. 


\begin{DoxyParams}{Parameters}
\item[\mbox{\tt[in,out]} {\em p}]The targeted point. \item[\mbox{\tt[in]} {\em dp}]A delta-\/point. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
A reference to the point {\ttfamily p} once translated by {\ttfamily dp}.
\end{DoxyReturn}
\begin{DoxyPrecond}{Precondition}
The type of {\ttfamily dp} has to be compatible with the type of {\ttfamily p}. 
\end{DoxyPrecond}


Definition at line 428 of file gpoint.hh.

\hypertarget{a00039_a2ce239db685aaf6b5e53ddeda20f2a4a}{
\index{mln::Gpoint@{mln::Gpoint}!operator-\/@{operator-\/}}
\index{operator-\/@{operator-\/}!mln::Gpoint@{mln::Gpoint}}
\subsubsection[{operator-\/}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename L , typename R $>$ L::delta operator-\/ (
\begin{DoxyParamCaption}
\item[{const {\bf Gpoint}$<$ L $>$ \&}]{ lhs, }
\item[{const {\bf Gpoint}$<$ R $>$ \&}]{ rhs}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}related\mbox{]}}}}
\label{d3/de7/a00039_a2ce239db685aaf6b5e53ddeda20f2a4a}


Difference between a couple of grid point {\ttfamily lhs} and {\ttfamily rhs}. 


\begin{DoxyParams}{Parameters}
\item[\mbox{\tt[in]} {\em lhs}]A first grid point. \item[\mbox{\tt[in]} {\em rhs}]A second grid point.\end{DoxyParams}
\begin{DoxyWarning}{Warning}
There is no type promotion in Milena so the client has to make sure that both points are defined with the same type of coordinates.
\end{DoxyWarning}
\begin{DoxyPrecond}{Precondition}
Both {\ttfamily lhs} and {\ttfamily rhs} have to be defined on the same topology and with the same type of coordinates; otherwise this test does not compile.
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
The result, {\ttfamily dp}, is such as {\ttfamily lhs} == {\ttfamily rhs} + {\ttfamily dp}.
\end{DoxyPostcond}
\begin{DoxyReturn}{Returns}
A delta point (temporary object).
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{a00037}{mln::Gdpoint} 
\end{DoxySeeAlso}


Definition at line 374 of file gpoint.hh.

\hypertarget{a00039_adc67ae17595aae1994576a31a26b57c3}{
\index{mln::Gpoint@{mln::Gpoint}!operator-\/=@{operator-\/=}}
\index{operator-\/=@{operator-\/=}!mln::Gpoint@{mln::Gpoint}}
\subsubsection[{operator-\/=}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename P , typename D $>$ P \& operator-\/= (
\begin{DoxyParamCaption}
\item[{{\bf Gpoint}$<$ P $>$ \&}]{ p, }
\item[{const {\bf Gdpoint}$<$ D $>$ \&}]{ dp}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}related\mbox{]}}}}
\label{d3/de7/a00039_adc67ae17595aae1994576a31a26b57c3}


Shift a point {\ttfamily by} the negate of a delta-\/point {\ttfamily dp}. 


\begin{DoxyParams}{Parameters}
\item[\mbox{\tt[in,out]} {\em p}]The targeted point. \item[\mbox{\tt[in]} {\em dp}]A delta-\/point. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
A reference to the point {\ttfamily p} once translated by -\/ {\ttfamily dp}.
\end{DoxyReturn}
\begin{DoxyPrecond}{Precondition}
The type of {\ttfamily dp} has to be compatible with the type of {\ttfamily p}. 
\end{DoxyPrecond}


Definition at line 436 of file gpoint.hh.

\hypertarget{a00039_a8d607c2cee9dfb7f6eae7644022fad6f}{
\index{mln::Gpoint@{mln::Gpoint}!operator/@{operator/}}
\index{operator/@{operator/}!mln::Gpoint@{mln::Gpoint}}
\subsubsection[{operator/}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename P , typename D $>$ P operator/ (
\begin{DoxyParamCaption}
\item[{const {\bf Gpoint}$<$ P $>$ \&}]{ p, }
\item[{const value::scalar\_\-$<$ D $>$ \&}]{ dp}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}related\mbox{]}}}}
\label{d3/de7/a00039_a8d607c2cee9dfb7f6eae7644022fad6f}


Divise a point {\ttfamily by} a scalar {\ttfamily s}. 


\begin{DoxyParams}{Parameters}
\item[\mbox{\tt[in,out]} {\em p}]The targeted point. \item[\mbox{\tt[in]} {\em dp}]A scalar. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
A reference to the point {\ttfamily p} once divised by {\ttfamily s}. 
\end{DoxyReturn}
\hypertarget{a00039_af987e2529986e8caaea70c72d7e5f808}{
\index{mln::Gpoint@{mln::Gpoint}!operator$<$$<$@{operator$<$$<$}}
\index{operator$<$$<$@{operator$<$$<$}!mln::Gpoint@{mln::Gpoint}}
\subsubsection[{operator$<$$<$}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename P $>$ std::ostream \& operator$<$$<$ (
\begin{DoxyParamCaption}
\item[{std::ostream \&}]{ ostr, }
\item[{const {\bf Gpoint}$<$ P $>$ \&}]{ p}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}related\mbox{]}}}}
\label{d3/de7/a00039_af987e2529986e8caaea70c72d7e5f808}


Print a grid point {\ttfamily p} into the output stream {\ttfamily ostr}. 


\begin{DoxyParams}{Parameters}
\item[\mbox{\tt[in,out]} {\em ostr}]An output stream. \item[\mbox{\tt[in]} {\em p}]A grid point.\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The modified output stream {\ttfamily ostr}. 
\end{DoxyReturn}


Definition at line 417 of file gpoint.hh.



References mln::debug::format().

\hypertarget{a00039_a6f38b0c9e98f9c6fbc00353962221e3f}{
\index{mln::Gpoint@{mln::Gpoint}!operator==@{operator==}}
\index{operator==@{operator==}!mln::Gpoint@{mln::Gpoint}}
\subsubsection[{operator==}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename L , typename R $>$ bool operator== (
\begin{DoxyParamCaption}
\item[{const {\bf Gpoint}$<$ L $>$ \&}]{ lhs, }
\item[{const {\bf Gpoint}$<$ R $>$ \&}]{ rhs}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}related\mbox{]}}}}
\label{d3/de7/a00039_a6f38b0c9e98f9c6fbc00353962221e3f}


Equality comparison between a couple of grid point {\ttfamily lhs} and {\ttfamily rhs}. 


\begin{DoxyParams}{Parameters}
\item[\mbox{\tt[in]} {\em lhs}]A first grid point. \item[\mbox{\tt[in]} {\em rhs}]A second grid point.\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
Both {\ttfamily lhs} and {\ttfamily rhs} have to be defined on the same topology; otherwise this test does not compile.
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
True if both grid points have the same coordinates, otherwise false. 
\end{DoxyReturn}


Definition at line 365 of file gpoint.hh.

