23 for (
int i = 0; i < 4; i++) {
25 float pivotsize =
M[i][i];
28 pivotsize = -pivotsize;
31 for (
int j = i + 1; j < 4; j++) {
38 if (tmp > pivotsize) {
49 for (
int j = 0; j < 4; j++) {
53 M[i][j] =
M[pivot][j];
57 R[i][j] =
R[pivot][j];
62 for (
int j = i + 1; j < 4; j++) {
63 float f =
M[j][i] /
M[i][i];
65 for (
int k = 0; k < 4; k++) {
66 M[j][k] -= f *
M[i][k];
67 R[j][k] -= f *
R[i][k];
73 for (
int i = 3; i >= 0; --i) {
80 for (
int j = 0; j < 4; j++) {
85 for (
int j = 0; j < i; j++) {
88 for (
int k = 0; k < 4; k++) {
89 M[j][k] -= f *
M[i][k];
90 R[j][k] -= f *
R[i][k];
101 float M[4][4],
R[4][4];
103 memcpy(
R, &tfmR,
sizeof(
R));
104 memcpy(
M, &tfm,
sizeof(
M));
110 memcpy(&tfmR.
x[0],
R,
sizeof(
R));
125 double trace = (
double)(tfm[0][0] + tfm[1][1] + tfm[2][2]);
129 double s =
sqrt(trace + 1.0);
131 qt.w = (
float)(s / 2.0);
134 qt.x = (
float)((
double)(tfm[2][1] - tfm[1][2]) * s);
135 qt.y = (
float)((
double)(tfm[0][2] - tfm[2][0]) * s);
136 qt.z = (
float)((
double)(tfm[1][0] - tfm[0][1]) * s);
141 if (tfm[1][1] > tfm[i][i]) {
144 if (tfm[2][2] > tfm[i][i]) {
151 double s =
sqrt((
double)(tfm[i][i] - (tfm[j][j] + tfm[k][k])) + 1.0);
159 double w = (
double)(tfm[k][j] - tfm[j][k]) * s;
160 q[j] = (
double)(tfm[j][i] + tfm[i][j]) * s;
161 q[k] = (
double)(tfm[k][i] + tfm[i][k]) * s;
192 for (
int i = 0; i < 3; i++)
193 for (
int j = 0; j < 4; j++)
194 Rnext[i][j] = 0.5f * (
R[i][j] + Rit[i][j]);
197 for (
int i = 0; i < 3; i++) {
199 fabsf(
R[i][0] - Rnext[i][0]) +
fabsf(
R[i][1] - Rnext[i][1]) +
200 fabsf(
R[i][2] - Rnext[i][2]));
205 }
while (iteration < 100 && norm > 1e-4f);
214 decomp->
y.w = scale.x.x;
215 decomp->
z =
make_float4(scale.x.y, scale.x.z, scale.y.x, scale.y.y);
216 decomp->
w =
make_float4(scale.y.z, scale.z.x, scale.z.y, scale.z.z);
226 shear.
z =
dot(colx, coly);
227 coly -= shear.
z * colx;
230 shear.
y =
dot(colx, colz);
231 colz -= shear.
y * colx;
232 shear.
x =
dot(coly, colz);
233 colz -= shear.
x * coly;
248 decomp->
y.w = scale.x;
257 for (
size_t i = 0; i <
size; i++) {
263 if (
dot(decomp[i - 1].x, decomp[i].x) < 0.0f) {
264 decomp[i].
x = -decomp[i].
x;
276 for (
size_t i = 0; i <
size; i++) {
283 decomp[i].
x = decomp[i - 1].
x;
285 else if (i < size - 1) {
286 decomp[i].
x = decomp[i + 1].
x;
294 1.0f / (viewplane.
top - viewplane.
bottom),
MINLINE float safe_divide(float a, float b)
typedef double(DMatrix)[4][4]
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
additional_info("compositor_sum_squared_difference_float_shared") .push_constant(Type output_img float dot(value.rgb, luminance_coefficients)") .define("LOAD(value)"
ccl_device_inline Transform projection_to_transform(const ProjectionTransform &a)
ccl_device_inline ProjectionTransform projection_identity()
ccl_device_inline ProjectionTransform projection_transpose(const ProjectionTransform &a)
#define CCL_NAMESPACE_END
draw_view in_light_buf[] float
ccl_device_inline bool is_zero(const float2 a)