소스 검색

cif2bcif tweak

David Sehnal 6 년 전
부모
커밋
2c50dc76ba
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/apps/cif2bcif/field-classifier.ts

+ 3 - 0
src/apps/cif2bcif/field-classifier.ts

@@ -146,6 +146,9 @@ namespace FloatClassifier {
     }
 
     export function classify(data: number[], name: string) {
+        // if a vector/matrix, do not reduce precision
+        if (name.indexOf('[') > 0) return { encoder: E.by(E.byteArray), typedArray: Float64Array };
+
         let dc = 10;
         for (let i = 0, n = data.length; i < n; i++) dc = Math.max(dc, digitCount(data[i]));