- Timestamp:
- Nov 4, 2005, 5:28:42 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_detection/lin_alg.h
r5449 r5488 5 5 compute the eigenpairs (eigenvalues and eigenvectors) of a real symmetric matrix "A" by the Jacobi method 6 6 */ 7 7 8 8 9 … … 22 23 * C++ version by J-P Moreau, Paris. * 23 24 ************************************************************/ 24 void JacobI(float **A,int N,float *D, float **V, int *NROT) { 25 void JacobI(float **A, float *D, float **V, int *NROT) { 26 27 int N = 3; 28 25 29 float *B, *Z; 26 30 double c=0.0f, g=0.0f, h=0.0f, s=0.0f, sm=0.0f, t=0.0f, tau=0.0f, theta=0.0f, tresh=0.0f; … … 29 33 //allocate vectors B, Z 30 34 31 B = (float *) calloc(100, 32); 32 Z = (float *) calloc(100, 32); 33 34 for(ip=0; ip<3; ip++) { //initialize V to identity matrix 35 for (iq=0; iq<3; iq++) V[ip][iq]=0; 36 V[ip][ip]=1; 37 } 38 for (ip=1; ip<=N; ip++) { 39 B[ip]=A[ip][ip]; 40 D[ip]=B[ip]; 41 Z[ip]=0; 42 } 43 *NROT=0; 44 for (i=1; i<=50; i++) { 45 sm=0; 46 for (ip=0; ip<2; ip++) //sum off-diagonal elements 47 for (iq=ip+1; iq<3; iq++) 35 //B = (float *) calloc(100, 32); 36 //Z = (float *) calloc(100, 32); 37 B = new float[N]; 38 Z = new float[N]; 39 40 41 for( ip = 0; ip < 3; ip++) { //initialize V to identity matrix 42 for( iq = 0; iq < 3; iq++) 43 V[ip][iq] = 0.0f; 44 V[ip][ip] = 1.0f; 45 } 46 for( ip = 1; ip <= N; ip++) { 47 B[ip] = A[ip][ip]; 48 D[ip] = B[ip]; 49 Z[ip] = 0; 50 } 51 52 *NROT = 0; 53 // make maximaly 50 iterations 54 for( i = 1; i <= 50; i++) { 55 sm = 0; 56 57 for( ip = 0; ip < 2; ip++) //sum off-diagonal elements 58 for( iq = ip + 1; iq < 3; iq++) 48 59 sm=sm+fabs(A[ip][iq]); 49 if (sm==0) 60 61 if(sm == 0) 50 62 { 51 63 free(B); -
trunk/src/lib/collision_detection/obb_tree_node.cc
r5487 r5488 386 386 387 387 /* new jacobi tests */ 388 JacobI(OBBTreeNode::coMat, 3,OBBTreeNode::eigvlMat, OBBTreeNode::eigvMat, OBBTreeNode::rotCount);388 JacobI(OBBTreeNode::coMat, OBBTreeNode::eigvlMat, OBBTreeNode::eigvMat, OBBTreeNode::rotCount); 389 389 PRINTF(3)("-- Done Jacobi Decomposition\n"); 390 390 -
trunk/src/orxonox.cc
r5480 r5488 242 242 EventHandler::getInstance()->subscribe(GraphicsEngine::getInstance(), ES_ALL, EV_VIDEO_RESIZE); 243 243 244 245 244 return 0; 246 245 } … … 268 267 PRINT(3)("initializing ResourceManager\n"); 269 268 269 // init the resource manager 270 270 const char* dataPath; 271 271 if ((dataPath = this->iniParser->getVar(CONFIG_NAME_DATADIR, CONFIG_SECTION_DATA))!= NULL) … … 296 296 delete[] imageDir; 297 297 298 // start the collision detection engine 298 299 CDEngine::getInstance(); 299 300 return 0; … … 429 430 Orxonox *orx = Orxonox::getInstance(); 430 431 431 if( (*orx).init(argc, argv) == -1)432 if(orx->init(argc, argv) == -1) 432 433 { 433 434 PRINTF(1)("! Orxonox initialization failed\n");
Note: See TracChangeset
for help on using the changeset viewer.