\doxysection{batch\+\_\+multi\+\_\+vector.\+hpp}
\hypertarget{batch__multi__vector_8hpp_source}{}\label{batch__multi__vector_8hpp_source}\index{ginkgo/core/base/batch\_multi\_vector.hpp@{ginkgo/core/base/batch\_multi\_vector.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\_BASE\_BATCH\_MULTI\_VECTOR\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_BASE\_BATCH\_MULTI\_VECTOR\_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\_dim.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/dim.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/polymorphic\_object.hpp>}}
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/range\_accessors.hpp>}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/utils.hpp>}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/dense.hpp>}}
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00024\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00025\ \textcolor{keyword}{namespace\ }batch\ \{}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00051\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision>}
\DoxyCodeLine{00052\ \textcolor{keyword}{class\ }MultiVector}
\DoxyCodeLine{00053\ \ \ \ \ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<MultiVector<ValueType>>,}
\DoxyCodeLine{00054\ \ \ \ \ \ \ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{EnablePolymorphicAssignment}}<MultiVector<ValueType>>,}
\DoxyCodeLine{00055\ \textcolor{preprocessor}{\#if\ GINKGO\_ENABLE\_HALF\ ||\ GINKGO\_ENABLE\_BFLOAT16}}
\DoxyCodeLine{00056\ \ \ \ \ \ \ \textcolor{keyword}{public}\ ConvertibleTo<MultiVector<next\_precision<ValueType,\ 2>>>,}
\DoxyCodeLine{00057\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00058\ \textcolor{preprocessor}{\#if\ GINKGO\_ENABLE\_HALF\ \&\&\ GINKGO\_ENABLE\_BFLOAT16}}
\DoxyCodeLine{00059\ \ \ \ \ \ \ \textcolor{keyword}{public}\ ConvertibleTo<MultiVector<next\_precision<ValueType,\ 3>>>,}
\DoxyCodeLine{00060\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00061\ \ \ \ \ \ \ \textcolor{keyword}{public}\ ConvertibleTo<MultiVector<next\_precision<ValueType>>>\ \{}
\DoxyCodeLine{00062\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<MultiVector>;}
\DoxyCodeLine{00063\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }MultiVector<\doxymbox{\hyperlink{namespacegko_a4ad20e5381a84928753efde0b2bc7f85}{to\_complex}}<ValueType>>;}
\DoxyCodeLine{00064\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }MultiVector<\doxymbox{\hyperlink{namespacegko_ada2119004771922e8f7fcb6910a0363c}{previous\_precision}}<ValueType>>;}
\DoxyCodeLine{00065\ \ \ \ \ GKO\_ASSERT\_SUPPORTED\_VALUE\_TYPE;}
\DoxyCodeLine{00066\ }
\DoxyCodeLine{00067\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00068\ \ \ \ \ \textcolor{keyword}{using\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{EnablePolymorphicAssignment}}<MultiVector>::convert\_to;}
\DoxyCodeLine{00069\ \ \ \ \ \textcolor{keyword}{using\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{EnablePolymorphicAssignment}}<MultiVector>::move\_to;}
\DoxyCodeLine{00070\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<MultiVector<next\_precision<ValueType>>>::convert\_to;}
\DoxyCodeLine{00071\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<MultiVector<next\_precision<ValueType>>>::move\_to;}
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00073\ \ \ \ \ \textcolor{keyword}{using\ }value\_type\ =\ ValueType;}
\DoxyCodeLine{00074\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ \doxymbox{\hyperlink{namespacegko_a16bd14c10900eb804d784908d8aab5ab}{int32}};}
\DoxyCodeLine{00075\ \ \ \ \ \textcolor{keyword}{using\ }unbatch\_type\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{gko::matrix::Dense<ValueType>}};}
\DoxyCodeLine{00076\ \ \ \ \ \textcolor{keyword}{using\ }absolute\_type\ =\ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<MultiVector<ValueType>}}>;}
\DoxyCodeLine{00077\ \ \ \ \ \textcolor{keyword}{using\ }complex\_type\ =\ \doxymbox{\hyperlink{namespacegko_a4ad20e5381a84928753efde0b2bc7f85}{to\_complex<MultiVector<ValueType>}}>;}
\DoxyCodeLine{00078\ }
\DoxyCodeLine{00085\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<MultiVector>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_ae2d65af2d11281df061b9e3284e2e7c1}{create\_with\_config\_of}}(}
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<const\ MultiVector>}}\ other);}
\DoxyCodeLine{00087\ }
\DoxyCodeLine{00088\ \ \ \ \ \textcolor{keywordtype}{void}\ convert\_to(}
\DoxyCodeLine{00089\ \ \ \ \ \ \ \ \ MultiVector<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType>}}>*\ result)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00091\ \ \ \ \ \textcolor{keywordtype}{void}\ move\_to(MultiVector<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType>}}>*\ result)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00092\ }
\DoxyCodeLine{00093\ \textcolor{preprocessor}{\#if\ GINKGO\_ENABLE\_HALF\ ||\ GINKGO\_ENABLE\_BFLOAT16}}
\DoxyCodeLine{00094\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }MultiVector<\doxymbox{\hyperlink{namespacegko_ada2119004771922e8f7fcb6910a0363c}{previous\_precision}}<ValueType,\ 2>>;}
\DoxyCodeLine{00095\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<MultiVector<next\_precision<ValueType,\ 2>>>::convert\_to;}
\DoxyCodeLine{00096\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<MultiVector<next\_precision<ValueType,\ 2>>>::move\_to;}
\DoxyCodeLine{00097\ }
\DoxyCodeLine{00098\ \ \ \ \ \textcolor{keywordtype}{void}\ convert\_to(}
\DoxyCodeLine{00099\ \ \ \ \ \ \ \ \ MultiVector<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType,\ 2>}}>*\ result)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00100\ }
\DoxyCodeLine{00101\ \ \ \ \ \textcolor{keywordtype}{void}\ move\_to(MultiVector<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType,\ 2>}}>*\ result)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00102\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00103\ }
\DoxyCodeLine{00104\ \textcolor{preprocessor}{\#if\ GINKGO\_ENABLE\_HALF\ \&\&\ GINKGO\_ENABLE\_BFLOAT16}}
\DoxyCodeLine{00105\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }MultiVector<\doxymbox{\hyperlink{namespacegko_ada2119004771922e8f7fcb6910a0363c}{previous\_precision}}<ValueType,\ 3>>;}
\DoxyCodeLine{00106\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<MultiVector<next\_precision<ValueType,\ 3>>>::convert\_to;}
\DoxyCodeLine{00107\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<MultiVector<next\_precision<ValueType,\ 3>>>::move\_to;}
\DoxyCodeLine{00108\ }
\DoxyCodeLine{00109\ \ \ \ \ \textcolor{keywordtype}{void}\ convert\_to(}
\DoxyCodeLine{00110\ \ \ \ \ \ \ \ \ MultiVector<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType,\ 3>}}>*\ result)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00111\ }
\DoxyCodeLine{00112\ \ \ \ \ \textcolor{keywordtype}{void}\ move\_to(MultiVector<\doxymbox{\hyperlink{namespacegko_aee37f85b217e5e26fe64207d41fa4bac}{next\_precision<ValueType,\ 3>}}>*\ result)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00113\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00114\ }
\DoxyCodeLine{00125\ \ \ \ \ std::unique\_ptr<unbatch\_type>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_aae43f4d06d668c881b1c023831f7bf40}{create\_view\_for\_item}}(\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ item\_id);}
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00130\ \ \ \ \ std::unique\_ptr<const\ unbatch\_type>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_afa4fb271979d809ecac809a9a04a5cd5}{create\_const\_view\_for\_item}}(}
\DoxyCodeLine{00131\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ item\_id)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00132\ }
\DoxyCodeLine{00138\ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_aaa04c8cc77f0e297b73099fd5c8b922c}{get\_size}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ batch\_size\_;\ \}}
\DoxyCodeLine{00139\ }
\DoxyCodeLine{00145\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a7e866dde6ed93bfb3489a74da31c82a6}{get\_num\_batch\_items}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00146\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00147\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ batch\_size\_.get\_num\_batch\_items();}
\DoxyCodeLine{00148\ \ \ \ \ \}}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00155\ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1dim}{dim<2>}}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a53513d38739f579a24242ac08d2c7a5c}{get\_common\_size}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ batch\_size\_.get\_common\_size();\ \}}
\DoxyCodeLine{00156\ }
\DoxyCodeLine{00162\ \ \ \ \ value\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a4e5edafa2d6328ffe0823b18ab433b13}{get\_values}}()\ noexcept\ \{\ \textcolor{keywordflow}{return}\ values\_.get\_data();\ \}}
\DoxyCodeLine{00163\ }
\DoxyCodeLine{00171\ \ \ \ \ \textcolor{keyword}{const}\ value\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_aaf49c3d6c0c99f1af1803ec1502e0332}{get\_const\_values}}()\ const\ noexcept}
\DoxyCodeLine{00172\ \ \ \ \ \{}
\DoxyCodeLine{00173\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_const\_data();}
\DoxyCodeLine{00174\ \ \ \ \ \}}
\DoxyCodeLine{00175\ }
\DoxyCodeLine{00184\ \ \ \ \ value\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a0a16eb2a0012ccc86163976d316f30df}{get\_values\_for\_item}}(\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ batch\_id)\ \textcolor{keyword}{noexcept}}
\DoxyCodeLine{00185\ \ \ \ \ \{}
\DoxyCodeLine{00186\ \ \ \ \ \ \ \ \ GKO\_ASSERT(batch\_id\ <\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a7e866dde6ed93bfb3489a74da31c82a6}{get\_num\_batch\_items}}());}
\DoxyCodeLine{00187\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_data()\ +\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a25f8de26b81b428d44914d99eb24a853}{get\_cumulative\_offset}}(batch\_id);}
\DoxyCodeLine{00188\ \ \ \ \ \}}
\DoxyCodeLine{00189\ }
\DoxyCodeLine{00197\ \ \ \ \ \textcolor{keyword}{const}\ value\_type*\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a26b678ad1d0337ffb7c411dccd6ec7b6}{get\_const\_values\_for\_item}}(}
\DoxyCodeLine{00198\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ batch\_id)\ \textcolor{keyword}{const}\ \textcolor{keyword}{noexcept}}
\DoxyCodeLine{00199\ \ \ \ \ \{}
\DoxyCodeLine{00200\ \ \ \ \ \ \ \ \ GKO\_ASSERT(batch\_id\ <\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a7e866dde6ed93bfb3489a74da31c82a6}{get\_num\_batch\_items}}());}
\DoxyCodeLine{00201\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_const\_data()\ +\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a25f8de26b81b428d44914d99eb24a853}{get\_cumulative\_offset}}(batch\_id);}
\DoxyCodeLine{00202\ \ \ \ \ \}}
\DoxyCodeLine{00203\ }
\DoxyCodeLine{00211\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a9218ea22b110991a45a797b983c98897}{get\_num\_stored\_elements}}()\ const\ noexcept}
\DoxyCodeLine{00212\ \ \ \ \ \{}
\DoxyCodeLine{00213\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_size();}
\DoxyCodeLine{00214\ \ \ \ \ \}}
\DoxyCodeLine{00215\ }
\DoxyCodeLine{00223\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a25f8de26b81b428d44914d99eb24a853}{get\_cumulative\_offset}}(\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ batch\_id)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00224\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00225\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ batch\_id\ *\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a53513d38739f579a24242ac08d2c7a5c}{get\_common\_size}}()[0]\ *}
\DoxyCodeLine{00226\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a53513d38739f579a24242ac08d2c7a5c}{get\_common\_size}}()[1];}
\DoxyCodeLine{00227\ \ \ \ \ \}}
\DoxyCodeLine{00228\ }
\DoxyCodeLine{00240\ \ \ \ \ value\_type\&\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_aefdac4009138aa3e5bdf8e7e3fafaf77}{at}}(\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ batch\_id,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ row,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ col)}
\DoxyCodeLine{00241\ \ \ \ \ \{}
\DoxyCodeLine{00242\ \ \ \ \ \ \ \ \ GKO\_ASSERT(batch\_id\ <\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a7e866dde6ed93bfb3489a74da31c82a6}{get\_num\_batch\_items}}());}
\DoxyCodeLine{00243\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_data()[linearize\_index(batch\_id,\ row,\ col)];}
\DoxyCodeLine{00244\ \ \ \ \ \}}
\DoxyCodeLine{00245\ }
\DoxyCodeLine{00249\ \ \ \ \ value\_type\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_adb9b8a1052dffd0e065123b8d402b5cb}{at}}(\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ batch\_id,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ row,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ col)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00250\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00251\ \ \ \ \ \ \ \ \ GKO\_ASSERT(batch\_id\ <\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a7e866dde6ed93bfb3489a74da31c82a6}{get\_num\_batch\_items}}());}
\DoxyCodeLine{00252\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_const\_data()[linearize\_index(batch\_id,\ row,\ col)];}
\DoxyCodeLine{00253\ \ \ \ \ \}}
\DoxyCodeLine{00254\ }
\DoxyCodeLine{00269\ \ \ \ \ ValueType\&\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a73fe70d021fdff576141021fab64e91b}{at}}(\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ batch\_id,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ idx)\ \textcolor{keyword}{noexcept}}
\DoxyCodeLine{00270\ \ \ \ \ \{}
\DoxyCodeLine{00271\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_data()[linearize\_index(batch\_id,\ idx)];}
\DoxyCodeLine{00272\ \ \ \ \ \}}
\DoxyCodeLine{00273\ }
\DoxyCodeLine{00277\ \ \ \ \ ValueType\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a9cdff419d416bb89a24e1082db3d7a68}{at}}(\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ batch\_id,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ idx)\ \textcolor{keyword}{const}\ \textcolor{keyword}{noexcept}}
\DoxyCodeLine{00278\ \ \ \ \ \{}
\DoxyCodeLine{00279\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ values\_.get\_const\_data()[linearize\_index(batch\_id,\ idx)];}
\DoxyCodeLine{00280\ \ \ \ \ \}}
\DoxyCodeLine{00281\ }
\DoxyCodeLine{00296\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a298cd5dc53de21cf1c20bbbd2d3d20db}{scale}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ MultiVector<ValueType>>\ alpha);}
\DoxyCodeLine{00297\ }
\DoxyCodeLine{00310\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_acc3e19e9cac497c2192e0529996644a4}{add\_scaled}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ MultiVector<ValueType>>\ alpha,}
\DoxyCodeLine{00311\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ MultiVector<ValueType>>\ b);}
\DoxyCodeLine{00312\ }
\DoxyCodeLine{00321\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a5d42e703310b579e559e86eb8d287687}{compute\_dot}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ MultiVector<ValueType>>\ b,}
\DoxyCodeLine{00322\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<MultiVector<ValueType>>\ result)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00323\ }
\DoxyCodeLine{00334\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a1701f7af0929ec37d23383ab2e8da19e}{compute\_conj\_dot}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ MultiVector<ValueType>>\ b,}
\DoxyCodeLine{00335\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<MultiVector<ValueType>>\ result)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00336\ }
\DoxyCodeLine{00344\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_ad6485053588dcae4b968ac35c8f51b61}{compute\_norm2}}(}
\DoxyCodeLine{00345\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<MultiVector<\doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}>>\ result)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00346\ }
\DoxyCodeLine{00356\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<MultiVector>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a4e42643068731d91682869a7f942bfd4}{create}}(}
\DoxyCodeLine{00357\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00358\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ size\ =\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\{\});}
\DoxyCodeLine{00359\ }
\DoxyCodeLine{00372\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<MultiVector>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a53d40b0b6ae2a48771f0c8f372209357}{create}}(}
\DoxyCodeLine{00373\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ size,}
\DoxyCodeLine{00374\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<value\_type>}}\ values);}
\DoxyCodeLine{00375\ }
\DoxyCodeLine{00380\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ InputValueType>}
\DoxyCodeLine{00381\ \ \ \ \ GKO\_DEPRECATED(}
\DoxyCodeLine{00382\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}explicitly\ construct\ the\ gko::array\ argument\ instead\ of\ passing\ an\ "{}}}
\DoxyCodeLine{00383\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}initializer\ list"{}})}
\DoxyCodeLine{00384\ \ \ \ \ static\ \doxymbox{\hyperlink{namespacestd}{std}}::unique\_ptr<MultiVector>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a4e42643068731d91682869a7f942bfd4}{create}}(}
\DoxyCodeLine{00385\ \ \ \ \ \ \ \ \ \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{00386\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacestd}{std}}::initializer\_list<InputValueType>\ values)}
\DoxyCodeLine{00387\ \ \ \ \ \{}
\DoxyCodeLine{00388\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a4e42643068731d91682869a7f942bfd4}{create}}(exec,\ size,\ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\{exec,\ std::move(values)\});}
\DoxyCodeLine{00389\ \ \ \ \ \}}
\DoxyCodeLine{00390\ }
\DoxyCodeLine{00404\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<const\ MultiVector>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_ab95f20510750e6e1991959d90b6eec39}{create\_const}}(}
\DoxyCodeLine{00405\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ sizes,}
\DoxyCodeLine{00406\ \ \ \ \ \ \ \ \ gko::detail::const\_array\_view<ValueType>\&\&\ values);}
\DoxyCodeLine{00407\ }
\DoxyCodeLine{00413\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a5faa1c1dee3e390d73d5df10b51377c9}{fill}}(ValueType\ value);}
\DoxyCodeLine{00414\ }
\DoxyCodeLine{00415\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00416\ \ \ \ \ \textcolor{keyword}{inline}\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ compute\_num\_elems(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ size)}
\DoxyCodeLine{00417\ \ \ \ \ \{}
\DoxyCodeLine{00418\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ size.\doxymbox{\hyperlink{structgko_1_1batch__dim_a380f449cd6305c8baba95569627503b2}{get\_num\_batch\_items}}()\ *\ size.\doxymbox{\hyperlink{structgko_1_1batch__dim_a2e5b548457e59a551328cb10cc38a688}{get\_common\_size}}()[0]\ *}
\DoxyCodeLine{00419\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ size.\doxymbox{\hyperlink{structgko_1_1batch__dim_a2e5b548457e59a551328cb10cc38a688}{get\_common\_size}}()[1];}
\DoxyCodeLine{00420\ \ \ \ \ \}}
\DoxyCodeLine{00421\ }
\DoxyCodeLine{00422\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00428\ \ \ \ \ \textcolor{keywordtype}{void}\ set\_size(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ value)\ \textcolor{keyword}{noexcept};}
\DoxyCodeLine{00429\ }
\DoxyCodeLine{00430\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector}{MultiVector}}(std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00431\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ size\ =\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\{\});}
\DoxyCodeLine{00432\ }
\DoxyCodeLine{00433\ \ \ \ \ MultiVector(std::shared\_ptr<const\ Executor>\ exec,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1batch__dim}{batch\_dim<2>}}\&\ size,}
\DoxyCodeLine{00434\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<value\_type>}}\ values);}
\DoxyCodeLine{00435\ }
\DoxyCodeLine{00443\ \ \ \ \ std::unique\_ptr<MultiVector>\ create\_with\_same\_config()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00444\ }
\DoxyCodeLine{00445\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ linearize\_index(\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ batch,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ row,}
\DoxyCodeLine{00446\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ col)\ \textcolor{keyword}{const}\ \textcolor{keyword}{noexcept}}
\DoxyCodeLine{00447\ \ \ \ \ \{}
\DoxyCodeLine{00448\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a25f8de26b81b428d44914d99eb24a853}{get\_cumulative\_offset}}(batch)\ +}
\DoxyCodeLine{00449\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ row\ *\ batch\_size\_.\doxymbox{\hyperlink{structgko_1_1batch__dim_a2e5b548457e59a551328cb10cc38a688}{get\_common\_size}}()[1]\ +\ col;}
\DoxyCodeLine{00450\ \ \ \ \ \}}
\DoxyCodeLine{00451\ }
\DoxyCodeLine{00452\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ linearize\_index(\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ batch,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ idx)\ \textcolor{keyword}{const}\ \textcolor{keyword}{noexcept}}
\DoxyCodeLine{00453\ \ \ \ \ \{}
\DoxyCodeLine{00454\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ linearize\_index(batch,\ idx\ /\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a53513d38739f579a24242ac08d2c7a5c}{get\_common\_size}}()[1],}
\DoxyCodeLine{00455\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ idx\ \%\ this-\/>\doxymbox{\hyperlink{classgko_1_1batch_1_1MultiVector_a53513d38739f579a24242ac08d2c7a5c}{get\_common\_size}}()[1]);}
\DoxyCodeLine{00456\ \ \ \ \ \}}
\DoxyCodeLine{00457\ }
\DoxyCodeLine{00458\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00459\ \ \ \ \ batch\_dim<2>\ batch\_size\_;}
\DoxyCodeLine{00460\ \ \ \ \ array<value\_type>\ values\_;}
\DoxyCodeLine{00461\ \};}
\DoxyCodeLine{00462\ }
\DoxyCodeLine{00463\ }
\DoxyCodeLine{00464\ \}\ \ \textcolor{comment}{//\ namespace\ batch}}
\DoxyCodeLine{00465\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00466\ }
\DoxyCodeLine{00467\ }
\DoxyCodeLine{00468\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_BASE\_BATCH\_MULTI\_VECTOR\_HPP\_}}

\end{DoxyCode}
