5#ifndef OPENFPM_PDATA_VECTOR_ALGEBRA_OFP_GPU_HPP
6#define OPENFPM_PDATA_VECTOR_ALGEBRA_OFP_GPU_HPP
12 template<
typename S1,
typename Op>
13 __global__
void for_each1_ker(S1 s1, Op op)
15 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
17 if (p >= s1.data.size()) {
return;}
19 for_each_prop1<S1,size_t,Op> cp(s1,p,op);
21 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
24 template<
typename S1,
typename S2,
typename Op>
25 __global__
void for_each2_ker(S1 s1,S2 s2, Op op)
27 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
29 if (p >= s1.data.template get<0>().size()) {
return;}
32 for_each_prop2<S1,S2,unsigned int,Op> cp(s1,s2,p,op);
35 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
38 template<
typename S1,
typename S2,
typename S3,
typename Op>
39 __global__
void for_each3_ker(S1 s1,S2 s2,S3 s3, Op op)
41 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
43 if (p >= s1.data.template get<0>().size()) {
return;}
46 for_each_prop3<S1,S2,S3,unsigned int,Op> cp(s1,s2,s3,p,op);
49 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
52 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename Op>
53 __global__
void for_each4_ker(S1 s1,S2 s2,S3 s3,S4 s4, Op op)
55 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
57 if (p >= s1.data.template get<0>().size()) {
return;}
60 for_each_prop4<S1,S2,S3,S4,unsigned int,Op> cp(s1,s2,s3,s4,p,op);
63 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
66 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename S5,
typename Op>
67 __global__
void for_each5_ker(S1 s1,S2 s2,S3 s3,S4 s4,S5 s5, Op op)
69 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
71 if (p >= s1.data.template get<0>().size()) {
return;}
74 for_each_prop5<S1,S2,S3,S4,S5,unsigned int,Op> cp(s1,s2,s3,s4,s5,p,op);
77 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
80 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename S5,
typename S6,
typename Op>
81 __global__
void for_each6_ker(S1 s1,S2 s2,S3 s3,S4 s4,S5 s5,S6 s6, Op op)
83 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
85 if (p >= s1.data.template get<0>().size()) {
return;}
87 for_each_prop6<S1,S2,S3,S4,S5,S6,unsigned int,Op> cp(s1,s2,s3,s4,s5,s6,p,op);
89 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
91 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename S5,
typename S6,
typename S7,
typename Op>
92 __global__
void for_each7_ker(S1 s1,S2 s2,S3 s3,S4 s4,S5 s5,S6 s6,S7 s7, Op op)
94 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
96 if (p >= s1.data.template get<0>().size()) {
return;}
98 for_each_prop7<S1,S2,S3,S4,S5,S6,S7,unsigned int,Op> cp(s1,s2,s3,s4,s5,s6,s7,p,op);
100 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
102 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename S5,
typename S6,
typename S7,
typename S8,
typename Op>
103 __global__
void for_each8_ker(S1 s1,S2 s2,S3 s3,S4 s4,S5 s5,S6 s6,S7 s7,S8 s8, Op op)
105 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
107 if (p >= s1.data.template get<0>().size()) {
return;}
109 for_each_prop8<S1,S2,S3,S4,S5,S6,S7,S8,unsigned int,Op> cp(s1,s2,s3,s4,s5,s6,s7,s8,p,op);
111 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
113 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename S5,
typename S6,
typename S7,
typename S8,
typename S9,
typename Op>
114 __global__
void for_each9_ker(S1 s1,S2 s2,S3 s3,S4 s4,S5 s5,S6 s6,S7 s7,S8 s8,S9 s9, Op op)
116 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
118 if (p >= s1.data.template get<0>().size()) {
return;}
120 for_each_prop9<S1,S2,S3,S4,S5,S6,S7,S8,S9,unsigned int,Op> cp(s1,s2,s3,s4,s5,s6,s7,s8,s9,p,op);
122 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
124 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename S5,
typename S6,
typename S7,
typename S8,
typename S9,
typename S10,
typename Op>
125 __global__
void for_each10_ker(S1 s1,S2 s2,S3 s3,S4 s4,S5 s5,S6 s6,S7 s7,S8 s8,S9 s9,S10 s10, Op op)
127 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
129 if (p >= s1.data.template get<0>().size()) {
return;}
131 for_each_prop10<S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,unsigned int,Op> cp(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,p,op);
133 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
135 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename S5,
typename S6,
typename S7,
typename S8,
typename S9,
typename S10,
typename S11,
typename Op>
136 __global__
void for_each11_ker(S1 s1,S2 s2,S3 s3,S4 s4,S5 s5,S6 s6,S7 s7,S8 s8,S9 s9,S10 s10,S11 s11, Op op)
138 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
140 if (p >= s1.data.template get<0>().size()) {
return;}
142 for_each_prop11<S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,unsigned int,Op> cp(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,p,op);
144 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
146 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename S5,
typename S6,
typename S7,
typename S8,
typename S9,
typename S10,
typename S11,
typename S12,
typename Op>
147 __global__
void for_each12_ker(S1 s1,S2 s2,S3 s3,S4 s4,S5 s5,S6 s6,S7 s7,S8 s8,S9 s9,S10 s10,S11 s11,S12 s12, Op op)
149 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
151 if (p >= s1.data.template get<0>().size()) {
return;}
153 for_each_prop12<S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,unsigned int,Op> cp(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,p,op);
155 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
157 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename S5,
typename S6,
typename S7,
typename S8,
typename S9,
typename S10,
typename S11,
typename S12,
typename S13,
typename Op>
158 __global__
void for_each13_ker(S1 s1,S2 s2,S3 s3,S4 s4,S5 s5,S6 s6,S7 s7,S8 s8,S9 s9,S10 s10,S11 s11,S12 s12,S13 s13, Op op)
160 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
162 if (p >= s1.data.template get<0>().size()) {
return;}
164 for_each_prop13<S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,unsigned int,Op> cp(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,p,op);
166 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
168 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename S5,
typename S6,
typename S7,
typename S8,
typename S9,
typename S10,
typename S11,
typename S12,
typename S13,
typename S14,
typename Op>
169 __global__
void for_each14_ker(S1 s1,S2 s2,S3 s3,S4 s4,S5 s5,S6 s6,S7 s7,S8 s8,S9 s9,S10 s10,S11 s11,S12 s12,S13 s13,S14 s14, Op op)
171 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
173 if (p >= s1.data.template get<0>().size()) {
return;}
175 for_each_prop14<S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,unsigned int,Op> cp(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,p,op);
177 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
181 template<
typename S1,
typename S2,
typename S3,
typename S4,
typename S5,
typename S6,
typename S7,
typename S8,
typename S9,
typename S10,
typename S11,
typename S12,
typename S13,
typename S14,
typename S15,
typename Op>
182 __global__
void for_each15_ker(S1 s1,S2 s2,S3 s3,S4 s4,S5 s5,S6 s6,S7 s7,S8 s8,S9 s9,S10 s10,S11 s11,S12 s12,S13 s13,S14 s14,S15 s15, Op op)
184 unsigned int p = threadIdx.x + blockIdx.x * blockDim.x;
186 if (p >= s1.data.template get<0>().size()) {
return;}
188 for_each_prop15<S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,unsigned int,Op> cp(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,p,op);
190 boost::mpl::for_each_ref<boost::mpl::range_c<
int,0,
decltype( s1.data)::max_prop>>(cp);
196 template<
class S1 ,
class Op >
197 static void for_each1( S1 &s1 , Op op )
200 auto it=s1.data.template get<0>().getVector().getDomainIteratorGPU();
201 CUDA_LAUNCH((for_each1_ker),it,s1,op);
203 template<
class S1 ,
class S2 ,
class Op >
204 static void for_each2( S1 &s1 , S2 &s2 , Op op )
207 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
210 auto it=s1.data.template get<0>().getVector().getGPUIterator();
212 CUDA_LAUNCH((for_each2_ker),it,s1.toKernel(),s2.toKernel(),op);
215 template<
class S1 ,
class S2 ,
class S3 ,
class Op >
216 static void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op )
219 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype( s1.data)::max_prop>>(the_resize);
221 auto it=s1.data.template get<0>().getVector().getGPUIterator();
223 CUDA_LAUNCH((for_each3_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),op);
227 template<
class S1 ,
class S2 ,
class S3 ,
class S4 ,
class Op >
228 static void for_each4( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op )
231 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
233 auto it=s1.data.template get<0>().getVector().getGPUIterator();
235 CUDA_LAUNCH((for_each4_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),op);
239 template<
class S1 ,
class S2 ,
class S3 ,
class S4,
class S5 ,
class Op >
240 static void for_each5( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4,S5 &s5 , Op op )
243 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
245 auto it=s1.data.template get<0>().getVector().getGPUIterator();
247 CUDA_LAUNCH((for_each5_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),s5.toKernel(),op);
250 template<
class S1 ,
class S2 ,
class S3 ,
class S4,
class S5,
class S6 ,
class Op >
251 static void for_each6( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4,S5 &s5,S6 &s6 , Op op )
254 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
256 auto it=s1.data.template get<0>().getVector().getGPUIterator();
258 CUDA_LAUNCH((for_each6_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),s5.toKernel(),s6.toKernel(),op);
262 template<
class S1 ,
class S2 ,
class S3 ,
class S4,
class S5,
class S6 ,
class S7,
class Op >
263 static void for_each7( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4,S5 &s5,S6 &s6,S7 &s7 , Op op )
266 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
268 auto it=s1.data.template get<0>().getVector().getGPUIterator();
270 CUDA_LAUNCH((for_each7_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),s5.toKernel(),s6.toKernel(),s7.toKernel(),op);
273 template<
class S1 ,
class S2 ,
class S3 ,
class S4,
class S5,
class S6 ,
class S7,
class S8,
class Op >
274 static void for_each8( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4,S5 &s5,S6 &s6,S7 &s7,S8 &s8 , Op op )
277 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
279 auto it=s1.data.template get<0>().getVector().getGPUIterator();
281 CUDA_LAUNCH((for_each8_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),s5.toKernel(),s6.toKernel(),s7.toKernel(),s8.toKernel(),op);
284 template<
class S1 ,
class S2 ,
class S3 ,
class S4,
class S5,
class S6 ,
class S7,
class S8,
class S9,
class Op >
285 static void for_each9( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4,S5 &s5,S6 &s6,S7 &s7,S8 &s8, S9 &s9 , Op op )
288 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
290 auto it=s1.data.template get<0>().getVector().getGPUIterator();
292 CUDA_LAUNCH((for_each9_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),s5.toKernel(),s6.toKernel(),s7.toKernel(),s8.toKernel(),s9.toKernel(),op);
296 template<
class S1 ,
class S2 ,
class S3 ,
class S4,
class S5,
class S6 ,
class S7,
class S8,
class S9,
class S10,
class Op >
297 static void for_each10( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4,S5 &s5,S6 &s6,S7 &s7,S8 &s8, S9 &s9 , S10 &s10, Op op )
300 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
302 auto it=s1.data.template get<0>().getVector().getGPUIterator();
304 CUDA_LAUNCH((for_each10_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),s5.toKernel(),s6.toKernel(),s7.toKernel(),s8.toKernel(),s9.toKernel(),s10.toKernel(),op);
309 template<
class S1 ,
class S2 ,
class S3 ,
class S4,
class S5,
class S6 ,
class S7,
class S8,
class S9,
class S10,
class S11,
class Op >
310 static void for_each11( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4,S5 &s5,S6 &s6,S7 &s7,S8 &s8, S9 &s9 , S10 &s10,S11 &s11, Op op )
313 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
315 auto it=s1.data.template get<0>().getVector().getGPUIterator();
317 CUDA_LAUNCH((for_each11_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),op);
321 template<
class S1 ,
class S2 ,
class S3 ,
class S4,
class S5,
class S6 ,
class S7,
class S8,
class S9,
class S10,
class S11,
class S12,
class Op >
322 static void for_each12( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4,S5 &s5,S6 &s6,S7 &s7,S8 &s8, S9 &s9 , S10 &s10,S11 &s11,S12 &s12, Op op )
325 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
327 auto it=s1.data.template get<0>().getVector().getGPUIterator();
329 CUDA_LAUNCH((for_each12_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),s5.toKernel(),s6.toKernel(),s7.toKernel(),s8.toKernel(),s9.toKernel(),s10.toKernel(),s11.toKernel(),s12.toKernel(),op);
333 template<
class S1 ,
class S2 ,
class S3 ,
class S4,
class S5,
class S6 ,
class S7,
class S8,
class S9,
class S10,
class S11,
class S12,
class S13,
class Op >
334 static void for_each13( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4,S5 &s5,S6 &s6,S7 &s7,S8 &s8, S9 &s9 , S10 &s10,S11 &s11,S12 &s12,S13 &s13, Op op )
337 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
339 auto it=s1.data.template get<0>().getVector().getGPUIterator();
341 CUDA_LAUNCH((for_each13_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),s5.toKernel(),s6.toKernel(),s7.toKernel(),s8.toKernel(),s9.toKernel(),s10.toKernel(),s11.toKernel(),s12.toKernel(),s13.toKernel(),op);
344 template<
class S1 ,
class S2 ,
class S3 ,
class S4,
class S5,
class S6 ,
class S7,
class S8,
class S9,
class S10,
class S11,
class S12,
class S13,
class S14,
class Op >
345 static void for_each14( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4,S5 &s5,S6 &s6,S7 &s7,S8 &s8, S9 &s9, S10 &s10,S11 &s11,S12 &s12,S13 &s13,S14 &s14, Op op )
348 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
350 auto it=s1.data.template get<0>().getVector().getGPUIterator();
352 CUDA_LAUNCH((for_each14_ker),it,it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),s5.toKernel(),s6.toKernel(),s7.toKernel(),s8.toKernel(),s9.toKernel(),s10.toKernel(),s11.toKernel(),s12.toKernel(),s13.toKernel(),s14.toKernel(),op);
355 template<
class S1 ,
class S2 ,
class S3 ,
class S4,
class S5,
class S6 ,
class S7,
class S8,
class S9,
class S10,
class S11,
class S12,
class S13,
class S14,
class S15,
class Op >
356 static void for_each15( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4,S5 &s5,S6 &s6,S7 &s7,S8 &s8, S9 &s9, S10 &s10,S11 &s11,S12 &s12,S13 &s13,S14 &s14,S15 &s15, Op op )
359 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s1.data)::max_prop>>(the_resize);
360 auto it=s1.data.template get<0>().getVector().getGPUIterator();
362 CUDA_LAUNCH((for_each15_ker),it,s1.toKernel(),s2.toKernel(),s3.toKernel(),s4.toKernel(),s5.toKernel(),s6.toKernel(),s7.toKernel(),s8.toKernel(),s9.toKernel(),s10.toKernel(),s11.toKernel(),s12.toKernel(),s13.toKernel(),s14.toKernel(),s15.toKernel(),op);
370 template<
typename vector_type,
typename index_type,
typename norm_result_type>
390 if(fabs(v.data.template get<T::value>().getVector().template get<0>(p)) > n)
392 n=fabs(v.data.template get<T::value>().getVector().template get<0>(p));
399 static typename boost::numeric::odeint::vector_space_norm_inf< S >::result_type norm_inf(
const S &s )
401 typename boost::numeric::odeint::vector_space_norm_inf< S >::result_type n=0;
402 auto it=s.data.template get<0>().getVector().getIterator();
406 for_each_norm<S,size_t,typename boost::numeric::odeint::vector_space_norm_inf< S >::result_type> cp(s,p,n);
408 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,
decltype(s.data)::max_prop>>(cp);
412 auto &v_cl = create_vcluster();
424#include <boost/config.hpp>
425#include <boost/array.hpp>
426#include <boost/numeric/odeint/util/unit_helper.hpp>
440 template<
class Fac1 =
double >
445 scale( Fac1 alpha1 ) : m_alpha1( alpha1 ) { }
448 __device__ __host__
void operator()( T1 &
t1 )
const
453 typedef void result_type;
456 template<
class Fac1 =
double >
461 scale_sum1( Fac1 alpha1 ) : m_alpha1( alpha1 ) { }
463 template<
class T1 ,
class T2 >
464 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 )
const
469 typedef void result_type;
473 template<
class Fac1 =
double ,
class Fac2 = Fac1 >
479 scale_sum2( Fac1 alpha1 , Fac2 alpha2 ) : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { }
481 template<
class T1 ,
class T2 ,
class T3 >
482 BOOST_FUSION_GPU_ENABLED
483 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3)
const
485 t1 = m_alpha1 *
t2 + m_alpha2 *
t3;
488 typedef void result_type;
492 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 >
499 scale_sum3( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 )
500 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) { }
502 template<
class T1 ,
class T2 ,
class T3 ,
class T4 >
503 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 )
const
505 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4;
508 typedef void result_type;
512 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 ,
class Fac4 = Fac3 >
520 scale_sum4( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 )
521 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) { }
523 template<
class T1 ,
class T2 ,
class T3 ,
class T4 ,
class T5 >
524 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 ,
const T5 &
t5)
const
526 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4 + m_alpha4 *
t5;
529 typedef void result_type;
533 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 ,
class Fac4 = Fac3 ,
class Fac5 = Fac4 >
542 scale_sum5( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , Fac5 alpha5 )
543 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) { }
545 template<
class T1 ,
class T2 ,
class T3 ,
class T4 ,
class T5 ,
class T6 >
546 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 ,
const T5 &
t5 ,
const T6 &
t6)
const
548 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4 + m_alpha4 *
t5 + m_alpha5 *
t6;
551 typedef void result_type;
555 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 ,
class Fac4 = Fac3 ,
class Fac5 = Fac4 ,
class Fac6 = Fac5 >
565 scale_sum6( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , Fac5 alpha5 , Fac6 alpha6 )
566 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ){ }
568 template<
class T1 ,
class T2 ,
class T3 ,
class T4 ,
class T5 ,
class T6 ,
class T7 >
569 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 ,
const T5 &
t5 ,
const T6 &
t6 ,
const T7 &t7)
const
571 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4 + m_alpha4 *
t5 + m_alpha5 *
t6 + m_alpha6 * t7;
574 typedef void result_type;
578 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 ,
class Fac4 = Fac3 ,
class Fac5 = Fac4 ,
class Fac6 = Fac5 ,
class Fac7 = Fac6 >
589 scale_sum7( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
590 Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 )
591 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) { }
593 template<
class T1 ,
class T2 ,
class T3 ,
class T4 ,
class T5 ,
class T6 ,
class T7 ,
class T8 >
594 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 ,
const T5 &
t5 ,
const T6 &
t6 ,
const T7 &t7 ,
const T8 &t8 )
const
596 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4 + m_alpha4 *
t5 + m_alpha5 *
t6 + m_alpha6 * t7 + m_alpha7 * t8;
599 typedef void result_type;
603 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 ,
class Fac4 = Fac3 ,
class Fac5 = Fac4 ,
class Fac6 = Fac5 ,
class Fac7 = Fac6 ,
class Fac8 = Fac7 >
615 scale_sum8( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
616 Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 )
617 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) { }
619 template<
class T1 ,
class T2 ,
class T3 ,
class T4 ,
class T5 ,
class T6 ,
class T7 ,
class T8 ,
class T9 >
620 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 ,
const T5 &
t5 ,
const T6 &
t6 ,
const T7 &t7 ,
const T8 &t8 ,
const T9 &t9 )
const
622 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4 + m_alpha4 *
t5 + m_alpha5 *
t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9;
625 typedef void result_type;
628 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 ,
class Fac4 = Fac3 ,
class Fac5 = Fac4 ,
class Fac6 = Fac5 ,
class Fac7 = Fac6 ,
class Fac8 = Fac7 ,
class Fac9 = Fac8 >
641 scale_sum9( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
642 Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 )
643 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) { }
645 template<
class T1 ,
class T2 ,
class T3 ,
class T4 ,
class T5 ,
class T6 ,
class T7 ,
class T8 ,
class T9 ,
class T10 >
646 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 ,
const T5 &
t5 ,
const T6 &
t6 ,
const T7 &t7 ,
const T8 &t8 ,
const T9 &t9 ,
const T10 &t10 )
const
648 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4 + m_alpha4 *
t5 + m_alpha5 *
t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10;
651 typedef void result_type;
654 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 ,
class Fac4 = Fac3 ,
class Fac5 = Fac4 ,
class Fac6 = Fac5 ,
class Fac7 = Fac6 ,
class Fac8 = Fac7 ,
class Fac9 = Fac8 ,
class Fac10 = Fac9 >
666 const Fac10 m_alpha10;
668 scale_sum10( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
669 Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 , Fac10 alpha10 )
670 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) { }
672 template<
class T1 ,
class T2 ,
class T3 ,
class T4 ,
class T5 ,
class T6 ,
class T7 ,
class T8 ,
class T9 ,
class T10 ,
class T11 >
673 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 ,
const T5 &
t5 ,
const T6 &
t6 ,
const T7 &t7 ,
const T8 &t8 ,
const T9 &t9 ,
const T10 &t10 ,
const T11 &t11 )
const
675 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4 + m_alpha4 *
t5 + m_alpha5 *
t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11;
678 typedef void result_type;
682 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 ,
class Fac4 = Fac3 ,
class Fac5 = Fac4 ,
class Fac6 = Fac5 ,
class Fac7 = Fac6 ,
class Fac8 = Fac7 ,
class Fac9 = Fac8 ,
class Fac10 = Fac9 ,
class Fac11 = Fac10 >
694 const Fac10 m_alpha10;
695 const Fac11 m_alpha11;
697 scale_sum11( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
698 Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 ,
699 Fac10 alpha10 , Fac11 alpha11 )
700 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) { }
702 template<
class T1 ,
class T2 ,
class T3 ,
class T4 ,
class T5 ,
class T6 ,
class T7 ,
class T8 ,
class T9 ,
class T10 ,
class T11 ,
class T12 >
703 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 ,
const T5 &
t5 ,
const T6 &
t6 ,
const T7 &t7 ,
const T8 &t8 ,
const T9 &t9 ,
const T10 &t10 ,
const T11 &t11 ,
const T12 &t12 )
const
705 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4 + m_alpha4 *
t5 + m_alpha5 *
t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12;
708 typedef void result_type;
711 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 ,
class Fac4 = Fac3 ,
class Fac5 = Fac4 ,
class Fac6 = Fac5 ,
class Fac7 = Fac6 ,
class Fac8 = Fac7 ,
class Fac9 = Fac8 ,
class Fac10 = Fac9 ,
class Fac11 = Fac10 ,
class Fac12 = Fac11 >
723 const Fac10 m_alpha10;
724 const Fac11 m_alpha11;
725 const Fac12 m_alpha12;
727 scale_sum12( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
728 Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 ,
729 Fac10 alpha10 , Fac11 alpha11 , Fac12 alpha12 )
730 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) , m_alpha12( alpha12 ) { }
732 template<
class T1 ,
class T2 ,
class T3 ,
class T4 ,
class T5 ,
class T6 ,
class T7 ,
class T8 ,
class T9 ,
class T10 ,
class T11 ,
class T12 ,
class T13 >
733 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 ,
const T5 &
t5 ,
const T6 &
t6 ,
const T7 &t7 ,
const T8 &t8 ,
const T9 &t9 ,
const T10 &t10 ,
const T11 &t11 ,
const T12 &t12 ,
const T13 &t13 )
const
735 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4 + m_alpha4 *
t5 + m_alpha5 *
t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12 + m_alpha12 * t13;
738 typedef void result_type;
741 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 ,
class Fac4 = Fac3 ,
class Fac5 = Fac4 ,
class Fac6 = Fac5 ,
class Fac7 = Fac6 ,
class Fac8 = Fac7 ,
class Fac9 = Fac8 ,
class Fac10 = Fac9 ,
class Fac11 = Fac10 ,
class Fac12 = Fac11 ,
class Fac13 = Fac12 >
753 const Fac10 m_alpha10;
754 const Fac11 m_alpha11;
755 const Fac12 m_alpha12;
756 const Fac13 m_alpha13;
758 scale_sum13( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
759 Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 ,
760 Fac10 alpha10 , Fac11 alpha11 , Fac12 alpha12 , Fac13 alpha13 )
761 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) , m_alpha12( alpha12 ) , m_alpha13( alpha13 ) { }
763 template<
class T1 ,
class T2 ,
class T3 ,
class T4 ,
class T5 ,
class T6 ,
class T7 ,
class T8 ,
class T9 ,
class T10 ,
class T11 ,
class T12 ,
class T13 ,
class T14 >
764 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 ,
const T5 &
t5 ,
const T6 &
t6 ,
const T7 &t7 ,
const T8 &t8 ,
const T9 &t9 ,
const T10 &t10 ,
const T11 &t11 ,
const T12 &t12 ,
const T13 &t13 ,
const T14 &t14 )
const
766 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4 + m_alpha4 *
t5 + m_alpha5 *
t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12 + m_alpha12 * t13 + m_alpha13 * t14;
769 typedef void result_type;
772 template<
class Fac1 =
double ,
class Fac2 = Fac1 ,
class Fac3 = Fac2 ,
class Fac4 = Fac3 ,
class Fac5 = Fac4 ,
class Fac6 = Fac5 ,
class Fac7 = Fac6 ,
class Fac8 = Fac7 ,
class Fac9 = Fac8 ,
class Fac10 = Fac9 ,
class Fac11 = Fac10 ,
class Fac12 = Fac11 ,
class Fac13 = Fac12 ,
class Fac14 = Fac13 >
784 const Fac10 m_alpha10;
785 const Fac11 m_alpha11;
786 const Fac12 m_alpha12;
787 const Fac13 m_alpha13;
788 const Fac14 m_alpha14;
790 scale_sum14( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
791 Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 ,
792 Fac10 alpha10 , Fac11 alpha11 , Fac12 alpha12 , Fac13 alpha13 , Fac14 alpha14 )
793 : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) , m_alpha12( alpha12 ) , m_alpha13( alpha13 ) , m_alpha14( alpha14 ) { }
795 template<
class T1 ,
class T2 ,
class T3 ,
class T4 ,
class T5 ,
class T6 ,
class T7 ,
class T8 ,
class T9 ,
class T10 ,
class T11 ,
class T12 ,
class T13 ,
class T14 ,
class T15 >
796 __device__ __host__
void operator()( T1 &
t1 ,
const T2 &
t2 ,
const T3 &
t3 ,
const T4 &
t4 ,
const T5 &
t5 ,
const T6 &
t6 ,
const T7 &t7 ,
const T8 &t8 ,
const T9 &t9 ,
const T10 &t10 ,
const T11 &t11 ,
const T12 &t12 ,
const T13 &t13 ,
const T14 &t14 ,
const T15 &t15 )
const
798 t1 = m_alpha1 *
t2 + m_alpha2 *
t3 + m_alpha3 *
t4 + m_alpha4 *
t5 + m_alpha5 *
t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12 + m_alpha12 * t13 + m_alpha13 * t14 + m_alpha14 * t15;
801 typedef void result_type;
804 template<
class Fac1 =
double ,
class Fac2 = Fac1 >
810 scale_sum_swap2( Fac1 alpha1 , Fac2 alpha2 ) : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { }
812 template<
class T1 ,
class T2 ,
class T3 >
813 __device__ __host__
void operator()( T1 &
t1 , T2 &
t2 ,
const T3 &
t3)
const
816 t1 = m_alpha1 *
t2 + m_alpha2 *
t3;
820 typedef void result_type;
828 template<
class Fac1 =
double >
831 const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt;
833 rel_error( Fac1 eps_abs , Fac1 eps_rel , Fac1 a_x , Fac1 a_dxdt )
834 : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt ) { }
837 template<
class T1 ,
class T2 ,
class T3 >
838 __device__ __host__
void operator()( T3 &
t3 ,
const T1 &
t1 ,
const T2 &
t2 )
const
841 set_unit_value(
t3 , abs( get_unit_value(
t3 ) ) / ( m_eps_abs + m_eps_rel * ( m_a_x * abs( get_unit_value(
t1 ) ) + m_a_dxdt * abs( get_unit_value(
t2 ) ) ) ) );
844 typedef void result_type;
855 template<
class Fac1 =
double >
858 const Fac1 m_eps_abs , m_eps_rel ;
861 : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) { }
867 template<
class T1 ,
class T2 ,
class T3 >
868 __device__ __host__
void operator()( T3 &
t3 ,
const T1 &
t1 ,
const T2 &
t2 )
const
870 BOOST_USING_STD_MAX();
872 Fac1 x1 = abs( get_unit_value(
t1 ) ) , x2 = abs( get_unit_value(
t2 ) );
873 set_unit_value(
t3 , abs( get_unit_value(
t3 ) ) / ( m_eps_abs + m_eps_rel * max BOOST_PREVENT_MACRO_SUBSTITUTION ( x1 , x2 ) ) );
876 typedef void result_type;
885 template<
class Value >
888 template<
class Fac1 ,
class Fac2 >
889 __device__ __host__ Value operator()( Fac1
t1 ,
const Fac2
t2 )
const
892 Value a1 = abs( get_unit_value(
t1 ) ) , a2 = abs( get_unit_value(
t2 ) );
893 return ( a1 < a2 ) ? a2 : a1 ;
896 typedef Value result_type;
900 template<
class Fac1 =
double >
903 const Fac1 m_eps_abs , m_eps_rel;
906 : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel )
909 template<
class Res ,
class T1 ,
class T2 ,
class T3 >
910__device__ __host__ Res operator()( Res r ,
const T1 &x_old ,
const T2 &x ,
const T3 &x_err )
912 BOOST_USING_STD_MAX();
914 Res tmp = abs( get_unit_value( x_err ) ) / ( m_eps_abs + m_eps_rel * max BOOST_PREVENT_MACRO_SUBSTITUTION ( abs( x_old ) , abs( x ) ) );
915 return max BOOST_PREVENT_MACRO_SUBSTITUTION ( r , tmp );
920 template<
class Fac1 =
double >
923 const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt;
925 rel_error_max2( Fac1 eps_abs , Fac1 eps_rel , Fac1 a_x , Fac1 a_dxdt )
926 : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt )
929 template<
class Res ,
class T1 ,
class T2 ,
class T3 ,
class T4 >
930__device__ __host__ Res operator()( Res r ,
const T1 &x_old ,
const T2 & ,
const T3 &dxdt_old ,
const T4 &x_err )
932 BOOST_USING_STD_MAX();
934 Res tmp = abs( get_unit_value( x_err ) ) /
935 ( m_eps_abs + m_eps_rel * ( m_a_x * abs( get_unit_value( x_old ) ) + m_a_dxdt * abs( get_unit_value( dxdt_old ) ) ) );
936 return max BOOST_PREVENT_MACRO_SUBSTITUTION ( r , tmp );
943 template<
class Fac1 =
double >
946 const Fac1 m_eps_abs , m_eps_rel;
949 : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel )
952 template<
class Res ,
class T1 ,
class T2 ,
class T3 >
953__device__ __host__ Res operator()( Res r ,
const T1 &x_old ,
const T2 &x ,
const T3 &x_err )
955 BOOST_USING_STD_MAX();
957 Res tmp = abs( get_unit_value( x_err ) ) / ( m_eps_abs + m_eps_rel * max BOOST_PREVENT_MACRO_SUBSTITUTION ( abs( x_old ) , abs( x ) ) );
958 return r + tmp * tmp;
965 template<
class Fac1 =
double >
968 const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt;
970 rel_error_l2_2( Fac1 eps_abs , Fac1 eps_rel , Fac1 a_x , Fac1 a_dxdt )
971 : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt )
974 template<
class Res ,
class T1 ,
class T2 ,
class T3 ,
class T4 >
975__device__ __host__ Res operator()( Res r ,
const T1 &x_old ,
const T2 & ,
const T3 &dxdt_old ,
const T4 &x_err )
978 Res tmp = abs( get_unit_value( x_err ) ) /
979 ( m_eps_abs + m_eps_rel * ( m_a_x * abs( get_unit_value( x_old ) ) + m_a_dxdt * abs( get_unit_value( dxdt_old ) ) ) );
980 return r + tmp * tmp;
KeyT const ValueT ValueT OffsetIteratorT OffsetIteratorT int
[in] The number of segments that comprise the sorting data
for_each_norm(const vector_type &v, index_type &p, norm_result_type &n)
constructor
void operator()(T &t) const
It call the copy function for each property.
It model an expression expr1 * expr2.