\doxysection{gko::\+matrix\+\_\+data\texorpdfstring{$<$}{<} Value\+Type, Index\+Type \texorpdfstring{$>$}{>} Struct Template Reference}
\hypertarget{structgko_1_1matrix__data}{}\label{structgko_1_1matrix__data}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}


This structure is used as an intermediate data type to store a sparse matrix.  




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



Inheritance diagram for gko::\+matrix\+\_\+data\texorpdfstring{$<$}{<} Value\+Type, Index\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{structgko_1_1matrix__data__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for gko::\+matrix\+\_\+data\texorpdfstring{$<$}{<} Value\+Type, Index\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{structgko_1_1matrix__data__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{structgko_1_1matrix__data_a6c838616006189780b02eb05d0c60fa6}\label{structgko_1_1matrix__data_a6c838616006189780b02eb05d0c60fa6} 
using {\bfseries value\+\_\+type} = Value\+Type
\item 
\Hypertarget{structgko_1_1matrix__data_a60fc773e696c9295aff1d9f685a67712}\label{structgko_1_1matrix__data_a60fc773e696c9295aff1d9f685a67712} 
using {\bfseries index\+\_\+type} = Index\+Type
\item 
\Hypertarget{structgko_1_1matrix__data_a083205dc2d87cf76f02d050a2cc576bd}\label{structgko_1_1matrix__data_a083205dc2d87cf76f02d050a2cc576bd} 
using {\bfseries nonzero\+\_\+type} = \doxymbox{\hyperlink{structgko_1_1matrix__data__entry}{matrix\+\_\+data\+\_\+entry}}$<$value\+\_\+type, index\+\_\+type$>$
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} (\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ size\+\_\+=\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$\{\}, Value\+Type value=\doxymbox{\hyperlink{namespacegko_a70dbe01ff95c7b953d3d737424c6feb5}{zero}}$<$ Value\+Type $>$())
\begin{DoxyCompactList}\small\item\em Initializes a matrix filled with the specified value. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Random\+Distribution, typename Random\+Engine$>$ }\\\doxymbox{\hyperlink{structgko_1_1matrix__data_aea89944190aba3ace872bf31fd98fd3d}{matrix\+\_\+data}} (\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ size\+\_\+, Random\+Distribution \&\&dist, Random\+Engine \&\&engine)
\begin{DoxyCompactList}\small\item\em Initializes a matrix with random values from the specified distribution. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{structgko_1_1matrix__data_ac78cdd3da5bed7779109ba2569ce93fe}{matrix\+\_\+data}} (std::\+initializer\+\_\+list$<$ std::\+initializer\+\_\+list$<$ Value\+Type $>$ $>$ values)
\begin{DoxyCompactList}\small\item\em List-\/initializes the structure from a matrix of values. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{structgko_1_1matrix__data_afe0e4e15f03548f48b99649375cf64ba}{matrix\+\_\+data}} (\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ size\+\_\+, std::\+initializer\+\_\+list$<$ detail::\+input\+\_\+triple$<$ Value\+Type, Index\+Type $>$ $>$ nonzeros\+\_\+)
\begin{DoxyCompactList}\small\item\em Initializes the structure from a list of nonzeros. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{structgko_1_1matrix__data_aa8398ce720b3db2ebde137419d032352}{matrix\+\_\+data}} (\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ size\+\_\+, const matrix\+\_\+data \&block)
\begin{DoxyCompactList}\small\item\em Initializes a matrix out of a matrix block via duplication. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Accessor$>$ }\\\doxymbox{\hyperlink{structgko_1_1matrix__data_a380d2b8207621f3c997804afa6d729af}{matrix\+\_\+data}} (const \doxymbox{\hyperlink{classgko_1_1range}{range}}$<$ Accessor $>$ \&data)
\begin{DoxyCompactList}\small\item\em Initializes a matrix from a range. \end{DoxyCompactList}\item 
\Hypertarget{structgko_1_1matrix__data_ab2094160087e0d7fcbb85120f2138b52}\label{structgko_1_1matrix__data_ab2094160087e0d7fcbb85120f2138b52} 
void {\bfseries sort\+\_\+row\+\_\+major} ()
\begin{DoxyCompactList}\small\item\em Sorts the nonzero vector so the values follow row-\/major order. \end{DoxyCompactList}\item 
\Hypertarget{structgko_1_1matrix__data_ac83a3b5d892fbd132fd9a7f50b0f83b8}\label{structgko_1_1matrix__data_ac83a3b5d892fbd132fd9a7f50b0f83b8} 
void {\bfseries ensure\+\_\+row\+\_\+major\+\_\+order} ()
\begin{DoxyCompactList}\small\item\em Sorts the nonzero vector so the values follow row-\/major order. \end{DoxyCompactList}\item 
\Hypertarget{structgko_1_1matrix__data_a7b360eaf4c11e846c561f2910e2d425f}\label{structgko_1_1matrix__data_a7b360eaf4c11e846c561f2910e2d425f} 
void {\bfseries remove\+\_\+zeros} ()
\begin{DoxyCompactList}\small\item\em Remove entries with value zero from the matrix data. \end{DoxyCompactList}\item 
void \doxymbox{\hyperlink{structgko_1_1matrix__data_aafdce2b510afe4e0aa0645a734f240a3}{sum\+\_\+duplicates}} ()
\begin{DoxyCompactList}\small\item\em Sum up all values that refer to the same matrix entry. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static \doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data_a307091117617a342b9e576bcc9dd3c80}{diag}} (\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ size\+\_\+, Value\+Type value)
\begin{DoxyCompactList}\small\item\em Initializes a diagonal matrix. \end{DoxyCompactList}\item 
static \doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data_aa80c7201a72ebf5b79a793b8d38db8e2}{diag}} (\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ size\+\_\+, std::\+initializer\+\_\+list$<$ Value\+Type $>$ nonzeros\+\_\+)
\begin{DoxyCompactList}\small\item\em Initializes a diagonal matrix using a list of diagonal elements. \end{DoxyCompactList}\item 
static \doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data_a2d2fb8725ef69679a74f7bd2f627e776}{diag}} (\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ size\+\_\+, const \doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \&block)
\begin{DoxyCompactList}\small\item\em Initializes a block-\/diagonal matrix. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Forward\+Iterator$>$ }\\static \doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data_a83d309b12caf3957c116ed1133da39a7}{diag}} (Forward\+Iterator begin, Forward\+Iterator end)
\begin{DoxyCompactList}\small\item\em Initializes a block-\/diagonal matrix from a list of diagonal blocks. \end{DoxyCompactList}\item 
static \doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data_aa809c5fbd147b72b18efeca595338398}{diag}} (std::\+initializer\+\_\+list$<$ \doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} $>$ blocks)
\begin{DoxyCompactList}\small\item\em Initializes a block-\/diagonal matrix from a list of diagonal blocks. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Random\+Distribution, typename Random\+Engine$>$ }\\static \doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data_a84056e4ef41884be328ec78554074df1}{cond}} (\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \doxymbox{\hyperlink{structgko_1_1matrix__data_a30716bd9e39a7beed52fc56d737fc07b}{size}}, \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\+\_\+complex}}$<$ Value\+Type $>$ condition\+\_\+number, Random\+Distribution \&\&dist, Random\+Engine \&\&engine, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} num\+\_\+reflectors)
\begin{DoxyCompactList}\small\item\em Initializes a random dense matrix with a specific condition number. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Random\+Distribution, typename Random\+Engine$>$ }\\static \doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data_aff5d2293d78e83ed783b5b8e231e7ede}{cond}} (\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \doxymbox{\hyperlink{structgko_1_1matrix__data_a30716bd9e39a7beed52fc56d737fc07b}{size}}, \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\+\_\+complex}}$<$ Value\+Type $>$ condition\+\_\+number, Random\+Distribution \&\&dist, Random\+Engine \&\&engine)
\begin{DoxyCompactList}\small\item\em Initializes a random dense matrix with a specific condition number. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{structgko_1_1matrix__data_a30716bd9e39a7beed52fc56d737fc07b}\label{structgko_1_1matrix__data_a30716bd9e39a7beed52fc56d737fc07b} 
\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ {\bfseries size}
\begin{DoxyCompactList}\small\item\em Size of the matrix. \end{DoxyCompactList}\item 
std::\+vector$<$ nonzero\+\_\+type $>$ \doxymbox{\hyperlink{structgko_1_1matrix__data_a4f6be92270fa96bccdc502c83d248dc0}{nonzeros}}
\begin{DoxyCompactList}\small\item\em A vector of tuples storing the non-\/zeros of the matrix. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$\newline
struct gko::\+matrix\+\_\+data$<$ Value\+Type, Index\+Type $>$}
This structure is used as an intermediate data type to store a sparse matrix. 

The matrix is stored as a sequence of nonzero elements, where each element is a triple of the form (row\+\_\+index, column\+\_\+index, value).

\begin{DoxyNote}{Note}
All Ginkgo functions returning such a structure will return the nonzeros sorted in row-\/major order. 

All Ginkgo functions that take this structure as input expect that the nonzeros are sorted in row-\/major order and that the index pair (row\+\_\+index, column\+\_\+index) of each nonzero is unique. 

This structure is not optimized for usual access patterns and it can only exist on the CPU. Thus, it should only be used for utility functions which do not have to be optimized for performance.
\end{DoxyNote}

\begin{DoxyTemplParams}{Template Parameters}
{\em Value\+Type} & type of matrix values stored in the structure \\
\hline
{\em Index\+Type} & type of matrix indexes stored in the structure \\
\hline
\end{DoxyTemplParams}


\label{doc-constructors}
\Hypertarget{structgko_1_1matrix__data_doc-constructors}
\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!matrix\_data@{matrix\_data}}
\index{matrix\_data@{matrix\_data}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{matrix\_data()}{matrix\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [1/6]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+matrix\+\_\+data (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$}]{size\+\_\+}{ = {\ttfamily \doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$2$>$\{\}}, }\item[{Value\+Type}]{value}{ = {\ttfamily \doxymbox{\hyperlink{namespacegko_a70dbe01ff95c7b953d3d737424c6feb5}{zero}}$<$ValueType$>$()}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Initializes a matrix filled with the specified value. 


\begin{DoxyParams}{Parameters}
{\em size\+\_\+} & dimensions of the matrix \\
\hline
{\em value} & value used to fill the elements of the matrix \\
\hline
\end{DoxyParams}
\Hypertarget{structgko_1_1matrix__data_aea89944190aba3ace872bf31fd98fd3d}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!matrix\_data@{matrix\_data}}
\index{matrix\_data@{matrix\_data}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{matrix\_data()}{matrix\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [2/6]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_aea89944190aba3ace872bf31fd98fd3d} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
template$<$typename Random\+Distribution, typename Random\+Engine$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+matrix\+\_\+data (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$}]{size\+\_\+}{, }\item[{Random\+Distribution \&\&}]{dist}{, }\item[{Random\+Engine \&\&}]{engine}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Initializes a matrix with random values from the specified distribution. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Random\+Distribution} & random distribution type \\
\hline
{\em Random\+Engine} & random engine type\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em size\+\_\+} & dimensions of the matrix \\
\hline
{\em dist} & random distribution of the elements of the matrix \\
\hline
{\em engine} & random engine used to generate random values \\
\hline
\end{DoxyParams}
\Hypertarget{structgko_1_1matrix__data_ac78cdd3da5bed7779109ba2569ce93fe}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!matrix\_data@{matrix\_data}}
\index{matrix\_data@{matrix\_data}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{matrix\_data()}{matrix\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [3/6]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_ac78cdd3da5bed7779109ba2569ce93fe} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+matrix\+\_\+data (\begin{DoxyParamCaption}\item[{std::\+initializer\+\_\+list$<$ std::\+initializer\+\_\+list$<$ Value\+Type $>$ $>$}]{values}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



List-\/initializes the structure from a matrix of values. 


\begin{DoxyParams}{Parameters}
{\em values} & a 2D braced-\/init-\/list of matrix values. \\
\hline
\end{DoxyParams}
\Hypertarget{structgko_1_1matrix__data_afe0e4e15f03548f48b99649375cf64ba}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!matrix\_data@{matrix\_data}}
\index{matrix\_data@{matrix\_data}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{matrix\_data()}{matrix\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [4/6]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_afe0e4e15f03548f48b99649375cf64ba} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+matrix\+\_\+data (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$}]{size\+\_\+}{, }\item[{std::\+initializer\+\_\+list$<$ detail::\+input\+\_\+triple$<$ Value\+Type, Index\+Type $>$ $>$}]{nonzeros\+\_\+}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Initializes the structure from a list of nonzeros. 


\begin{DoxyParams}{Parameters}
{\em size\+\_\+} & dimensions of the matrix \\
\hline
{\em nonzeros\+\_\+} & list of nonzero elements \\
\hline
\end{DoxyParams}
\Hypertarget{structgko_1_1matrix__data_aa8398ce720b3db2ebde137419d032352}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!matrix\_data@{matrix\_data}}
\index{matrix\_data@{matrix\_data}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{matrix\_data()}{matrix\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [5/6]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_aa8398ce720b3db2ebde137419d032352} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+matrix\+\_\+data (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$}]{size\+\_\+}{, }\item[{const matrix\+\_\+data$<$ Value\+Type, Index\+Type $>$ \&}]{block}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Initializes a matrix out of a matrix block via duplication. 


\begin{DoxyParams}{Parameters}
{\em \doxylink{structgko_1_1matrix__data_a30716bd9e39a7beed52fc56d737fc07b}{size}} & size of the block-\/matrix (in blocks) \\
\hline
{\em diag\+\_\+block} & matrix block used to fill the complete matrix \\
\hline
\end{DoxyParams}
\Hypertarget{structgko_1_1matrix__data_a380d2b8207621f3c997804afa6d729af}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!matrix\_data@{matrix\_data}}
\index{matrix\_data@{matrix\_data}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{matrix\_data()}{matrix\_data()}\hspace{0.1cm}{\footnotesize\ttfamily [6/6]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_a380d2b8207621f3c997804afa6d729af} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
template$<$typename Accessor$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+matrix\+\_\+data (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{classgko_1_1range}{range}}$<$ Accessor $>$ \&}]{data}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Initializes a matrix from a range. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Accessor} & accessor type of the input range\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em data} & range used to initialize the matrix \\
\hline
\end{DoxyParams}


\label{doc-func-members}
\Hypertarget{structgko_1_1matrix__data_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{structgko_1_1matrix__data_aff5d2293d78e83ed783b5b8e231e7ede}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!cond@{cond}}
\index{cond@{cond}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{cond()}{cond()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_aff5d2293d78e83ed783b5b8e231e7ede} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
template$<$typename Random\+Distribution, typename Random\+Engine$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+cond (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{size}{, }\item[{\doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\+\_\+complex}}$<$ Value\+Type $>$}]{condition\+\_\+number}{, }\item[{Random\+Distribution \&\&}]{dist}{, }\item[{Random\+Engine \&\&}]{engine}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Initializes a random dense matrix with a specific condition number. 

The matrix is generated by applying a series of random Hausholder reflectors to a diagonal matrix with diagonal entries uniformly distributed between {\ttfamily sqrt(condition\+\_\+number)} and {\ttfamily 1/\+sqrt(condition\+\_\+number)}.

This version of the function applies {\ttfamily \doxylink{structgko_1_1matrix__data_a30716bd9e39a7beed52fc56d737fc07b}{size} -\/ 1} reflectors to each side of the diagonal matrix.


\begin{DoxyTemplParams}{Template Parameters}
{\em Random\+Distribution} & the type of the random distribution \\
\hline
{\em Random\+Engine} & the type of the random engine\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em \doxylink{structgko_1_1matrix__data_a30716bd9e39a7beed52fc56d737fc07b}{size}} & number of rows and columns of the matrix \\
\hline
{\em condition\+\_\+number} & condition number of the matrix \\
\hline
{\em dist} & random distribution used to generate reflectors \\
\hline
{\em engine} & random engine used to generate reflectors\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the dense matrix with the specified condition number 
\end{DoxyReturn}
\Hypertarget{structgko_1_1matrix__data_a84056e4ef41884be328ec78554074df1}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!cond@{cond}}
\index{cond@{cond}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{cond()}{cond()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_a84056e4ef41884be328ec78554074df1} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
template$<$typename Random\+Distribution, typename Random\+Engine$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+cond (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{size}{, }\item[{\doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\+\_\+complex}}$<$ Value\+Type $>$}]{condition\+\_\+number}{, }\item[{Random\+Distribution \&\&}]{dist}{, }\item[{Random\+Engine \&\&}]{engine}{, }\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{num\+\_\+reflectors}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Initializes a random dense matrix with a specific condition number. 

The matrix is generated by applying a series of random Hausholder reflectors to a diagonal matrix with diagonal entries uniformly distributed between {\ttfamily sqrt(condition\+\_\+number)} and {\ttfamily 1/\+sqrt(condition\+\_\+number)}.


\begin{DoxyTemplParams}{Template Parameters}
{\em Random\+Distribution} & the type of the random distribution \\
\hline
{\em Random\+Engine} & the type of the random engine\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em \doxylink{structgko_1_1matrix__data_a30716bd9e39a7beed52fc56d737fc07b}{size}} & number of rows and columns of the matrix \\
\hline
{\em condition\+\_\+number} & condition number of the matrix \\
\hline
{\em dist} & random distribution used to generate reflectors \\
\hline
{\em engine} & random engine used to generate reflectors \\
\hline
{\em num\+\_\+reflectors} & number of reflectors to apply from each side\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the dense matrix with the specified condition number 
\end{DoxyReturn}


Referenced by \doxymbox{\hyperlink{structgko_1_1matrix__data_aff5d2293d78e83ed783b5b8e231e7ede}{gko::\+matrix\+\_\+data$<$ value\+\_\+type, index\+\_\+type $>$::\+cond()}}.

\Hypertarget{structgko_1_1matrix__data_a2d2fb8725ef69679a74f7bd2f627e776}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!diag@{diag}}
\index{diag@{diag}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{diag()}{diag()}\hspace{0.1cm}{\footnotesize\ttfamily [1/5]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_a2d2fb8725ef69679a74f7bd2f627e776} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+diag (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$}]{size\+\_\+}{, }\item[{const \doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$ \&}]{block}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Initializes a block-\/diagonal matrix. 


\begin{DoxyParams}{Parameters}
{\em size\+\_\+} & the size of the matrix \\
\hline
{\em diag\+\_\+block} & matrix used to fill diagonal blocks\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the block-\/diagonal matrix 
\end{DoxyReturn}
\Hypertarget{structgko_1_1matrix__data_aa80c7201a72ebf5b79a793b8d38db8e2}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!diag@{diag}}
\index{diag@{diag}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{diag()}{diag()}\hspace{0.1cm}{\footnotesize\ttfamily [2/5]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_aa80c7201a72ebf5b79a793b8d38db8e2} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+diag (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$}]{size\+\_\+}{, }\item[{std::\+initializer\+\_\+list$<$ Value\+Type $>$}]{nonzeros\+\_\+}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Initializes a diagonal matrix using a list of diagonal elements. 


\begin{DoxyParams}{Parameters}
{\em size\+\_\+} & dimensions of the matrix \\
\hline
{\em nonzeros\+\_\+} & list of diagonal elements\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the diagonal matrix 
\end{DoxyReturn}
\Hypertarget{structgko_1_1matrix__data_a307091117617a342b9e576bcc9dd3c80}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!diag@{diag}}
\index{diag@{diag}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{diag()}{diag()}\hspace{0.1cm}{\footnotesize\ttfamily [3/5]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_a307091117617a342b9e576bcc9dd3c80} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+diag (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$}]{size\+\_\+}{, }\item[{Value\+Type}]{value}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Initializes a diagonal matrix. 


\begin{DoxyParams}{Parameters}
{\em size\+\_\+} & dimensions of the matrix \\
\hline
{\em value} & value used to fill the elements of the matrix\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the diagonal matrix 
\end{DoxyReturn}


Referenced by \doxymbox{\hyperlink{structgko_1_1matrix__data_aa809c5fbd147b72b18efeca595338398}{gko::\+matrix\+\_\+data$<$ value\+\_\+type, index\+\_\+type $>$::\+diag()}}.

\Hypertarget{structgko_1_1matrix__data_a83d309b12caf3957c116ed1133da39a7}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!diag@{diag}}
\index{diag@{diag}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{diag()}{diag()}\hspace{0.1cm}{\footnotesize\ttfamily [4/5]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_a83d309b12caf3957c116ed1133da39a7} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
template$<$typename Forward\+Iterator$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+diag (\begin{DoxyParamCaption}\item[{Forward\+Iterator}]{begin}{, }\item[{Forward\+Iterator}]{end}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Initializes a block-\/diagonal matrix from a list of diagonal blocks. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Forward\+Iterator} & type of list iterator\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em begin} & the first iterator of the list \\
\hline
{\em end} & the last iterator of the list\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the block-\/diagonal matrix with diagonal blocks set to the blocks between begin (inclusive) and end (exclusive) 
\end{DoxyReturn}
\Hypertarget{structgko_1_1matrix__data_aa809c5fbd147b72b18efeca595338398}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!diag@{diag}}
\index{diag@{diag}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{diag()}{diag()}\hspace{0.1cm}{\footnotesize\ttfamily [5/5]}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_aa809c5fbd147b72b18efeca595338398} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}} \doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+diag (\begin{DoxyParamCaption}\item[{std::\+initializer\+\_\+list$<$ \doxymbox{\hyperlink{structgko_1_1matrix__data_a4be80a4afbd7f905aa4e73fbeb9df762}{matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$ $>$}]{blocks}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Initializes a block-\/diagonal matrix from a list of diagonal blocks. 


\begin{DoxyParams}{Parameters}
{\em blocks} & a list of blocks to initialize from\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the block-\/diagonal matrix with diagonal blocks set to the blocks passed in blocks 
\end{DoxyReturn}
\Hypertarget{structgko_1_1matrix__data_aafdce2b510afe4e0aa0645a734f240a3}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!sum\_duplicates@{sum\_duplicates}}
\index{sum\_duplicates@{sum\_duplicates}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{sum\_duplicates()}{sum\_duplicates()}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_aafdce2b510afe4e0aa0645a734f240a3} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
void \doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+sum\+\_\+duplicates (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Sum up all values that refer to the same matrix entry. 

The result is sorted in row-\/major order. 

\label{doc-variable-members}
\Hypertarget{structgko_1_1matrix__data_doc-variable-members}
\doxysubsection{Member Data Documentation}
\Hypertarget{structgko_1_1matrix__data_a4f6be92270fa96bccdc502c83d248dc0}\index{gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}!nonzeros@{nonzeros}}
\index{nonzeros@{nonzeros}!gko::matrix\_data$<$ ValueType, IndexType $>$@{gko::matrix\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{nonzeros}{nonzeros}}
{\footnotesize\ttfamily \label{structgko_1_1matrix__data_a4f6be92270fa96bccdc502c83d248dc0} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
std::\+vector$<$nonzero\+\_\+type$>$ \doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::\+matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+nonzeros}



A vector of tuples storing the non-\/zeros of the matrix. 

The first two elements of the tuple are the row index and the column index of a matrix element, and its third element is the value at that position. 

Referenced by \doxymbox{\hyperlink{structgko_1_1matrix__data_a2d2fb8725ef69679a74f7bd2f627e776}{gko::\+matrix\+\_\+data$<$ value\+\_\+type, index\+\_\+type $>$::\+diag()}}, \doxymbox{\hyperlink{structgko_1_1matrix__data_aa80c7201a72ebf5b79a793b8d38db8e2}{gko::\+matrix\+\_\+data$<$ value\+\_\+type, index\+\_\+type $>$::\+diag()}}, \doxymbox{\hyperlink{structgko_1_1matrix__data_a307091117617a342b9e576bcc9dd3c80}{gko::\+matrix\+\_\+data$<$ value\+\_\+type, index\+\_\+type $>$::\+diag()}}, \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data_a9a86018a5bd6475d8bd3c4ea229aee1d}{gko::\+matrix\+\_\+assembly\+\_\+data$<$ Value\+Type, Index\+Type $>$::\+get\+\_\+ordered\+\_\+data()}}, and \doxymbox{\hyperlink{structgko_1_1matrix__data_aa8398ce720b3db2ebde137419d032352}{gko::\+matrix\+\_\+data$<$ value\+\_\+type, index\+\_\+type $>$::\+matrix\+\_\+data()}}.



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