1 #ifndef SimTK_SIMMATRIX_SMALLMATRIX_VEC_H_
2 #define SimTK_SIMMATRIX_SMALLMATRIX_VEC_H_
46 template <
class E1,
int S1,
class E2,
int S2>
void
48 Vec<1,
typename CNT<E1>::template Result<E2>::Add>& result) {
49 result[0] = r1[0] + r2[0];
51 template <
int N,
class E1,
int S1,
class E2,
int S2>
void
53 Vec<N,
typename CNT<E1>::template Result<E2>::Add>& result) {
55 reinterpret_cast<const Vec<N-1,E2,S2
>&>(r2),
56 reinterpret_cast<Vec<N-1,typename CNT<E1>::
57 template Result<E2>::Add
>&>(result));
58 result[N-1] = r1[N-1] + r2[N-1];
61 template <
class E1,
int S1,
class E2,
int S2>
void
63 Vec<1,
typename CNT<E1>::template Result<E2>::Sub>& result) {
64 result[0] = r1[0] - r2[0];
66 template <
int N,
class E1,
int S1,
class E2,
int S2>
void
68 Vec<N,
typename CNT<E1>::template Result<E2>::Sub>& result) {
70 reinterpret_cast<const Vec<N-1,E2,S2
>&>(r2),
71 reinterpret_cast<Vec<N-1,typename CNT<E1>::
72 template Result<E2>::Sub
>&>(result));
73 result[N-1] = r1[N-1] - r2[N-1];
76 template <
class E1,
int S1,
class E2,
int S2>
void
78 Vec<1,
typename CNT<E1>::template Result<E2>::Mul>& result) {
79 result[0] = r1[0] * r2[0];
81 template <
int N,
class E1,
int S1,
class E2,
int S2>
void
83 Vec<N,
typename CNT<E1>::template Result<E2>::Mul>& result) {
85 reinterpret_cast<const Vec<N-1,E2,S2
>&>(r2),
86 reinterpret_cast<Vec<N-1,typename CNT<E1>::
87 template Result<E2>::Mul
>&>(result));
88 result[N-1] = r1[N-1] * r2[N-1];
91 template <
class E1,
int S1,
class E2,
int S2>
void
93 Vec<1,
typename CNT<E1>::template Result<E2>::Dvd>& result) {
94 result[0] = r1[0] / r2[0];
96 template <
int N,
class E1,
int S1,
class E2,
int S2>
void
98 Vec<N,
typename CNT<E1>::template Result<E2>::Dvd>& result) {
100 reinterpret_cast<const Vec<N-1,E2,S2
>&>(r2),
101 reinterpret_cast<Vec<N-1,typename CNT<E1>::
102 template Result<E2>::Dvd
>&>(result));
103 result[N-1] = r1[N-1] / r2[N-1];
106 template <
class E1,
int S1,
class E2,
int S2>
void
107 copy(Vec<1,E1,S1>& r1,
const Vec<1,E2,S2>& r2) {
110 template <
int N,
class E1,
int S1,
class E2,
int S2>
void
111 copy(Vec<N,E1,S1>& r1,
const Vec<N,E2,S2>& r2) {
112 copy(
reinterpret_cast<Vec<N-1,E1,S1
>&>(r1),
113 reinterpret_cast<const Vec<N-1,E2,S2
>&>(r2));
130 template <
int M,
class ELT,
int STRIDE>
263 static int size() {
return M; }
265 static int nrow() {
return M; }
267 static int ncol() {
return 1; }
274 for(
int i=0;i<M;++i) sum += CNT<E>::scalarNormSqr(d[i*STRIDE]);
284 for(
int i=0;i<M;++i) vsqrt[i] = CNT<E>::sqrt(d[i*STRIDE]);
304 for(
int i=0;i<M;++i) vstd[i] = CNT<E>::standardize(d[i*STRIDE]);
313 for (
int i=0;i<M;++i) sum += d[i*STRIDE];
335 typedef typename MulOp::Type
Mul;
340 typedef typename MulOpNonConforming::Type
MulNon;
345 typedef typename DvdOp::Type
Dvd;
350 typedef typename AddOp::Type
Add;
355 typedef typename SubOp::Type
Sub;
415 explicit Vec(
const E& e) {
for (
int i=0;i<M;++i) d[i*STRIDE]=e;}
423 for (
int i=0;i<M;++i) d[i*STRIDE]=e;
436 { assert(M==2);(*this)[0]=e0;(*this)[1]=e1; }
438 { assert(M==3);(*this)[0]=e0;(*this)[1]=e1;(*this)[2]=e2; }
439 Vec(
const E& e0,
const E& e1,
const E& e2,
const E& e3)
440 { assert(M==4);(*this)[0]=e0;(*this)[1]=e1;(*this)[2]=e2;(*this)[3]=e3; }
441 Vec(
const E& e0,
const E& e1,
const E& e2,
const E& e3,
const E& e4)
442 { assert(M==5);(*this)[0]=e0;(*this)[1]=e1;(*this)[2]=e2;
443 (*this)[3]=e3;(*this)[4]=e4; }
444 Vec(
const E& e0,
const E& e1,
const E& e2,
const E& e3,
const E& e4,
const E& e5)
445 { assert(M==6);(*this)[0]=e0;(*this)[1]=e1;(*this)[2]=e2;
446 (*this)[3]=e3;(*this)[4]=e4;(*this)[5]=e5; }
447 Vec(
const E& e0,
const E& e1,
const E& e2,
const E& e3,
const E& e4,
const E& e5,
const E& e6)
448 { assert(M==7);(*this)[0]=e0;(*this)[1]=e1;(*this)[2]=e2;
449 (*this)[3]=e3;(*this)[4]=e4;(*this)[5]=e5;(*this)[6]=e6; }
450 Vec(
const E& e0,
const E& e1,
const E& e2,
const E& e3,
const E& e4,
const E& e5,
const E& e6,
const E& e7)
451 { assert(M==8);(*this)[0]=e0;(*this)[1]=e1;(*this)[2]=e2;
452 (*this)[3]=e3;(*this)[4]=e4;(*this)[5]=e5;(*this)[6]=e6;(*this)[7]=e7; }
453 Vec(
const E& e0,
const E& e1,
const E& e2,
const E& e3,
const E& e4,
const E& e5,
const E& e6,
const E& e7,
const E& e8)
454 { assert(M==9);(*this)[0]=e0;(*this)[1]=e1;(*this)[2]=e2;
455 (*this)[3]=e3;(*this)[4]=e4;(*this)[5]=e5;(*this)[6]=e6;(*this)[7]=e7;(*this)[8]=e8; }
461 template <
class EE>
explicit Vec(
const EE* p)
462 { assert(p);
for(
int i=0;i<M;++i) d[i*STRIDE]=p[i]; }
469 { assert(p);
for(
int i=0;i<M;++i) d[i*STRIDE]=p[i];
return *
this; }
479 {
for(
int i=0;i<M;++i) d[i*STRIDE] += r[i];
return *
this; }
484 {
for(
int i=0;i<M;++i) d[i*STRIDE] -= -(r[i]);
return *
this; }
489 {
for(
int i=0;i<M;++i) d[i*STRIDE] -= r[i];
return *
this; }
494 {
for(
int i=0;i<M;++i) d[i*STRIDE] += -(r[i]);
return *
this; }
542 { assert(0 <= i && i < M);
return d[i*STRIDE]; }
549 E&
operator[](
int i) {assert(0 <= i && i < M);
return d[i*STRIDE];}
572 TNormalize elementwiseNormalized;
573 for (
int i=0; i<M; ++i)
575 return elementwiseNormalized;
601 const TNeg&
negate()
const {
return *
reinterpret_cast<const TNeg*
>(
this); }
604 TNeg&
updNegate() {
return *
reinterpret_cast< TNeg*
>(
this); }
607 const THerm&
transpose()
const {
return *
reinterpret_cast<const THerm*
>(
this); }
617 {
return *
reinterpret_cast<const TPosTrans*
>(
this); }
620 {
return *
reinterpret_cast<TPosTrans*
>(
this); }
639 const EImag* p =
reinterpret_cast<const EImag*
>(
this);
640 return *
reinterpret_cast<const TImag*
>(p+offs);
647 return *
reinterpret_cast<TImag*
>(p+offs);
654 {
return *
reinterpret_cast<const TWithoutNegator*
>(
this); }
658 {
return *
reinterpret_cast<TWithoutNegator*
>(
this); }
671 for (
int i=0; i<M; ++i) result[i] = (*
this)[i] * e;
677 for (
int i=0; i<M; ++i) result[i] = e * (*
this)[i];
686 for (
int i=0; i<M; ++i) result[i] = (*
this)[i] / e;
692 for (
int i=0; i<M; ++i) result[i] = e / (*
this)[i];
699 for (
int i=0; i<M; ++i) result[i] = (*
this)[i] + e;
707 for (
int i=0; i<M; ++i) result[i] = (*
this)[i] - e;
713 for (
int i=0; i<M; ++i) result[i] = e - (*
this)[i];
729 {
for(
int i=0;i<M;++i) d[i*STRIDE] = ee;
return *
this; }
731 {
for(
int i=0;i<M;++i) d[i*STRIDE] += ee;
return *
this; }
733 {
for(
int i=0;i<M;++i) d[i*STRIDE] -= ee;
return *
this; }
735 {
for(
int i=0;i<M;++i) d[i*STRIDE] = ee - d[i*STRIDE];
return *
this; }
737 {
for(
int i=0;i<M;++i) d[i*STRIDE] *= ee;
return *
this; }
739 {
for(
int i=0;i<M;++i) d[i*STRIDE] = ee * d[i*STRIDE];
return *
this; }
741 {
for(
int i=0;i<M;++i) d[i*STRIDE] /= ee;
return *
this; }
743 {
for(
int i=0;i<M;++i) d[i*STRIDE] = ee / d[i*STRIDE];
return *
this; }
773 assert(0 <= i && i + MM <= M);
783 assert(0 <= i && i + MM <= M);
793 assert(0 <= i && i + M <= MM);
801 assert(0 <= i && i + M <= MM);
809 assert(0 <= p && p < M);
812 for (
int i=0; i<M-1; ++i, ++nxt) {
814 out[i] = (*this)[nxt];
836 assert(0 <= p && p <= M);
840 for (
int i=0; i<M; ++i, ++nxt) {
841 if (i==p) out[nxt++] = v;
842 out[nxt] = (*this)[i];
850 {
return *
reinterpret_cast<const Vec*
>(p); }
854 {
return *
reinterpret_cast<Vec*
>(p); }
864 for (
int i=0; i<M; ++i)
873 bool seenInf =
false;
874 for (
int i=0; i<M; ++i) {
875 const ELT& e = (*this)[i];
888 for (
int i=0; i<M; ++i)
900 template <
class E2,
int RS2>
902 for (
int i=0; i<M; ++i)
911 template <
class E2,
int RS2>
925 for (
int i=0; i<M; ++i)
934 std::stringstream stream;
940 void set(
int i,
const E& value)
941 { (*this)[i] = value; }
944 const E&
get(
int i)
const
959 template <
int M,
class E1,
int S1,
class E2,
int S2>
inline
960 typename Vec<M,E1,S1>::template Result< Vec<M,E2,S2> >::Add
963 ::AddOp::perform(l,r);
967 template <
int M,
class E1,
int S1,
class E2,
int S2>
inline
968 typename Vec<M,E1,S1>::template Result< Vec<M,E2,S2> >::Sub
971 ::SubOp::perform(l,r);
975 template <
int M,
class E1,
int S1,
class E2,
int S2>
inline bool
977 {
for (
int i=0; i < M; ++i)
if (l[i] != r[i])
return false;
980 template <
int M,
class E1,
int S1,
class E2,
int S2>
inline bool
984 template <
int M,
class E1,
int S1,
class E2>
inline bool
986 {
for (
int i=0; i < M; ++i)
if (v[i] != e)
return false;
989 template <
int M,
class E1,
int S1,
class E2>
inline bool
993 template <
int M,
class E1,
int S1,
class E2,
int S2>
inline bool
995 {
for (
int i=0; i < M; ++i) if (l[i] >= r[i])
return false;
998 template <
int M,
class E1,
int S1,
class E2>
inline bool
999 operator<(const Vec<M,E1,S1>& v,
const E2& e)
1000 {
for (
int i=0; i < M; ++i) if (v[i] >= e)
return false;
1004 template <
int M,
class E1,
int S1,
class E2,
int S2>
inline bool
1006 {
for (
int i=0; i < M; ++i)
if (l[i] <= r[i])
return false;
1009 template <
int M,
class E1,
int S1,
class E2>
inline bool
1011 {
for (
int i=0; i < M; ++i)
if (v[i] <= e)
return false;
1016 template <
int M,
class E1,
int S1,
class E2,
int S2>
inline bool
1018 {
for (
int i=0; i < M; ++i) if (l[i] > r[i])
return false;
1022 template <
int M,
class E1,
int S1,
class E2>
inline bool
1023 operator<=(const Vec<M,E1,S1>& v,
const E2& e)
1024 {
for (
int i=0; i < M; ++i) if (v[i] > e)
return false;
1029 template <
int M,
class E1,
int S1,
class E2,
int S2>
inline bool
1031 {
for (
int i=0; i < M; ++i)
if (l[i] < r[i])
return false;
1035 template <
int M,
class E1,
int S1,
class E2>
inline bool
1037 {
for (
int i=0; i < M; ++i)
if (v[i] < e)
return false;
1051 template <
int M,
class E,
int S>
inline
1052 typename Vec<M,E,S>::template Result<float>::Mul
1055 template <
int M,
class E,
int S>
inline
1056 typename Vec<M,E,S>::template Result<float>::Mul
1059 template <
int M,
class E,
int S>
inline
1060 typename Vec<M,E,S>::template Result<double>::Mul
1063 template <
int M,
class E,
int S>
inline
1064 typename Vec<M,E,S>::template Result<double>::Mul
1067 template <
int M,
class E,
int S>
inline
1068 typename Vec<M,E,S>::template Result<long double>::Mul
1071 template <
int M,
class E,
int S>
inline
1072 typename Vec<M,E,S>::template Result<long double>::Mul
1076 template <
int M,
class E,
int S>
inline
1077 typename Vec<M,E,S>::template Result<typename CNT<E>::Precision>::Mul
1079 template <
int M,
class E,
int S>
inline
1080 typename Vec<M,E,S>::template Result<typename CNT<E>::Precision>::Mul
1086 template <
int M,
class E,
int S,
class R>
inline
1087 typename Vec<M,E,S>::template Result<std::complex<R> >::Mul
1090 template <
int M,
class E,
int S,
class R>
inline
1091 typename Vec<M,E,S>::template Result<std::complex<R> >::Mul
1095 template <
int M,
class E,
int S,
class R>
inline
1096 typename Vec<M,E,S>::template Result<std::complex<R> >::Mul
1098 template <
int M,
class E,
int S,
class R>
inline
1099 typename Vec<M,E,S>::template Result<std::complex<R> >::Mul
1103 template <
int M,
class E,
int S,
class R>
inline
1104 typename Vec<M,E,S>::template Result<typename negator<R>::StdNumber>::Mul
1106 template <
int M,
class E,
int S,
class R>
inline
1107 typename Vec<M,E,S>::template Result<typename negator<R>::StdNumber>::Mul
1116 template <
int M,
class E,
int S>
inline
1117 typename Vec<M,E,S>::template Result<float>::Dvd
1120 template <
int M,
class E,
int S>
inline
1121 typename CNT<float>::template Result<Vec<M,E,S> >::Dvd
1125 template <
int M,
class E,
int S>
inline
1126 typename Vec<M,E,S>::template Result<double>::Dvd
1129 template <
int M,
class E,
int S>
inline
1130 typename CNT<double>::template Result<Vec<M,E,S> >::Dvd
1134 template <
int M,
class E,
int S>
inline
1135 typename Vec<M,E,S>::template Result<long double>::Dvd
1138 template <
int M,
class E,
int S>
inline
1139 typename CNT<long double>::template Result<Vec<M,E,S> >::Dvd
1144 template <
int M,
class E,
int S>
inline
1145 typename Vec<M,E,S>::template Result<typename CNT<E>::Precision>::Dvd
1147 template <
int M,
class E,
int S>
inline
1148 typename CNT<typename CNT<E>::Precision>::template Result<Vec<M,E,S> >::Dvd
1155 template <
int M,
class E,
int S,
class R>
inline
1156 typename Vec<M,E,S>::template Result<std::complex<R> >::Dvd
1159 template <
int M,
class E,
int S,
class R>
inline
1160 typename CNT<std::complex<R> >::template Result<Vec<M,E,S> >::Dvd
1165 template <
int M,
class E,
int S,
class R>
inline
1166 typename Vec<M,E,S>::template Result<std::complex<R> >::Dvd
1168 template <
int M,
class E,
int S,
class R>
inline
1169 typename CNT<std::complex<R> >::template Result<Vec<M,E,S> >::Dvd
1173 template <
int M,
class E,
int S,
class R>
inline
1174 typename Vec<M,E,S>::template Result<typename negator<R>::StdNumber>::Dvd
1176 template <
int M,
class E,
int S,
class R>
inline
1177 typename CNT<R>::template Result<Vec<M,E,S> >::Dvd
1188 template <
int M,
class E,
int S>
inline
1189 typename Vec<M,E,S>::template Result<float>::Add
1192 template <
int M,
class E,
int S>
inline
1193 typename Vec<M,E,S>::template Result<float>::Add
1196 template <
int M,
class E,
int S>
inline
1197 typename Vec<M,E,S>::template Result<double>::Add
1200 template <
int M,
class E,
int S>
inline
1201 typename Vec<M,E,S>::template Result<double>::Add
1204 template <
int M,
class E,
int S>
inline
1205 typename Vec<M,E,S>::template Result<long double>::Add
1208 template <
int M,
class E,
int S>
inline
1209 typename Vec<M,E,S>::template Result<long double>::Add
1213 template <
int M,
class E,
int S>
inline
1214 typename Vec<M,E,S>::template Result<typename CNT<E>::Precision>::Add
1216 template <
int M,
class E,
int S>
inline
1217 typename Vec<M,E,S>::template Result<typename CNT<E>::Precision>::Add
1223 template <
int M,
class E,
int S,
class R>
inline
1224 typename Vec<M,E,S>::template Result<std::complex<R> >::Add
1227 template <
int M,
class E,
int S,
class R>
inline
1228 typename Vec<M,E,S>::template Result<std::complex<R> >::Add
1232 template <
int M,
class E,
int S,
class R>
inline
1233 typename Vec<M,E,S>::template Result<std::complex<R> >::Add
1235 template <
int M,
class E,
int S,
class R>
inline
1236 typename Vec<M,E,S>::template Result<std::complex<R> >::Add
1240 template <
int M,
class E,
int S,
class R>
inline
1241 typename Vec<M,E,S>::template Result<typename negator<R>::StdNumber>::Add
1243 template <
int M,
class E,
int S,
class R>
inline
1244 typename Vec<M,E,S>::template Result<typename negator<R>::StdNumber>::Add
1250 template <
int M,
class E,
int S>
inline
1251 typename Vec<M,E,S>::template Result<float>::Sub
1254 template <
int M,
class E,
int S>
inline
1255 typename CNT<float>::template Result<Vec<M,E,S> >::Sub
1259 template <
int M,
class E,
int S>
inline
1260 typename Vec<M,E,S>::template Result<double>::Sub
1263 template <
int M,
class E,
int S>
inline
1264 typename CNT<double>::template Result<Vec<M,E,S> >::Sub
1268 template <
int M,
class E,
int S>
inline
1269 typename Vec<M,E,S>::template Result<long double>::Sub
1272 template <
int M,
class E,
int S>
inline
1273 typename CNT<long double>::template Result<Vec<M,E,S> >::Sub
1278 template <
int M,
class E,
int S>
inline
1279 typename Vec<M,E,S>::template Result<typename CNT<E>::Precision>::Sub
1281 template <
int M,
class E,
int S>
inline
1282 typename CNT<typename CNT<E>::Precision>::template Result<Vec<M,E,S> >::Sub
1289 template <
int M,
class E,
int S,
class R>
inline
1290 typename Vec<M,E,S>::template Result<std::complex<R> >::Sub
1293 template <
int M,
class E,
int S,
class R>
inline
1294 typename CNT<std::complex<R> >::template Result<Vec<M,E,S> >::Sub
1299 template <
int M,
class E,
int S,
class R>
inline
1300 typename Vec<M,E,S>::template Result<std::complex<R> >::Sub
1302 template <
int M,
class E,
int S,
class R>
inline
1303 typename CNT<std::complex<R> >::template Result<Vec<M,E,S> >::Sub
1307 template <
int M,
class E,
int S,
class R>
inline
1308 typename Vec<M,E,S>::template Result<typename negator<R>::StdNumber>::Sub
1310 template <
int M,
class E,
int S,
class R>
inline
1311 typename CNT<R>::template Result<Vec<M,E,S> >::Sub
1315 template <
int M,
class E,
int S,
class CHAR,
class TRAITS>
inline
1316 std::basic_ostream<CHAR,TRAITS>&
1317 operator<<(std::basic_ostream<CHAR,TRAITS>& o,
const Vec<M,E,S>& v) {
1318 o <<
"~[" << v[0];
for(
int i=1;i<M;++i) o<<
','<<v[i]; o<<
']';
return o;
1323 template <
int M,
class E,
int S,
class CHAR,
class TRAITS>
inline
1324 std::basic_istream<CHAR,TRAITS>&
1327 is >> tilde;
if (is.fail())
return is;
1328 if (tilde != CHAR(
'~')) {
1330 is.unget();
if (is.fail())
return is;
1333 CHAR openBracket, closeBracket;
1334 is >> openBracket;
if (is.fail())
return is;
1335 if (openBracket==CHAR(
'('))
1336 closeBracket = CHAR(
')');
1337 else if (openBracket==CHAR(
'['))
1338 closeBracket = CHAR(
']');
1340 closeBracket = CHAR(0);
1341 is.unget();
if (is.fail())
return is;
1346 if (tilde != CHAR(0) && closeBracket == CHAR(0)) {
1347 is.setstate( std::ios::failbit );
1351 for (
int i=0; i < M; ++i) {
1353 if (is.fail())
return is;
1355 CHAR c; is >> c;
if (is.fail())
return is;
1356 if (c !=
',') is.unget();
1357 if (is.fail())
return is;
1363 if (closeBracket != CHAR(0)) {
1364 CHAR closer; is >> closer;
if (is.fail())
return is;
1365 if (closer != closeBracket) {
1366 is.unget();
if (is.fail())
return is;
1367 is.setstate( std::ios::failbit );
1377 #endif //SimTK_SIMMATRIX_SMALLMATRIX_VEC_H_
Matrix_< E > operator/(const MatrixBase< E > &l, const typename CNT< E >::StdNumber &r)
Definition: BigMatrix.h:2693
TImag & imag()
Recast to show only the imaginary portion of this Vec and return a writable reference.
Definition: Vec.h:644
std::string toString() const
Print Vec into a string and return it.
Definition: Vec.h:933
bool isFinite() const
Return true if no element of this Vec contains an Infinity or a NaN anywhere.
Definition: Vec.h:887
TAbs abs() const
Elementwise absolute value; that is, the return value has the same dimension as this Vec but with eac...
Definition: Vec.h:292
CNT< E >::TSqHermT ESqHermT
Type of the expression ~E*E (default vector and matrix square; symmetric).
Definition: Vec.h:159
K::ScalarNormSq ScalarNormSq
Definition: CompositeNumericalTypes.h:166
SubOp::Type Sub
Definition: Vec.h:355
static Vec< M, ELT, 1 > getNaN()
Return a Vec of the same length and element type as this one but with all elements set to NaN...
Definition: Vec.h:860
K::ULessScalar ULessScalar
Definition: CompositeNumericalTypes.h:161
TNeg & operator-()
Recast to negated type and return a writable reference; writing to this will cause the negated result...
Definition: Vec.h:590
static int size()
The number of elements in this Vec (note that stride does not affect this number.) ...
Definition: Vec.h:263
Vec(const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5, const E &e6, const E &e7, const E &e8)
Definition: Vec.h:453
Vec< M, P > Type
Definition: Vec.h:364
K::TReal TReal
Definition: CompositeNumericalTypes.h:141
CNT< E >::TSqrt ESqrt
Type required to hold the result of sqrt(E).
Definition: Vec.h:163
const TImag & imag() const
Return a reference to the imaginary portion of this Vec if it has complex elements; otherwise the typ...
Definition: Vec.h:637
ScalarNormSq scalarNormSqr() const
Scalar norm square is sum( conjugate squares of all underlying scalars ), where conjugate square of s...
Definition: Vec.h:272
Vec< M, typename CNT< E >::template Result< EE >::Dvd > elementwiseDivide(const Vec< M, EE, SS > &r) const
Elementwise divide (Matlab .
Definition: Vec.h:532
RS is total spacing between rows in memory (default 1)
Definition: SymMat.h:71
const E & operator[](int i) const
Select an element of this Vec and return a const reference to it.
Definition: Vec.h:541
SymMat< M, ESqTHerm > TSqTHerm
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:249
Vec< M, typename CNT< EE >::template Result< E >::Sub > scalarSubtractFromLeft(const EE &e) const
Definition: Vec.h:711
Vec & scalarEq(const EE &ee)
Definition: Vec.h:728
CNT< E >::TImag EImag
Type showing the imaginary part of an element of this Vec as real, if elements are complex; otherwise...
Definition: Vec.h:149
MulOp::Type Mul
Definition: Vec.h:335
CNT< E >::TReal EReal
Type showing just the real part of an element of this Vec if elements are complex; otherwise just the...
Definition: Vec.h:145
TSqrt sqrt() const
Elementwise square root; that is, the return value has the same length as this Vec but with each elem...
Definition: Vec.h:282
Vec & scalarTimesEq(const EE &ee)
Definition: Vec.h:736
Vec & scalarTimesEqFromLeft(int ee)
Definition: Vec.h:752
bool isNaN() const
Return true if any element of this Vec contains a NaN anywhere.
Definition: Vec.h:863
SimTK::conjugate<R> should be instantiated only for float, double, long double.
Definition: String.h:45
K::TSqrt TSqrt
Definition: CompositeNumericalTypes.h:154
Vec< M-1, ELT, 1 > drop1(int p) const
Return a vector one smaller than this one by dropping the element at the indicated position p...
Definition: Vec.h:808
TWithoutNegator & updCastAwayNegatorIfAny()
Recast to remove negators from this Vec's type if present and return a writable reference.
Definition: Vec.h:657
Vec(const E &e)
Construction from a single value of this Vec's element type assigns that value to each element...
Definition: Vec.h:415
TInvert invert() const
This method is not supported for Vec objects.
Definition: Vec.h:580
static TSqrt sqrt(const K &t)
Definition: CompositeNumericalTypes.h:239
static Vec & updAs(ELT *p)
Recast a writable ordinary C++ array E[] to a writable Vec<M,E,S>; assumes compatible length...
Definition: Vec.h:853
Vec< M, ESqrt, 1 > TSqrt
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:242
Vec & operator=(const EE *p)
Assignment to a pointer to elements of any type EE assumes we're pointing at a C++ array of EE's of t...
Definition: Vec.h:468
TNeg & updNegate()
Non-operator version of unary negation; recasts and returns a writable reference. ...
Definition: Vec.h:604
K::Scalar Scalar
Definition: CompositeNumericalTypes.h:160
ESqHermT TSqHermT
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:248
Vec & operator+=(const EE &e)
Definition: Vec.h:721
CNT< E >::TNormalize ENormalize
Packed type that can hold the value returned from normalize(E).
Definition: Vec.h:173
K::TNormalize TNormalize
Definition: CompositeNumericalTypes.h:158
Vec< M, typename CNT< EE >::template Result< E >::Mul > scalarMultiplyFromLeft(const EE &e) const
Definition: Vec.h:675
E TElement
Element type of this Vec.
Definition: Vec.h:234
Vec< M, typename CNT< E >::template Result< EE >::Mul > elementwiseMultiply(const Vec< M, EE, SS > &r) const
Elementwise multiply (Matlab .
Definition: Vec.h:525
Vec(const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5, const E &e6)
Definition: Vec.h:447
static int nrow()
The number of rows in a Vec is the number of elements.
Definition: Vec.h:265
E & operator[](int i)
Select an element of this Vec and return a writable reference to it.
Definition: Vec.h:549
Vec(const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5, const E &e6, const E &e7)
Definition: Vec.h:450
K::TImag TImag
Definition: CompositeNumericalTypes.h:142
CNT< E >::StdNumber EStdNumber
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:178
Vec(const E &e0, const E &e1)
Construct a Vec<2,E> from two elements of type E, etc.
Definition: Vec.h:435
TStandard standardize() const
Return a copy of this Vec but with the underlying scalar type converted (if necessary) to one of the ...
Definition: Vec.h:302
void set(int i, const E &value)
Variant of operator[] that's scripting friendly to set ith entry.
Definition: Vec.h:940
Vec< M, typename CNT< E >::template Result< P >::Mul, 1 > Mul
Definition: Vec.h:323
Vec & operator-=(const EE &e)
Definition: Vec.h:722
EStdNumber StdNumber
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:256
AddCNTs< M, 1, ArgDepth, Vec, ColSpacing, RowSpacing, CNT< P >::NRows, CNT< P >::NCols, CNT< P >::ArgDepth, P, CNT< P >::ColSpacing, CNT< P >::RowSpacing > AddOp
Definition: Vec.h:349
std::basic_istream< CHAR, TRAITS > & operator>>(std::basic_istream< CHAR, TRAITS > &is, conjugate< R > &c)
Definition: conjugate.h:800
Vec(const EE *p)
Construction from a pointer to elements of any type EE assumes we're pointing at a C++ array of EE's ...
Definition: Vec.h:461
Vec< M, EAbs, 1 > TAbs
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:243
negator<N>, where N is a number type (real, complex, conjugate), is represented in memory identically...
Definition: String.h:44
Definition: CompositeNumericalTypes.h:120
static double getDefaultTolerance()
Definition: CompositeNumericalTypes.h:269
CNT< E >::THerm EHerm
Type of the Hermitian transpose of an element of this Vec.
Definition: Vec.h:154
Vec< M+1, ELT, 1 > insert1(int p, const EE &v) const
Return a vector one larger than this one by inserting an element before the indicated one...
Definition: Vec.h:835
const TNeg & operator-() const
Unary minus recasts this Vec to a type that has the opposite interpretation of the sign but is otherw...
Definition: Vec.h:587
SubCNTs< M, 1, ArgDepth, Vec, ColSpacing, RowSpacing, CNT< P >::NRows, CNT< P >::NCols, CNT< P >::ArgDepth, P, CNT< P >::ColSpacing, CNT< P >::RowSpacing > SubOp
Definition: Vec.h:354
TPosTrans & updPositionalTranspose()
Positional transpose returning a writable reference.
Definition: Vec.h:619
Vec(const Vec &src)
Copy constructor copies the logically-included elements from the source Vec; gaps due to stride are n...
Definition: Vec.h:383
bool operator==(const PhiMatrix &p1, const PhiMatrix &p2)
Definition: SpatialAlgebra.h:774
CNT< E >::TStandard EStandard
Return type of standardize(E) method; a packed type that can hold the value of an element after elimi...
Definition: Vec.h:168
static TStandard standardize(const K &t)
Definition: CompositeNumericalTypes.h:241
Vec(const E &e0, const E &e1, const E &e2, const E &e3)
Definition: Vec.h:439
Vec< M, EReal, STRIDE *CNT< E >::RealStrideFactor > TReal
Type of this Vec cast to show only the real part of its element; this might affect the stride...
Definition: Vec.h:220
CNT< E >::Scalar EScalar
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:175
EPrecision Precision
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:257
CNT< E >::TPosTrans EPosTrans
Type of a positional transpose of an element of this Vec.
Definition: Vec.h:156
CNT< E >::TSqTHerm ESqTHerm
Type of the expression E*~E ("row square"; symmetric).
Definition: Vec.h:161
Vec< M, typename CNT< E >::template Result< P >::Add, 1 > Add
Definition: Vec.h:325
Vec< M, EStandard, 1 > TStandard
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:244
Vec & scalarMinusEqFromLeft(int ee)
Definition: Vec.h:751
Vec & scalarPlusEq(const EE &ee)
Definition: Vec.h:730
const E & operator()(int i) const
Same as const operator[] above.
Definition: Vec.h:544
Vec & operator+=(const Vec< M, negator< EE >, SS > &r)
Add in a conforming Vec, of any negated element type and stride, provided that the element types are ...
Definition: Vec.h:483
Vec< M, E, STRIDE > T
The type of this Vec.
Definition: Vec.h:210
CNT< E >::ScalarNormSq EScalarNormSq
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:180
Mat< M, M, typename CNT< E >::template Result< EE >::Mul > conformingMultiply(const Row< M, EE, SS > &r) const
Same as outer product (m = col*row) – use operator* or outer() instead.
Definition: Vec.h:517
K::TSqTHerm TSqTHerm
Definition: CompositeNumericalTypes.h:147
Vec(const Vec< M, ENeg, SS > &src)
This is an implicit conversion from a Vec of the same length and negated element type (possibly with ...
Definition: Vec.h:403
EStandard sum() const
Sum just adds up all the elements into a single return element that is the same type as this Vec's el...
Definition: Vec.h:311
This is a fixed length column vector designed for no-overhead inline computation. ...
Definition: Vec.h:131
const Vec & operator+() const
Unary plus does nothing.
Definition: Vec.h:583
Row< M, EInvert, 1 > TInvert
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:245
const TNeg & negate() const
Non-operator version of unary negation; just a recast.
Definition: Vec.h:601
Vec(const Vec< M, EE, SS > &src)
Construct a Vec from a Vec of the same length, with any stride.
Definition: Vec.h:409
const TReal & real() const
Return a reference to the real portion of this Vec if it has complex elements; otherwise the type doe...
Definition: Vec.h:626
const THerm & operator~() const
The Hermitian transpose operator recasts this Vec to a type that specifies the opposite storage order...
Definition: Vec.h:594
Vec< M, typename CNT< E >::template Result< EE >::Mul > scalarMultiply(const EE &e) const
Definition: Vec.h:669
static double getDefaultTolerance()
For approximate comparisions, the default tolerance to use for a vector is the same as its elements' ...
Definition: Vec.h:896
K::Precision Precision
Definition: CompositeNumericalTypes.h:164
Vec & scalarEq(int ee)
Definition: Vec.h:746
Row< M, EHerm, STRIDE > THerm
Type of this Vec after casting to its Hermitian transpose; that is, the Vec turns into a Row and each...
Definition: Vec.h:229
ENumber Number
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:255
void setToNaN()
Set every scalar in this Vec to NaN; this is the default initial value in Debug builds, but not in Release.
Definition: Vec.h:757
Matrix_< E > operator*(const MatrixBase< E > &l, const typename CNT< E >::StdNumber &r)
Definition: BigMatrix.h:2685
Vec< M, typename CNT< E >::template Result< EE >::Add > scalarAdd(const EE &e) const
Definition: Vec.h:697
void setToZero()
Set every scalar in this Vec to zero.
Definition: Vec.h:762
void elementwiseDivide(const Row< 1, E1, S1 > &r1, const Row< 1, E2, S2 > &r2, Row< 1, typename CNT< E1 >::template Result< E2 >::Dvd > &result)
Definition: Row.h:90
K::TInvert TInvert
Definition: CompositeNumericalTypes.h:157
THerm & operator~()
Recast to Hermitian transposed type and return a writable reference; the effect is that writing to el...
Definition: Vec.h:598
bool isNumericallyEqual(const Vec< M, E2, RS2 > &v, double tol) const
Test whether this vector is numerically equal to some other vector with the same shape, using a specified tolerance.
Definition: Vec.h:901
Vec & operator=(const Vec &src)
Copy assignment operator copies the logically-included elements from the source Vec; gaps due to stri...
Definition: Vec.h:390
Vec(const E &e0, const E &e1, const E &e2)
Definition: Vec.h:437
MulOpNonConforming::Type MulNon
Definition: Vec.h:340
ELEM max(const VectorBase< ELEM > &v)
Definition: VectorMath.h:251
NTraits< N >::StdNumber StdNumber
Definition: negator.h:107
Vec & scalarMinusEq(int ee)
Definition: Vec.h:748
Shape-preserving element substitution (always packed).
Definition: Vec.h:363
Vec< M, typename CNT< E >::template Result< EE >::Add > conformingAdd(const Vec< M, EE, SS > &r) const
Vector addition – use operator+ instead.
Definition: Vec.h:501
MulCNTsNonConforming< M, 1, ArgDepth, Vec, ColSpacing, RowSpacing, CNT< P >::NRows, CNT< P >::NCols, CNT< P >::ArgDepth, P, CNT< P >::ColSpacing, CNT< P >::RowSpacing > MulOpNonConforming
Definition: Vec.h:339
TNormalize normalize() const
If the elements of this Vec are scalars, the result is what you get by dividing each element by the n...
Definition: Vec.h:568
Vec & operator/=(const EE &e)
Definition: Vec.h:724
static const Vec & getSubVec(const Vec< MM, ELT, STRIDE > &v, int i)
Extract a subvector of type Vec from a longer one that has the same element type and stride...
Definition: Vec.h:792
bool operator>=(const Row< N, E1, S1 > &l, const Row< N, E2, S2 > &r)
bool = v1[i] >= v2[i], for all elements i This is not the same as !(v1<v2).
Definition: Row.h:844
CNT< E >::TWithoutNegator EWithoutNegator
Element type, stripped of negator<> if it has one.
Definition: Vec.h:142
CNT< E >::TComplex EComplex
Type that elements would have if complex, if E is currently real; otherwise just the element type E...
Definition: Vec.h:152
Vec(const ENeg &ne)
Construction from a single value of this Vec's negated element type assigns that value to each elemen...
Definition: Vec.h:421
K::TPosTrans TPosTrans
Definition: CompositeNumericalTypes.h:145
Vec & operator*=(const EE &e)
Definition: Vec.h:723
void elementwiseMultiply(const Row< 1, E1, S1 > &r1, const Row< 1, E2, S2 > &r2, Row< 1, typename CNT< E1 >::template Result< E2 >::Mul > &result)
Definition: Row.h:75
Vec< M, EImag, STRIDE *CNT< E >::RealStrideFactor > TImag
Type of this Vec cast to show only the imaginary part of its element; this might affect the stride...
Definition: Vec.h:224
TReal & real()
Recast to show only the real portion of this Vec and return a writable reference. ...
Definition: Vec.h:629
const TPosTrans & positionalTranspose() const
Positional transpose turns this Vec into a Row but does not transpose the individual elements...
Definition: Vec.h:616
CNT< E >::TAbs EAbs
Type required to hold the result of abs(E).
Definition: Vec.h:165
K::StdNumber StdNumber
Definition: CompositeNumericalTypes.h:163
RowVectorBase< typename CNT< ELEM >::TAbs > abs(const RowVectorBase< ELEM > &v)
Definition: VectorMath.h:120
Vec & scalarTimesEqFromLeft(const EE &ee)
Definition: Vec.h:738
bool operator!=(const conjugate< R > &a, const float &b)
Definition: conjugate.h:859
E TRow
Type of a row of this CNT object (for a Vec, just its element type).
Definition: Vec.h:236
Specialized information about Composite Numerical Types which allows us to define appropriate templat...
Definition: CompositeNumericalTypes.h:136
Vec & scalarPlusEq(int ee)
Definition: Vec.h:747
THerm & updTranspose()
Non-operator version of Hermitian transpose; recasts and returns a writable reference.
Definition: Vec.h:610
DvdCNTs< M, 1, ArgDepth, Vec, ColSpacing, RowSpacing, CNT< P >::NRows, CNT< P >::NCols, CNT< P >::ArgDepth, P, CNT< P >::ColSpacing, CNT< P >::RowSpacing > DvdOp
Definition: Vec.h:344
Vec & scalarDivideEq(int ee)
Definition: Vec.h:750
CNT< E >::Precision EPrecision
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:179
Generic Row.
Definition: Row.h:118
Vec & scalarMinusEqFromLeft(const EE &ee)
Definition: Vec.h:734
Mandatory first inclusion for any Simbody source or header file.
Vec< M, ENormalize, 1 > TNormalize
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:246
E & operator()(int i)
Same as non-const operator[] above.
Definition: Vec.h:551
Vec< M, typename CNT< E >::template Result< EE >::Sub > scalarSubtract(const EE &e) const
Definition: Vec.h:705
K::TNeg TNeg
Definition: CompositeNumericalTypes.h:139
K::TStandard TStandard
Definition: CompositeNumericalTypes.h:156
void copy(Row< 1, E1, S1 > &r1, const Row< 1, E2, S2 > &r2)
Definition: Row.h:105
ScalarNormSq normSqr() const
Definition: Vec.h:553
K::TWithoutNegator TWithoutNegator
Definition: CompositeNumericalTypes.h:140
Vec & operator=(const Vec< M, EE, SS > &vv)
Assignment to a conforming Vec, of any element type and stride, provided that the element types are a...
Definition: Vec.h:473
void conformingSubtract(const Row< 1, E1, S1 > &r1, const Row< 1, E2, S2 > &r2, Row< 1, typename CNT< E1 >::template Result< E2 >::Sub > &result)
Definition: Row.h:60
const THerm & transpose() const
Non-operator version of Hermitian transpose; just a recast.
Definition: Vec.h:607
CNT< ScalarNormSq >::TSqrt norm() const
Definition: Vec.h:555
Vec< MM, ELT, STRIDE > & updSubVec(int i)
Extract a writable reference to a sub-Vec with size known at compile time.
Definition: Vec.h:782
Vec< M, typename CNT< E >::template Result< P >::Sub, 1 > Sub
Definition: Vec.h:326
CNT< E >::TInvert EInvert
Packed type that can hold the value returned from invert(E), the inverse type of an element...
Definition: Vec.h:171
Vec< M, EComplex, STRIDE > TComplex
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:225
Vec< M+1, ELT, 1 > append1(const EE &v) const
Return a vector one larger than this one by adding an element to the end.
Definition: Vec.h:822
const Vec< MM, ELT, STRIDE > & getSubVec(int i) const
Extract a const reference to a sub-Vec with size known at compile time.
Definition: Vec.h:772
This class represents a small matrix whose size is known at compile time, containing elements of any ...
Definition: Mat.h:51
Vec & scalarDivideEqFromLeft(int ee)
Definition: Vec.h:753
K::TComplex TComplex
Definition: CompositeNumericalTypes.h:143
Vec & scalarTimesEq(int ee)
Definition: Vec.h:749
K::Number Number
Definition: CompositeNumericalTypes.h:162
Vec & operator+=(const Vec< M, EE, SS > &r)
Add in a conforming Vec, of any element type and stride, provided that the element types are addition...
Definition: Vec.h:478
Row< M, E, STRIDE > TPosTrans
Type of this Vec after casting to its positional transpose; that is, the Vec turns into a Row but the...
Definition: Vec.h:232
bool isInf() const
Return true if any element of this Vec contains a +Infinity or -Infinity somewhere but no element con...
Definition: Vec.h:872
Vec & scalarDivideEq(const EE &ee)
Definition: Vec.h:740
static K getNaN()
Definition: CompositeNumericalTypes.h:246
Vec & operator-=(const Vec< M, negator< EE >, SS > &r)
Subtract off a conforming Vec, of any negated element type and stride, provided that the element type...
Definition: Vec.h:493
static Vec & updSubVec(Vec< MM, ELT, STRIDE > &v, int i)
Extract a subvector of type Vec from a longer one that has the same element type and stride...
Definition: Vec.h:800
Vec(const E &e0, const E &e1, const E &e2, const E &e3, const E &e4)
Definition: Vec.h:441
Vec< M, ENeg, STRIDE > TNeg
Type this Vec would have if its elements were interpreted as negated.
Definition: Vec.h:213
CNT< E >::Number ENumber
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:177
ELT E
Element type of this Vec.
Definition: Vec.h:138
EScalarNormSq ScalarNormSq
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:258
K::TSqHermT TSqHermT
Definition: CompositeNumericalTypes.h:146
bool isNumericallyEqual(const Vec< M, E2, RS2 > &v) const
Test whether this vector is numerically equal to some other vector with the same shape, using a default tolerance which is the looser of the default tolerances of the two objects being compared.
Definition: Vec.h:912
bool operator>(const Row< N, E1, S1 > &l, const Row< N, E2, S2 > &r)
bool = v1[i] > v2[i], for all elements i
Definition: Row.h:819
Vec(const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5)
Definition: Vec.h:444
CNT< E >::ULessScalar EULessScalar
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:176
AddOp::Type Add
Definition: Vec.h:350
Vec TCol
Type of a column of this CNT object (for a Vec, the whole thing).
Definition: Vec.h:238
EULessScalar ULessScalar
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:254
K::THerm THerm
Definition: CompositeNumericalTypes.h:144
Vec()
Default construction initializes Vec's elements to NaN when debugging but leaves them uninitialized g...
Definition: Vec.h:370
Vec< M, typename CNT< E >::template Result< EE >::Sub > conformingSubtract(const Vec< M, EE, SS > &r) const
Vector subtraction – use operator- instead.
Definition: Vec.h:508
Vec< M, typename CNT< E >::template Result< EE >::Dvd > scalarDivide(const EE &e) const
Definition: Vec.h:684
Vec & scalarMinusEq(const EE &ee)
Definition: Vec.h:732
static int ncol()
The number of columns in a Vec is always 1.
Definition: Vec.h:267
EScalar Scalar
These compile-time constants are required of every Composite Numerical Type (CNT).
Definition: Vec.h:253
Vec(const Vec< M, E, SS > &src)
This is an implicit conversion from a Vec of the same length and element type but with a different st...
Definition: Vec.h:397
Vec & scalarDivideEqFromLeft(const EE &ee)
Definition: Vec.h:742
const TWithoutNegator & castAwayNegatorIfAny() const
Recast to remove negators from this Vec's type if present; this is handy for simplifying operations w...
Definition: Vec.h:653
Vec(int i)
Given an int value, turn it into a suitable floating point number, convert that to element type E and...
Definition: Vec.h:430
CNT< E >::TNeg ENeg
Negated version of this Vec's element type; ENeg==negator< E >.
Definition: Vec.h:140
void conformingAdd(const Row< 1, E1, S1 > &r1, const Row< 1, E2, S2 > &r2, Row< 1, typename CNT< E1 >::template Result< E2 >::Add > &result)
Definition: Row.h:45
Vec< M, typename CNT< EE >::template Result< E >::Dvd > scalarDivideFromLeft(const EE &e) const
Definition: Vec.h:690
Vec & operator-=(const Vec< M, EE, SS > &r)
Subtract off a conforming Vec, of any element type and stride, provided that the element types are ad...
Definition: Vec.h:488
DvdOp::Type Dvd
Definition: Vec.h:345
Vec< M, EWithoutNegator, STRIDE > TWithoutNegator
Type of this Vec with negator removed from its element type, if the element is negated.
Definition: Vec.h:216
Vec< M, typename CNT< E >::template Result< P >::Dvd, 1 > Dvd
Definition: Vec.h:324
static const Vec & getAs(const ELT *p)
Recast an ordinary C++ array E[] to a const Vec<M,E,S>; assumes compatible length, stride, and packing.
Definition: Vec.h:849
K::TAbs TAbs
Definition: CompositeNumericalTypes.h:155
MulCNTs< M, 1, ArgDepth, Vec, ColSpacing, RowSpacing, CNT< P >::NRows, CNT< P >::NCols, CNT< P >::ArgDepth, P, CNT< P >::ColSpacing, CNT< P >::RowSpacing > MulOp
Definition: Vec.h:334