\doxysection{batch\+\_\+dim.\+hpp}
\hypertarget{batch__dim_8hpp_source}{}\label{batch__dim_8hpp_source}\index{ginkgo/core/base/batch\_dim.hpp@{ginkgo/core/base/batch\_dim.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{//\ SPDX-\/FileCopyrightText:\ 2017\ -\/\ 2024\ The\ Ginkgo\ authors}}
\DoxyCodeLine{00002\ \textcolor{comment}{//}}
\DoxyCodeLine{00003\ \textcolor{comment}{//\ SPDX-\/License-\/Identifier:\ BSD-\/3-\/Clause}}
\DoxyCodeLine{00004\ }
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#ifndef\ GKO\_PUBLIC\_CORE\_BASE\_BATCH\_DIM\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_BASE\_BATCH\_DIM\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <iostream>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/dim.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00013\ }
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00015\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00016\ }
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00026\ \textcolor{keyword}{template}\ <\textcolor{keywordtype}{size\_t}ype\ Dimensionality\ =\ 2,\ \textcolor{keyword}{typename}\ DimensionType\ =\ \textcolor{keywordtype}{size\_t}ype>}
\DoxyCodeLine{00027\ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1batch__dim_a9ad0e2ce59184e0969c4cfbbccd16fbc}{batch\_dim}}\ \{}
\DoxyCodeLine{00028\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{constexpr}\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ dimensionality\ =\ Dimensionality;}
\DoxyCodeLine{00029\ \ \ \ \ \textcolor{keyword}{using\ }dimension\_type\ =\ DimensionType;}
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00036\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ \doxymbox{\hyperlink{structgko_1_1batch__dim_a380f449cd6305c8baba95569627503b2}{get\_num\_batch\_items}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ num\_batch\_items\_;\ \}}
\DoxyCodeLine{00037\ }
\DoxyCodeLine{00043\ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1dim}{dim<dimensionality,\ dimension\_type>}}\ \doxymbox{\hyperlink{structgko_1_1batch__dim_a2e5b548457e59a551328cb10cc38a688}{get\_common\_size}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00044\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00045\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ common\_size\_;}
\DoxyCodeLine{00046\ \ \ \ \ \}}
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00056\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{structgko_1_1batch__dim_a8ab2005862218bbbe2bb1e35868b0ad0}{operator==}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim_a9ad0e2ce59184e0969c4cfbbccd16fbc}{batch\_dim}}\&\ x,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim_a9ad0e2ce59184e0969c4cfbbccd16fbc}{batch\_dim}}\&\ y)}
\DoxyCodeLine{00057\ \ \ \ \ \{}
\DoxyCodeLine{00058\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ x.num\_batch\_items\_\ ==\ y.num\_batch\_items\_\ \&\&}
\DoxyCodeLine{00059\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ x.common\_size\_\ ==\ y.common\_size\_;}
\DoxyCodeLine{00060\ \ \ \ \ \}}
\DoxyCodeLine{00061\ }
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00074\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{structgko_1_1batch__dim_a1f2d93006b55ad3002e7074e3e6035ee}{operator!=}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim_a9ad0e2ce59184e0969c4cfbbccd16fbc}{batch\_dim<Dimensionality,\ DimensionType>}}\&\ x,}
\DoxyCodeLine{00075\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim_a9ad0e2ce59184e0969c4cfbbccd16fbc}{batch\_dim<Dimensionality,\ DimensionType>}}\&\ y)}
\DoxyCodeLine{00076\ \ \ \ \ \{}
\DoxyCodeLine{00077\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ !(x\ ==\ y);}
\DoxyCodeLine{00078\ \ \ \ \ \}}
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00080\ }
\DoxyCodeLine{00084\ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1batch__dim_a9ad0e2ce59184e0969c4cfbbccd16fbc}{batch\_dim}}()}
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ :\ num\_batch\_items\_(0),}
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ \ \ common\_size\_(\doxymbox{\hyperlink{structgko_1_1dim}{dim}}<dimensionality,\ dimension\_type>\{\})}
\DoxyCodeLine{00087\ \ \ \ \ \{\}}
\DoxyCodeLine{00088\ }
\DoxyCodeLine{00098\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{structgko_1_1batch__dim_a084efe247f49ff54a4156858991a2eb5}{batch\_dim}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ num\_batch\_items,}
\DoxyCodeLine{00099\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1dim}{dim<dimensionality,\ dimension\_type>}}\&\ common\_size)}
\DoxyCodeLine{00100\ \ \ \ \ \ \ \ \ :\ num\_batch\_items\_(num\_batch\_items),\ common\_size\_(common\_size)}
\DoxyCodeLine{00101\ \ \ \ \ \{\}}
\DoxyCodeLine{00102\ }
\DoxyCodeLine{00103\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00104\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ num\_batch\_items\_\{\};}
\DoxyCodeLine{00105\ \ \ \ \ dim<dimensionality,\ dimension\_type>\ common\_size\_\{\};}
\DoxyCodeLine{00106\ \};}
\DoxyCodeLine{00107\ }
\DoxyCodeLine{00108\ }
\DoxyCodeLine{00118\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ DimensionType>}
\DoxyCodeLine{00119\ \textcolor{keyword}{inline}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2,\ DimensionType>}}\ \doxymbox{\hyperlink{namespacegko_aacad7f87b38d3f26674ed034d442a1a0}{transpose}}(}
\DoxyCodeLine{00120\ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2,\ DimensionType>}}\&\ input)}
\DoxyCodeLine{00121\ \{}
\DoxyCodeLine{00122\ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2,\ DimensionType>}}(input.\doxymbox{\hyperlink{structgko_1_1batch__dim_a380f449cd6305c8baba95569627503b2}{get\_num\_batch\_items}}(),}
\DoxyCodeLine{00123\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_aacad7f87b38d3f26674ed034d442a1a0}{transpose}}(input.\doxymbox{\hyperlink{structgko_1_1batch__dim_a2e5b548457e59a551328cb10cc38a688}{get\_common\_size}}()));}
\DoxyCodeLine{00124\ \}}
\DoxyCodeLine{00125\ }
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00127\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00128\ }
\DoxyCodeLine{00129\ }
\DoxyCodeLine{00130\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_BASE\_BATCH\_DIM\_HPP\_}}

\end{DoxyCode}
