\doxysection{gko::\+span Struct Reference}
\hypertarget{structgko_1_1span}{}\label{structgko_1_1span}\index{gko::span@{gko::span}}


A span is a lightweight structure used to create sub-\/ranges from other ranges.  




{\ttfamily \+\#include $<$ginkgo/\+core/\+base/\+range.\+hpp$>$}



Inheritance diagram for gko::\+span:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=164pt]{structgko_1_1span__inherit__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
constexpr \doxymbox{\hyperlink{structgko_1_1span_a2aafb0414ef14fac91296066f7426d6d}{span}} (\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} point) noexcept
\begin{DoxyCompactList}\small\item\em Creates a span representing a point {\ttfamily point}. \end{DoxyCompactList}\item 
constexpr \doxymbox{\hyperlink{structgko_1_1span_a1566e1ab67312a6b9ece66fa4f5c8799}{span}} (\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \doxymbox{\hyperlink{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7}{begin}}, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \doxymbox{\hyperlink{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886}{end}}) noexcept
\begin{DoxyCompactList}\small\item\em Creates a span. \end{DoxyCompactList}\item 
constexpr bool \doxymbox{\hyperlink{structgko_1_1span_a32a87f434708e6857820858503f9b133}{is\+\_\+valid}} () const
\begin{DoxyCompactList}\small\item\em Checks if a span is valid. \end{DoxyCompactList}\item 
constexpr \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \doxymbox{\hyperlink{structgko_1_1span_a4e869a36bebf78c090a0c2219f47c419}{length}} () const
\begin{DoxyCompactList}\small\item\em Returns the length of a span. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7}\label{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7} 
const \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} {\bfseries begin}
\begin{DoxyCompactList}\small\item\em Beginning of the span. \end{DoxyCompactList}\item 
\Hypertarget{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886}\label{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886} 
const \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} {\bfseries end}
\begin{DoxyCompactList}\small\item\em End of the span. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
A span is a lightweight structure used to create sub-\/ranges from other ranges. 

A {\ttfamily \doxylink{structgko_1_1span}{span} s} represents a contiguous set of indexes in one dimension of the range, starting on index {\ttfamily s.\+begin} (inclusive) and ending at index {\ttfamily s.\+end} (exclusive). A span is only valid if its starting index is smaller than its ending index.

Spans can be compared using the {\ttfamily ==} and {\ttfamily !=} operators. Two spans are identical if both their {\ttfamily \doxylink{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7}{begin}} and {\ttfamily \doxylink{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886}{end}} values are identical.

Spans also have two distinct partial orders defined on them:\+
\begin{DoxyEnumerate}
\item {\ttfamily x \texorpdfstring{$<$}{<} y} ({\ttfamily y \texorpdfstring{$>$}{>} x}) if and only if {\ttfamily x.\+end \texorpdfstring{$<$}{<} y.\+begin}
\item {\ttfamily x \texorpdfstring{$<$}{<}= y} ({\ttfamily y \texorpdfstring{$>$}{>}= x}) if and only if {\ttfamily x.\+end \texorpdfstring{$<$}{<}= y.\+begin}
\end{DoxyEnumerate}

Note that the orders are in fact partial -\/ there are spans {\ttfamily x} and {\ttfamily y} for which none of the following inequalities holds:\+ {\ttfamily x \texorpdfstring{$<$}{<} y}, {\ttfamily x \texorpdfstring{$>$}{>} y}, {\ttfamily x == y}, {\ttfamily x \texorpdfstring{$<$}{<}= y}, {\ttfamily x \texorpdfstring{$>$}{>}= y}. An example are spans {\ttfamily \doxylink{structgko_1_1span}{span}\{0, 2\}} and {\ttfamily \doxylink{structgko_1_1span}{span}\{1, 3\}}.

In addition, {\ttfamily \texorpdfstring{$<$}{<}=} is a distinct order from {\ttfamily \texorpdfstring{$<$}{<}}, and not just an extension of the strict order to its weak equivalent. Thus, {\ttfamily x \texorpdfstring{$<$}{<}= y} is not equivalent to {\ttfamily x \texorpdfstring{$<$}{<} y \texorpdfstring{$\vert$}{|}\texorpdfstring{$\vert$}{|} x == y}. 

\label{doc-constructors}
\Hypertarget{structgko_1_1span_doc-constructors}
\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{structgko_1_1span_a2aafb0414ef14fac91296066f7426d6d}\index{gko::span@{gko::span}!span@{span}}
\index{span@{span}!gko::span@{gko::span}}
\doxysubsubsection{\texorpdfstring{span()}{span()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{structgko_1_1span_a2aafb0414ef14fac91296066f7426d6d} 
gko::\+span::\+span (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{point}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}, {\ttfamily [noexcept]}}



Creates a span representing a point {\ttfamily point}. 

The {\ttfamily \doxylink{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7}{begin}} of this span is set to {\ttfamily point}, and the {\ttfamily \doxylink{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886}{end}} to {\ttfamily point + 1}.


\begin{DoxyParams}{Parameters}
{\em point} & the point which the span represents \\
\hline
\end{DoxyParams}


References \doxymbox{\hyperlink{structgko_1_1span_a2aafb0414ef14fac91296066f7426d6d}{span()}}.



Referenced by \doxymbox{\hyperlink{structgko_1_1span_a2aafb0414ef14fac91296066f7426d6d}{span()}}.

\Hypertarget{structgko_1_1span_a1566e1ab67312a6b9ece66fa4f5c8799}\index{gko::span@{gko::span}!span@{span}}
\index{span@{span}!gko::span@{gko::span}}
\doxysubsubsection{\texorpdfstring{span()}{span()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{structgko_1_1span_a1566e1ab67312a6b9ece66fa4f5c8799} 
gko::\+span::\+span (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{begin}{, }\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{end}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}, {\ttfamily [noexcept]}}



Creates a span. 


\begin{DoxyParams}{Parameters}
{\em \doxylink{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7}{begin}} & the beginning of the span \\
\hline
{\em \doxylink{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886}{end}} & the end of the span \\
\hline
\end{DoxyParams}


References \doxymbox{\hyperlink{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7}{begin}}, and \doxymbox{\hyperlink{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886}{end}}.



\label{doc-func-members}
\Hypertarget{structgko_1_1span_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{structgko_1_1span_a32a87f434708e6857820858503f9b133}\index{gko::span@{gko::span}!is\_valid@{is\_valid}}
\index{is\_valid@{is\_valid}!gko::span@{gko::span}}
\doxysubsubsection{\texorpdfstring{is\_valid()}{is\_valid()}}
{\footnotesize\ttfamily \label{structgko_1_1span_a32a87f434708e6857820858503f9b133} 
bool gko::\+span::\+is\+\_\+valid (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}



Checks if a span is valid. 

\begin{DoxyReturn}{Returns}
true if and only if {\ttfamily this-\/\texorpdfstring{$>$}{>}\doxylink{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7}{begin} \texorpdfstring{$<$}{<}= this-\/\texorpdfstring{$>$}{>}\doxylink{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886}{end}} 
\end{DoxyReturn}


References \doxymbox{\hyperlink{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7}{begin}}, and \doxymbox{\hyperlink{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886}{end}}.



Referenced by \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a1cd0b97c9e3b75e4dd957eff35831048}{gko::\+accessor::\+row\+\_\+major$<$ Value\+Type, Dimensionality $>$::\+operator()()}}.

\Hypertarget{structgko_1_1span_a4e869a36bebf78c090a0c2219f47c419}\index{gko::span@{gko::span}!length@{length}}
\index{length@{length}!gko::span@{gko::span}}
\doxysubsubsection{\texorpdfstring{length()}{length()}}
{\footnotesize\ttfamily \label{structgko_1_1span_a4e869a36bebf78c090a0c2219f47c419} 
\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} gko::\+span::\+length (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}



Returns the length of a span. 

\begin{DoxyReturn}{Returns}
{\ttfamily this-\/\texorpdfstring{$>$}{>}\doxylink{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886}{end} -\/ this-\/\texorpdfstring{$>$}{>}\doxylink{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7}{begin}} 
\end{DoxyReturn}


References \doxymbox{\hyperlink{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7}{begin}}, and \doxymbox{\hyperlink{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886}{end}}.



The documentation for this struct was generated from the following file:\+\begin{DoxyCompactItemize}
\item 
ginkgo/\+core/\+base/\+range.\+hpp\end{DoxyCompactItemize}
