Changeset 250dbae for libcfa/src/vec/vec4.hfa
- Timestamp:
- Dec 31, 2019, 12:19:53 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- f8a8fb1
- Parents:
- 94df8de
- git-author:
- Dmitry Kobets <dkobets@…> (12/31/19 12:13:34)
- git-committer:
- Dmitry Kobets <dkobets@…> (12/31/19 12:19:53)
- File:
-
- 1 edited
-
libcfa/src/vec/vec4.hfa (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/vec/vec4.hfa
r94df8de r250dbae 10 10 } 11 11 12 13 12 forall (otype T) { 14 13 static inline { … … 31 30 } 32 31 33 // Assignment34 32 void ?=?(vec4(T)& vec, vec4(T) other) with (vec) { 35 33 [x,y,z,w] = other.[x,y,z,w]; … … 44 42 // - 45 43 forall(| subtract(T)) { 46 vec4(T) ?-?(vec4(T) u, vec4(T) v) { // TODO( can't make this const ref )44 vec4(T) ?-?(vec4(T) u, vec4(T) v) { 47 45 return [u.x - v.x, u.y - v.y, u.z - v.z, u.w - v.w]; 48 46 } … … 52 50 } 53 51 } 54 55 52 forall(| negate(T)) { 56 53 vec4(T) -?(vec4(T) v) with (v) { … … 58 55 } 59 56 } 60 61 57 forall(| { T --?(T&); }) { 62 58 vec4(T)& --?(vec4(T)& v) { … … 102 98 // * 103 99 forall(| multiply(T)) { 104 vec4(T) ?*?(vec4(T) v, T scalar) with (v) { // TODO (can't make this const ref)100 vec4(T) ?*?(vec4(T) v, T scalar) with (v) { 105 101 return [x * scalar, y * scalar, z * scalar, w * scalar]; 106 102 } 107 vec4(T) ?*?(T scalar, vec4(T) v) { // TODO (can't make this const ref)103 vec4(T) ?*?(T scalar, vec4(T) v) { 108 104 return v * scalar; 109 105 } … … 121 117 } 122 118 123 // Scalar Division119 // / 124 120 forall(| divide(T)) { 125 121 vec4(T) ?/?(vec4(T) v, T scalar) with (v) { … … 129 125 return [u.x / v.x, u.y / v.y, u.z / v.z, u.w / v.w]; 130 126 } 131 vec4(T)& ?/=?(vec4(T)& v, T scalar) with (v){127 vec4(T)& ?/=?(vec4(T)& v, T scalar) { 132 128 v = v / scalar; 133 129 return v; … … 253 249 } 254 250 255 // Relational Operators251 // relational 256 252 forall(| equality(T)) { 257 253 bool ?==?(vec4(T) u, vec4(T) v) with (u) {
Note:
See TracChangeset
for help on using the changeset viewer.