- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# D:/Programmation/Sources/Tensor2/Utils/src/frost_utils_int_impl.cpp

Go to the documentation of this file.

    00001 #include "frost_utils_types.h"
    00002
    00003 #include <cmath>
    00004
    00005 namespace Frost {
    00006
    00007 template <class T>
    00008 s_int_t<T>::s_int_t()
    00009 {
    00010     mType_ = INTEGER;
    00011     iValue_ = 0;
    00012 }
    00013
    00014 template <class T>
    00015 s_int_t<T>::s_int_t(const T& iValue)
    00016 {
    00017     mType_ = INTEGER;
    00018     iValue_ = iValue;
    00019 }
    00020
    00021 template <class T>
    00022 s_int_t<T>::s_int_t(const Type& mType)
    00023 {
    00024     mType_ = mType;
    00025     iValue_ = 0;
    00026 }
    00027
    00028 template <class T>
    00029 s_int_t<T>::s_int_t(const float& fValue)
    00030 {
    00031     mType_ = INTEGER;
    00032     iValue_ = static_cast<T>(round(fValue));
    00033 }
    00034
    00035 template <class T>
    00036 s_int_t<T>::s_int_t(const double& dValue)
    00037 {
    00038     mType_ = INTEGER;
    00039     iValue_ = static_cast<T>(round(dValue));
    00040 }
    00041
    00042 template <class T>
    00043 s_int_t<T>::s_int_t(const s_bool& bValue)
    00044 {
    00045     mType_ = INTEGER;
    00046     if (bValue)
    00047         iValue_ = 1;
    00048     else
    00049         iValue_ = 0;
    00050 }
    00051
    00052 template <class T>
    00053 void s_int_t<T>::Clamp(const s_int_t& iMin, const s_int_t& iMax)
    00054 {
    00055     iValue_ = (*this < iMax) ? ((*this > iMin) ? iValue_ : iMin.iValue_) : iMax.iValue_;
    00056 }
    00057
    00058 template <class T>
    00059 s_uint_t<typename TypeTraits<T>::UnsignedType> s_int_t<T>::GetNearestPowerOfTwo() const
    00060 {
    00061     if (IsValid())
    00062     {
    00063         int i = 1;
    00064         while (iValue_ > i)
    00065             i = i << 1;
    00066
    00067         return static_cast<typename TypeTraits<T>::UnsignedType>(i);
    00068     }
    00069     else
    00070         return s_uint_t<typename TypeTraits<T>::UnsignedType>::NaN;
    00071 }
    00072
    00073 template <class T>
    00074 typename s_int_t<T>::Type s_int_t<T>::GetType() const
    00075 {
    00076     return mType_;
    00077 }
    00078
    00079 template <class T>
    00080 s_bool s_int_t<T>::IsInfiniteMinus() const
    00081 {
    00082     return (mType_ == INTEGER_INF_MINUS);
    00083 }
    00084
    00085 template <class T>
    00086 s_bool s_int_t<T>::IsInfinitePlus() const
    00087 {
    00088     return (mType_ == INTEGER_INF_PLUS);
    00089 }
    00090
    00091 template <class T>
    00092 void s_int_t<T>::Pow(const s_uint_t<typename TypeTraits<T>::UnsignedType>& uiPower)
    00093 {
    00094     if (IsValid() && uiPower.IsValid())
    00095     {
    00096         iValue_ = static_cast<T>(pow(
    00097             static_cast<float>(iValue_), static_cast<T>(uiPower.Get())
    00098         ));
    00099     }
    00100 }
    00101
    00102 template <class T>
    00103 s_bool s_int_t<T>::IsInRange(const s_int_t<T>& iMin, const s_int_t<T>& iMax) const
    00104 {
    00105     return ( (iMin <= (*this)) && ((*this) <= iMax) );
    00106 }
    00107
    00108 template <class T>
    00109 s_bool s_int_t<T>::IsNaN() const
    00110 {
    00111     return (mType_ == INTEGER_NAN);
    00112 }
    00113
    00114 template <class T>
    00115 s_bool s_int_t<T>::IsNull() const
    00116 {
    00117     return ( IsValid() && (iValue_ == 0) );
    00118 }
    00119
    00120 template <class T>
    00121 s_bool s_int_t<T>::IsValid() const
    00122 {
    00123     return (mType_ == INTEGER);
    00124 }
    00125
    00126 template <class T>
    00127 s_bool s_int_t<T>::IsInfinite() const
    00128 {
    00129     return (mType_ == INTEGER_INF_MINUS) || (mType_ == INTEGER_INF_PLUS);
    00130 }
    00131
    00132 template <class T>
    00133 void s_int_t<T>::Randomize(const s_int_t& iMin, const s_int_t& iMax)
    00134 {
    00135     if (iMin.IsValid() && iMax.IsValid())
    00136     {
    00137         mType_ = INTEGER;
    00138         if (iMax.iValue_ < iMin.iValue_)
    00139             iValue_ = iMin.iValue_;
    00140         else
    00141         {
    00142             T iRange = iMax.iValue_ - iMin.iValue_ + 1;
    00143             iValue_ = static_cast<T>(iRange*(rand()/(RAND_MAX+1.0))) + iMin.iValue_;
    00144         }
    00145     }
    00146 }
    00147
    00148 template <class T>
    00149 void s_int_t<T>::SetInfiniteMinus()
    00150 {
    00151     mType_ = INTEGER_INF_MINUS;
    00152     iValue_ = 0;
    00153 }
    00154
    00155 template <class T>
    00156 void s_int_t<T>::SetInfinitePlus()
    00157 {
    00158     mType_ = INTEGER_INF_PLUS;
    00159     iValue_ = 0;
    00160 }
    00161
    00162 template <class T>
    00163 void s_int_t<T>::SetNaN()
    00164 {
    00165     mType_ = INTEGER_NAN;
    00166     iValue_ = 0;
    00167 }
    00168
    00169 template <class T>
    00170 s_int_t<T> s_int_t<T>::GetSign() const
    00171 {
    00172     if (IsValid())
    00173     {
    00174         return (iValue_ < 0) ? -1 : 1;
    00175     }
    00176     else
    00177         return s_int_t::NaN;
    00178 }
    00179
    00180 template <class T>
    00181 s_int_t<T>& s_int_t<T>::operator ++ ()
    00182 {
    00183     if (IsValid())
    00184     {
    00185         ++iValue_;
    00186     }
    00187     return *this;
    00188 }
    00189
    00190 template <class T>
    00191 s_int_t<T> s_int_t<T>::operator ++ (int)
    00192 {
    00193     if (IsValid())
    00194     {
    00195         return iValue_++;
    00196     }
    00197     else
    00198         return *this;
    00199 }
    00200
    00201 template <class T>
    00202 s_int_t<T> s_int_t<T>::operator - () const
    00203 {
    00204     if (!IsNaN())
    00205     {
    00206         if (IsInfinitePlus())
    00207             return s_int_t::INFMINUS;
    00208         else if (IsInfiniteMinus())
    00209             return s_int_t::INFPLUS;
    00210         else
    00211             return -iValue_;
    00212     }
    00213     else
    00214         return s_int_t::NaN;
    00215 }
    00216
    00217 template <class T>
    00218 s_int_t<T>& s_int_t<T>::operator -- ()
    00219 {
    00220     if (IsValid())
    00221     {
    00222         --iValue_;
    00223     }
    00224     return *this;
    00225 }
    00226
    00227 template <class T>
    00228 s_int_t<T> s_int_t<T>::operator -- (int)
    00229 {
    00230     if (IsValid())
    00231     {
    00232         return iValue_--;
    00233     }
    00234     else
    00235         return *this;
    00236 }
    00237
    00238 template <class T>
    00239 s_int_t<T> s_int_t<T>::operator + (const s_int_t& iValue) const
    00240 {
    00241     if (iValue.IsNaN() || IsNaN())
    00242         return s_int_t::NaN;
    00243
    00244     if (!iValue.IsValid())
    00245     {
    00246         if (iValue.IsInfinitePlus())
    00247         {
    00248             if (IsInfiniteMinus())
    00249                 return s_int_t::NaN;
    00250             else
    00251                 return s_int_t::INFPLUS;
    00252         }
    00253         else
    00254         {
    00255             if (IsInfinitePlus())
    00256                 return s_int_t::NaN;
    00257             else
    00258                 return s_int_t::INFMINUS;
    00259         }
    00260     }
    00261     else if (!this->IsValid())
    00262     {
    00263         if (IsInfinitePlus())
    00264             return s_int_t::INFPLUS;
    00265         else
    00266             return s_int_t::INFMINUS;
    00267     }
    00268     else
    00269     {
    00270         return iValue_ + iValue.iValue_;
    00271     }
    00272 }
    00273
    00274 template <class T>
    00275 s_int_t<T> s_int_t<T>::operator - (const s_int_t& iValue) const
    00276 {
    00277     if (iValue.IsNaN() || IsNaN())
    00278         return s_int_t::NaN;
    00279
    00280     if (!iValue.IsValid())
    00281     {
    00282         if (iValue.IsInfinitePlus())
    00283         {
    00284             if (IsInfinitePlus())
    00285                 return s_int_t::NaN;
    00286             else
    00287                 return s_int_t::INFMINUS;
    00288         }
    00289         else
    00290         {
    00291             if (IsInfiniteMinus())
    00292                 return s_int_t::NaN;
    00293             else
    00294                 return s_int_t::INFPLUS;
    00295         }
    00296     }
    00297     else if (!this->IsValid())
    00298     {
    00299         if (IsInfinitePlus())
    00300             return s_int_t::INFMINUS;
    00301         else
    00302             return s_int_t::INFPLUS;
    00303     }
    00304     else
    00305     {
    00306         return iValue_ - iValue.iValue_;
    00307     }
    00308 }
    00309
    00310 template <class T>
    00311 s_int_t<T> s_int_t<T>::operator * (const s_int_t& iValue) const
    00312 {
    00313     if (iValue.IsNaN() || IsNaN())
    00314         return s_int_t::NaN;
    00315
    00316     if (!iValue.IsValid())
    00317     {
    00318         if (iValue.IsInfinitePlus())
    00319         {
    00320             if (IsInfiniteMinus() || IsNull())
    00321                 return s_int_t::NaN;
    00322             else if (IsInfinitePlus())
    00323                 return s_int_t::INFPLUS;
    00324             else
    00325             {
    00326                 if (iValue_ > 0)
    00327                     return s_int_t::INFPLUS;
    00328                 else
    00329                     return s_int_t::INFMINUS;
    00330             }
    00331         }
    00332         else
    00333         {
    00334             if (IsInfinitePlus() || IsNull())
    00335                 return s_int_t::NaN;
    00336             else if (IsInfiniteMinus())
    00337                 return s_int_t::INFMINUS;
    00338             else
    00339             {
    00340                 if (iValue_ > 0)
    00341                     return s_int_t::INFMINUS;
    00342                 else
    00343                     return s_int_t::INFPLUS;
    00344             }
    00345         }
    00346     }
    00347     else if (!this->IsValid())
    00348     {
    00349         if (iValue.IsNull())
    00350             return s_int_t::NaN;
    00351
    00352         if (IsInfinitePlus())
    00353         {
    00354             if (iValue.iValue_ > 0)
    00355                 return s_int_t::INFPLUS;
    00356             else
    00357                 return s_int_t::INFMINUS;
    00358         }
    00359         else
    00360         {
    00361             if (iValue.iValue_ > 0)
    00362                 return s_int_t::INFMINUS;
    00363             else
    00364                 return s_int_t::INFPLUS;
    00365         }
    00366     }
    00367     else
    00368     {
    00369         return iValue_ * iValue.iValue_;
    00370     }
    00371 }
    00372
    00373 template <class T>
    00374 s_int_t<T> s_int_t<T>::operator / (const s_int_t& iValue) const
    00375 {
    00376     if (iValue.IsNaN() || IsNaN() || iValue.IsNull())
    00377         return s_int_t::NaN;
    00378
    00379     if (!iValue.IsValid())
    00380     {
    00381         if (!this->IsValid())
    00382             return s_int_t::NaN;
    00383         else
    00384             return 0;
    00385     }
    00386     else if (!this->IsValid())
    00387     {
    00388         if (IsInfinitePlus())
    00389         {
    00390             if (iValue.iValue_ > 0)
    00391                 return s_int_t::INFPLUS;
    00392             else
    00393                 return s_int_t::INFMINUS;
    00394         }
    00395         else
    00396         {
    00397             if (iValue.iValue_ > 0)
    00398                 return s_int_t::INFMINUS;
    00399             else
    00400                 return s_int_t::INFPLUS;
    00401         }
    00402     }
    00403     else
    00404     {
    00405         return iValue_ / iValue.iValue_;
    00406     }
    00407 }
    00408
    00409 template <class T>
    00410 s_int_t<T> s_int_t<T>::operator % (const s_int_t& iValue) const
    00411 {
    00412     if (iValue.IsNaN() || IsNaN() || iValue.IsNull())
    00413         return s_int_t::NaN;
    00414
    00415     if (!iValue.IsValid())
    00416     {
    00417         if (!this->IsValid())
    00418             return 0;
    00419         else
    00420             return *this;
    00421     }
    00422     else if (!this->IsValid())
    00423     {
    00424         return 0;
    00425     }
    00426     else
    00427     {
    00428         return iValue_ % iValue.iValue_;
    00429     }
    00430 }
    00431
    00432 template <class T>
    00433 void s_int_t<T>::operator += (const s_int_t& iValue)
    00434 {
    00435     *this = *this + iValue;
    00436 }
    00437
    00438 template <class T>
    00439 void s_int_t<T>::operator -= (const s_int_t& iValue)
    00440 {
    00441     *this = *this - iValue;
    00442 }
    00443
    00444 template <class T>
    00445 void s_int_t<T>::operator *= (const s_int_t& iValue)
    00446 {
    00447     *this = *this * iValue;
    00448 }
    00449
    00450 template <class T>
    00451 void s_int_t<T>::operator /= (const s_int_t& iValue)
    00452 {
    00453     *this = *this / iValue;
    00454 }
    00455
    00456 template <class T>
    00457 void s_int_t<T>::operator %= (const s_int_t& iValue)
    00458 {
    00459     *this = *this % iValue;
    00460 }
    00461
    00462 template <class T>
    00463 s_int_t<T>& s_int_t<T>::operator << (const uint& uiValue)
    00464 {
    00465     if (IsValid())
    00466     {
    00467         iValue_ = iValue_ << uiValue;
    00468     }
    00469     return *this;
    00470 }
    00471
    00472 template <class T>
    00473 s_bool s_int_t<T>::operator == (const s_int_t& iValue) const
    00474 {
    00475     if (iValue.IsNaN() || IsNaN())
    00476         return false;
    00477     else
    00478     {
    00479         if ( (mType_ == iValue.mType_) && (mType_ != INTEGER) )
    00480             return true;
    00481
    00482         return (iValue_ == iValue.iValue_);
    00483     }
    00484 }
    00485
    00486 template <class T>
    00487 s_bool s_int_t<T>::operator != (const s_int_t& iValue) const
    00488 {
    00489     if (iValue.IsNaN() || IsNaN())
    00490         return false;
    00491     else
    00492     {
    00493         if (mType_ != iValue.mType_)
    00494             return true;
    00495
    00496         return (iValue_ != iValue.iValue_);
    00497     }
    00498 }
    00499
    00500 template <class T>
    00501 s_bool s_int_t<T>::operator < (const s_int_t& iValue) const
    00502 {
    00503     if (iValue.IsNaN() || IsNaN())
    00504         return false;
    00505     else
    00506     {
    00507         if ( (mType_ == iValue.mType_) && (mType_ != INTEGER) )
    00508             return false;
    00509
    00510         if (mType_ == INTEGER_INF_MINUS)
    00511             return true;
    00512         if (mType_ == INTEGER_INF_PLUS)
    00513             return false;
    00514
    00515         if (iValue.mType_ == INTEGER_INF_MINUS)
    00516             return false;
    00517         if (iValue.mType_ == INTEGER_INF_PLUS)
    00518             return true;
    00519
    00520         return (iValue_ < iValue.iValue_);
    00521     }
    00522 }
    00523
    00524 template <class T>
    00525 s_bool s_int_t<T>::operator > (const s_int_t& iValue) const
    00526 {
    00527     if (iValue.IsNaN() || IsNaN())
    00528         return false;
    00529     else
    00530     {
    00531         if ( (mType_ == iValue.mType_) && (mType_ != INTEGER) )
    00532             return false;
    00533
    00534         if (mType_ == INTEGER_INF_MINUS)
    00535             return false;
    00536         if (mType_ == INTEGER_INF_PLUS)
    00537             return true;
    00538
    00539         if (iValue.mType_ == INTEGER_INF_MINUS)
    00540             return true;
    00541         if (iValue.mType_ == INTEGER_INF_PLUS)
    00542             return false;
    00543
    00544         return (iValue_ > iValue.iValue_);
    00545     }
    00546 }
    00547
    00548 template <class T>
    00549 s_bool s_int_t<T>::operator <= (const s_int_t& iValue) const
    00550 {
    00551     if (iValue.IsNaN() || IsNaN())
    00552         return false;
    00553     else
    00554     {
    00555         if ( (mType_ == iValue.mType_) && (mType_ != INTEGER) )
    00556             return true;
    00557
    00558         if (mType_ == INTEGER_INF_MINUS)
    00559             return true;
    00560         if (mType_ == INTEGER_INF_PLUS)
    00561             return false;
    00562
    00563         if (iValue.mType_ == INTEGER_INF_MINUS)
    00564             return false;
    00565         if (iValue.mType_ == INTEGER_INF_PLUS)
    00566             return true;
    00567
    00568         return (iValue_ <= iValue.iValue_);
    00569     }
    00570 }
    00571
    00572 template <class T>
    00573 s_bool s_int_t<T>::operator >= (const s_int_t& iValue) const
    00574 {
    00575     if (iValue.IsNaN() || IsNaN())
    00576         return false;
    00577     else
    00578     {
    00579         if ( (mType_ == iValue.mType_) && (mType_ != INTEGER) )
    00580             return true;
    00581
    00582         if (mType_ == INTEGER_INF_MINUS)
    00583             return false;
    00584         if (mType_ == INTEGER_INF_PLUS)
    00585             return true;
    00586
    00587         if (iValue.mType_ == INTEGER_INF_MINUS)
    00588             return true;
    00589         if (iValue.mType_ == INTEGER_INF_PLUS)
    00590             return false;
    00591
    00592         return (iValue_ >= iValue.iValue_);
    00593     }
    00594 }
    00595
    00596 template <class T>
    00597 s_int_t<T> s_int_t<T>::Min(const s_int_t& iLeft, const s_int_t& iRight)
    00598 {
    00599     return (iLeft >= iRight) ? iRight : iLeft;
    00600 }
    00601
    00602 template <class T>
    00603 s_int_t<T> s_int_t<T>::Max(const s_int_t& iLeft, const s_int_t& iRight)
    00604 {
    00605     return (iLeft <= iRight) ? iRight : iLeft;
    00606 }
    00607
    00608 template <class T>
    00609 s_int_t<T> s_int_t<T>::Clamp(const s_int_t& iValue, const s_int_t& iMin, const s_int_t& iMax)
    00610 {
    00611     return (iValue < iMax) ? ((iValue > iMin) ? iValue : iMin) : iMax;
    00612 }
    00613
    00614 template <class T>
    00615 s_int_t<T> s_int_t<T>::Random(const s_int_t& iMin, const s_int_t& iMax)
    00616 {
    00617     if (iMin.IsValid() && iMax.IsValid())
    00618     {
    00619         if (iMax.iValue_ < iMin.iValue_)
    00620             return iMin;
    00621         else
    00622         {
    00623             T iRange = iMax.iValue_ - iMin.iValue_ + 1;
    00624             return static_cast<T>(iRange*(rand()/(RAND_MAX+1.0))) + iMin.iValue_;
    00625         }
    00626     }
    00627     else
    00628         return s_int_t::NaN;
    00629 }
    00630
    00631 template <class T>
    00632 s_int_t<T> s_int_t<T>::Sign(const s_int_t& iValue) const
    00633 {
    00634     if (iValue.IsValid())
    00635     {
    00636         return (iValue.iValue_ < 0) ? -1 : 1;
    00637     }
    00638     else
    00639         return s_int_t::NaN;
    00640 }
    00641
    00642 template<class T>
    00643 const s_int_t<T> s_int_t<T>::NaN      = s_int_t<T>(INTEGER_NAN);
    00644 template<class T>
    00645 const s_int_t<T> s_int_t<T>::INFPLUS  = s_int_t<T>(INTEGER_INF_PLUS);
    00646 template<class T>
    00647 const s_int_t<T> s_int_t<T>::INFMINUS = s_int_t<T>(INTEGER_INF_MINUS);
    00648
    00649 template<class T>
    00650 s_int_t<T> operator + (const T& iLeft, const s_int_t<T>& iRight)
    00651 {
    00652     return s_int_t<T>(iLeft) + iRight;
    00653 }
    00654 template<class T>
    00655 s_int_t<T> operator - (const T& iLeft, const s_int_t<T>& iRight)
    00656 {
    00657     return s_int_t<T>(iLeft) - iRight;
    00658 }
    00659 template<class T>
    00660 s_int_t<T> operator * (const T& iLeft, const s_int_t<T>& iRight)
    00661 {
    00662     return s_int_t<T>(iLeft) * iRight;
    00663 }
    00664 template<class T>
    00665 s_int_t<T> operator / (const T& iLeft, const s_int_t<T>& iRight)
    00666 {
    00667     return s_int_t<T>(iLeft) / iRight;
    00668 }
    00669 template<class T>
    00670 s_int_t<T> operator % (const T& iLeft, const s_int_t<T>& iRight)
    00671 {
    00672     return s_int_t<T>(iLeft) % iRight;
    00673 }
    00674
    00675 template<class T>
    00676 s_int_t<T> operator + (const typename TypeTraits<T>::UnsignedType& uiLeft, const s_int_t<T>& iRight)
    00677 {
    00678     return s_int_t<T>(s_uint_t<typename TypeTraits<T>::UnsignedType>(uiLeft)) + iRight;
    00679 }
    00680 template<class T>
    00681 s_int_t<T> operator - (const typename TypeTraits<T>::UnsignedType& uiLeft, const s_int_t<T>& iRight)
    00682 {
    00683     return s_int_t<T>(s_uint_t<typename TypeTraits<T>::UnsignedType>(uiLeft)) - iRight;
    00684 }
    00685 template<class T>
    00686 s_int_t<T> operator * (const typename TypeTraits<T>::UnsignedType& uiLeft, const s_int_t<T>& iRight)
    00687 {
    00688     return s_int_t<T>(s_uint_t<typename TypeTraits<T>::UnsignedType>(uiLeft)) * iRight;
    00689 }
    00690 template<class T>
    00691 s_int_t<T> operator / (const typename TypeTraits<T>::UnsignedType& uiLeft, const s_int_t<T>& iRight)
    00692 {
    00693     return s_int_t<T>(s_uint_t<typename TypeTraits<T>::UnsignedType>(uiLeft)) / iRight;
    00694 }
    00695 template<class T>
    00696 s_int_t<T> operator % (const typename TypeTraits<T>::UnsignedType& uiLeft, const s_int_t<T>& iRight)
    00697 {
    00698     return s_int_t<T>(s_uint_t<typename TypeTraits<T>::UnsignedType>(uiLeft)) % iRight;
    00699 }
    00700
    00701 template class s_int_t<char>;
    00702 template class s_int_t<short>;
    00703 template class s_int_t<int>;
    00704 template class s_int_t<long>;
    00705 template class s_int_t<long long>;
    00706
    00707 template s_int_t<char> operator + (const char& iLeft, const s_int_t<char>& iRight);
    00708 template s_int_t<char> operator - (const char& iLeft, const s_int_t<char>& iRight);
    00709 template s_int_t<char> operator * (const char& iLeft, const s_int_t<char>& iRight);
    00710 template s_int_t<char> operator / (const char& iLeft, const s_int_t<char>& iRight);
    00711 template s_int_t<char> operator % (const char& iLeft, const s_int_t<char>& iRight);
    00712
    00713 template s_int_t<char> operator + (const uchar& iLeft, const s_int_t<char>& iRight);
    00714 template s_int_t<char> operator - (const uchar& iLeft, const s_int_t<char>& iRight);
    00715 template s_int_t<char> operator * (const uchar& iLeft, const s_int_t<char>& iRight);
    00716 template s_int_t<char> operator / (const uchar& iLeft, const s_int_t<char>& iRight);
    00717 template s_int_t<char> operator % (const uchar& iLeft, const s_int_t<char>& iRight);
    00718
    00719 template s_int_t<short> operator + (const short& iLeft, const s_int_t<short>& iRight);
    00720 template s_int_t<short> operator - (const short& iLeft, const s_int_t<short>& iRight);
    00721 template s_int_t<short> operator * (const short& iLeft, const s_int_t<short>& iRight);
    00722 template s_int_t<short> operator / (const short& iLeft, const s_int_t<short>& iRight);
    00723 template s_int_t<short> operator % (const short& iLeft, const s_int_t<short>& iRight);
    00724
    00725 template s_int_t<short> operator + (const ushort& iLeft, const s_int_t<short>& iRight);
    00726 template s_int_t<short> operator - (const ushort& iLeft, const s_int_t<short>& iRight);
    00727 template s_int_t<short> operator * (const ushort& iLeft, const s_int_t<short>& iRight);
    00728 template s_int_t<short> operator / (const ushort& iLeft, const s_int_t<short>& iRight);
    00729 template s_int_t<short> operator % (const ushort& iLeft, const s_int_t<short>& iRight);
    00730
    00731 template s_int_t<int> operator + (const int& iLeft, const s_int_t<int>& iRight);
    00732 template s_int_t<int> operator - (const int& iLeft, const s_int_t<int>& iRight);
    00733 template s_int_t<int> operator * (const int& iLeft, const s_int_t<int>& iRight);
    00734 template s_int_t<int> operator / (const int& iLeft, const s_int_t<int>& iRight);
    00735 template s_int_t<int> operator % (const int& iLeft, const s_int_t<int>& iRight);
    00736
    00737 template s_int_t<int> operator + (const uint& iLeft, const s_int_t<int>& iRight);
    00738 template s_int_t<int> operator - (const uint& iLeft, const s_int_t<int>& iRight);
    00739 template s_int_t<int> operator * (const uint& iLeft, const s_int_t<int>& iRight);
    00740 template s_int_t<int> operator / (const uint& iLeft, const s_int_t<int>& iRight);
    00741 template s_int_t<int> operator % (const uint& iLeft, const s_int_t<int>& iRight);
    00742
    00743 template s_int_t<long> operator + (const long& iLeft, const s_int_t<long>& iRight);
    00744 template s_int_t<long> operator - (const long& iLeft, const s_int_t<long>& iRight);
    00745 template s_int_t<long> operator * (const long& iLeft, const s_int_t<long>& iRight);
    00746 template s_int_t<long> operator / (const long& iLeft, const s_int_t<long>& iRight);
    00747 template s_int_t<long> operator % (const long& iLeft, const s_int_t<long>& iRight);
    00748
    00749 template s_int_t<long long> operator + (const long long& iLeft, const s_int_t<long long>& iRight);
    00750 template s_int_t<long long> operator - (const long long& iLeft, const s_int_t<long long>& iRight);
    00751 template s_int_t<long long> operator * (const long long& iLeft, const s_int_t<long long>& iRight);
    00752 template s_int_t<long long> operator / (const long long& iLeft, const s_int_t<long long>& iRight);
    00753 template s_int_t<long long> operator % (const long long& iLeft, const s_int_t<long long>& iRight);
    00754
    00755 template s_int_t<long long> operator + (const ullong& iLeft, const s_int_t<long long>& iRight);
    00756 template s_int_t<long long> operator - (const ullong& iLeft, const s_int_t<long long>& iRight);
    00757 template s_int_t<long long> operator * (const ullong& iLeft, const s_int_t<long long>& iRight);
    00758 template s_int_t<long long> operator / (const ullong& iLeft, const s_int_t<long long>& iRight);
    00759 template s_int_t<long long> operator % (const ullong& iLeft, const s_int_t<long long>& iRight);
    00760
    00761 }