16 #ifndef BT_DEFORMABLE_LAGRANGIAN_FORCE_H
17 #define BT_DEFORMABLE_LAGRANGIAN_FORCE_H
35 return low +
static_cast<double>(rand()) / RAND_MAX * (
high -
low);
139 for (
int i = 0; i < dphi_dx.
size(); ++i)
141 dphi_dx[i].setZero();
161 for (
int i = 0; i < dx.
size(); ++i)
169 for (
int it = 0; it < 10; ++it)
171 for (
int i = 0; i < dx.
size(); ++i)
178 for (
int i = 0; i < dx.
size(); ++i)
180 dphi += dphi_dx[i].dot(dx[i]);
222 double error = f1 - f2 - 2 * dphi;
224 std::cout <<
"Iteration = " << it <<
", f1 = " << f1 <<
", f2 = " << f2 <<
", error = " <<
error << std::endl;
226 for (
int i = 1; i < errors.
size(); ++i)
228 std::cout <<
"Iteration = " << i <<
", ratio = " << errors[i - 1] / errors[i] << std::endl;
270 for (
int i = 0; i < dx.
size(); ++i)
278 for (
int it = 0; it < 10; ++it)
280 for (
int i = 0; i < dx.
size(); ++i)
286 for (
int i = 0; i < df.
size(); ++i)
339 for (
int i = 0; i < df.
size(); ++i)
341 btVector3 error_vector = f1[i] - f2[i] - 2 * df[i];
342 error += error_vector.length2();
346 std::cout <<
"Iteration = " << it <<
", error = " <<
error << std::endl;
348 for (
int i = 1; i < errors.
size(); ++i)
350 std::cout <<
"Iteration = " << i <<
", ratio = " << errors[i - 1] / errors[i] << std::endl;
__forceinline ssef low(const avxf &a)
__forceinline ssef high(const avxf &a)
btMatrix3x3
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
SIMD_FORCE_INLINE btScalar btSqrt(btScalar y)
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
void remove(const T &key)
SIMD_FORCE_INLINE void resize(int newsize, const T &fillData=T())
SIMD_FORCE_INLINE void push_back(const T &_Val)
ccl_gpu_kernel_postfix ccl_global int * counter
static void error(const char *str)