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


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




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

\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1matrix__assembly__data_a2d82e8f2d5d54f9a40d7203b8aa846a0}\label{classgko_1_1matrix__assembly__data_a2d82e8f2d5d54f9a40d7203b8aa846a0} 
using {\bfseries value\+\_\+type} = Value\+Type
\item 
\Hypertarget{classgko_1_1matrix__assembly__data_aca749bd223b0c216236a7168e59dc248}\label{classgko_1_1matrix__assembly__data_aca749bd223b0c216236a7168e59dc248} 
using {\bfseries index\+\_\+type} = Index\+Type
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1matrix__assembly__data_a1d69991399629a0de0cd275743acfab1}\label{classgko_1_1matrix__assembly__data_a1d69991399629a0de0cd275743acfab1} 
{\bfseries matrix\+\_\+assembly\+\_\+data} (\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ size)
\item 
void \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data_a0927a396f936167366bce13745156cf5}{add\+\_\+value}} (index\+\_\+type row, index\+\_\+type col, value\+\_\+type val)
\begin{DoxyCompactList}\small\item\em Sets the matrix value at (row, col). \end{DoxyCompactList}\item 
void \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data_a2860092246c1184546610e903ac1b94b}{set\+\_\+value}} (index\+\_\+type row, index\+\_\+type col, value\+\_\+type val)
\begin{DoxyCompactList}\small\item\em Sets the matrix value at (row, col). \end{DoxyCompactList}\item 
value\+\_\+type \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data_a55c82c5c099a6a77c0dfb3930148f09c}{get\+\_\+value}} (index\+\_\+type row, index\+\_\+type col)
\begin{DoxyCompactList}\small\item\em Gets the matrix value at (row, col). \end{DoxyCompactList}\item 
bool \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data_a38a6b452ac3c028ed0c7f2eeac4616e8}{contains}} (index\+\_\+type row, index\+\_\+type col)
\begin{DoxyCompactList}\small\item\em Returns true iff the matrix contains an entry at (row, col). \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data_a740d347282ce8588ab21637a6728bd9f}{get\+\_\+size}} () const noexcept
\item 
\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data_a300e1722d1853b50fb2c196a2457d0f2}{get\+\_\+num\+\_\+stored\+\_\+elements}} () const noexcept
\item 
\doxymbox{\hyperlink{structgko_1_1matrix__data}{matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$ \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data_a9a86018a5bd6475d8bd3c4ea229aee1d}{get\+\_\+ordered\+\_\+data}} () const
\end{DoxyCompactItemize}


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

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

New values can be added by using the \doxylink{classgko_1_1matrix__assembly__data_a0927a396f936167366bce13745156cf5}{matrix\+\_\+assembly\+\_\+data::\+add\+\_\+value} or \doxylink{classgko_1_1matrix__assembly__data_a2860092246c1184546610e903ac1b94b}{matrix\+\_\+assembly\+\_\+data::\+set\+\_\+value}


\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-func-members}
\Hypertarget{classgko_1_1matrix__assembly__data_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1matrix__assembly__data_a0927a396f936167366bce13745156cf5}\index{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}!add\_value@{add\_value}}
\index{add\_value@{add\_value}!gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{add\_value()}{add\_value()}}
{\footnotesize\ttfamily \label{classgko_1_1matrix__assembly__data_a0927a396f936167366bce13745156cf5} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
void \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data}{gko::\+matrix\+\_\+assembly\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+add\+\_\+value (\begin{DoxyParamCaption}\item[{index\+\_\+type}]{row}{, }\item[{index\+\_\+type}]{col}{, }\item[{value\+\_\+type}]{val}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Sets the matrix value at (row, col). 

If there is an existing value, it will be set to the sum of the existing and new value, otherwise the value will be inserted.


\begin{DoxyParams}{Parameters}
{\em row} & the row where the value should be added \\
\hline
{\em col} & the column where the value should be added \\
\hline
{\em val} & the value to be added to (row, col) \\
\hline
\end{DoxyParams}
\Hypertarget{classgko_1_1matrix__assembly__data_a38a6b452ac3c028ed0c7f2eeac4616e8}\index{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}!contains@{contains}}
\index{contains@{contains}!gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{contains()}{contains()}}
{\footnotesize\ttfamily \label{classgko_1_1matrix__assembly__data_a38a6b452ac3c028ed0c7f2eeac4616e8} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
bool \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data}{gko::\+matrix\+\_\+assembly\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+contains (\begin{DoxyParamCaption}\item[{index\+\_\+type}]{row}{, }\item[{index\+\_\+type}]{col}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Returns true iff the matrix contains an entry at (row, col). 


\begin{DoxyParams}{Parameters}
{\em row} & the row index \\
\hline
{\em col} & the column index \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the value at (row, col) exists, false otherwise 
\end{DoxyReturn}
\Hypertarget{classgko_1_1matrix__assembly__data_a300e1722d1853b50fb2c196a2457d0f2}\index{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}!get\_num\_stored\_elements@{get\_num\_stored\_elements}}
\index{get\_num\_stored\_elements@{get\_num\_stored\_elements}!gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_num\_stored\_elements()}{get\_num\_stored\_elements()}}
{\footnotesize\ttfamily \label{classgko_1_1matrix__assembly__data_a300e1722d1853b50fb2c196a2457d0f2} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data}{gko::\+matrix\+\_\+assembly\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+get\+\_\+num\+\_\+stored\+\_\+elements (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}

\begin{DoxyReturn}{Returns}
the number of non-\/zeros in the (partially) assembled matrix 
\end{DoxyReturn}
\Hypertarget{classgko_1_1matrix__assembly__data_a9a86018a5bd6475d8bd3c4ea229aee1d}\index{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}!get\_ordered\_data@{get\_ordered\_data}}
\index{get\_ordered\_data@{get\_ordered\_data}!gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_ordered\_data()}{get\_ordered\_data()}}
{\footnotesize\ttfamily \label{classgko_1_1matrix__assembly__data_a9a86018a5bd6475d8bd3c4ea229aee1d} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{structgko_1_1matrix__data}{matrix\+\_\+data}}$<$ Value\+Type, Index\+Type $>$ \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data}{gko::\+matrix\+\_\+assembly\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+get\+\_\+ordered\+\_\+data (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

\begin{DoxyReturn}{Returns}
a \doxylink{structgko_1_1matrix__data}{matrix\+\_\+data} instance containing the assembled non-\/zeros in row-\/major order to be used by all matrix formats. 
\end{DoxyReturn}


References \doxymbox{\hyperlink{structgko_1_1matrix__data_a4f6be92270fa96bccdc502c83d248dc0}{gko::\+matrix\+\_\+data$<$ Value\+Type, Index\+Type $>$::\+nonzeros}}.



Referenced by \doxymbox{\hyperlink{classgko_1_1ReadableFromMatrixData_a7fc1141f76b70b6ca112c7b99387b8b7}{gko::\+\+Readable\+From\+Matrix\+Data$<$ Value\+Type, Index\+Type $>$::\+read()}}.

\Hypertarget{classgko_1_1matrix__assembly__data_a740d347282ce8588ab21637a6728bd9f}\index{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}!get\_size@{get\_size}}
\index{get\_size@{get\_size}!gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_size()}{get\_size()}}
{\footnotesize\ttfamily \label{classgko_1_1matrix__assembly__data_a740d347282ce8588ab21637a6728bd9f} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data}{gko::\+matrix\+\_\+assembly\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+get\+\_\+size (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}

\begin{DoxyReturn}{Returns}
the dimensions of the matrix being assembled 
\end{DoxyReturn}
\Hypertarget{classgko_1_1matrix__assembly__data_a55c82c5c099a6a77c0dfb3930148f09c}\index{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}!get\_value@{get\_value}}
\index{get\_value@{get\_value}!gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_value()}{get\_value()}}
{\footnotesize\ttfamily \label{classgko_1_1matrix__assembly__data_a55c82c5c099a6a77c0dfb3930148f09c} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
value\+\_\+type \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data}{gko::\+matrix\+\_\+assembly\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+get\+\_\+value (\begin{DoxyParamCaption}\item[{index\+\_\+type}]{row}{, }\item[{index\+\_\+type}]{col}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Gets the matrix value at (row, col). 


\begin{DoxyParams}{Parameters}
{\em row} & the row index \\
\hline
{\em col} & the column index \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the value at (row, col) or 0 if it doesn\textquotesingle{}t exist. 
\end{DoxyReturn}


References \doxymbox{\hyperlink{namespacegko_a70dbe01ff95c7b953d3d737424c6feb5}{gko::\+zero()}}.

\Hypertarget{classgko_1_1matrix__assembly__data_a2860092246c1184546610e903ac1b94b}\index{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}!set\_value@{set\_value}}
\index{set\_value@{set\_value}!gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$@{gko::matrix\_assembly\_data$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{set\_value()}{set\_value()}}
{\footnotesize\ttfamily \label{classgko_1_1matrix__assembly__data_a2860092246c1184546610e903ac1b94b} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
void \doxymbox{\hyperlink{classgko_1_1matrix__assembly__data}{gko::\+matrix\+\_\+assembly\+\_\+data}}$<$ Value\+Type, Index\+Type $>$::\+set\+\_\+value (\begin{DoxyParamCaption}\item[{index\+\_\+type}]{row}{, }\item[{index\+\_\+type}]{col}{, }\item[{value\+\_\+type}]{val}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Sets the matrix value at (row, col). 

If there is an existing value, it will be overwritten by the new value.


\begin{DoxyParams}{Parameters}
{\em row} & the row index \\
\hline
{\em col} & the column index \\
\hline
{\em val} & the value to be written to (row, col) \\
\hline
\end{DoxyParams}


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