@@ -71,24 +71,41 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
7171 std::vector<std::map<TA, std::map<TAC, Tensor<Tdata>>>> Ds_result_thread (1 );
7272 LRI_Cal_Tools<TA,TC,Tdata> tools (this ->period , this ->Ds_ab , Ds_result_thread);
7373
74+ const std::vector<TA> list_Aa01_Da = LRI_Cal_Aux::filter_list_map ( this ->parallel ->get_list_Aa01 (), this ->Ds_ab [Label::ab::a] );
75+ const std::vector<TAC> list_Ab01_Db = LRI_Cal_Aux::filter_list_map ( this ->parallel ->get_list_Ab01 (), this ->Ds_ab [Label::ab::b] );
76+ const std::vector<TAC> list_Aa2_Da = LRI_Cal_Aux::filter_list_set ( this ->parallel ->get_list_Aa2 (), this ->index_Ds_ab [Label::ab::a][0 ] );
77+ const std::vector<TAC> list_Ab2_Db = LRI_Cal_Aux::filter_list_set ( this ->parallel ->get_list_Ab2 (), this ->index_Ds_ab [Label::ab::b][0 ] );
78+
7479 for (const Label::ab_ab &label : labels)
7580 {
7681 switch (label)
7782 {
7883 case Label::ab_ab::a0b0_a1b1:
7984 {
80- for (const TAC &Aa2 : this ->parallel ->get_list_Aa2 ())
85+ const std::vector<TA > list_Aa01 = LRI_Cal_Aux::filter_list_map ( LRI_Cal_Aux::filter_list_map (
86+ list_Aa01_Da,
87+ this ->Ds_ab [Label::ab::a0b0] ),
88+ this ->Ds_ab [Label::ab::a1b1] );
89+ const std::vector<TAC> &list_Aa2 =
90+ list_Aa2_Da;
91+ const std::vector<TAC> list_Ab01 = LRI_Cal_Aux::filter_list_set ( LRI_Cal_Aux::filter_list_set (
92+ list_Ab01_Db,
93+ this ->index_Ds_ab [Label::ab::a0b0][0 ]),
94+ this ->index_Ds_ab [Label::ab::a1b1][0 ]);
95+ const std::vector<TAC> &list_Ab2 =
96+ list_Ab2_Db;
97+
98+ for (const TAC &Aa2 : list_Aa2)
8199 {
82100 std::map<TAC,Tensor<Tdata>> Ds_result_fixed;
83101
84- const std::vector<TAC> &list_Ab01 = this ->parallel ->get_list_Ab01 ();
85102 #pragma omp for schedule(dynamic) nowait
86103 for (std::size_t ib01=0 ; ib01<list_Ab01.size (); ++ib01)
87104 {
88105 const TAC &Ab01 = list_Ab01[ib01];
89106 // D_mul = D_a * D_a0b0 * D_a1b1
90107 Tensor<Tdata> D_mul;
91- for (const TA &Aa01 : this -> parallel -> get_list_Aa01 () )
108+ for (const TA &Aa01 : list_Aa01 )
92109 {
93110 const Tensor<Tdata> D_a = tools.get_Ds_ab (Label::ab::a, Aa01, Aa2);
94111 if (D_a.empty ()) continue ;
@@ -106,7 +123,7 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
106123 if (D_mul.empty ()) continue ;
107124
108125 // D_result = D_mul * D_b
109- for (const TAC &Ab2 : this -> parallel -> get_list_Ab2 () )
126+ for (const TAC &Ab2 : list_Ab2 )
110127 {
111128 const Tensor<Tdata> D_b = tools.get_Ds_ab (Label::ab::b, Ab01, Ab2);
112129 if (D_b.empty ()) continue ;
@@ -126,11 +143,23 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
126143
127144 case Label::ab_ab::a0b0_a1b2:
128145 {
129- for (const TAC &Ab01 : this ->parallel ->get_list_Ab01 ())
146+ const std::vector<TA > list_Aa01 = LRI_Cal_Aux::filter_list_map ( LRI_Cal_Aux::filter_list_map (
147+ list_Aa01_Da,
148+ this ->Ds_ab [Label::ab::a0b0] ),
149+ this ->Ds_ab [Label::ab::a1b2] );
150+ const std::vector<TAC> &list_Aa2 =
151+ list_Aa2_Da;
152+ const std::vector<TAC> list_Ab01 = LRI_Cal_Aux::filter_list_set (
153+ list_Ab01_Db,
154+ this ->index_Ds_ab [Label::ab::a0b0][0 ]);
155+ const std::vector<TAC> list_Ab2 = LRI_Cal_Aux::filter_list_set (
156+ list_Ab2_Db,
157+ this ->index_Ds_ab [Label::ab::a1b2][0 ]);
158+
159+ for (const TAC &Ab01 : list_Ab01)
130160 {
131161 std::map<TAC,Tensor<Tdata>> Ds_result_fixed;
132162
133- const std::vector<TA> &list_Aa01 = this ->parallel ->get_list_Aa01 ();
134163 #pragma omp for schedule(dynamic) nowait
135164 for (std::size_t ia01=0 ; ia01<list_Aa01.size (); ++ia01)
136165 {
@@ -139,7 +168,7 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
139168 if (D_a0b0.empty ()) continue ;
140169 // D_mul = D_b * D_a1b2
141170 Tensor<Tdata> D_mul;
142- for (const TAC &Ab2 : this -> parallel -> get_list_Ab2 () )
171+ for (const TAC &Ab2 : list_Ab2 )
143172 {
144173 const Tensor<Tdata> D_b = tools.get_Ds_ab (Label::ab::b, Ab01, Ab2);
145174 if (D_b.empty ()) continue ;
@@ -153,7 +182,7 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
153182 if (D_mul.empty ()) continue ;
154183
155184 // D_result = D_mul * D_a * D_a0b0
156- for (const TAC &Aa2 : this -> parallel -> get_list_Aa2 () )
185+ for (const TAC &Aa2 : list_Aa2 )
157186 {
158187 const Tensor<Tdata> &D_a_transpose = Global_Func::find (Ds_a_transpose, Aa01, Aa2);
159188 if (D_a_transpose.empty ()) continue ;
@@ -175,11 +204,23 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
175204
176205 case Label::ab_ab::a0b0_a2b1:
177206 {
178- for (const TA &Aa01 : this ->parallel ->get_list_Aa01 ())
207+ const std::vector<TA > list_Aa01 = LRI_Cal_Aux::filter_list_map (
208+ list_Aa01_Da,
209+ this ->Ds_ab [Label::ab::a0b0] );
210+ const std::vector<TAC> list_Aa2 = LRI_Cal_Aux::filter_list_map (
211+ list_Aa2_Da,
212+ this ->Ds_ab [Label::ab::a2b1] );
213+ const std::vector<TAC> list_Ab01 = LRI_Cal_Aux::filter_list_set ( LRI_Cal_Aux::filter_list_set (
214+ list_Ab01_Db,
215+ this ->index_Ds_ab [Label::ab::a0b0][0 ]),
216+ this ->index_Ds_ab [Label::ab::a2b1][0 ]);
217+ const std::vector<TAC> &list_Ab2 =
218+ list_Ab2_Db;
219+
220+ for (const TA &Aa01 : list_Aa01)
179221 {
180222 std::map<TAC,Tensor<Tdata>> Ds_result_fixed;
181223
182- const std::vector<TAC> &list_Ab01 = this ->parallel ->get_list_Ab01 ();
183224 #pragma omp for schedule(dynamic) nowait
184225 for (std::size_t ib01=0 ; ib01<list_Ab01.size (); ++ib01)
185226 {
@@ -188,7 +229,7 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
188229 if (D_a0b0.empty ()) continue ;
189230 // D_mul = D_a * D_a2b1
190231 Tensor<Tdata> D_mul;
191- for (const TAC &Aa2 : this -> parallel -> get_list_Aa2 () )
232+ for (const TAC &Aa2 : list_Aa2 )
192233 {
193234 const Tensor<Tdata> D_a = tools.get_Ds_ab (Label::ab::a, Aa01, Aa2);
194235 if (D_a.empty ()) continue ;
@@ -202,7 +243,7 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
202243 if (D_mul.empty ()) continue ;
203244
204245 // D_result = D_mul * D_a0b0 * D_b
205- for (const TAC &Ab2 : this -> parallel -> get_list_Ab2 () )
246+ for (const TAC &Ab2 : list_Ab2 )
206247 {
207248 const Tensor<Tdata> &D_b_transpose = Global_Func::find (Ds_b_transpose, Ab01.first , TAC{Ab2.first , (Ab2.second -Ab01.second )%this ->period });
208249 if (D_b_transpose.empty ()) continue ;
@@ -225,18 +266,30 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
225266
226267 case Label::ab_ab::a0b0_a2b2:
227268 {
228- for (const TA &Aa01 : this ->parallel ->get_list_Aa01 ())
269+ const std::vector<TA > list_Aa01 = LRI_Cal_Aux::filter_list_map (
270+ list_Aa01_Da,
271+ this ->Ds_ab [Label::ab::a0b0] );
272+ const std::vector<TAC> list_Aa2 = LRI_Cal_Aux::filter_list_map (
273+ list_Aa2_Da,
274+ this ->Ds_ab [Label::ab::a2b2] );
275+ const std::vector<TAC> list_Ab01 = LRI_Cal_Aux::filter_list_set (
276+ list_Ab01_Db,
277+ this ->index_Ds_ab [Label::ab::a0b0][0 ]);
278+ const std::vector<TAC> list_Ab2 = LRI_Cal_Aux::filter_list_set (
279+ list_Ab2_Db,
280+ this ->index_Ds_ab [Label::ab::a2b2][0 ]);
281+
282+ for (const TA &Aa01 : list_Aa01)
229283 {
230284 std::map<TAC,Tensor<Tdata>> Ds_result_fixed;
231285
232- const std::vector<TAC> &list_Ab2 = this ->parallel ->get_list_Ab2 ();
233286 #pragma omp for schedule(dynamic) nowait
234287 for (std::size_t ib2=0 ; ib2<list_Ab2.size (); ++ib2)
235288 {
236289 const TAC &Ab2 = list_Ab2[ib2];
237290 // D_mul = D_a * D_a2b2
238291 Tensor<Tdata> D_mul;
239- for (const TAC &Aa2 : this -> parallel -> get_list_Aa2 () )
292+ for (const TAC &Aa2 : list_Aa2 )
240293 {
241294 const Tensor<Tdata> &D_a_transpose = Global_Func::find (Ds_a_transpose, Aa01, Aa2);
242295 if (D_a_transpose.empty ()) continue ;
@@ -250,7 +303,7 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
250303 if (D_mul.empty ()) continue ;
251304
252305 // D_result = D_mul * D_a0b0 * D_b
253- for (const TAC &Ab01 : this -> parallel -> get_list_Ab01 () )
306+ for (const TAC &Ab01 : list_Ab01 )
254307 {
255308 const Tensor<Tdata> &D_b_transpose = Global_Func::find (Ds_b_transpose, Ab01.first , TAC{Ab2.first , (Ab2.second -Ab01.second )%this ->period });
256309 if (D_b_transpose.empty ()) continue ;
0 commit comments