From 8f8e1dd8f7c7afefc98e4f8be185e2af8c048827 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 1 Nov 2014 03:26:50 +0500 Subject: Code cleanup: Remove unused functions from implicit.c Most of the unused functions were removed. Some of them were if-defed because they are referenced from the code which was already if-defed. Reviewers: lukastoenne, campbellbarton Differential Revision: https://developer.blender.org/D868 --- source/blender/blenkernel/intern/implicit.c | 204 +--------------------------- 1 file changed, 3 insertions(+), 201 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 4cf9d52989f..9a8c32c4393 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -144,14 +144,6 @@ DO_INLINE void mul_fvector_S(float to[3], float from[3], float scalar) to[1] = from[1] * scalar; to[2] = from[2] * scalar; } -/* simple cross product */ -/* STATUS: verified */ -DO_INLINE void cross_fvector(float to[3], float vectorA[3], float vectorB[3]) -{ - to[0] = vectorA[1] * vectorB[2] - vectorA[2] * vectorB[1]; - to[1] = vectorA[2] * vectorB[0] - vectorA[0] * vectorB[2]; - to[2] = vectorA[0] * vectorB[1] - vectorA[1] * vectorB[0]; -} /* simple v^T * v product ("outer product") */ /* STATUS: HAS TO BE verified (*should* work) */ DO_INLINE void mul_fvectorT_fvector(float to[3][3], float vectorA[3], float vectorB[3]) @@ -337,6 +329,7 @@ DO_INLINE void initdiag_fmatrixS(float to[3][3], float aS) to[2][2] = aS; } +#if 0 /* calculate determinant of 3x3 matrix */ DO_INLINE float det_fmatrix(float m[3][3]) { @@ -371,6 +364,7 @@ DO_INLINE void inverse_fmatrix(float to[3][3], float from[3][3]) } } +#endif /* 3x3 matrix multiplied by a scalar */ /* STATUS: verified */ @@ -398,14 +392,6 @@ DO_INLINE void mul_fmatrix_fvector(float *to, float matrix[3][3], float from[3]) to[1] = dot_v3v3(matrix[1], from); to[2] = dot_v3v3(matrix[2], from); } -/* 3x3 matrix multiplied by a 3x3 matrix */ -/* STATUS: verified */ -DO_INLINE void mul_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3]) -{ - mul_fvector_fmatrix(to[0], matrixA[0], matrixB); - mul_fvector_fmatrix(to[1], matrixA[1], matrixB); - mul_fvector_fmatrix(to[2], matrixA[2], matrixB); -} /* 3x3 matrix addition with 3x3 matrix */ DO_INLINE void add_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3]) { @@ -413,27 +399,6 @@ DO_INLINE void add_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float ma VECADD(to[1], matrixA[1], matrixB[1]); VECADD(to[2], matrixA[2], matrixB[2]); } -/* 3x3 matrix add-addition with 3x3 matrix */ -DO_INLINE void addadd_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3]) -{ - VECADDADD(to[0], matrixA[0], matrixB[0]); - VECADDADD(to[1], matrixA[1], matrixB[1]); - VECADDADD(to[2], matrixA[2], matrixB[2]); -} -/* 3x3 matrix sub-addition with 3x3 matrix */ -DO_INLINE void addsub_fmatrixS_fmatrixS(float to[3][3], float matrixA[3][3], float aS, float matrixB[3][3], float bS) -{ - VECADDSUBSS(to[0], matrixA[0], aS, matrixB[0], bS); - VECADDSUBSS(to[1], matrixA[1], aS, matrixB[1], bS); - VECADDSUBSS(to[2], matrixA[2], aS, matrixB[2], bS); -} -/* A -= B + C (3x3 matrix sub-addition with 3x3 matrix) */ -DO_INLINE void subadd_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3]) -{ - VECSUBADD(to[0], matrixA[0], matrixB[0]); - VECSUBADD(to[1], matrixA[1], matrixB[1]); - VECSUBADD(to[2], matrixA[2], matrixB[2]); -} /* A -= B*x + C*y (3x3 matrix sub-addition with 3x3 matrix) */ DO_INLINE void subadd_fmatrixS_fmatrixS(float to[3][3], float matrixA[3][3], float aS, float matrixB[3][3], float bS) { @@ -448,44 +413,9 @@ DO_INLINE void sub_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float ma sub_v3_v3v3(to[1], matrixA[1], matrixB[1]); sub_v3_v3v3(to[2], matrixA[2], matrixB[2]); } -/* A += B - C (3x3 matrix add-subtraction with 3x3 matrix) */ -DO_INLINE void addsub_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3]) -{ - VECADDSUB(to[0], matrixA[0], matrixB[0]); - VECADDSUB(to[1], matrixA[1], matrixB[1]); - VECADDSUB(to[2], matrixA[2], matrixB[2]); -} ///////////////////////////////////////////////////////////////// // special functions ///////////////////////////////////////////////////////////////// -/* a vector multiplied and added to/by a 3x3 matrix */ -DO_INLINE void muladd_fvector_fmatrix(float to[3], float from[3], float matrix[3][3]) -{ - to[0] += matrix[0][0]*from[0] + matrix[1][0]*from[1] + matrix[2][0]*from[2]; - to[1] += matrix[0][1]*from[0] + matrix[1][1]*from[1] + matrix[2][1]*from[2]; - to[2] += matrix[0][2]*from[0] + matrix[1][2]*from[1] + matrix[2][2]*from[2]; -} -/* 3x3 matrix multiplied and added to/by a 3x3 matrix and added to another 3x3 matrix */ -DO_INLINE void muladd_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3]) -{ - muladd_fvector_fmatrix(to[0], matrixA[0], matrixB); - muladd_fvector_fmatrix(to[1], matrixA[1], matrixB); - muladd_fvector_fmatrix(to[2], matrixA[2], matrixB); -} -/* a vector multiplied and sub'd to/by a 3x3 matrix */ -DO_INLINE void mulsub_fvector_fmatrix(float to[3], float from[3], float matrix[3][3]) -{ - to[0] -= matrix[0][0]*from[0] + matrix[1][0]*from[1] + matrix[2][0]*from[2]; - to[1] -= matrix[0][1]*from[0] + matrix[1][1]*from[1] + matrix[2][1]*from[2]; - to[2] -= matrix[0][2]*from[0] + matrix[1][2]*from[1] + matrix[2][2]*from[2]; -} -/* 3x3 matrix multiplied and sub'd to/by a 3x3 matrix and added to another 3x3 matrix */ -DO_INLINE void mulsub_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3]) -{ - mulsub_fvector_fmatrix(to[0], matrixA[0], matrixB); - mulsub_fvector_fmatrix(to[1], matrixA[1], matrixB); - mulsub_fvector_fmatrix(to[2], matrixA[2], matrixB); -} /* 3x3 matrix multiplied+added by a vector */ /* STATUS: verified */ DO_INLINE void muladd_fmatrix_fvector(float to[3], float matrix[3][3], float from[3]) @@ -494,13 +424,6 @@ DO_INLINE void muladd_fmatrix_fvector(float to[3], float matrix[3][3], float fro to[1] += dot_v3v3(matrix[1], from); to[2] += dot_v3v3(matrix[2], from); } -/* 3x3 matrix multiplied+sub'ed by a vector */ -DO_INLINE void mulsub_fmatrix_fvector(float to[3], float matrix[3][3], float from[3]) -{ - to[0] -= dot_v3v3(matrix[0], from); - to[1] -= dot_v3v3(matrix[1], from); - to[2] -= dot_v3v3(matrix[2], from); -} ///////////////////////////////////////////////////////////////// /////////////////////////// @@ -569,15 +492,6 @@ DO_INLINE void initdiag_bfmatrix(fmatrix3x3 *matrix, float m3[3][3]) } } -/* multiply big matrix with scalar*/ -DO_INLINE void mul_bfmatrix_S(fmatrix3x3 *matrix, float scalar) -{ - unsigned int i = 0; - for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++) { - mul_fmatrix_S(matrix[i].m, scalar); - } -} - /* SPARSE SYMMETRIC multiply big matrix with long vector*/ /* STATUS: verified */ DO_INLINE void mul_bfmatrix_lfvector( float (*to)[3], fmatrix3x3 *from, lfVector *fLongVector) @@ -610,83 +524,6 @@ DO_INLINE void mul_bfmatrix_lfvector( float (*to)[3], fmatrix3x3 *from, lfVector } -/* SPARSE SYMMETRIC multiply big matrix with long vector (for diagonal preconditioner) */ -/* STATUS: verified */ -DO_INLINE void mul_prevfmatrix_lfvector( float (*to)[3], fmatrix3x3 *from, lfVector *fLongVector) -{ - unsigned int i = 0; - - for (i = 0; i < from[0].vcount; i++) { - mul_fmatrix_fvector(to[from[i].r], from[i].m, fLongVector[from[i].c]); - } -} - -/* SPARSE SYMMETRIC add big matrix with big matrix: A = B + C*/ -DO_INLINE void add_bfmatrix_bfmatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) -{ - unsigned int i = 0; - - /* process diagonal elements */ - for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++) { - add_fmatrix_fmatrix(to[i].m, from[i].m, matrix[i].m); - } - -} -/* SPARSE SYMMETRIC add big matrix with big matrix: A += B + C */ -DO_INLINE void addadd_bfmatrix_bfmatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) -{ - unsigned int i = 0; - - /* process diagonal elements */ - for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++) { - addadd_fmatrix_fmatrix(to[i].m, from[i].m, matrix[i].m); - } - -} -/* SPARSE SYMMETRIC subadd big matrix with big matrix: A -= B + C */ -DO_INLINE void subadd_bfmatrix_bfmatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) -{ - unsigned int i = 0; - - /* process diagonal elements */ - for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++) { - subadd_fmatrix_fmatrix(to[i].m, from[i].m, matrix[i].m); - } - -} -/* A = B - C (SPARSE SYMMETRIC sub big matrix with big matrix) */ -DO_INLINE void sub_bfmatrix_bfmatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) -{ - unsigned int i = 0; - - /* process diagonal elements */ - for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++) { - sub_fmatrix_fmatrix(to[i].m, from[i].m, matrix[i].m); - } - -} -/* SPARSE SYMMETRIC sub big matrix with big matrix S (special constraint matrix with limited entries) */ -DO_INLINE void sub_bfmatrix_Smatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) -{ - unsigned int i = 0; - - /* process diagonal elements */ - for (i = 0; i < matrix[0].vcount; i++) { - sub_fmatrix_fmatrix(to[matrix[i].c].m, from[matrix[i].c].m, matrix[i].m); - } - -} -/* A += B - C (SPARSE SYMMETRIC addsub big matrix with big matrix) */ -DO_INLINE void addsub_bfmatrix_bfmatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) -{ - unsigned int i = 0; - - /* process diagonal elements */ - for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++) { - addsub_fmatrix_fmatrix(to[i].m, from[i].m, matrix[i].m); - } - -} /* SPARSE SYMMETRIC sub big matrix with big matrix*/ /* A -= B * float + C * float --> for big matrix */ /* VERIFIED */ @@ -958,6 +795,7 @@ static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z return conjgrad_loopcountclothObject; -- cgit v1.2.3