example.cpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. int main(){}
  2. //#include <igl/svd.h>
  3. //#include <cstdlib>
  4. //#include <Accelerate/Accelerate.h>
  5. //#include <cstdio>
  6. //
  7. ///* Auxiliary routines prototypes */
  8. //extern void print_matrix( char* desc, int m, int n, double* a, int lda );
  9. //
  10. ///* Parameters */
  11. //
  12. //void print3x3(const char * s, double * a)
  13. //{
  14. // printf("%s =\n",s);
  15. // for(int i = 0;i<3;i++)
  16. // {
  17. // for(int j = 0;j<3;j++)
  18. // {
  19. // printf("%g ",a[j*3+i]);
  20. // }
  21. // printf("\n");
  22. // }
  23. // printf("\n");
  24. //}
  25. //
  26. //int main(int argc, char * argv[])
  27. //{
  28. // //// List of rest positions
  29. // //// (0,1)
  30. // //// / \
  31. // //// / \
  32. // //// / \
  33. // //// / \
  34. // //// (-1,0)-----(1,0)
  35. // ////
  36. // //double rest[3][3] = {
  37. // // {-1,0,0},
  38. // // {1,0,0},
  39. // // {0,1,0}};
  40. // //// List of pose positions
  41. // ////
  42. // //// (0,1)
  43. // //// | \
  44. // //// | \
  45. // //// | (1,0)
  46. // //// | /
  47. // //// | /
  48. // //// (0,-1)
  49. // //double pose[3][3] = {
  50. // // {0,1,0},
  51. // // {0,-1,0},
  52. // // {1,0,0}};
  53. // //// Compute covariance matrix C
  54. // //double C[3*3];
  55. // //// Initialize to zero
  56. // //for(int i = 0;i<3*3;i++)
  57. // //{
  58. // // C[i] = 0;
  59. // //}
  60. //
  61. // //// Loop over vertices
  62. // //for(int i = 0;i<3;i++)
  63. // //{
  64. // // // Compute outer product rest[i] * pose[i]
  65. // // // Loop over coordinates
  66. // // for(int j = 0;j<3;j++)
  67. // // {
  68. // // // Loop over coordinates
  69. // // for(int k = 0;k<3;k++)
  70. // // {
  71. // // C[k*3+j] = rest[i][j] * pose[i][k];
  72. // // }
  73. // // }
  74. // //}
  75. // //print3x3("C",C);
  76. //
  77. //
  78. // //
  79. // //double C[3*3] = {8,3,4,1,5,9,6,7,2};
  80. // double C[3*3] = {5242.55,3364,-0,-8170.15,-5242.56,0,-0,-0,0};
  81. // double u[3*3],s[3],vt[3*3];
  82. // print3x3("C",C);
  83. // // Compute SVD of C
  84. // igl::svd3x3(C,u,s,vt);
  85. // print3x3("u",u);
  86. // print3x3("vt",vt);
  87. //
  88. // // Compute R = u*vt
  89. // double R[3*3];
  90. // const double _3 = 3;
  91. // const double _1 = 1;
  92. // cblas_dgemm(CblasColMajor, CblasNoTrans,CblasNoTrans,3,3,3,1,u,3,vt,3,1,R,3);
  93. // print3x3("RT (transposed to be row-major)",R);
  94. //
  95. //
  96. // return 0;
  97. //}