(defun l-sort ( L / L1 LL)
(defun foo1 (a b)
(cond ((<= (car a) (car b))
)
(T
nil)
)
)
(setq li (vl-sort-i l 'foo1))
(while Li
(setq LL (cons (nth (car Li) L) LL))
(setq Li (cdr Li))
)
(reverse LL)
)
(defun xd::list:position-fuzz (e l fuzz)
(if (atom e)
(vl-position
(xd::list:car-member-if '(lambda (x) (equal e x fuzz)) l)
l
)
(vl-position e l)
)
)
(defun findterm ( l1 l2 a / n m ll sn fu yn ni mi snlst )
(cond ((and (= (length l1) 1) (= (length l2) 1))
nil)
((= a 0)
nil)
(T
(setq n (length l1))
(setq m (length l2))
(setq ll l1)
(setq sn (fix (/ 60 (length l2))))
(if (<= sn 4) (setq sn 4))
(setq sn 4)
(setq fu (/ a sn 1.0))
(setq yn T)
(setq snlst (crlst5 sn))
(while (and yn snlst)
(setq ll l1)
(while (and ll yn)
(if (xd::list:position-fuzz (+ (car ll) (* fu (car snlst))) l2 (* fu 0.9))
(progn
(setq ni (- n (length ll)))
(setq mi (xd::list:position-fuzz (+ (car ll) (* fu (car snlst))) l2 (* fu 0.9)))
(setq yn nil)
)
)
(setq ll (cdr ll))
)
(setq snlst (cdr snlst))
)
(if yn
nil
(list ni mi)
)
)
)
)
(defun changeterm ( l1 l2 a / n m ll sn fu yn l1_new l2_new snlst )
(cond ((and (= (length l1) 1) (= (length l2) 1))
nil)
((= a 0)
nil)
(T
(setq n (length l1))
(setq m (length l2))
(setq ll l1)
(setq sn (fix (/ 60 (length l2))))
(if (<= sn 4) (setq sn 4))
(setq sn 4)
(setq fu (/ a sn 1.0))
(setq yn T)
(setq snlst (crlst5 sn))
(while (and yn snlst)
(setq ll l1)
(while (and ll yn)
(if (setq ls_z (findr_fu_k (+ (car ll) (* fu (car snlst)))
l2
(* fu 0.9)
))
(progn
)
(defun createlst1 ( n / ll)
(repeat n (setq ll (cons (list 0 nil) ll)))
)
(defun createlst2 ( n / ll)
(repeat n (setq ll (cons (list 0 "" nil nil) ll)))
)
(defun createlst3 ( r n m / ll su a)
(setq r (* r 1.0))
(repeat n
(setq ll (cons (XD::math:rand 1 m) ll))
)
(setq su (apply '+ ll))
(setq a (/ r su))
(setq ll (mapcar '(lambda (x) (* x a)) ll))
)
(defun createlst4 ( r n m / ll )
(repeat n
(setq ll (append (createlst3 r (XD::math:rand 4 30) m) ll))
)
)
(defun crlst5 ( i / n ll )
(setq n (* i 2))
(while (> n 0)
(setq ll (cons n ll))
(setq n (- n 1))
)
(setq ll (append (reverse (XD:ist:N-M ll 1 i)) (XD:ist:N-M ll (+ i 1) (- (length ll) 1))))
)
(defun findtwo ( r lst / lst2 lstsu ll i lstr )
(setq lst2 (apply 'mapcar (cons 'list (list lst (cdr lst)))))
(setq lstsu (mapcar '(lambda (x) (apply '+ x)) lst2))
(if (setq ll (member r lstsu))
(progn
(setq i (- (length lst) (length ll)))
(setq lstr (XD:ist:N-M lst i (+ i (- 2 1))))
)
nil
)
)
(defun findthr ( r lst / lst2 lstsu i ll lstr )