\doxysection{batch\+\_\+csr.\+hpp}
\hypertarget{batch__csr_8hpp_source}{}\label{batch__csr_8hpp_source}\index{ginkgo/core/matrix/batch\_csr.hpp@{ginkgo/core/matrix/batch\_csr.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{//\ SPDX-\/FileCopyrightText:\ 2017\ -\/\ 2025\ 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\_MATRIX\_BATCH\_CSR\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_MATRIX\_BATCH\_CSR\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <initializer\_list>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00011\ }
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/array.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/batch\_lin\_op.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/batch\_multi\_vector.hpp>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/executor.hpp>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/mtx\_io.hpp>}}
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/utils.hpp>}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/csr.hpp>}}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00022\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00023\ \textcolor{keyword}{namespace\ }batch\ \{}
\DoxyCodeLine{00024\ \textcolor{keyword}{namespace\ }matrix\ \{}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00046\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision,\ \textcolor{keyword}{typename}\ IndexType\ =\ \textcolor{keywordtype}{int}32>}
\DoxyCodeLine{00047\ \textcolor{keyword}{class\ }Csr\ final}
\DoxyCodeLine{00048\ \ \ \ \ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1EnableBatchLinOp}{EnableBatchLinOp}}<Csr<ValueType,\ IndexType>>,}
\DoxyCodeLine{00049\ \textcolor{preprocessor}{\#if\ GINKGO\_ENABLE\_HALF\ ||\ GINKGO\_ENABLE\_BFLOAT16}}
\DoxyCodeLine{00050\ \ \ \ \ \ \ \textcolor{keyword}{public}\ ConvertibleTo<Csr<next\_precision<ValueType,\ 2>,\ IndexType>>,}
\DoxyCodeLine{00051\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00052\ \textcolor{preprocessor}{\#if\ GINKGO\_ENABLE\_HALF\ \&\&\ GINKGO\_ENABLE\_BFLOAT16}}
\DoxyCodeLine{00053\ \ \ \ \ \ \ \textcolor{keyword}{public}\ ConvertibleTo<Csr<next\_precision<ValueType,\ 3>,\ IndexType>>,}
\DoxyCodeLine{00054\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00055\ \ \ \ \ \ \ \textcolor{keyword}{public}\ ConvertibleTo<Csr<next\_precision<ValueType>,\ IndexType>>\ \{}
\DoxyCodeLine{00056\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<Csr,\ \doxymbox{\hyperlink{classgko_1_1batch_1_1BatchLinOp}{BatchLinOp}}>;}
\DoxyCodeLine{00057\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }Csr<\doxymbox{\hyperlink{namespacegko_a4ad20e5381a84928753efde0b2bc7f85}{to\_complex}}<ValueType>,\ IndexType>;}
\DoxyCodeLine{00058\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }Csr<\doxymbox{\hyperlink{namespacegko_ada2119004771922e8f7fcb6910a0363c}{previous\_precision}}<ValueType>,\ IndexType>;}
\DoxyCodeLine{00059\ \ \ \ \ \textcolor{keyword}{static\_assert}(std::is\_same<IndexType,\ int32>::value,}
\DoxyCodeLine{00060\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}IndexType\ must\ be\ a\ 32\ bit\ integer"{}});}
\DoxyCodeLine{00061\ \ \ \ \ GKO\_ASSERT\_SUPPORTED\_VALUE\_TYPE;}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00063\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00064\ \ \ \ \ \textcolor{keyword}{using\ }\doxymbox{\hyperlink{classgko_1_1batch_1_1EnableBatchLinOp}{EnableBatchLinOp}}<Csr>::convert\_to;}
\DoxyCodeLine{00065\ \ \ \ \ \textcolor{keyword}{using\ }\doxymbox{\hyperlink{classgko_1_1batch_1_1EnableBatchLinOp}{EnableBatchLinOp}}<Csr>::move\_to;}
\DoxyCodeLine{00066\ }
\DoxyCodeLine{00067\ \ \ \ \ \textcolor{keyword}{using\ }value\_type\ =\ ValueType;}
\DoxyCodeLine{00068\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ IndexType;}
\DoxyCodeLine{00069\ \ \ \ \ \textcolor{keyword}{using\ }unbatch\_type\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<value\_type,\ index\_type>}};}
\DoxyCodeLine{00070\ \ \ \ \ \textcolor{keyword}{using\ }absolute\_type\ =\ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<Csr>}};}
\DoxyCodeLine{00071\ \ \ \ \ \textcolor{keyword}{using\ }complex\_type\ =\ \doxymbox{\hyperlink{namespacegko_a4ad20e5381a84928753efde0b2bc7f85}{to\_complex<Csr>}};}
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00073\ \ \ \ \ \textcolor{keywordtype}{void}\ convert\_to(}
\DoxyCodeLine{00074\ \ \ \ \ \ \ \ \ Csr<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType>}},\ IndexType>*\ result)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00075\ }
\DoxyCodeLine{00076\ \ \ \ \ \textcolor{keywordtype}{void}\ move\_to(Csr<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType>}},\ IndexType>*\ result)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00077\ }
\DoxyCodeLine{00078\ \textcolor{preprocessor}{\#if\ GINKGO\_ENABLE\_HALF\ ||\ GINKGO\_ENABLE\_BFLOAT16}}
\DoxyCodeLine{00079\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }Csr<\doxymbox{\hyperlink{namespacegko_ada2119004771922e8f7fcb6910a0363c}{previous\_precision}}<ValueType,\ 2>,\ IndexType>;}
\DoxyCodeLine{00080\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<}
\DoxyCodeLine{00081\ \ \ \ \ \ \ \ \ Csr<next\_precision<ValueType,\ 2>,\ IndexType>>::convert\_to;}
\DoxyCodeLine{00082\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<Csr<next\_precision<ValueType,\ 2>,\ IndexType>>::move\_to;}
\DoxyCodeLine{00083\ }
\DoxyCodeLine{00084\ \ \ \ \ \textcolor{keywordtype}{void}\ convert\_to(}
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ Csr<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType,\ 2>}},\ IndexType>*\ result)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00087\ \ \ \ \ \textcolor{keywordtype}{void}\ move\_to(Csr<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType,\ 2>}},\ IndexType>*\ result)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00088\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00090\ \textcolor{preprocessor}{\#if\ GINKGO\_ENABLE\_HALF\ \&\&\ GINKGO\_ENABLE\_BFLOAT16}}
\DoxyCodeLine{00091\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }Csr<\doxymbox{\hyperlink{namespacegko_ada2119004771922e8f7fcb6910a0363c}{previous\_precision}}<ValueType,\ 3>,\ IndexType>;}
\DoxyCodeLine{00092\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<}
\DoxyCodeLine{00093\ \ \ \ \ \ \ \ \ Csr<next\_precision<ValueType,\ 3>,\ IndexType>>::convert\_to;}
\DoxyCodeLine{00094\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<Csr<next\_precision<ValueType,\ 3>,\ IndexType>>::move\_to;}
\DoxyCodeLine{00095\ }
\DoxyCodeLine{00096\ \ \ \ \ \textcolor{keywordtype}{void}\ convert\_to(}
\DoxyCodeLine{00097\ \ \ \ \ \ \ \ \ Csr<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType,\ 3>}},\ IndexType>*\ result)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00098\ }
\DoxyCodeLine{00099\ \ \ \ \ \textcolor{keywordtype}{void}\ move\_to(Csr<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType,\ 3>}},\ IndexType>*\ result)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00100\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00101\ }
\DoxyCodeLine{00112\ \ \ \ \ std::unique\_ptr<unbatch\_type>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_afded6329a86f2eb4f1d2b7d6d7719359}{create\_view\_for\_item}}(\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ item\_id);}
\DoxyCodeLine{00113\ }
\DoxyCodeLine{00117\ \ \ \ \ std::unique\_ptr<const\ unbatch\_type>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a241bc10f81962c7e0b35c517dd6e8222}{create\_const\_view\_for\_item}}(}
\DoxyCodeLine{00118\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ item\_id)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00119\ }
\DoxyCodeLine{00125\ \ \ \ \ value\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a57cdd4d42f14917d47c5d7b96474e802}{get\_values}}()\ noexcept\ \{\ \textcolor{keywordflow}{return}\ values\_.get\_data();\ \}}
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00134\ \ \ \ \ \textcolor{keyword}{const}\ value\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_ae0aee55cbf7f9eb061472b18b5e1281d}{get\_const\_values}}()\ const\ noexcept}
\DoxyCodeLine{00135\ \ \ \ \ \{}
\DoxyCodeLine{00136\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_const\_data();}
\DoxyCodeLine{00137\ \ \ \ \ \}}
\DoxyCodeLine{00138\ }
\DoxyCodeLine{00144\ \ \ \ \ index\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a6d8a7b96be2834082768e8098c1a424d}{get\_col\_idxs}}()\ noexcept\ \{\ \textcolor{keywordflow}{return}\ col\_idxs\_.get\_data();\ \}}
\DoxyCodeLine{00145\ }
\DoxyCodeLine{00153\ \ \ \ \ \textcolor{keyword}{const}\ index\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a83e45d1dfa784a4f09e57f8b51d1f607}{get\_const\_col\_idxs}}()\ const\ noexcept}
\DoxyCodeLine{00154\ \ \ \ \ \{}
\DoxyCodeLine{00155\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ col\_idxs\_.get\_const\_data();}
\DoxyCodeLine{00156\ \ \ \ \ \}}
\DoxyCodeLine{00157\ }
\DoxyCodeLine{00163\ \ \ \ \ index\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_aee69116cc418c128d984a634d701e8eb}{get\_row\_ptrs}}()\ noexcept\ \{\ \textcolor{keywordflow}{return}\ row\_ptrs\_.get\_data();\ \}}
\DoxyCodeLine{00164\ }
\DoxyCodeLine{00172\ \ \ \ \ \textcolor{keyword}{const}\ index\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a6029a4db301094784d3f13dadf40bdd9}{get\_const\_row\_ptrs}}()\ const\ noexcept}
\DoxyCodeLine{00173\ \ \ \ \ \{}
\DoxyCodeLine{00174\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ row\_ptrs\_.get\_const\_data();}
\DoxyCodeLine{00175\ \ \ \ \ \}}
\DoxyCodeLine{00176\ }
\DoxyCodeLine{00184\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a32c35e5a01191c37d46a44b2eca3551b}{get\_num\_stored\_elements}}()\ const\ noexcept}
\DoxyCodeLine{00185\ \ \ \ \ \{}
\DoxyCodeLine{00186\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_size();}
\DoxyCodeLine{00187\ \ \ \ \ \}}
\DoxyCodeLine{00188\ }
\DoxyCodeLine{00194\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a8a83dc917e64e56912e89e1b09be117e}{get\_num\_elements\_per\_item}}()\ const\ noexcept}
\DoxyCodeLine{00195\ \ \ \ \ \{}
\DoxyCodeLine{00196\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a32c35e5a01191c37d46a44b2eca3551b}{get\_num\_stored\_elements}}()\ /\ this-\/>get\_num\_batch\_items();}
\DoxyCodeLine{00197\ \ \ \ \ \}}
\DoxyCodeLine{00198\ }
\DoxyCodeLine{00207\ \ \ \ \ value\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a178585a6ece8f57313998389e7404b92}{get\_values\_for\_item}}(\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ batch\_id)\ \textcolor{keyword}{noexcept}}
\DoxyCodeLine{00208\ \ \ \ \ \{}
\DoxyCodeLine{00209\ \ \ \ \ \ \ \ \ GKO\_ASSERT(batch\_id\ <\ this-\/>get\_num\_batch\_items());}
\DoxyCodeLine{00210\ \ \ \ \ \ \ \ \ GKO\_ASSERT(values\_.get\_size()\ >=}
\DoxyCodeLine{00211\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ batch\_id\ *\ this-\/>get\_num\_elements\_per\_item());}
\DoxyCodeLine{00212\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_data()\ +}
\DoxyCodeLine{00213\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ batch\_id\ *\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a8a83dc917e64e56912e89e1b09be117e}{get\_num\_elements\_per\_item}}();}
\DoxyCodeLine{00214\ \ \ \ \ \}}
\DoxyCodeLine{00215\ }
\DoxyCodeLine{00223\ \ \ \ \ \textcolor{keyword}{const}\ value\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_aa3075e9893d383dc4fad852201cec317}{get\_const\_values\_for\_item}}(}
\DoxyCodeLine{00224\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ batch\_id)\ \textcolor{keyword}{const}\ \textcolor{keyword}{noexcept}}
\DoxyCodeLine{00225\ \ \ \ \ \{}
\DoxyCodeLine{00226\ \ \ \ \ \ \ \ \ GKO\_ASSERT(batch\_id\ <\ this-\/>get\_num\_batch\_items());}
\DoxyCodeLine{00227\ \ \ \ \ \ \ \ \ GKO\_ASSERT(values\_.get\_size()\ >=}
\DoxyCodeLine{00228\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ batch\_id\ *\ this-\/>get\_num\_elements\_per\_item());}
\DoxyCodeLine{00229\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_const\_data()\ +}
\DoxyCodeLine{00230\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ batch\_id\ *\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a8a83dc917e64e56912e89e1b09be117e}{get\_num\_elements\_per\_item}}();}
\DoxyCodeLine{00231\ \ \ \ \ \}}
\DoxyCodeLine{00232\ }
\DoxyCodeLine{00248\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<Csr>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_aa6fdee51616719f9fe09de182d556177}{create}}(}
\DoxyCodeLine{00249\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00250\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ size\ =\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\{\},}
\DoxyCodeLine{00251\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ num\_nonzeros\_per\_item\ =\ \{\});}
\DoxyCodeLine{00252\ }
\DoxyCodeLine{00269\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<Csr>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a5ed96cd3395e135d827f23928cab82d6}{create}}(std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00270\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ size,}
\DoxyCodeLine{00271\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<value\_type>}}\ values,}
\DoxyCodeLine{00272\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ col\_idxs,}
\DoxyCodeLine{00273\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ row\_ptrs);}
\DoxyCodeLine{00274\ }
\DoxyCodeLine{00280\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ InputValueType,\ \textcolor{keyword}{typename}\ ColIndexType,}
\DoxyCodeLine{00281\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typename}\ RowPtrType>}
\DoxyCodeLine{00282\ \ \ \ \ GKO\_DEPRECATED(}
\DoxyCodeLine{00283\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}explicitly\ construct\ the\ gko::array\ arguments\ instead\ of\ passing\ "{}}}
\DoxyCodeLine{00284\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}initializer\ lists"{}})}
\DoxyCodeLine{00285\ \ \ \ \ static\ \doxymbox{\hyperlink{namespacestd}{std}}::unique\_ptr<Csr>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_aa6fdee51616719f9fe09de182d556177}{create}}(}
\DoxyCodeLine{00286\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacestd}{std}}::shared\_ptr<const\ \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}}>\ exec,\ const\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim}}<2>\&\ size,}
\DoxyCodeLine{00287\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacestd}{std}}::initializer\_list<InputValueType>\ values,}
\DoxyCodeLine{00288\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacestd}{std}}::initializer\_list<ColIndexType>\ col\_idxs,}
\DoxyCodeLine{00289\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacestd}{std}}::initializer\_list<RowPtrType>\ row\_ptrs)}
\DoxyCodeLine{00290\ \ \ \ \ \{}
\DoxyCodeLine{00291\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_aa6fdee51616719f9fe09de182d556177}{create}}(exec,\ size,\ \doxymbox{\hyperlink{classgko_1_1array}{array<value\_type>}}\{exec,\ std::move(values)\},}
\DoxyCodeLine{00292\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\{exec,\ std::move(col\_idxs)\},}
\DoxyCodeLine{00293\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\{exec,\ std::move(row\_ptrs)\});}
\DoxyCodeLine{00294\ \ \ \ \ \}}
\DoxyCodeLine{00295\ }
\DoxyCodeLine{00314\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<const\ Csr>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a64e928475313e3fa3185a7ab8517ac42}{create\_const}}(}
\DoxyCodeLine{00315\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ sizes,}
\DoxyCodeLine{00316\ \ \ \ \ \ \ \ \ gko::detail::const\_array\_view<value\_type>\&\&\ values,}
\DoxyCodeLine{00317\ \ \ \ \ \ \ \ \ gko::detail::const\_array\_view<index\_type>\&\&\ col\_idxs,}
\DoxyCodeLine{00318\ \ \ \ \ \ \ \ \ gko::detail::const\_array\_view<index\_type>\&\&\ row\_ptrs);}
\DoxyCodeLine{00319\ }
\DoxyCodeLine{00327\ \ \ \ \ Csr*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a3bb8d9cdcf97bcfb87c9870208242905}{apply}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ b,}
\DoxyCodeLine{00328\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ x);}
\DoxyCodeLine{00329\ }
\DoxyCodeLine{00340\ \ \ \ \ Csr*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a67b5b1ac586ea53ec0fca9f6117ea75f}{apply}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ alpha,}
\DoxyCodeLine{00341\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ b,}
\DoxyCodeLine{00342\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ beta,}
\DoxyCodeLine{00343\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ x);}
\DoxyCodeLine{00344\ }
\DoxyCodeLine{00348\ \ \ \ \ \textcolor{keyword}{const}\ Csr*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a128ab19ac40af0320078b185628ab162}{apply}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ b,}
\DoxyCodeLine{00349\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ x)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00350\ }
\DoxyCodeLine{00356\ \ \ \ \ \textcolor{keyword}{const}\ Csr*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a5a732a033e9092f116a5347cae88d551}{apply}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ alpha,}
\DoxyCodeLine{00357\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ b,}
\DoxyCodeLine{00358\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ beta,}
\DoxyCodeLine{00359\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ x)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00360\ }
\DoxyCodeLine{00367\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a077d6da7d3572f0813da946555b6a64d}{scale}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1array}{array<value\_type>}}\&\ row\_scale,}
\DoxyCodeLine{00368\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1array}{array<value\_type>}}\&\ col\_scale);}
\DoxyCodeLine{00369\ }
\DoxyCodeLine{00380\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_ae878dfc049b3eebbeb1ae6f196aa7017}{add\_scaled\_identity}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ alpha,}
\DoxyCodeLine{00381\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector<value\_type>}}>\ beta);}
\DoxyCodeLine{00382\ }
\DoxyCodeLine{00383\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00384\ \ \ \ \ Csr(std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00385\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ size\ =\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\{\},}
\DoxyCodeLine{00386\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ num\_nonzeros\_per\_item\ =\ \{\});}
\DoxyCodeLine{00387\ }
\DoxyCodeLine{00388\ \ \ \ \ Csr(std::shared\_ptr<const\ Executor>\ exec,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ size,}
\DoxyCodeLine{00389\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<value\_type>}}\ values,\ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ col\_idxs,}
\DoxyCodeLine{00390\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ row\_ptrs)}
\DoxyCodeLine{00391\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1batch_1_1EnableBatchLinOp}{EnableBatchLinOp}}<Csr>(exec,\ size),}
\DoxyCodeLine{00392\ \ \ \ \ \ \ \ \ \ \ values\_\{exec,\ \doxymbox{\hyperlink{namespacestd}{std}}::move(values)\},}
\DoxyCodeLine{00393\ \ \ \ \ \ \ \ \ \ \ col\_idxs\_\{exec,\ \doxymbox{\hyperlink{namespacestd}{std}}::move(col\_idxs)\},}
\DoxyCodeLine{00394\ \ \ \ \ \ \ \ \ \ \ row\_ptrs\_\{exec,\ \doxymbox{\hyperlink{namespacestd}{std}}::move(row\_ptrs)\}}
\DoxyCodeLine{00395\ \ \ \ \ \{}
\DoxyCodeLine{00396\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Ensure\ that\ the\ value\ and\ col\_idxs\ arrays\ have\ the\ correct\ size}}
\DoxyCodeLine{00397\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ max\_num\_elems\ =\ this-\/>get\_common\_size()[0]\ *}
\DoxyCodeLine{00398\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>get\_common\_size()[1]\ *}
\DoxyCodeLine{00399\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>get\_num\_batch\_items();}
\DoxyCodeLine{00400\ \ \ \ \ \ \ \ \ GKO\_ASSERT(values\_.\doxymbox{\hyperlink{classgko_1_1array_ad38e4c252d698a4581ffa0833ab98c3f}{get\_size}}()\ <=\ max\_num\_elems);}
\DoxyCodeLine{00401\ \ \ \ \ \ \ \ \ GKO\_ASSERT\_EQ(row\_ptrs\_.\doxymbox{\hyperlink{classgko_1_1array_ad38e4c252d698a4581ffa0833ab98c3f}{get\_size}}(),\ this-\/>get\_common\_size()[0]\ +\ 1);}
\DoxyCodeLine{00402\ \ \ \ \ \ \ \ \ GKO\_ASSERT\_EQ(this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1matrix_1_1Csr_a8a83dc917e64e56912e89e1b09be117e}{get\_num\_elements\_per\_item}}(),\ col\_idxs\_.\doxymbox{\hyperlink{classgko_1_1array_ad38e4c252d698a4581ffa0833ab98c3f}{get\_size}}());}
\DoxyCodeLine{00403\ \ \ \ \ \}}
\DoxyCodeLine{00404\ }
\DoxyCodeLine{00405\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_impl(\textcolor{keyword}{const}\ MultiVector<value\_type>*\ b,}
\DoxyCodeLine{00406\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ MultiVector<value\_type>*\ x)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00407\ }
\DoxyCodeLine{00408\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_impl(\textcolor{keyword}{const}\ MultiVector<value\_type>*\ alpha,}
\DoxyCodeLine{00409\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ MultiVector<value\_type>*\ b,}
\DoxyCodeLine{00410\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ MultiVector<value\_type>*\ beta,}
\DoxyCodeLine{00411\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ MultiVector<value\_type>*\ x)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00412\ }
\DoxyCodeLine{00413\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<value\_type>}}\ values\_;}
\DoxyCodeLine{00414\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ col\_idxs\_;}
\DoxyCodeLine{00415\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ row\_ptrs\_;}
\DoxyCodeLine{00416\ \};}
\DoxyCodeLine{00417\ }
\DoxyCodeLine{00418\ }
\DoxyCodeLine{00419\ \}\ \ \textcolor{comment}{//\ namespace\ matrix}}
\DoxyCodeLine{00420\ \}\ \ \textcolor{comment}{//\ namespace\ batch}}
\DoxyCodeLine{00421\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00422\ }
\DoxyCodeLine{00423\ }
\DoxyCodeLine{00424\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_MATRIX\_BATCH\_CSR\_HPP\_}}

\end{DoxyCode}
