diff --git a/src/math/pimathvector.h b/src/math/pimathvector.h index 6e5667d1..824e89a7 100644 --- a/src/math/pimathvector.h +++ b/src/math/pimathvector.h @@ -69,6 +69,7 @@ public: Type & operator [](uint index) {return c[index];} Type operator [](uint index) const {return c[index];} _CVector & operator =(const _CVector & v) {memcpy(c, v.c, sizeof(Type) * Size); return *this;} + _CVector & operator =(const Type & v) {PIMV_FOR(i, 0) c[i] = v; return *this;} bool operator ==(const _CVector & v) const {PIMV_FOR(i, 0) if (c[i] != v[i]) return false; return true;} bool operator !=(const _CVector & v) const {return !(*this == c);} void operator +=(const _CVector & v) {PIMV_FOR(i, 0) c[i] += v[i];} @@ -181,7 +182,8 @@ public: Type at(uint index) const {return c[index];} Type & operator [](uint index) {return c[index];} Type operator [](uint index) const {return c[index];} - void operator =(const _CVector & v) {c = v.c;} + _CVector & operator =(const _CVector & v) {c = v.c; return *this;} + _CVector & operator =(const Type & v) {PIMV_FOR(i, 0) c[i] = v; return *this;} bool operator ==(const _CVector & v) const {PIMV_FOR(i, 0) if (c[i] != v[i]) return false; return true;} bool operator !=(const _CVector & v) const {return !(*this == c);} void operator +=(const _CVector & v) {PIMV_FOR(i, 0) c[i] += v[i];}