Changeset 5489 in orxonox.OLD for trunk/src/lib/collision_detection
- Timestamp:
- Nov 4, 2005, 5:34:51 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_detection/lin_alg.h
r5488 r5489 35 35 //B = (float *) calloc(100, 32); 36 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 matrix42 for( iq = 0; iq < 3; iq++)37 B = new float[N+1]; 38 Z = new float[N+1]; 39 40 // initialize V to identity matrix 41 for( ip = 0; ip < N; ip++) { 42 for( iq = 0; iq < N; iq++) 43 43 V[ip][iq] = 0.0f; 44 44 V[ip][ip] = 1.0f; 45 45 } 46 for( ip = 1; ip <= N; ip++) { 46 // initialize B,D to the diagonal of A 47 for( ip = 0; ip < N; ip++) { 47 48 B[ip] = A[ip][ip]; 48 49 D[ip] = B[ip]; 49 Z[ip] = 0 ;50 Z[ip] = 0.0f; 50 51 } 51 52 … … 61 62 if(sm == 0) 62 63 { 63 free(B); 64 free(Z); 64 //free(B); 65 //free(Z); 66 delete[] B; 67 delete[] Z; 65 68 return; //normal return 66 69 } … … 125 128 } //end of main i loop 126 129 // printf("\n 50 iterations !\n"); 127 free(B); 128 free(Z); 130 //free(B); 131 //free(Z); 132 delete[] B; 133 delete[] Z; 129 134 return; //too many iterations 130 135 }
Note: See TracChangeset
for help on using the changeset viewer.