ソースを参照

Fix narrowing conversion warning in clang

Dhairya Malhotra 8 年 前
コミット
c65bf7e9d0
1 ファイル変更2 行追加2 行削除
  1. 2 2
      include/mat_utils.txx

+ 2 - 2
include/mat_utils.txx

@@ -365,7 +365,7 @@ namespace mat{
   inline void svd(char *JOBU, char *JOBVT, int *M, int *N, T *A, int *LDA,
       T *S, T *U, int *LDU, T *VT, int *LDVT, T *WORK, int *LWORK,
       int *INFO){
-    const size_t dim[2]={std::max(*N,*M), std::min(*N,*M)};
+    const size_t dim[2]={(size_t)std::max(*N,*M), (size_t)std::min(*N,*M)};
     T* U_=mem::aligned_new<T>(dim[0]*dim[0]); memset(U_, 0, dim[0]*dim[0]*sizeof(T));
     T* V_=mem::aligned_new<T>(dim[1]*dim[1]); memset(V_, 0, dim[1]*dim[1]*sizeof(T));
     T* S_=mem::aligned_new<T>(dim[0]*dim[1]);
@@ -428,7 +428,7 @@ namespace mat{
     mem::aligned_delete<T>(V_);
 
     if(0){ // Verify
-      const size_t dim[2]={std::max(*N,*M), std::min(*N,*M)};
+      const size_t dim[2]={(size_t)std::max(*N,*M), (size_t)std::min(*N,*M)};
       const size_t lda=*LDA;
       const size_t ldu=*LDU;
       const size_t ldv=*LDVT;