ASL 0.1.7
Advanced Simulation Library
Loading...
Searching...
No Matches
aclVectorOfElementsOperations.h
Go to the documentation of this file.
1/*
2 * Advanced Simulation Library <http://asl.org.il>
3 *
4 * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5 *
6 *
7 * This file is part of Advanced Simulation Library (ASL).
8 *
9 * ASL is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU Affero General Public License as
11 * published by the Free Software Foundation, version 3 of the License.
12 *
13 * ASL is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23
24#ifndef ACLVECTORELEMENTSOPERATIONS_H
25#define ACLVECTORELEMENTSOPERATIONS_H
26
28
29namespace acl
30{
31
32 class ElementBase;
33 class MemBlock;
34 class KernelConfiguration;
35
36
37 typedef std::shared_ptr<ElementBase> Element;
38 typedef std::shared_ptr<MemBlock> ElementData;
39
40 class VectorOfElements;
41
42 typedef shared_ptr<VectorOfElementsData> SPVectorOfElementsData;
43 typedef shared_ptr<VectorOfElements> SPVectorOfElements;
44
48
52
53
57 VectorOfElements initializationValue,
58 const KernelConfiguration & kernelConfig);
59
63 VectorOfElements initializationValue);
64
65
67
70 void copy(const vector<Element> & source,
71 VectorOfElements & destination);
72
74
77 void copy(const vector<ElementData> & source,
78 VectorOfElements & destination);
79
81
85 void copy(const vector<Element> & source,
86 VectorOfElements & destination, unsigned int start, unsigned int end);
87
88
90
93 void copy(const VectorOfElementsData & source,
94 VectorOfElementsData & destination);
95
96
100 unsigned int start,
101 unsigned int end);
102
106 unsigned int i);
107
111 const vector<unsigned int> & iList);
112
116 unsigned int start,
117 unsigned int end);
118
119
124 const VectorOfElementsData & b);
125
127
130
134 const VectorOfElements & b);
135
136
140
141
146 const VectorOfElements & b);
147
148
152 const VectorOfElements & b);
153
154
159 const VectorOfElements & b);
160
161
166 const VectorOfElements & b);
167
168
172 const VectorOfElements & b);
173
174
178 const VectorOfElements & b);
179
180
186 const VectorOfElements & b);
187
188
192 const VectorOfElements & b);
193
197 const VectorOfElements & b);
198
199
203 const VectorOfElements & b);
204
205
209 const VectorOfElements & b);
210
211
215
216
220 const VectorOfElements & b);
221
225 const VectorOfElements & b);
226
230 const VectorOfElements & b);
231
235 const VectorOfElements & b);
236
240 const VectorOfElements & b);
241
245
246
251 const VectorOfElements & b);
252
253
257 inline VectorOfElements l2(const VectorOfElements & a);
258
259
264 const VectorOfElements & b);
265
270
274 const VectorOfElements & b);
275
279 const VectorOfElements & b);
280
284 const VectorOfElements & b,
285 TypeID type);
286
290 const VectorOfElements & b);
291
295 const VectorOfElements & b);
296
300 const VectorOfElements & b,
301 TypeID type);
302
306 const VectorOfElements & b);
307
311 const VectorOfElements & b,
312 TypeID t);
313
317
323 const VectorOfElements & filter);
324
325
329
335 const VectorOfElements & b,
336 const VectorOfElements & c);
337
341
347 const VectorOfElements & b,
348 const VectorOfElements & c,
349 TypeID t);
350
354
360 const VectorOfElements & c,
361 TypeID t);
362
368 const VectorOfElements & b,
369 const VectorOfElements & c);
370
376 const VectorOfElements & b,
377 const VectorOfElements & c,
378 TypeID t);
379
383
384
388
389
392 VectorOfElements powI(const VectorOfElements & a, unsigned int i);
393
394
398
402
406
410
414
418
422
426
430
434
438
442
446
450
453
467 const VectorOfElements & b);
468
471
485 const VectorOfElementsData & b);
486
489
508 const VectorOfElements & b,
509 const VectorOfElements & c);
510
514 unsigned int n);
515
519 unsigned int n);
520
521
525 template <typename T> VectorOfElements operator+=(const VectorOfElements & a,
526 const T & b);
527
528
533 template <typename T> VectorOfElements operator-=(const VectorOfElements & a,
534 const T & b);
535
536
539
542 template <typename T> VectorOfElements operator*=(const VectorOfElements & a,
543 const T & b);
544
545
548
551 template <typename T> VectorOfElements operator/=(const VectorOfElements & a,
552 const T & b);
553
554
557
560 template <typename T> VectorOfElements operator+(const VectorOfElements & a,
561 const T & b);
562
563
566
569 template <typename T> VectorOfElements operator+(const T & a,
570 const VectorOfElements & b);
571
572
577 template <typename T> VectorOfElements operator-(const VectorOfElements & a,
578 const T & b);
579
580
585 template <typename T> VectorOfElements operator-(const T & a,
586 const VectorOfElements & b);
587
588
593 template <typename T> VectorOfElements operator*(const VectorOfElements & a,
594 const T & b);
595
596
601 template <typename T> VectorOfElements operator*(const T & a,
602 const VectorOfElements & b);
603
604
607
610 template <typename T> VectorOfElements operator/(const VectorOfElements & a,
611 const T & b);
612
615
618 template <typename T> VectorOfElements operator%(const VectorOfElements & a,
619 const T & b);
620
623
626 template <typename T> VectorOfElements operator/(const T & b,
627 const VectorOfElements & a);
628
631
634 template <typename T> VectorOfElements operator%(const T & b,
635 const VectorOfElements & a);
636
639
642 template <typename T> VectorOfElements operator>(const VectorOfElements & a,
643 const T & b);
644
645
648
651 template <typename T> VectorOfElements operator>(const T & b,
652 const VectorOfElements & a);
653
654
657
660 template <typename T> VectorOfElements operator<(const VectorOfElements & a,
661 const T & b);
662
663
666
669 template <typename T> VectorOfElements operator<(const T & b,
670 const VectorOfElements & a);
671
674
677 template <typename T> VectorOfElements operator>=(const VectorOfElements & a,
678 const T & b);
679
680
683
686 template <typename T> VectorOfElements operator>=(const T & b,
687 const VectorOfElements & a);
688
691
694 template <typename T> VectorOfElements operator<=(const VectorOfElements & a,
695 const T & b);
696
697
700
703 template <typename T> VectorOfElements operator<=(const T & b,
704 const VectorOfElements & a);
705
708
711 template <typename T> VectorOfElements operator==(const VectorOfElements & a,
712 const T & b);
713
714
717
720 template <typename T> VectorOfElements operator==(const T & b,
721 const VectorOfElements & a);
722
723
726
729 template <typename T> VectorOfElements operator!=(const VectorOfElements & a,
730 const T & b);
731
732
737 template <typename T> VectorOfElements operator!=(const T & b,
738 const VectorOfElements & a);
740
742 vector<Element> gcNormalize(const VectorOfElements & a);
744 vector<Element> gcLength2(const VectorOfElements & a, const VectorOfElements & l2);
746 vector<Element> gcLength(const VectorOfElements & a, const VectorOfElements & l);
747
748
749//------------------------------ Implementation ----------------
750
751 inline VectorOfElements l2(const VectorOfElements & a)
752 {
753 return a * a;
754 }
755
756
757} //namespace acl
758
759#endif // ACLVECTORELEMENTSOPERATIONS_H
ACL Kernel configuration class.
The class represents several ElementData.
VectorOfElementsData clone(VectorOfElementsData a)
VectorOfElementsData clone(VectorOfElementsData a, unsigned int n)
void swapBuffers(const VectorOfElementsData &a, const VectorOfElementsData &b)
The class represents several Element.
void copy(const vector< Element > &source, VectorOfElements &destination, unsigned int start, unsigned int end)
Copies the VectorOfElements class.
void initData(VectorOfElements a, VectorOfElements initializationValue, const KernelConfiguration &kernelConfig)
void initData(VectorOfElements a, VectorOfElements initializationValue)
void copy(const vector< ElementData > &source, VectorOfElements &destination)
Copies the VectorOfElements class.
VectorOfElements subVE(const VectorOfElements &source, unsigned int start, unsigned int end)
VectorOfElements subVE(const VectorOfElements &source, unsigned int i)
VectorOfElements subVE(const VectorOfElements &source, const vector< unsigned int > &iList)
VectorOfElementsData subVE(const VectorOfElementsData &source, unsigned int start, unsigned int end)
VectorOfElements operator!=(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements minAbsElement(const VectorOfElements &a)
VectorOfElements fabs(const VectorOfElements &a)
VectorOfElements operator!=(const VectorOfElements &a, const T &b)
VectorOfElements operator*(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements assignmentSafe(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator<(const VectorOfElements &a, const T &b)
VectorOfElements operator!(const VectorOfElements &a)
VectorOfElements copysign(const VectorOfElements &a, const VectorOfElements &b, TypeID t)
VectorOfElements sqrt(const VectorOfElements &a)
VectorOfElements operator<(const T &b, const VectorOfElements &a)
VectorOfElements operator+=(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator/(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator>=(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements floor(const VectorOfElements &a)
VectorOfElements abs(const VectorOfElements &a)
VectorOfElements operator==(const T &b, const VectorOfElements &a)
VectorOfElements operator>=(const T &b, const VectorOfElements &a)
VectorOfElements operator-(const VectorOfElements &a, const T &b)
VectorOfElements abs_diff(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator-(const VectorOfElements &a)
VectorOfElements crossProduct(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator*=(const VectorOfElements &a, const T &b)
VectorOfElements log10(const VectorOfElements &a)
VectorOfElements operator%(const VectorOfElements &a, const T &b)
VectorOfElements operator-=(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator-=(const VectorOfElements &a, const T &b)
VectorOfElements operator+(const VectorOfElements &a, const T &b)
VectorOfElements operator*=(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator*(const T &a, const VectorOfElements &b)
VectorOfElements operator!=(const T &b, const VectorOfElements &a)
VectorOfElements operator+(const T &a, const VectorOfElements &b)
VectorOfElements productOfElements(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator/=(const VectorOfElements &a, const T &b)
VectorOfElements catN(const VectorOfElements &a, unsigned int n)
VectorOfElements minElement(const VectorOfElements &a)
VectorOfElements convert(acl::TypeID type, const VectorOfElements &a, bool strong=true)
VectorOfElements operator/(const VectorOfElements &a, const T &b)
VectorOfElements operator+=(const VectorOfElements &a, const T &b)
VectorOfElements select(const VectorOfElements &b, const VectorOfElements &c, TypeID t)
VectorOfElementsData cat(const VectorOfElementsData &a, const VectorOfElementsData &b)
VectorOfElements operator+(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements max(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator%(const T &b, const VectorOfElements &a)
VectorOfElements min(const VectorOfElements &a, const VectorOfElements &b, TypeID type)
VectorOfElements exp(const VectorOfElements &a)
VectorOfElements select(const VectorOfElements &a, const VectorOfElements &b, const VectorOfElements &c)
VectorOfElements max(const VectorOfElements &a, const VectorOfElements &b, TypeID type)
VectorOfElements operator||(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements sign(const VectorOfElements &a)
VectorOfElements cat(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements sumOfElements(const VectorOfElements &a)
VectorOfElements mad(const VectorOfElements &a, const VectorOfElements &b, const VectorOfElements &c, TypeID t)
VectorOfElements productOfElements(const VectorOfElements &a)
VectorOfElements divisionOfElements(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements cat(const VectorOfElements *a, unsigned int n)
VectorOfElements rsqrt(const VectorOfElements &a)
VectorOfElements log(const VectorOfElements &a)
VectorOfElements operator<(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator>(const VectorOfElements &a, const T &b)
VectorOfElements excerpt(const VectorOfElements &source, const VectorOfElements &filter)
VectorOfElements operator/(const T &b, const VectorOfElements &a)
VectorOfElements cat(const VectorOfElements &a, const VectorOfElements &b, const VectorOfElements &c)
VectorOfElements operator==(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements min(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator-(const T &a, const VectorOfElements &b)
VectorOfElements minAbs(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator%(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator<=(const VectorOfElements &a, const T &b)
VectorOfElements operator-(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements select(const VectorOfElements &a, const VectorOfElements &b, const VectorOfElements &c, TypeID t)
VectorOfElements operator*(const VectorOfElements &a, const T &b)
VectorOfElements copysign(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements powI(const VectorOfElements &a, unsigned int i)
VectorOfElements mad(const VectorOfElements &a, const VectorOfElements &b, const VectorOfElements &c)
VectorOfElements orOfElements(const VectorOfElements &a)
VectorOfElements andOfElements(const VectorOfElements &a)
VectorOfElements maxElement(const VectorOfElements &a)
VectorOfElements operator==(const VectorOfElements &a, const T &b)
VectorOfElements operator>(const T &b, const VectorOfElements &a)
VectorOfElements operator<=(const T &b, const VectorOfElements &a)
VectorOfElements operator<=(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator&&(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator>(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator/=(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements operator>=(const VectorOfElements &a, const T &b)
acl::TypeID type(acl::typeToTypeID< FlT >())
Advanced Computational Language.
Definition acl.h:41
shared_ptr< VectorOfElementsData > SPVectorOfElementsData
VectorOfElements l2(const VectorOfElements &a)
vector< Element > gcLength2(const VectorOfElements &a, const VectorOfElements &l2)
generates code corresponding . Result will be stored in l2
void copy(MemBlock &source, T *destination)
TypeID
Definition aclTypes.h:39
vector< Element > gcLength(const VectorOfElements &a, const VectorOfElements &l)
generates code corresponding . Result will be stored in l
vector< Element > gcNormalize(const VectorOfElements &a)
generates code corresponding
std::shared_ptr< MemBlock > ElementData
Definition acl.h:48
shared_ptr< VectorOfElements > SPVectorOfElements
std::shared_ptr< ElementBase > Element
Definition acl.h:49