38 #ifndef FCL_CCD_TAYLOR_VECTOR_INL_H 39 #define FCL_CCD_TAYLOR_VECTOR_INL_H 41 #include "fcl/math/motion/taylor_model/taylor_vector.h" 48 class TVector3<double>;
52 void generateTVector3ForLinearFunc(TVector3<double>& v,
const Vector3<double>& position,
const Vector3<double>& velocity);
56 TVector3<double> operator * (
const Vector3<double>& v,
const TaylorModel<double>& a);
60 TVector3<double> operator + (
const Vector3<double>& v1,
const TVector3<double>& v2);
64 TVector3<double> operator - (
const Vector3<double>& v1,
const TVector3<double>& v2);
68 TVector3<S>::TVector3()
75 TVector3<S>::TVector3(
const std::shared_ptr<TimeInterval<S>>& time_interval)
77 setTimeInterval(time_interval);
82 TVector3<S>::TVector3(TaylorModel<S> v[3])
91 TVector3<S>::TVector3(
const TaylorModel<S>& v1,
const TaylorModel<S>& v2,
const TaylorModel<S>& v3)
100 TVector3<S>::TVector3(
const Vector3<S>& v,
const std::shared_ptr<TimeInterval<S>>& time_interval)
102 i_[0] = TaylorModel<S>(v[0], time_interval);
103 i_[1] = TaylorModel<S>(v[1], time_interval);
104 i_[2] = TaylorModel<S>(v[2], time_interval);
108 template <
typename S>
109 void TVector3<S>::setZero()
117 template <
typename S>
118 TVector3<S> TVector3<S>::operator + (
const TVector3<S>& other)
const 120 return TVector3(i_[0] + other.i_[0], i_[1] + other.i_[1], i_[2] + other.i_[2]);
124 template <
typename S>
125 TVector3<S> TVector3<S>::operator - (
const TVector3<S>& other)
const 127 return TVector3(i_[0] - other.i_[0], i_[1] - other.i_[1], i_[2] - other.i_[2]);
131 template <
typename S>
132 TVector3<S> TVector3<S>::operator - ()
const 134 return TVector3(-i_[0], -i_[1], -i_[2]);
138 template <
typename S>
139 TVector3<S>& TVector3<S>::operator += (
const TVector3<S>& other)
141 i_[0] += other.i_[0];
142 i_[1] += other.i_[1];
143 i_[2] += other.i_[2];
148 template <
typename S>
149 TVector3<S>& TVector3<S>::operator -= (
const TVector3<S>& other)
151 i_[0] -= other.i_[0];
152 i_[1] -= other.i_[1];
153 i_[2] -= other.i_[2];
158 template <
typename S>
159 TVector3<S> TVector3<S>::operator + (
const Vector3<S>& other)
const 161 return TVector3(i_[0] + other[0], i_[1] + other[1], i_[2] + other[2]);
165 template <
typename S>
166 TVector3<S>& TVector3<S>::operator += (
const Vector3<S>& other)
175 template <
typename S>
176 TVector3<S> TVector3<S>::operator - (
const Vector3<S>& other)
const 178 return TVector3(i_[0] - other[0], i_[1] - other[1], i_[2] - other[2]);
182 template <
typename S>
183 TVector3<S>& TVector3<S>::operator -= (
const Vector3<S>& other)
192 template <
typename S>
193 TVector3<S> TVector3<S>::operator * (
const TaylorModel<S>& d)
const 195 return TVector3(i_[0] * d, i_[1] * d, i_[2] * d);
199 template <
typename S>
200 TVector3<S>& TVector3<S>::operator *= (
const TaylorModel<S>& d)
209 template <
typename S>
210 TVector3<S> TVector3<S>::operator * (S d)
const 212 return TVector3(i_[0] * d, i_[1] * d, i_[2] * d);
216 template <
typename S>
217 TVector3<S>& TVector3<S>::operator *= (S d)
226 template <
typename S>
227 const TaylorModel<S>& TVector3<S>::operator [] (
size_t i)
const 233 template <
typename S>
234 TaylorModel<S>& TVector3<S>::operator [] (
size_t i)
240 template <
typename S>
241 TaylorModel<S> TVector3<S>::dot(
const TVector3& other)
const 243 return i_[0] * other.i_[0] + i_[1] * other.i_[1] + i_[2] * other.i_[2];
247 template <
typename S>
248 TVector3<S> TVector3<S>::cross(
const TVector3<S>& other)
const 250 return TVector3<S>(i_[1] * other.i_[2] - i_[2] * other.i_[1],
251 i_[2] * other.i_[0] - i_[0] * other.i_[2],
252 i_[0] * other.i_[1] - i_[1] * other.i_[0]);
256 template <
typename S>
257 TaylorModel<S> TVector3<S>::dot(
const Vector3<S>& other)
const 259 return i_[0] * other[0] + i_[1] * other[1] + i_[2] * other[2];
263 template <
typename S>
264 TVector3<S> TVector3<S>::cross(
const Vector3<S>& other)
const 266 return TVector3<S>(i_[1] * other[2] - i_[2] * other[1],
267 i_[2] * other[0] - i_[0] * other[2],
268 i_[0] * other[1] - i_[1] * other[0]);
272 template <
typename S>
273 S TVector3<S>::volumn()
const 275 return i_[0].getBound().diameter() * i_[1].getBound().diameter() * i_[2].getBound().diameter();
279 template <
typename S>
280 IVector3<S> TVector3<S>::getBound()
const 282 return IVector3<S>(i_[0].getBound(), i_[1].getBound(), i_[2].getBound());
286 template <
typename S>
287 IVector3<S> TVector3<S>::getBound(S l, S r)
const 289 return IVector3<S>(i_[0].getBound(l, r), i_[1].getBound(l, r), i_[2].getBound(l, r));
293 template <
typename S>
294 IVector3<S> TVector3<S>::getBound(S t)
const 296 return IVector3<S>(i_[0].getBound(t), i_[1].getBound(t), i_[2].getBound(t));
300 template <
typename S>
301 IVector3<S> TVector3<S>::getTightBound()
const 303 return IVector3<S>(i_[0].getTightBound(), i_[1].getTightBound(), i_[2].getTightBound());
307 template <
typename S>
308 IVector3<S> TVector3<S>::getTightBound(S l, S r)
const 310 return IVector3<S>(i_[0].getTightBound(l, r), i_[1].getTightBound(l, r), i_[2].getTightBound(l, r));
314 template <
typename S>
315 void TVector3<S>::print()
const 323 template <
typename S>
324 TaylorModel<S> TVector3<S>::squareLength()
const 326 return i_[0] * i_[0] + i_[1] * i_[1] + i_[2] * i_[2];
330 template <
typename S>
331 void TVector3<S>::setTimeInterval(
const std::shared_ptr<TimeInterval<S>>& time_interval)
333 i_[0].setTimeInterval(time_interval);
334 i_[1].setTimeInterval(time_interval);
335 i_[2].setTimeInterval(time_interval);
339 template <
typename S>
340 void TVector3<S>::setTimeInterval(S l, S r)
342 i_[0].setTimeInterval(l, r);
343 i_[1].setTimeInterval(l, r);
344 i_[2].setTimeInterval(l, r);
348 template <
typename S>
349 const std::shared_ptr<TimeInterval<S>>& TVector3<S>::getTimeInterval()
const 351 return i_[0].getTimeInterval();
355 template <
typename S>
356 void generateTVector3ForLinearFunc(TVector3<S>& v,
const Vector3<S>& position,
const Vector3<S>& velocity)
358 generateTaylorModelForLinearFunc(v[0], position[0], velocity[0]);
359 generateTaylorModelForLinearFunc(v[1], position[1], velocity[1]);
360 generateTaylorModelForLinearFunc(v[2], position[2], velocity[2]);
364 template <
typename S>
365 TVector3<S> operator * (
const Vector3<S>& v,
const TaylorModel<S>& a)
367 TVector3<S> res(a.getTimeInterval());
376 template <
typename S>
377 TVector3<S> operator + (
const Vector3<S>& v1,
const TVector3<S>& v2)
383 template <
typename S>
384 TVector3<S> operator - (
const Vector3<S>& v1,
const TVector3<S>& v2)
Main namespace.
Definition: broadphase_bruteforce-inl.h:45