File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,10 @@ class AFAPI dim4
5252 const dim_type* get () const { return dims; }
5353};
5454
55+ dim4 operator +(const dim4& first, const dim4& second);
56+ dim4 operator -(const dim4& first, const dim4& second);
57+ dim4 operator *(const dim4& first, const dim4& second);
58+
5559static inline
5660std::ostream&
5761operator <<(std::ostream& ostr, const dim4& dims)
Original file line number Diff line number Diff line change @@ -142,6 +142,34 @@ dim4::operator-=(const dim4 &other)
142142 return *this ;
143143}
144144
145+ dim4 operator +(const dim4& first, const dim4& second)
146+ {
147+ dim4 dims;
148+ for (unsigned i = 0 ; i < 4 ; i++) {
149+ dims[i] = first[i] + second[i];
150+ }
151+ return dims;
152+ }
153+
154+ dim4 operator -(const dim4& first, const dim4& second)
155+ {
156+ dim4 dims;
157+ for (unsigned i = 0 ; i < 4 ; i++) {
158+ dims[i] = first[i] - second[i];
159+ }
160+ return dims;
161+ }
162+
163+ dim4 operator *(const dim4& first, const dim4& second)
164+ {
165+ dim4 dims;
166+ for (unsigned i = 0 ; i < 4 ; i++) {
167+ dims[i] = first[i] * second[i];
168+ }
169+ return dims;
170+ }
171+
172+
145173bool
146174isEnd (const af_seq &seq) { return (seq.end <= -1 ); }
147175
You can’t perform that action at this time.
0 commit comments