Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
multiply.h
Go to the documentation of this file.
1#ifndef MULTIPLY_H
2#define MULTIPLY_H
3/*
4Various matrix operations performed upon arrays of DynLinArr and
5DynArr classes.
6
7Copyright (c) 2001 Igor B. Smirnov
8
9The file can be used, copied, modified, and distributed
10according to the terms of GNU Lesser General Public License version 2.1
11as published by the Free Software Foundation,
12and provided that the above copyright notice, this permission notice,
13and notices about any modifications of the original text
14appear in all copies and in supporting documentation.
15The file is provided "as is" without express or implied warranty.
16*/
17
20/*
21In the following functions the preffix "norm" denotes calculation
22of sum of squares, not just sum. Be careful.
23*/
25
26template <class T> T norm_DynLinArr(const DynLinArr<T>& f) {
27 long q = f.get_qel();
28 T s(0); // assumes that this clears the element
29 long n;
30 for (n = 0; n < q; n++) {
31 T t(f.acu(n));
32 s = s + t * t;
33 }
34 return sqrt(s);
35}
36
37// Uses only selected elements
38template <class T>
40 mfunname("template<class T> T norm_DynLinArr_part(...)");
41 long q = f.get_qel();
42 check_econd12(q, !=, s_use.get_qel(), mcerr);
43 T s(0); // assumes that this clears the element
44 long n;
45 for (n = 0; n < q; n++) {
46 if (s_use.acu(n) == 1) {
47 T t(f.acu(n));
48 s = s + t * t;
49 }
50 }
51 return sqrt(s);
52}
53
55
56template <class T> T normsq_DynLinArr(const DynLinArr<T>& f) {
57 long q = f.get_qel();
58 T s(0); // assumes that this clears the element
59 long n;
60 for (n = 0; n < q; n++) {
61 T t(f.acu(n));
62 s = s + t * t;
63 }
64 return s;
65}
66
67template <class T>
69 mfunname("template<class T> T normsq_DynLinArr_part(...)");
70 long q = f.get_qel();
71 check_econd12(q, !=, s_use.get_qel(), mcerr);
72 T s(0); // assumes that this clears the element
73 long n;
74 for (n = 0; n < q; n++) {
75 if (s_use.acu(n) == 1) {
76 T t(f.acu(n));
77 s = s + t * t;
78 }
79 }
80 return s;
81}
82
83// Matrix multiplication of two matrices:
84template <class T>
85DynArr<T> operator*(const DynArr<T>& mt1, const DynArr<T>& mt2) {
86 mfunnamep("template<class T> DynArr<T> operator*(const DynArr<T>& mt1, const "
87 "DynArr<T>& mt2)");
88 check_econd11(mt1.get_qdim(), != 2, mcerr);
89 check_econd11(mt2.get_qdim(), > 2, mcerr);
90 check_econd11(mt2.get_qdim(), < 1, mcerr);
91 const DynLinArr<long>& qel_mt1(mt1.get_qel());
92 const DynLinArr<long>& qel_mt2(mt2.get_qel());
93 check_econd12(qel_mt1[1], !=, qel_mt2[0], mcerr);
94 if (mt2.get_qdim() == 2) { // otherwise 1
95 long q1 = qel_mt1[0];
96 long q2 = qel_mt2[1];
97 long q3 = qel_mt1[1];
98 DynArr<T> res(q1, q2);
99 for (long n1 = 0; n1 < q1; ++n1) {
100 for (long n2 = 0; n2 < q2; ++n2) {
101 T t(0.0);
102 for (long n3 = 0; n3 < q3; ++n3) {
103 t += mt1.acu(n1, n3) * mt2.acu(n3, n2);
104 }
105 res.acu(n1, n2) = t;
106 }
107 }
108 return res;
109 } else {
110 long q1 = qel_mt1[0];
111 long q3 = qel_mt1[1];
112 DynArr<T> res(q1);
113 for (long n1 = 0; n1 < q1; ++n1) {
114 T t(0.0);
115 for (long n3 = 0; n3 < q3; ++n3) {
116 t += mt1.acu(n1, n3) * mt2.acu(n3);
117 }
118 res.acu(n1) = t;
119 }
120 return res;
121 }
122}
123
124template <class T>
126 const DynLinArr<long>& qel_mt(mt.get_qel());
127 if (qel_mt.get_qel() != 2) {
128 mcerr << "template<class T>\n"
129 << "DynLinArr<T> operator*(const DynArr<T>& mt, "
130 << "const DynLinArr<T>& vc):\n";
131 mcerr << "qel_mt.get_qel() != 2, qel_mt.get_qel() =" << qel_mt.get_qel()
132 << '\n';
133 spexit(mcerr);
134 }
135 long q = vc.get_qel();
136 if (q != qel_mt[1]) {
137 mcerr << "template<class T>\n"
138 << "DynLinArr<T> operator*(const DynArr<T>& mt, "
139 << "const DynLinArr<T>& vc):\n";
140 mcerr << "q != qel_mt[1], q =" << q << "qel_mt[1]=" << qel_mt[1] << '\n';
141 spexit(mcerr);
142 }
143 T s(0); // assumes that this clears the element
144 DynLinArr<T> res(qel_mt[0], s);
145 long n1, n2;
146 for (n1 = 0; n1 < qel_mt[0]; n1++) {
147 for (n2 = 0; n2 < q; n2++) {
148 res[n1] += mt.acu(n1, n2) * vc.acu(n2);
149 }
150 }
151 return res;
152}
153
154//DynLinArr<DoubleAc> operator*(const DynArr<DoubleAc>& mt,
155// const DynLinArr<DoubleAc>& vc);
156
158 const DynLinArr<double>& vc);
160 const DynLinArr<DoubleAc>& vc);
161
162template <class T>
163T operator*(const DynLinArr<T>& vc1, const DynLinArr<T>& vc2) {
164 //mcout<<"T operator*(const DynLinArr<T>& vc1, const DynLinArr<T>& vc2):\n";
165 long q1 = vc1.get_qel();
166 long q2 = vc2.get_qel();
167 if (q1 != q2) {
168 mcerr << "template<class T>\n"
169 << "DynLinArr<T> operator*(const DynArr<T>& mt, "
170 << "const DynLinArr<T>& vc):\n";
171 mcerr << "q1 != q2, q1 =" << q1 << "q2=" << q2 << '\n';
172 spexit(mcerr);
173 }
174 T s(0); // assumes that this clears the element
175 long n;
176 //mcout<<"s="<<s<<'\n';
177 for (n = 0; n < q1; n++) {
178 s += vc1.acu(n) * vc2.acu(n);
179 //mcout<<"vc1[n]="<<vc1[n]<<'\n';
180 //mcout<<"vc2[n]="<<vc2[n]<<'\n';
181 //mcout<<"vc1[n] * vc2[n]="<<vc1[n] * vc2[n]<<'\n';
182 //mcout<<"s="<<s<<'\n';
183 }
184 return s;
185}
186
187//DoubleAc operator*(const DynLinArr<DoubleAc>& mt,
188// const DynLinArr<DoubleAc>& vc);
189
191 const DynLinArr<double>& vc2);
193 const DynLinArr<DoubleAc>& vc2);
194
195template <class T, class X>
196DynLinArr<T> operator*(const DynLinArr<T>& ar, const X& t) {
197 long q = ar.get_qel();
198 DynLinArr<T> res(q);
199 long n;
200 for (n = 0; n < q; n++) {
201 res.acu(n) = ar.acu(n) * t;
202 }
203 return res;
204}
205
206template <class T, class X>
208 long q = ar.get_qel();
209 long n;
210 for (n = 0; n < q; n++) {
211 ar.acu(n) *= t;
212 }
213 return ar;
214}
215
216template <class T, class X>
217DynLinArr<T> operator*(const X& t, const DynLinArr<T>& ar) {
218 mfunnamep("template<class T, class X> DynLinArr<T> operator*(const X& t, "
219 "const DynLinArr<T>& ar)");
220 long q = ar.get_qel();
221 DynLinArr<T> res(q);
222 long n;
223 for (n = 0; n < q; n++) {
224 res.acu(n) = t * ar.acu(n);
225 }
226 return res;
227}
228
229template <class T, class X>
230DynLinArr<T> operator/(const DynLinArr<T>& ar, const X& t) {
231 mfunname("DynLinArr<T> operator/(const DynLinArr<T>& ar, const X& t)");
232 check_econd11(t, == 0, mcerr);
233 long q = ar.get_qel();
234 DynLinArr<T> res(q);
235 long n;
236 for (n = 0; n < q; n++) {
237 res.acu(n) = ar.acu(n) / t;
238 }
239 return res;
240}
241
242template <class T, class X>
244 mfunname("DynLinArr<T>& operator/=(DynLinArr<T>& ar, const X& t)");
245 check_econd11(t, == 0, mcerr);
246 long q = ar.get_qel();
247 long n;
248 for (n = 0; n < q; n++) {
249 ar.acu(n) /= t;
250 }
251 return ar;
252}
253
254template <class T, class X>
255DynArr<T> operator*(const DynArr<T>& mt, const X& t) {
256 mfunnamep("template<class T, class X> DynArr<T> operator*(const DynArr<T>& "
257 "mt, const X& t)");
258 DynArr<T> ms(mt.get_qel(), NULL);
259 long qel_lin = mt.get_qel_lin();
260 long n;
261 for (n = 0; n < qel_lin; n++) {
262 ms.acu_lin(n) = mt.acu_lin(n) * t;
263 }
264 /*
265 DynArr<T> ms(mt);
266 IterDynArr<T> iter(&ms);
267 T* at;
268 while( (at=iter.more()) != NULL )
269 {
270 (*at) = (*at) * t ;
271 }
272 */
273 return ms;
274}
275
276template <class T, class X>
277DynArr<T> operator*(const X& t, const DynArr<T>& mt) {
278 mfunnamep("template<class T, class X> DynArr<T> operator*(const X& t, const "
279 "DynArr<T>& mt)");
280 DynArr<T> ms(mt.get_qel(), NULL);
281 long qel_lin = mt.get_qel_lin();
282 long n;
283 for (n = 0; n < qel_lin; n++) {
284 ms.acu_lin(n) = t * mt.acu_lin(n);
285 }
286 /*
287 DynArr<T> ms(mt);
288 IterDynArr<T> iter(&ms);
289 T* at;
290 while( (at=iter.more()) != NULL )
291 {
292 (*at) = t * (*at);
293 }
294 */
295 return ms;
296}
297
298template <class T, class X> DynArr<T>& operator*=(DynArr<T>& mt, const X& t) {
299 mfunnamep("template<class T, class X> DynArr<T>& operator*=(DynArr<T>& mt, "
300 "const X& t)");
301 long qel_lin = mt.get_qel_lin();
302 long n;
303 for (n = 0; n < qel_lin; n++) {
304 mt.acu_lin(n) *= t;
305 }
306 /*
307 //DynArr<T> ms(mt);
308 IterDynArr<T> iter(&mt);
309 T* at;
310 while( (at=iter.more()) != NULL )
311 {
312 (*at) *= t ;
313 }
314 */
315 return mt;
316}
317
318template <class T, class X>
319DynArr<T> operator/(const DynArr<T>& mt, const X& t) {
320 mfunnamep("template<class T, class X> DynArr<T> operator/(const DynArr<T>& "
321 "mt, const X& t)");
322 check_econd11(t, == 0, mcerr);
323 DynArr<T> ms(mt.get_qel(), NULL);
324 long qel_lin = mt.get_qel_lin();
325 long n;
326 for (n = 0; n < qel_lin; n++) {
327 ms.acu_lin(n) = mt.acu_lin(n) / t;
328 }
329 /*
330 DynArr<T> ms(mt);
331 IterDynArr<T> iter(&ms);
332 T* at;
333 while( (at=iter.more()) != NULL )
334 {
335 (*at) = (*at) / t ;
336 }
337 */
338 return ms;
339}
340template <class T, class X> DynArr<T>& operator/=(DynArr<T>& mt, const X& t) {
341 mfunnamep("template<class T, class X> DynArr<T>& operator/(DynArr<T>& mt, "
342 "const X& t)");
343 check_econd11(t, == 0, mcerr);
344 long qel_lin = mt.get_qel_lin();
345 long n;
346 for (n = 0; n < qel_lin; n++) {
347 mt.acu_lin(n) /= t;
348 }
349 /*
350 //DynArr<T> ms(mt);
351 IterDynArr<T> iter(&mt);
352 T* at;
353 while( (at=iter.more()) != NULL )
354 {
355 (*at) = (*at) / t ;
356 }
357 */
358 return mt;
359}
360
361template <class T>
363 long q1 = vc1.get_qel();
364 long q2 = vc2.get_qel();
365 if (q1 != q2) {
366 mcerr << "template<class T>\n"
367 << "DynLinArr<T> operator+(const DynLinArr<T>& vc1, "
368 << "const DynLinArr<T>& vc2):\n";
369 mcerr << "q1 != q2, q1 =" << q1 << "q2=" << q2 << '\n';
370 spexit(mcerr);
371 }
372 DynLinArr<T> s(q1);
373 long n;
374 for (n = 0; n < q1; n++) {
375 s.acu(n) = vc1.acu(n) + vc2.acu(n);
376 }
377 return s;
378}
379
380template <class T>
382 long q1 = vc1.get_qel();
383 long q2 = vc2.get_qel();
384 if (q1 != q2) {
385 mcerr << "template<class T>\n"
386 << "DynLinArr<T>& operator+=(DynLinArr<T>& vc1, "
387 << "const DynLinArr<T>& vc2):\n";
388 mcerr << "q1 != q2, q1 =" << q1 << "q2=" << q2 << '\n';
389 spexit(mcerr);
390 }
391 long n;
392 for (n = 0; n < q1; n++) {
393 vc1.acu(n) += vc2.acu(n);
394 }
395 return vc1;
396}
397
398template <class T>
400 long q1 = vc1.get_qel();
401 long q2 = vc2.get_qel();
402 if (q1 != q2) {
403 mcerr << "template<class T>\n"
404 << "DynLinArr<T> operator-(const DynLinArr<T>& vc1, "
405 << "const DynLinArr<T>& vc2):\n";
406 mcerr << "q1 != q2, q1 =" << q1 << "q2=" << q2 << '\n';
407 spexit(mcerr);
408 }
409 DynLinArr<T> s(q1);
410 long n;
411 for (n = 0; n < q1; n++) {
412 s.acu(n) = vc1.acu(n) - vc2.acu(n);
413 }
414 return s;
415}
416
417template <class T>
419 long q1 = vc1.get_qel();
420 long q2 = vc2.get_qel();
421 if (q1 != q2) {
422 mcerr << "template<class T>\n"
423 << "DynLinArr<T>& operator-=(DynLinArr<T>& vc1, "
424 << "const DynLinArr<T>& vc2):\n";
425 mcerr << "q1 != q2, q1 =" << q1 << "q2=" << q2 << '\n';
426 spexit(mcerr);
427 }
428 long n;
429 for (n = 0; n < q1; n++) {
430 vc1.acu(n) -= vc2.acu(n);
431 }
432 return vc1;
433}
434
436 const DynLinArr<double>& vc2);
438 const DynLinArr<DoubleAc>& vc2);
440 const DynLinArr<double>& vc2);
442 const DynLinArr<DoubleAc>& vc2);
443template <class T>
445 ar) { // creates local copy and returns it - may
446 // be inefficient
447 long q = ar.get_qel();
448 DynLinArr<T> s(q);
449 long n;
450 for (n = 0; n < q; n++) {
451 s.acu(n) = -ar.acu(n);
452 }
453 return s;
454}
455
456template <class T>
458 DynLinArr<T>& ar) { // just change sign without copying total content,
459 // but correspondent member function should exist for type of elements T
460 long q = ar.get_qel();
461 DynLinArr<T> s(q);
462 long n;
463 for (n = 0; n < q; n++) {
464 change_sign(ar.acu(n));
465 }
466}
467
468inline void change_sign(float& f) { f = -f; }
469
470inline void change_sign(double& f) { f = -f; }
471
472template <class T, class X>
474 long q = ar.get_qel();
475 long n;
476 for (n = 0; n < q; n++) {
477 ar.acu(n) += t;
478 }
479 return ar;
480}
481
482template <class T, class X>
484 long q = ar.get_qel();
485 long n;
486 for (n = 0; n < q; n++) {
487 ar.acu(n) -= t;
488 }
489 return ar;
490}
491
492template <class T>
493 DynArr<T> operator+(const DynArr<T>& mt1, const DynArr<T>& mt2) {
494 mfunnamep("template<class T> DynArr<T> operator+(const DynArr<T>& mt1, const "
495 "DynArr<T>& mt2)");
496 long qdim1 = mt1.get_qdim();
497 long qdim2 = mt2.get_qdim();
498 check_econd12(qdim1, !=, qdim2, mcerr);
499 const DynLinArr<long>& qe1 = mt1.get_qel();
500 const DynLinArr<long>& qe2 = mt2.get_qel();
501 check_econd12(qe1, !=, qe2, mcerr);
502 DynArr<T> ms(mt1.get_qel(), NULL);
503 long qel_lin = mt1.get_qel_lin();
504 long n;
505 for (n = 0; n < qel_lin; n++) {
506 ms.acu_lin(n) = mt1.acu_lin(n) + mt2.acu_lin(n);
507 }
508
509 /*
510 DynArr<T> ms(mt1); // initializes array and copy content.
511 // it seems to be more economical, than to initialize, and to assign later.
512 IterDynArr<T> iter(&ms);
513 T* at;
514 while( (at=iter.more()) != NULL )
515 {
516 (*at) = (*at) + mt2.acu( iter.get_ncur() );
517 }
518 */
519 return ms;
520}
521
522template <class T> DynArr<T>& operator+=(DynArr<T>& mt1, const DynArr<T>& mt2) {
523 mfunnamep("template<class T> DynArr<T>& operator+(DynArr<T>& mt1, const "
524 "DynArr<T>& mt2)");
525 long qdim1 = mt1.get_qdim();
526 long qdim2 = mt2.get_qdim();
527 check_econd12(qdim1, !=, qdim2, mcerr);
528 const DynLinArr<long>& qe1 = mt1.get_qel();
529 const DynLinArr<long>& qe2 = mt2.get_qel();
530 check_econd12(qe1, !=, qe2, mcerr);
531 long qel_lin = mt1.get_qel_lin();
532 long n;
533 for (n = 0; n < qel_lin; n++) {
534 mt1.acu_lin(n) += mt2.acu_lin(n);
535 }
536 /*
537 IterDynArr<T> iter(&mt1);
538 T* at;
539 while( (at=iter.more()) != NULL )
540 {
541 (*at) += mt2.acu( iter.get_ncur() );
542 }
543 */
544 return mt1;
545}
546
547template <class T>
548 DynArr<T> operator-(const DynArr<T>& mt1, const DynArr<T>& mt2) {
549 mfunnamep("template<class T> DynArr<T> operator-(const DynArr<T>& mt1, const "
550 "DynArr<T>& mt2)");
551 long qdim1 = mt1.get_qdim();
552 long qdim2 = mt2.get_qdim();
553 check_econd12(qdim1, !=, qdim2, mcerr);
554 const DynLinArr<long>& qe1 = mt1.get_qel();
555 const DynLinArr<long>& qe2 = mt2.get_qel();
556 check_econd12(qe1, !=, qe2, mcerr);
557 DynArr<T> ms(mt1.get_qel(), NULL);
558 long qel_lin = mt1.get_qel_lin();
559 long n;
560 for (n = 0; n < qel_lin; n++) {
561 ms.acu_lin(n) = mt1.acu_lin(n) - mt2.acu_lin(n);
562 }
563 /*
564 DynArr<T> ms(mt1);
565 IterDynArr<T> iter(&ms);
566 T* at;
567 while( (at=iter.more()) != NULL )
568 {
569 (*at) = (*at) - mt2.acu( iter.get_ncur() );
570 }
571 */
572 return ms;
573}
574
575template <class T> DynArr<T>& operator-=(DynArr<T>& mt1, const DynArr<T>& mt2) {
576 mfunnamep("template<class T> DynArr<T>& operator-(DynArr<T>& mt1, const "
577 "DynArr<T>& mt2)");
578 long qdim1 = mt1.get_qdim();
579 long qdim2 = mt2.get_qdim();
580 check_econd12(qdim1, !=, qdim2, mcerr);
581 const DynLinArr<long>& qe1 = mt1.get_qel();
582 const DynLinArr<long>& qe2 = mt2.get_qel();
583 check_econd12(qe1, !=, qe2, mcerr);
584 long qel_lin = mt1.get_qel_lin();
585 long n;
586 for (n = 0; n < qel_lin; n++) {
587 mt1.acu_lin(n) -= mt2.acu_lin(n);
588 }
589 /*
590 IterDynArr<T> iter(&mt1);
591 T* at;
592 while( (at=iter.more()) != NULL )
593 {
594 (*at) = (*at) - mt2.acu( iter.get_ncur() );
595 }
596 */
597 return mt1;
598}
599
600template <class T> DynArr<T> operator-(const DynArr<T>& mt) {
601 mfunnamep("template<class T> DynArr<T> operator-(const DynArr<T>& mt)");
602 //long qdim=mt.get_qdim();
603 //const DynLinArr<long>& qe=mt.get_qel();
604 DynArr<T> ms(mt.get_qel(), NULL);
605 long qel_lin = mt.get_qel_lin();
606 long n;
607 for (n = 0; n < qel_lin; n++) {
608 ms.acu_lin(n) -= mt.acu_lin(n);
609 }
610 /*
611 DynArr<T> ms(mt);
612 IterDynArr<T> iter(&ms);
613 T* at;
614 while( (at=iter.more()) != NULL )
615 {
616 (*at) = -(*at);
617 }
618 */
619 return ms;
620}
621
622template <class T>
624 DynArr<T>& mt) { // just change sign without copying total content,
625 // but correspondent member function should exist for type of elements T
626 long qel_lin = mt.get_qel_lin();
627 long n;
628 for (n = 0; n < qel_lin; n++) {
629 change_sign(mt.acu_lin(n));
630 }
631 /*
632 long qdim=mt.get_qdim();
633 const DynLinArr<long>& qe=mt.get_qel();
634 IterDynArr<T> iter(&mt);
635 T* at;
636 while( (at=iter.more()) != NULL )
637 {
638 change_sign((*at));
639 }
640 */
641}
642
643template <class T, class X> DynArr<T>& operator+=(DynArr<T>& mt, const X& t) {
644 mfunnamep("template<class T, class X> DynArr<T>& operator+=(DynArr<T>& mt, "
645 "const X& t)");
646 long qel_lin = mt.get_qel_lin();
647 long n;
648 for (n = 0; n < qel_lin; n++) {
649 mt.acu_lin(n) += t;
650 }
651 /*
652 //DynArr<T> ms(mt);
653 IterDynArr<T> iter(&mt);
654 T* at;
655 while( (at=iter.more()) != NULL )
656 {
657 (*at) += t ;
658 }
659 */
660 return mt;
661}
662
663template <class T, class X> DynArr<T>& operator-=(DynArr<T>& mt, const X& t) {
664 mfunnamep("template<class T, class X> DynArr<T>& operator-=(DynArr<T>& mt, "
665 "const X& t)");
666 long qel_lin = mt.get_qel_lin();
667 long n;
668 for (n = 0; n < qel_lin; n++) {
669 mt.acu_lin(n) += t;
670 }
671 /*
672 //DynArr<T> ms(mt);
673 IterDynArr<T> iter(&mt);
674 T* at;
675 while( (at=iter.more()) != NULL )
676 {
677 (*at) -= t ;
678 }
679 */
680 return mt;
681}
682
684 const DynArr<double>& mt2);
686 const DynArr<DoubleAc>& mt2);
688 const DynArr<double>& mt2);
690 const DynArr<DoubleAc>& mt2);
691
692#endif
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:313
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:366
#define mfunnamep(string)
Definition: FunNameStack.h:77
#define spexit(stream)
Definition: FunNameStack.h:536
#define check_econd12(a, sign, b, stream)
Definition: FunNameStack.h:380
#define mfunname(string)
Definition: FunNameStack.h:67
T & acu_lin(long n)
Definition: AbsArr.h:2542
long get_qdim(void) const
Definition: AbsArr.h:2547
T & acu(long i1)
Definition: AbsArr.h:2098
long get_qel_lin(void) const
Definition: AbsArr.h:2498
const DynLinArr< long > & get_qel(void) const
Definition: AbsArr.h:2548
long get_qel(void) const
Definition: AbsArr.h:420
T & acu(long n)
Definition: AbsArr.h:372
DynLinArr< T > & operator/=(DynLinArr< T > &ar, const X &t)
Definition: multiply.h:243
void change_sign(DynLinArr< T > &ar)
Definition: multiply.h:457
T normsq_DynLinArr_part(const DynLinArr< T > &f, const DynLinArr< int > &s_use)
Definition: multiply.h:68
DynLinArr< T > & operator+=(DynLinArr< T > &vc1, const DynLinArr< T > &vc2)
Definition: multiply.h:381
T norm_DynLinArr_part(const DynLinArr< T > &f, const DynLinArr< int > &s_use)
Definition: multiply.h:39
DynLinArr< T > & operator*=(DynLinArr< T > &ar, const X &t)
Definition: multiply.h:207
DoubleAc norm_DynLinArr(const DynLinArr< DoubleAc > &f)
Definition: multiply.cpp:15
DynLinArr< T > operator-(const DynLinArr< T > &vc1, const DynLinArr< T > &vc2)
Definition: multiply.h:399
DynLinArr< T > operator+(const DynLinArr< T > &vc1, const DynLinArr< T > &vc2)
Definition: multiply.h:362
DynLinArr< T > operator/(const DynLinArr< T > &ar, const X &t)
Definition: multiply.h:230
DynArr< T > operator*(const DynArr< T > &mt1, const DynArr< T > &mt2)
Definition: multiply.h:85
DoubleAc normsq_DynLinArr(const DynLinArr< DoubleAc > &f)
Definition: multiply.cpp:26
DynLinArr< T > & operator-=(DynLinArr< T > &vc1, const DynLinArr< T > &vc2)
Definition: multiply.h:418
#define mcerr
Definition: prstream.h:135