r3125: move routines
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 21 Oct 2002 02:23:46 +0000 (02:23 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 21 Oct 2002 02:23:46 +0000 (02:23 +0000)
parse-common.lisp
sql-create.lisp

index 6b170e61fc8473ffcc9b3457df094886e34ec1a8..8ba30e61bf9be0c4c52c68774fac2ed169372a92 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: parse-common.lisp,v 1.3 2002/10/18 03:57:39 kevin Exp $
+;;;; $Id: parse-common.lisp,v 1.4 2002/10/21 02:23:46 kevin Exp $
 ;;;;
 ;;;; This file, part of UMLisp, is
 ;;;;    Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
@@ -178,68 +178,3 @@ Currently, these are the LEX and NET files."
            (umls-file-fields file))))
 
 
-;;; Routines for analyzing cost of fixed size storage
-
-(defun umls-fixed-size-waste ()
-  "Display storage waste if using all fixed size storage"
-  (let ((totalwaste 0)
-       (totalunavoidable 0)
-       (totalavoidable 0)
-       (unavoidable '())
-       (avoidable '()))
-    (dolist (file *umls-files*)
-      (dolist (col (umls-file-colstructs file))
-       (let* ((avwaste (- (umls-col-max col) (umls-col-av col)))
-              (cwaste (* avwaste (umls-file-rws file))))
-         (unless (zerop cwaste)
-           (if (<= avwaste 6)
-               (progn
-                 (incf totalunavoidable cwaste)
-                 (setq unavoidable (append unavoidable (list (list (umls-file-fil file) (umls-col-col col) avwaste cwaste)))))
-             (progn
-                 (incf totalavoidable cwaste)
-                 (setq avoidable (append avoidable (list (list (umls-file-fil file) (umls-col-col col) avwaste cwaste))))))
-           (incf totalwaste cwaste)))))
-    (values totalwaste totalavoidable totalunavoidable avoidable unavoidable)))
-
-(defun display-waste ()
-  (unless *umls-files*
-    (init-umls))
-  (multiple-value-bind (tw ta tu al ul) (umls-fixed-size-waste)
-    (format t "Total waste: ~d~%" tw)
-    (format t "Total avoidable: ~d~%" ta)
-    (format t "Total unavoidable: ~d~%" tu)
-    (format t "Avoidable:~%")
-    (dolist (w al)
-      (format t "  (~a,~a): ~a,~a~%" (car w) (cadr w) (caddr w) (cadddr w)))
-    (format t "Unavoidable:~%")
-    (dolist (w ul)
-      (format t "  (~a,~a): ~a,~a~%" (car w) (cadr w) (caddr w) (cadddr w)))
-  ))
-
-(defun max-umls-field ()
-  "Return length of longest field"
-  (unless *umls-files*
-    (init-umls))
-  (let ((max 0))
-    (declare (fixnum max))
-    (dolist (col *umls-cols*)
-      (when (> (umls-col-max col) max)
-       (setq max (umls-col-max col))))
-    max))
-
-(defun max-umls-row ()
-  "Return length of longest row"
-  (if t
-      6000  ;;; hack to use on systems without MRCOLS/MRFILES -- ok for UMLS2001
-    (progn
-      (unless *umls-files*
-       (init-umls))
-      (let ((rowsizes '()))
-       (dolist (file *umls-files*)
-         (let ((row 0)
-               (fields (umls-file-colstructs file)))
-           (dolist (field fields)
-             (incf row (1+ (umls-col-max field))))
-           (push row rowsizes)))
-       (car (sort rowsizes #'>))))))
index 73605a9f285c7db454aece139825fb72272bf0d2..f97b5f5de5ba68f670890402af51dd7f2a960313 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: sql-create.lisp,v 1.1 2002/10/18 03:57:39 kevin Exp $
+;;;; $Id: sql-create.lisp,v 1.2 2002/10/21 02:23:46 kevin Exp $
 ;;;;
 ;;;; This file, part of UMLisp, is
 ;;;;    Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
@@ -259,6 +259,9 @@ This is much faster that using create-umls-db-insert."
    (custom-col-values (custom-colstructs-for-file file) line "|" nil))))
    
 
+;;; Routines for analyzing cost of fixed size storage
+
+
 (defun umls-fixed-size-waste ()
   "Display storage waste if using all fixed size storage"
   (let ((totalwaste 0)