67 this->fArray[i] += rhs.fArray[i];
70 std::cout << __FILE__ <<
" " << __LINE__ <<
"different sizes of arrays!" << std::endl;
78 if (rhs.
GetSize() != this->GetSize())
return *
this;
79 for (
int i = 0; i < GetSize(); i++) {
80 fArray[i] -= rhs.fArray[i];
86 Array_1<T>& Array_1<T>::operator+(
const Array_1<T>& rhs) {
87 if (rhs.GetSize() != this->GetSize())
return *
this;
88 for (
int i = 0; i < GetSize(); i++) {
89 fArray[i] += rhs.fArray[i];
95 Array_1<T>& Array_1<T>::operator-(
const Array_1<T>& rhs) {
96 if (rhs.GetSize() != this->GetSize())
return *
this;
97 for (
int i = 0; i < GetSize(); i++) {
98 fArray[i] -= rhs.fArray[i];
104 Array_1<T>& Array_1<T>::operator*(
const T& val) {
105 for (
int i = 0; i < GetSize(); i++) {
112 Array_1<Bool_t>& Array_1<Bool_t>::operator*(
const Bool_t& val) {
113 for (
int i = 0; i < GetSize(); i++) {
114 fArray[i] = fArray[i] && val;
120 Array_1<T>& Array_1<T>::operator/(
const T& val) {
121 for (
int i = 0; i < GetSize(); i++) {
128 Array_1<T>& Array_1<T>::operator*=(
const T& val) {
129 for (
int i = 0; i < GetSize(); i++) {
136 Array_1<Bool_t>& Array_1<Bool_t>::operator*=(
const Bool_t& val) {
137 for (
int i = 0; i < GetSize(); i++) {
138 fArray[i] = fArray[i] && val;
145 for (
int i = 0; i < GetSize(); i++) {
153 T min = std::numeric_limits<T>::max();
154 for (
int i = 0; i < fSize; i++) {
155 if (min > fArray[i]) {
164 T Array_1<T>::FindMax(Int_t& index)
const {
165 T max = std::numeric_limits<T>::min();
166 for (
int i = 0; i < fSize; i++) {
167 if (max > fArray[i]) {
177 if (fSize == rhs.fSize) {
178 for (
int i = 0; i < fSize; i++) {
179 fArray[i] = fArray[i] + rhs.fArray[i];
187 fArray =
new T[fSize];
188 for (
int i = 0; i < fSize; i++)
189 fArray[i] = obj.fArray[i];
199 for (
int i = 0; i < fSize; i++) {
200 fArray[i].MakeBigger(sizeB);
205 for (
int i = 0; i < fSize; i++) {
209 if (temp)
delete[] temp;
210 for (
int i = fSize; i < sizeA; i++) {
211 fArray[i].MakeBigger(sizeB);
220 if (this->fSize != rhs.fSize) {
221 if (fArray)
delete[] fArray;
228 for (
int i = 0; i < fSize; i++) {
229 fArray[i] = rhs.fArray[i];
238 if (this->fSize != rhs.fSize) {
239 std::cout << __LINE__ <<
" " << __FILE__ <<
" incompatible arrays" << std::endl;
242 for (
int i = 0; i < fSize; i++) {
243 fArray[i] += rhs.fArray[i];
253 for (
int i = 0; i < fSize; i++)
254 fArray[i] = obj.fArray[i];
265 for (
int i = 0; i < fSize; i++) {
266 fArray[i].MakeBigger(sizeB, sizeC);
271 for (
int i = 0; i < fSize; i++) {
275 if (temp)
delete[] temp;
276 for (
int i = fSize; i < sizeA; i++) {
277 fArray[i].MakeBigger(sizeB, sizeC);
286 if (this->fSize != rhs.fSize) {
287 if (fArray)
delete[] fArray;
294 for (
int i = 0; i < fSize; i++) {
295 fArray[i] = rhs.fArray[i];
304 if (this->fSize != rhs.fSize) {
return *
this; }
305 for (
int i = 0; i < fSize; i++) {
306 fArray[i] += rhs.fArray[i];
316 for (
int i = 0; i < fSize; i++)
317 fArray[i] = obj.fArray[i];
328 for (
int i = 0; i < fSize; i++) {
329 fArray[i].MakeBigger(sizeB, sizeC, sizeD);
334 for (
int i = 0; i < fSize; i++) {
338 if (temp)
delete[] temp;
339 for (
int i = fSize; i < sizeA; i++) {
340 fArray[i].MakeBigger(sizeB, sizeC, sizeD);
349 if (this->fSize != rhs.fSize) {
350 if (fArray)
delete[] fArray;
357 for (
int i = 0; i < fSize; i++) {
358 fArray[i] = rhs.fArray[i];
367 if (this->fSize != rhs.fSize) {
return *
this; }
368 for (
int i = 0; i < fSize; i++) {
369 fArray[i] += rhs.fArray[i];
378 if (fSize > 0) fArray =
new Array_3<T>[fSize];
379 for (
int i = 0; i < fSize; i++)
380 fArray[i] = obj.fArray[i];
388 template class Array_1<Bool_t>;
389 template class Array_1<Int_t>;
390 template class Array_1<Short_t>;
391 template class Array_1<Float_t>;
392 template class Array_1<Double_t>;
393 template class Array_2<Bool_t>;
394 template class Array_2<Int_t>;
395 template class Array_2<Short_t>;
396 template class Array_2<Float_t>;
397 template class Array_2<Double_t>;
398 template class Array_3<Bool_t>;
399 template class Array_3<Int_t>;
400 template class Array_3<Short_t>;
401 template class Array_3<Float_t>;
402 template class Array_3<Double_t>;
403 template class Array_4<Bool_t>;
404 template class Array_4<Int_t>;
405 template class Array_4<Short_t>;
406 template class Array_4<Float_t>;
407 template class Array_4<Double_t>;