Changeset 455 for cpp/frams/model
- Timestamp:
- 12/05/15 18:31:38 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/similarity/SVD/matrix_tools.cpp
r389 r455 15 15 double *Create(int nSize) 16 16 { 17 double *matrix = (double *)malloc(nSize * sizeof(double));17 double *matrix = new double[nSize]; 18 18 19 19 for (int i = 0; i < nSize; i++) … … 40 40 41 41 if (delSize != 0) 42 free(toDel);42 delete[] toDel; 43 43 return c; 44 44 } … … 71 71 72 72 if (delSize != 0) 73 free(toDel);73 delete[] toDel; 74 74 75 75 return m_Power; … … 170 170 B = Multiply(B, Z, nSize, nSize, nSize, B, nSize); 171 171 172 free(Ones);173 free(Eye);174 free(Z);175 free(D);172 delete[] Ones; 173 delete[] Eye; 174 delete[] Z; 175 delete[] D; 176 176 } 177 177 … … 186 186 double *W = Transpose(Vt, nSize, nSize); 187 187 188 free(B);189 free(Vt);188 delete[] B; 189 delete[] Vt; 190 190 191 191 for (int i = 0; i < nSize; i++) … … 202 202 sqS = Power(S, nSize, nSize, 0.5, S, nSize); 203 203 dCoordinates = Multiply(W, sqS, nSize, nSize, nSize, W, nSize); 204 free(sqS);204 delete[] sqS; 205 205 206 206 for (int i = 0; i < nSize; i++) … … 222 222 } 223 223 224 free(Eigenvalues);225 free(dCoordinates);226 } 224 delete[] Eigenvalues; 225 delete[] dCoordinates; 226 }
Note: See TracChangeset
for help on using the changeset viewer.