\doxysection{gko::\+dim\texorpdfstring{$<$}{<} Dimensionality, Dimension\+Type \texorpdfstring{$>$}{>} Struct Template Reference}
\hypertarget{structgko_1_1dim}{}\label{structgko_1_1dim}\index{gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}}


A type representing the dimensions of a multidimensional object.  




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



Inheritance diagram for gko::\+dim\texorpdfstring{$<$}{<} Dimensionality, Dimension\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{structgko_1_1dim__inherit__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{structgko_1_1dim_a014dcfcbc2b4a8dad05d417d110711c7}\label{structgko_1_1dim_a014dcfcbc2b4a8dad05d417d110711c7} 
using {\bfseries dimension\+\_\+type} = Dimension\+Type
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}\label{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19} 
constexpr {\bfseries dim} ()
\begin{DoxyCompactList}\small\item\em Creates a dimension object with all dimensions set to zero. \end{DoxyCompactList}\item 
constexpr \doxymbox{\hyperlink{structgko_1_1dim_aaeb554ff56deeb0fabbe001c2c8521fe}{dim}} (const dimension\+\_\+type \&size)
\begin{DoxyCompactList}\small\item\em Creates a dimension object with all dimensions set to the same value. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename... Rest, std::\+enable\+\_\+if\+\_\+t$<$ sizeof...(Rest)==Dimensionality -\/ 1 $>$ \texorpdfstring{$\ast$}{*} = nullptr$>$ }\\constexpr \doxymbox{\hyperlink{structgko_1_1dim_ad0e8a1b8a4cb9fc34ddcabea61f9149d}{dim}} (const dimension\+\_\+type \&first, const Rest \&... rest)
\begin{DoxyCompactList}\small\item\em Creates a dimension object with the specified dimensions. \end{DoxyCompactList}\item 
constexpr const dimension\+\_\+type \& \doxymbox{\hyperlink{structgko_1_1dim_a8f62915634727b12aed8ebb6e3e62217}{operator\+[$\,$]\+}} (const \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \&dimension) const noexcept
\begin{DoxyCompactList}\small\item\em Returns the requested dimension. \end{DoxyCompactList}\item 
dimension\+\_\+type \& \doxymbox{\hyperlink{structgko_1_1dim_a9291ce5a513a65f1623822d584fef2e4}{operator\+[$\,$]\+}} (const \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \&dimension) noexcept
\item 
constexpr \doxymbox{\hyperlink{structgko_1_1dim_a250f37a972c7e3fd0cc4c173e46e577c}{operator bool}} () const
\begin{DoxyCompactList}\small\item\em Checks if all dimensions evaluate to true. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{structgko_1_1dim_a72d29ecf3590a02a8977efa34c03cec1}\label{structgko_1_1dim_a72d29ecf3590a02a8977efa34c03cec1} 
static constexpr \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} {\bfseries dimensionality} = Dimensionality
\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{structgko_1_1dim_ae3fd92090978b7ee96b007dda93905f0}\label{structgko_1_1dim_ae3fd92090978b7ee96b007dda93905f0} 
struct {\bfseries dim$<$ dimensionality+1 $>$}
\item 
constexpr bool \doxymbox{\hyperlink{structgko_1_1dim_a5e2c1e99f1c12540aac8489127c5dfb6}{operator==}} (const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}} \&x, const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}} \&y)
\begin{DoxyCompactList}\small\item\em Checks if two dim objects are equal. \end{DoxyCompactList}\item 
constexpr bool \doxymbox{\hyperlink{structgko_1_1dim_a2fc2e8710193f9a9d911a230e63711a2}{operator!=}} (const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}} \&x, const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}} \&y)
\begin{DoxyCompactList}\small\item\em Checks if two dim objects are not equal. \end{DoxyCompactList}\item 
constexpr \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}} \doxymbox{\hyperlink{structgko_1_1dim_a27d25e410396817b4ceafbae3d5df5c8}{operator\texorpdfstring{$\ast$}{*}}} (const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}} \&x, const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}} \&y)
\begin{DoxyCompactList}\small\item\em Multiplies two dim objects. \end{DoxyCompactList}\item 
std::\+ostream \& \doxymbox{\hyperlink{structgko_1_1dim_a6494433a0fd67659179d73029060bf17}{operator$<$$<$}} (std::\+ostream \&os, const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}} \&x)
\begin{DoxyCompactList}\small\item\em A stream operator overload for dim. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality, typename Dimension\+Type = size\+\_\+type$>$\newline
struct gko::\+dim$<$ Dimensionality, Dimension\+Type $>$}
A type representing the dimensions of a multidimensional object. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Dimensionality} & number of dimensions of the object \\
\hline
{\em Dimension\+Type} & datatype used to represent each dimension \\
\hline
\end{DoxyTemplParams}


\label{doc-constructors}
\Hypertarget{structgko_1_1dim_doc-constructors}
\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{structgko_1_1dim_aaeb554ff56deeb0fabbe001c2c8521fe}\index{gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}!dim@{dim}}
\index{dim@{dim}!gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}}
\doxysubsubsection{\texorpdfstring{dim()}{dim()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{structgko_1_1dim_aaeb554ff56deeb0fabbe001c2c8521fe} 
template$<$\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality, typename Dimension\+Type = size\+\_\+type$>$ \\
\doxymbox{\hyperlink{structgko_1_1dim}{gko::\+dim}}$<$ Dimensionality, Dimension\+Type $>$::\+dim (\begin{DoxyParamCaption}\item[{const dimension\+\_\+type \&}]{size}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [explicit]}, {\ttfamily [constexpr]}}



Creates a dimension object with all dimensions set to the same value. 


\begin{DoxyParams}{Parameters}
{\em size} & the size of each dimension \\
\hline
\end{DoxyParams}
\Hypertarget{structgko_1_1dim_ad0e8a1b8a4cb9fc34ddcabea61f9149d}\index{gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}!dim@{dim}}
\index{dim@{dim}!gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}}
\doxysubsubsection{\texorpdfstring{dim()}{dim()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{structgko_1_1dim_ad0e8a1b8a4cb9fc34ddcabea61f9149d} 
template$<$\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality, typename Dimension\+Type = size\+\_\+type$>$ \\
template$<$typename... Rest, std::\+enable\+\_\+if\+\_\+t$<$ sizeof...(Rest)==Dimensionality -\/ 1 $>$ \texorpdfstring{$\ast$}{*} = nullptr$>$ \\
\doxymbox{\hyperlink{structgko_1_1dim}{gko::\+dim}}$<$ Dimensionality, Dimension\+Type $>$::\+dim (\begin{DoxyParamCaption}\item[{const dimension\+\_\+type \&}]{first}{, }\item[{const Rest \&...}]{rest}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}



Creates a dimension object with the specified dimensions. 

If the number of dimensions given is less than the dimensionality of the object, the remaining dimensions are set to the same value as the last value given.

For example, in the context of matrices {\ttfamily \doxylink{structgko_1_1dim}{dim}\texorpdfstring{$<$}{<}2\texorpdfstring{$>$}{>}\{2, 3\}} creates the dimensions for a 2-\/by-\/3 matrix.


\begin{DoxyParams}{Parameters}
{\em first} & first dimension \\
\hline
{\em rest} & other dimensions \\
\hline
\end{DoxyParams}


\label{doc-func-members}
\Hypertarget{structgko_1_1dim_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{structgko_1_1dim_a250f37a972c7e3fd0cc4c173e46e577c}\index{gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}!operator bool@{operator bool}}
\index{operator bool@{operator bool}!gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}}
\doxysubsubsection{\texorpdfstring{operator bool()}{operator bool()}}
{\footnotesize\ttfamily \label{structgko_1_1dim_a250f37a972c7e3fd0cc4c173e46e577c} 
template$<$\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality, typename Dimension\+Type = size\+\_\+type$>$ \\
\doxymbox{\hyperlink{structgko_1_1dim}{gko::\+dim}}$<$ Dimensionality, Dimension\+Type $>$::\+operator bool (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [explicit]}, {\ttfamily [constexpr]}}



Checks if all dimensions evaluate to true. 

For standard arithmetic types, this is equivalent to all dimensions being different than zero.

\begin{DoxyReturn}{Returns}
true if and only if all dimensions evaluate to true
\end{DoxyReturn}
\begin{DoxyNote}{Note}
This operator is explicit to avoid implicit dim-\/to-\/int casts. It will still be used in contextual conversions (if, \&\&, \texorpdfstring{$\vert$}{|}\texorpdfstring{$\vert$}{|}, !) 
\end{DoxyNote}
\Hypertarget{structgko_1_1dim_a8f62915634727b12aed8ebb6e3e62217}\index{gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}!operator\+[]\+@{operator[]}}
\index{operator\+[]\+@{operator[]}!gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}}
\doxysubsubsection{\texorpdfstring{operator[]()}{operator[]()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{structgko_1_1dim_a8f62915634727b12aed8ebb6e3e62217} 
template$<$\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality, typename Dimension\+Type = size\+\_\+type$>$ \\
const dimension\+\_\+type \& \doxymbox{\hyperlink{structgko_1_1dim}{gko::\+dim}}$<$ Dimensionality, Dimension\+Type $>$::\+operator\+[$\,$]\+ (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \&}]{dimension}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}, {\ttfamily [noexcept]}}



Returns the requested dimension. 

For example, if {\ttfamily d} is a \doxylink{structgko_1_1dim}{dim$<$2$>$} object representing matrix dimensions, {\ttfamily d\+[0]\+} returns the number of rows, and {\ttfamily d\+[1]\+} returns the number of columns.


\begin{DoxyParams}{Parameters}
{\em dimension} & the requested dimension\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the {\ttfamily dimension}-\/th dimension 
\end{DoxyReturn}
\Hypertarget{structgko_1_1dim_a9291ce5a513a65f1623822d584fef2e4}\index{gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}!operator\+[]\+@{operator[]}}
\index{operator\+[]\+@{operator[]}!gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}}
\doxysubsubsection{\texorpdfstring{operator[]()}{operator[]()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{structgko_1_1dim_a9291ce5a513a65f1623822d584fef2e4} 
template$<$\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality, typename Dimension\+Type = size\+\_\+type$>$ \\
dimension\+\_\+type \& \doxymbox{\hyperlink{structgko_1_1dim}{gko::\+dim}}$<$ Dimensionality, Dimension\+Type $>$::\+operator\+[$\,$]\+ (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \&}]{dimension}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}







\label{doc-related-members}
\Hypertarget{structgko_1_1dim_doc-related-members}
\doxysubsection{Friends And Related Symbol Documentation}
\Hypertarget{structgko_1_1dim_a2fc2e8710193f9a9d911a230e63711a2}\index{gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}!operator"!=@{operator"!=}}
\index{operator"!=@{operator"!=}!gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}}
\doxysubsubsection{\texorpdfstring{operator"!=}{operator!=}}
{\footnotesize\ttfamily \label{structgko_1_1dim_a2fc2e8710193f9a9d911a230e63711a2} 
template$<$\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality, typename Dimension\+Type = size\+\_\+type$>$ \\
bool operator!= (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}}$<$ Dimensionality, Dimension\+Type $>$ \&}]{x}{, }\item[{const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}}$<$ Dimensionality, Dimension\+Type $>$ \&}]{y}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [friend]}}



Checks if two dim objects are not equal. 


\begin{DoxyParams}{Parameters}
{\em x} & first object \\
\hline
{\em y} & second object\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false if and only if all dimensions of both objects are equal. 
\end{DoxyReturn}


References \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim()}}.

\Hypertarget{structgko_1_1dim_a27d25e410396817b4ceafbae3d5df5c8}\index{gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}!operator\texorpdfstring{$\ast$}{*}@{operator\texorpdfstring{$\ast$}{*}}}
\index{operator\texorpdfstring{$\ast$}{*}@{operator\texorpdfstring{$\ast$}{*}}!gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}}
\doxysubsubsection{\texorpdfstring{operator\texorpdfstring{$\ast$}{*}}{operator*}}
{\footnotesize\ttfamily \label{structgko_1_1dim_a27d25e410396817b4ceafbae3d5df5c8} 
template$<$\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality, typename Dimension\+Type = size\+\_\+type$>$ \\
\doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}} operator\texorpdfstring{$\ast$}{*} (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}}$<$ Dimensionality, Dimension\+Type $>$ \&}]{x}{, }\item[{const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}}$<$ Dimensionality, Dimension\+Type $>$ \&}]{y}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [friend]}}



Multiplies two dim objects. 


\begin{DoxyParams}{Parameters}
{\em x} & first object \\
\hline
{\em y} & second object\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a dim object representing the size of the tensor product {\ttfamily x \texorpdfstring{$\ast$}{*} y} 
\end{DoxyReturn}


References \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim()}}.

\Hypertarget{structgko_1_1dim_a6494433a0fd67659179d73029060bf17}\index{gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}!operator$<$$<$@{operator$<$$<$}}
\index{operator$<$$<$@{operator$<$$<$}!gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}}
\doxysubsubsection{\texorpdfstring{operator$<$$<$}{operator<<}}
{\footnotesize\ttfamily \label{structgko_1_1dim_a6494433a0fd67659179d73029060bf17} 
template$<$\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality, typename Dimension\+Type = size\+\_\+type$>$ \\
std::\+ostream \& operator$<$$<$ (\begin{DoxyParamCaption}\item[{std::\+ostream \&}]{os}{, }\item[{const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}}$<$ Dimensionality, Dimension\+Type $>$ \&}]{x}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [friend]}}



A stream operator overload for dim. 


\begin{DoxyParams}{Parameters}
{\em os} & stream object \\
\hline
{\em x} & dim object\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a stream object appended with the dim output 
\end{DoxyReturn}


References \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim()}}.

\Hypertarget{structgko_1_1dim_a5e2c1e99f1c12540aac8489127c5dfb6}\index{gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}!operator==@{operator==}}
\index{operator==@{operator==}!gko::dim$<$ Dimensionality, DimensionType $>$@{gko::dim$<$ Dimensionality, DimensionType $>$}}
\doxysubsubsection{\texorpdfstring{operator==}{operator==}}
{\footnotesize\ttfamily \label{structgko_1_1dim_a5e2c1e99f1c12540aac8489127c5dfb6} 
template$<$\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} Dimensionality, typename Dimension\+Type = size\+\_\+type$>$ \\
bool operator== (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}}$<$ Dimensionality, Dimension\+Type $>$ \&}]{x}{, }\item[{const \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim}}$<$ Dimensionality, Dimension\+Type $>$ \&}]{y}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [friend]}}



Checks if two dim objects are equal. 


\begin{DoxyParams}{Parameters}
{\em x} & first object \\
\hline
{\em y} & second object\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if and only if all dimensions of both objects are equal. 
\end{DoxyReturn}


References \doxymbox{\hyperlink{structgko_1_1dim_a201dac73c419061a8a2dd2119c573a19}{dim()}}.



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