\doxysection{gko::\+accessor::\+row\+\_\+major\texorpdfstring{$<$}{<} Value\+Type, Dimensionality \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classgko_1_1accessor_1_1row__major}{}\label{classgko_1_1accessor_1_1row__major}\index{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$@{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$}}


A \doxylink{classgko_1_1accessor_1_1row__major}{row\+\_\+major} accessor is a bridge between a range and the row-\/major memory layout.  




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



Collaboration diagram for gko::\+accessor::\+row\+\_\+major\texorpdfstring{$<$}{<} Value\+Type, Dimensionality \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=259pt]{classgko_1_1accessor_1_1row__major__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1accessor_1_1row__major_a687bda931be92c31abf02965fa72ceba}\label{classgko_1_1accessor_1_1row__major_a687bda931be92c31abf02965fa72ceba} 
using {\bfseries value\+\_\+type} = Value\+Type
\begin{DoxyCompactList}\small\item\em Type of values returned by the accessor. \end{DoxyCompactList}\item 
\Hypertarget{classgko_1_1accessor_1_1row__major_af6e81060211b143c595ee4f77537dbc2}\label{classgko_1_1accessor_1_1row__major_af6e81060211b143c595ee4f77537dbc2} 
using {\bfseries data\+\_\+type} = \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a687bda931be92c31abf02965fa72ceba}{value\+\_\+type}}\texorpdfstring{$\ast$}{*}
\begin{DoxyCompactList}\small\item\em Type of underlying data storage. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
constexpr \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a687bda931be92c31abf02965fa72ceba}{value\+\_\+type}} \& \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_af208638f030fa882d1aaef5737a4c161}{operator()}} (\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} row, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} col) const
\begin{DoxyCompactList}\small\item\em Returns the data element at position (row, col). \end{DoxyCompactList}\item 
constexpr \doxymbox{\hyperlink{classgko_1_1range}{range}}$<$ row\+\_\+major $>$ \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a1cd0b97c9e3b75e4dd957eff35831048}{operator()}} (const \doxymbox{\hyperlink{structgko_1_1span}{span}} \&rows, const \doxymbox{\hyperlink{structgko_1_1span}{span}} \&cols) const
\begin{DoxyCompactList}\small\item\em Returns the sub-\/range spanning the range (rows, cols). \end{DoxyCompactList}\item 
constexpr \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a438bb22bf86a33db403119bcb914dacc}{length}} (\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} dimension) const
\begin{DoxyCompactList}\small\item\em Returns the length in dimension {\ttfamily dimension}. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Other\+Accessor$>$ }\\void \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a878a175c452549107d9db2521e481efe}{copy\+\_\+from}} (const Other\+Accessor \&other) const
\begin{DoxyCompactList}\small\item\em Copies data from another accessor. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1accessor_1_1row__major_aa83eec10535e8ac7f79c6a04c0c05b4c}\label{classgko_1_1accessor_1_1row__major_aa83eec10535e8ac7f79c6a04c0c05b4c} 
const \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_af6e81060211b143c595ee4f77537dbc2}{data\+\_\+type}} {\bfseries data}
\begin{DoxyCompactList}\small\item\em Reference to the underlying data. \end{DoxyCompactList}\item 
\Hypertarget{classgko_1_1accessor_1_1row__major_a4912695f06056d9e46cb335168bf28c9}\label{classgko_1_1accessor_1_1row__major_a4912695f06056d9e46cb335168bf28c9} 
const std::\+array$<$ const \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}, \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_ae969fbac55f5ba6e6f95f25a0aac483d}{dimensionality}} $>$ {\bfseries lengths}
\begin{DoxyCompactList}\small\item\em An array of dimension sizes. \end{DoxyCompactList}\item 
\Hypertarget{classgko_1_1accessor_1_1row__major_a651793392dc0327f324289bb096b3316}\label{classgko_1_1accessor_1_1row__major_a651793392dc0327f324289bb096b3316} 
const \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} {\bfseries stride}
\begin{DoxyCompactList}\small\item\em Distance between consecutive rows. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1accessor_1_1row__major_ae969fbac55f5ba6e6f95f25a0aac483d}\label{classgko_1_1accessor_1_1row__major_ae969fbac55f5ba6e6f95f25a0aac483d} 
static constexpr \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} {\bfseries dimensionality} = 2
\begin{DoxyCompactList}\small\item\em Number of dimensions of the accessor. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1accessor_1_1row__major_a770bcb0f86577602cd97f1ff8ccd7211}\label{classgko_1_1accessor_1_1row__major_a770bcb0f86577602cd97f1ff8ccd7211} 
class {\bfseries range$<$ row\+\_\+major $>$}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Value\+Type, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality$>$\newline
class gko::\+accessor::\+row\+\_\+major$<$ Value\+Type, Dimensionality $>$}
A \doxylink{classgko_1_1accessor_1_1row__major}{row\+\_\+major} accessor is a bridge between a range and the row-\/major memory layout. 

You should never try to explicitly create an instance of this accessor. Instead, supply it as a template parameter to a range, and pass the constructor parameters for this class to the range (it will forward it to this class).

\begin{DoxyWarning}{Warning}
The current implementation is incomplete, and only allows for 2-\/dimensional ranges.
\end{DoxyWarning}

\begin{DoxyTemplParams}{Template Parameters}
{\em Value\+Type} & type of values this accessor returns \\
\hline
{\em Dimensionality} & number of dimensions of this accessor (has to be 2) \\
\hline
\end{DoxyTemplParams}


\label{doc-func-members}
\Hypertarget{classgko_1_1accessor_1_1row__major_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1accessor_1_1row__major_a878a175c452549107d9db2521e481efe}\index{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$@{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$}!copy\_from@{copy\_from}}
\index{copy\_from@{copy\_from}!gko::accessor::row\_major$<$ ValueType, Dimensionality $>$@{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$}}
\doxysubsubsection{\texorpdfstring{copy\_from()}{copy\_from()}}
{\footnotesize\ttfamily \label{classgko_1_1accessor_1_1row__major_a878a175c452549107d9db2521e481efe} 
template$<$typename Value\+Type, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality$>$ \\
template$<$typename Other\+Accessor$>$ \\
void \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major}{gko::\+accessor::\+row\+\_\+major}}$<$ Value\+Type, Dimensionality $>$::\+copy\+\_\+from (\begin{DoxyParamCaption}\item[{const Other\+Accessor \&}]{other}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Copies data from another accessor. 

\begin{DoxyWarning}{Warning}
Do not use this function since it is not optimized for a specific executor. It will always be performed sequentially. Please write an optimized version (adjusted to the architecture) by iterating through the values yourself.
\end{DoxyWarning}

\begin{DoxyTemplParams}{Template Parameters}
{\em Other\+Accessor} & type of the other accessor\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em other} & other accessor \\
\hline
\end{DoxyParams}


References \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a4912695f06056d9e46cb335168bf28c9}{lengths}}.

\Hypertarget{classgko_1_1accessor_1_1row__major_a438bb22bf86a33db403119bcb914dacc}\index{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$@{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$}!length@{length}}
\index{length@{length}!gko::accessor::row\_major$<$ ValueType, Dimensionality $>$@{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$}}
\doxysubsubsection{\texorpdfstring{length()}{length()}}
{\footnotesize\ttfamily \label{classgko_1_1accessor_1_1row__major_a438bb22bf86a33db403119bcb914dacc} 
template$<$typename Value\+Type, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality$>$ \\
\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major}{gko::\+accessor::\+row\+\_\+major}}$<$ Value\+Type, Dimensionality $>$::\+length (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{dimension}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}



Returns the length in dimension {\ttfamily dimension}. 


\begin{DoxyParams}{Parameters}
{\em dimension} & a dimension index\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
length in dimension {\ttfamily dimension} 
\end{DoxyReturn}


References \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a4912695f06056d9e46cb335168bf28c9}{lengths}}.

\Hypertarget{classgko_1_1accessor_1_1row__major_a1cd0b97c9e3b75e4dd957eff35831048}\index{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$@{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$}!operator()@{operator()}}
\index{operator()@{operator()}!gko::accessor::row\_major$<$ ValueType, Dimensionality $>$@{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$}}
\doxysubsubsection{\texorpdfstring{operator()()}{operator()()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classgko_1_1accessor_1_1row__major_a1cd0b97c9e3b75e4dd957eff35831048} 
template$<$typename Value\+Type, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality$>$ \\
\doxymbox{\hyperlink{classgko_1_1range}{range}}$<$ row\+\_\+major $>$ \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major}{gko::\+accessor::\+row\+\_\+major}}$<$ Value\+Type, Dimensionality $>$::\+operator() (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{structgko_1_1span}{span}} \&}]{rows}{, }\item[{const \doxymbox{\hyperlink{structgko_1_1span}{span}} \&}]{cols}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}



Returns the sub-\/range spanning the range (rows, cols). 


\begin{DoxyParams}{Parameters}
{\em rows} & row span \\
\hline
{\em cols} & column span\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
sub-\/range spanning the range (rows, cols) 
\end{DoxyReturn}


References \doxymbox{\hyperlink{structgko_1_1span_a54ff06eda27a98b62e83c7e9e7b6dcd7}{gko::\+span::\+begin}}, \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_aa83eec10535e8ac7f79c6a04c0c05b4c}{data}}, \doxymbox{\hyperlink{structgko_1_1span_af68200dea4456e1bd3511c3b14bc2886}{gko::\+span::\+end}}, \doxymbox{\hyperlink{structgko_1_1span_a32a87f434708e6857820858503f9b133}{gko::\+span::\+is\+\_\+valid()}}, \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a4912695f06056d9e46cb335168bf28c9}{lengths}}, and \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a651793392dc0327f324289bb096b3316}{stride}}.

\Hypertarget{classgko_1_1accessor_1_1row__major_af208638f030fa882d1aaef5737a4c161}\index{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$@{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$}!operator()@{operator()}}
\index{operator()@{operator()}!gko::accessor::row\_major$<$ ValueType, Dimensionality $>$@{gko::accessor::row\_major$<$ ValueType, Dimensionality $>$}}
\doxysubsubsection{\texorpdfstring{operator()()}{operator()()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classgko_1_1accessor_1_1row__major_af208638f030fa882d1aaef5737a4c161} 
template$<$typename Value\+Type, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality$>$ \\
\doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a687bda931be92c31abf02965fa72ceba}{value\+\_\+type}} \& \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major}{gko::\+accessor::\+row\+\_\+major}}$<$ Value\+Type, Dimensionality $>$::\+operator() (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{row}{, }\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{col}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}



Returns the data element at position (row, col). 


\begin{DoxyParams}{Parameters}
{\em row} & row index \\
\hline
{\em col} & column index\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
data element at (row, col) 
\end{DoxyReturn}


References \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_aa83eec10535e8ac7f79c6a04c0c05b4c}{data}}, \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a4912695f06056d9e46cb335168bf28c9}{lengths}}, and \doxymbox{\hyperlink{classgko_1_1accessor_1_1row__major_a651793392dc0327f324289bb096b3316}{stride}}.



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