'(
("1-1" "1-2" "1-3" "1-4" "1-5" "1-6" "1-7")
("2-1" "2-2" "2-3" "2-4" "2-5" "2-6" "2-7")
("3-1" "3-2" "3-3" "3-4" "3-5" "3-6" "3-7")
("4-1" "4-2" "4-3" "4-4" "4-5" "4-6" "4-7")
)
'(
("1-1" "1-2" "2-1" "2-2")
("1-2" "1-3" "2-2" "2-3")
("1-3" "1-4" "2-3" "2-4")
("1-4" "1-5" "2-4" "2-5")
("1-5" "1-6" "2-5" "2-6")
("1-6" "1-7" "2-6" "2-7")
("2-1" "2-2" "3-1" "3-2")
("2-2" "2-3" "3-2" "3-3")
("2-3" "2-4" "3-3" "3-4")
("2-4" "2-5" "3-4" "3-5")
("2-5" "2-6" "3-5" "3-6")
("2-6" "2-7" "3-6" "3-7")
("3-1" "3-2" "4-1" "4-2")
("3-2" "3-3" "4-2" "4-3")
("3-3" "3-4" "4-3" "4-4")
("3-4" "3-5" "4-4" "4-5")
("3-5" "3-6" "4-5" "4-6")
("3-6" "3-7" "4-6" "4-7")
)
(defun subfoo ( lst / r a b c d )
(repeat (1- (length lst))
(repeat (1- (length (car (mapcar 'set '(a b) lst))))
(setq r (cons (append (mapcar 'set '(c d) a) (mapcar 'set '(c d) b)) r))
(mapcar 'set '(a b) (mapcar 'cdr (list a b)))
)
(setq lst (cdr lst))
)
(reverse r)
)
(defun c:recunfoldmatrix ( / matrix-n-m rec n m )
(defun matrix-n-m ( n m / nn mm itm row mat )
(setq nn 0)
(repeat n
(setq nn (1+ nn) mm 0)
(repeat m
(setq mm (1+ mm))
(setq itm (strcat (itoa nn) "-" (itoa mm)))
(setq row (cons itm row))
)
(setq mat (cons (reverse row) mat) row nil)
)
(reverse mat)
)
(defun rec ( mat / k itm1 itm2 kk lst )
(setq k -1)
(repeat (length mat)
(setq k (1+ k))
(setq itm1
(vl-remove-if-not '(lambda ( x ) (= (length x) 2))
(mapcar '(lambda ( x ) (setq kk (if (null kk) 2 (1+ kk))) (vl-remove-if-not '(lambda ( y ) (< (- kk 3) (vl-position y (nth k mat)) kk)) (nth k mat))) (nth k mat))
)
)
(setq kk nil)
(setq itm2
(vl-remove-if-not '(lambda ( x ) (= (length x) 2))
(mapcar '(lambda ( x ) (setq kk (if (null kk) 2 (1+ kk))) (vl-remove-if-not '(lambda ( y ) (< (- kk 3) (vl-position y (nth (1+ k) mat)) kk)) (nth (1+ k) mat))) (nth (1+ k) mat))
)
)
(setq kk nil)
(setq itm (mapcar '(lambda ( a b ) (append a b)) itm1 itm2))
(setq lst (cons itm lst))
)
(apply 'append (reverse lst))
)
(initget 7)
(setq n (getint "\nSpecify number of rows of matrix : "))
(initget 7)
(setq m (getint "\nSpecify number of columns of matrix : "))
(princ "\n")
(prin1 (rec (matrix-n-m n m)))
(princ)
)
;|
Command: RECUNFOLDMATRIX
Specify number of rows of matrix : 4
Specify number of columns of matrix : 7
(("1-1" "1-2" "2-1" "2-2") ("1-2" "1-3" "2-2" "2-3") ("1-3" "1-4" "2-3" "2-4") ("1-4" "1-5" "2-4" "2-5") ("1-5" "1-6" "2-5" "2-6") ("1-6" "1-7" "2-6" "2-7") ("2-1" "2-2" "3-1" "3-2") ("2-2" "2-3" "3-2" "3-3") ("2-3" "2-4" "3-3" "3-4") ("2-4" "2-5" "3-4" "3-5") ("2-5" "2-6" "3-5" "3-6") ("2-6" "2-7" "3-6" "3-7") ("3-1" "3-2" "4-1" "4-2") ("3-2" "3-3" "4-2" "4-3") ("3-3" "3-4" "4-3" "4-4") ("3-4" "3-5" "4-4" "4-5") ("3-5" "3-6" "4-5" "4-6") ("3-6" "3-7" "4-6" "4-7"))
|;
(defun f (lst)
(setq lst (mapcar (function (lambda (e) (mapcar 'list e (cdr e)))) lst))
(apply 'append (mapcar (function (lambda (e1 e2) (mapcar 'append e1 e2))) lst (cdr lst)))
)
especially given it's a Friday afternoon (in the Americas)and even more especially it's half past midnight in Ukraine
omg what am i doing here :)
nerdosis terminosiswow, google just returned nil :wideeyed2:
(defun foo (a)
(list
(car a)
(cadr a)
)
)
(defun rec (w / y)
(if (cdadr w)
(progn
(Setq y (foo w)
z (cons (mapcar 'foo y)
z
)
)
(rec (mapcar 'cdr y))
(rec (cdr w))
)
)
)
(defun rec2 (x / z)
(rec x)
(reverse
(mapcar '(lambda (x)
(apply 'append x)
)
z
)
)
)
(rec2 '(
("1-1" "1-2" "1-3" "1-4" "1-5" "1-6" "1-7")
("2-1" "2-2" "2-3" "2-4" "2-5" "2-6" "2-7")
("3-1" "3-2" "3-3" "3-4" "3-5" "3-6" "3-7")
("4-1" "4-2" "4-3" "4-4" "4-5" "4-6" "4-7")
)
)
Benchmarking ..................Elapsed milliseconds / relative speed for 32768 iteration(s):
(SQUARE L).......1921 / 8.52 <fastest>
(_RJPFOO L)......2094 / 7.81
(F_BRUNO L)......2984 / 5.48
(F L)............3141 / 5.21
(REC2 L)........13516 / 1.21
(SUBFOO L)......16359 / 1.00 <slowest>
... OP haven't replied in any way saying thanks or something equal to anyone participated... I don't know are replies useful to him, but IMHO not reacting to request proposed in first post is humiliating behaviour for all that wanted to contribute ...
Benchmarksbenchmarking is tricky :angel:
_$ (benchmark '((subfoo lst) (_rjpfoo lst) (f lst) (square lst) (fbru lst) (recrib lst)))
Benchmarking ..................Elapsed milliseconds / relative speed for 32768 iteration(s):
(SQUARE LST)........1701 / 78.48 <fastest>
(_RJPFOO LST).......2121 / 62.94
(FBRU LST)..........2356 / 56.66
(F LST).............2465 / 54.15
(SUBFOO LST)........9703 / 13.76
(RECRIB LST)......133491 / 1 <slowest>
Command: (load "D:\\Temp\\tmp1.lsp")
Elapsed milliseconds / relative speed for 32768 iteration(s):
(_RJPFOO LST).......1763 / 67.88 <fastest>
(SQUARE LST)........2247 / 53.26
(FBRU LST)..........3510 / 34.09
(F LST).............3807 / 31.43
(SUBFOO LST).......18876 / 6.34
(RECRIB LST)......119668 / 1 <slowest>
Command: (load "D:\\Temp\\tmp1.fas")
Elapsed milliseconds / relative speed for 32768 iteration(s):
(_RJPFOO LST).......1077 / 125.05 <fastest>
(FBRU LST)..........3495 / 38.53
(F LST).............3807 / 35.38
(SQUARE LST)........3807 / 35.38
(SUBFOO LST).......18564 / 7.25
(RECRIB LST)......134676 / 1 <slowest>
That it is :) ... I like your numbers better :2funny:Benchmarksbenchmarking is tricky :angel:
loaded from VLIDECode: [Select]_$ (benchmark '((subfoo lst) (_rjpfoo lst) (f lst) (square lst) (fbru lst) (recrib lst)))
Benchmarking ..................Elapsed milliseconds / relative speed for 32768 iteration(s):
(SQUARE LST)........1701 / 78.48 <fastest>
(_RJPFOO LST).......2121 / 62.94
(FBRU LST)..........2356 / 56.66
(F LST).............2465 / 54.15
(SUBFOO LST)........9703 / 13.76
(RECRIB LST)......133491 / 1 <slowest>
LSP loaded from Autocad command lineCode: [Select]Command: (load "D:\\Temp\\tmp1.lsp")
Elapsed milliseconds / relative speed for 32768 iteration(s):
(_RJPFOO LST).......1763 / 67.88 <fastest>
(SQUARE LST)........2247 / 53.26
(FBRU LST)..........3510 / 34.09
(F LST).............3807 / 31.43
(SUBFOO LST).......18876 / 6.34
(RECRIB LST)......119668 / 1 <slowest>
FAS loaded from Autocad command lineCode: [Select]Command: (load "D:\\Temp\\tmp1.fas")
Elapsed milliseconds / relative speed for 32768 iteration(s):
(_RJPFOO LST).......1077 / 125.05 <fastest>
(FBRU LST)..........3495 / 38.53
(F LST).............3807 / 35.38
(SQUARE LST)........3807 / 35.38
(SUBFOO LST).......18564 / 7.25
(RECRIB LST)......134676 / 1 <slowest>
(defun map2sqr (map / squares)
(mapcar
'(lambda (m1 m2)
(mapcar
'(lambda (c1 c2 c3 c4)
(setq squares (cons (list c1 c2 c3 c4) squares))
);lambda
m1
(cdr m1)
m2
(cdr m2)
);mapcar
);lambda
map
(cdr map)
);mapcar
(reverse squares)
);defun
Just to prove that benchmark for this task is wrong idea, here are results on my PC. :Marko, can you repeat the test without (prin1 ) ?
Benchmark.lsp | © 2005 Michael Puckett | All Rights Reserved
BricsCAD V20
Elapsed milliseconds / relative speed for 524288 iteration(s):
(BRUNO_F MLIST)......1109 / 49.51 <fastest>
(SQUARE MLIST).......1359 / 40.4
(VOVKA_F MLIST)......1812 / 30.3
(_RJPFOO MLIST)......1828 / 30.04
(MAP2SQR MLIST)......2469 / 22.24
(SUBFOO MLIST).......5984 / 9.18
(REC2 MLIST)........12266 / 4.48
(MR_REC MLIST)......54906 / 1 <slowest>
Elapsed milliseconds / relative speed for 524288 iteration(s):
(BRUNO_F MLIST).....1313 / 2.04 <fastest>
(SQUARE MLIST)......1359 / 1.97
(_RJPFOO MLIST).....2000 / 1.34
(VOVKA_F MLIST).....2078 / 1.29
(MAP2SQR MLIST).....2672 / 1 <slowest>
Elapsed milliseconds / relative speed for 524288 iteration(s):
(BRUNO_F MLIST).....1109 / 1.65 <fastest>
(SQUARE MLIST)......1140 / 1.6
(VOVKA_F MLIST).....1812 / 1.01
(_RJPFOO MLIST).....1828 / 1 <slowest>
Elapsed milliseconds / relative speed for 524288 iteration(s):
(BRUNO_F MLIST).....1266 / 1.06 <fastest>
(SQUARE MLIST)......1344 / 1 <slowest>
AutoCAD 2013
Elapsed milliseconds / relative speed for 32768 iteration(s):
(_RJPFOO MLIST)......2438 / 31.63 <fastest>
(BRUNO_F MLIST)......2766 / 27.88
(MAP2SQR MLIST)......3031 / 25.45
(SQUARE MLIST).......3859 / 19.99
(VOVKA_F MLIST)......7312 / 10.55
(REC2 MLIST)........28984 / 2.66
(SUBFOO MLIST)......34016 / 2.27
(MR_REC MLIST)......77125 / 1 <slowest>
Elapsed milliseconds / relative speed for 32768 iteration(s):
(_RJPFOO MLIST).....1125 / 2.35 <fastest>
(BRUNO_F MLIST).....1219 / 2.17
(MAP2SQR MLIST).....1468 / 1.8
(SQUARE MLIST)......1469 / 1.8
(VOVKA_F MLIST).....2641 / 1 <slowest>
Elapsed milliseconds / relative speed for 32768 iteration(s):
(_RJPFOO MLIST).....1047 / 1.39 <fastest>
(BRUNO_F MLIST).....1203 / 1.21
(SQUARE MLIST)......1422 / 1.02
(MAP2SQR MLIST).....1453 / 1 <slowest>
Elapsed milliseconds / relative speed for 32768 iteration(s):
(_RJPFOO MLIST).....1094 / 1.2 <fastest>
(BRUNO_F MLIST).....1313 / 1 <slowest>
Just to prove that benchmark for this task is wrong idea, here are results on my PC. :Code - Auto/Visual Lisp: [Select]
(repeat n (repeat m ) ) ) (setq itm1 ) ) (setq itm2 ) ) ) ) ) ;| Command: RECUNFOLDMATRIX Specify number of rows of matrix : 50 Specify number of columns of matrix : 50 (("1-1" "1-2" "2-1" "2-2") ("1-2" "1-3" "2-2" "2-3") ("1-3" "1-4" "2-3" "2-4") ("1-4" "1-5" "2-4" "2-5") ("1-5" "1-6" "2-5" "2-6") ("1-6" "1-7" "2-6" "2-7") ("1-7" "1-8" "2-7" "2-8") ("1-8" "1-9" "2-8" "2-9") ("1-9" "1-10" "2-9" "2-10") ("1-10" "1-11" "2-10" "2-11") ("1-11" "1-12" "2-11" "2-12") ("1-12" "1-13" "2-12" "2-13") ("1-13" "1-14" "2-13" "2-14") ("1-14" "1-15" "2-14" "2-15") ("1-15" "1-16" "2-15" "2-16") ("1-16" "1-17" "2-16" "2-17") ("1-17" "1-18" "2-17" "2-18") ("1-18" "1-19" "2-18" "2-19") ("1-19" "1-20" "2-19" "2-20") ("1-20" "1-21" "2-20" "2-21") ("1-21" "1-22" "2-21" "2-22") ("1-22" "1-23" "2-22" "2-23") ("1-23" "1-24" "2-23" "2-24") ("1-24" "1-25" "2-24" "2-25") ("1-25" "1-26" "2-25" "2-26") ("1-26" "1-27" "2-26" "2-27") ("1-27" "1-28" "2-27" "2-28") ("1-28" "1-29" "2-28" "2-29") ("1-29" "1-30" "2-29" "2-30") ("1-30" "1-31" "2-30" "2-31") ("1-31" "1-32" "2-31" "2-32") ("1-32" "1-33" "2-32" "2-33") ("1-33" "1-34" "2-33" "2-34") ("1-34" "1-35" "2-34" "2-35") ("1-35" "1-36" "2-35" "2-36") ("1-36" "1-37" "2-36" "2-37") ("1-37" "1-38" "2-37" "2-38") ("1-38" "1-39" "2-38" "2-39") ("1-39" "1-40" "2-39" "2-40") ("1-40" "1-41" "2-40" "2-41") ("1-41" "1-42" "2-41" "2-42") ("1-42" "1-43" "2-42" "2-43") ("1-43" "1-44" "2-43" "2-44") ("1-44" "1-45" "2-44" "2-45") ("1-45" "1-46" "2-45" "2-46") ("1-46" "1-47" "2-46" "2-47") ("1-47" "1-48" "2-47" "2-48") ("1-48" "1-49" "2-48" "2-49") ("1-49" "1-50" "2-49" "2-50") ... ("49-1" "49-2" "50-1" "50-2") ("49-2" "49-3" "50-2" "50-3") ("49-3" "49-4" "50-3" "50-4") ("49-4" "49-5" "50-4" "50-5") ("49-5" "49-6" "50-5" "50-6") ("49-6" "49-7" "50-6" "50-7") ("49-7" "49-8" "50-7" "50-8") ("49-8" "49-9" "50-8" "50-9") ("49-9" "49-10" "50-9" "50-10") ("49-10" "49-11" "50-10" "50-11") ("49-11" "49-12" "50-11" "50-12") ("49-12" "49-13" "50-12" "50-13") ("49-13" "49-14" "50-13" "50-14") ("49-14" "49-15" "50-14" "50-15") ("49-15" "49-16" "50-15" "50-16") ("49-16" "49-17" "50-16" "50-17") ("49-17" "49-18" "50-17" "50-18") ("49-18" "49-19" "50-18" "50-19") ("49-19" "49-20" "50-19" "50-20") ("49-20" "49-21" "50-20" "50-21") ("49-21" "49-22" "50-21" "50-22") ("49-22" "49-23" "50-22" "50-23") ("49-23" "49-24" "50-23" "50-24") ("49-24" "49-25" "50-24" "50-25") ("49-25" "49-26" "50-25" "50-26") ("49-26" "49-27" "50-26" "50-27") ("49-27" "49-28" "50-27" "50-28") ("49-28" "49-29" "50-28" "50-29") ("49-29" "49-30" "50-29" "50-30") ("49-30" "49-31" "50-30" "50-31") ("49-31" "49-32" "50-31" "50-32") ("49-32" "49-33" "50-32" "50-33") ("49-33" "49-34" "50-33" "50-34") ("49-34" "49-35" "50-34" "50-35") ("49-35" "49-36" "50-35" "50-36 ") ("49-36" "49-37" "50-36" "50-37") ("49-37" "49-38" "50-37" "50-38") ("49-38" "49-39" "50-38" "50-39") ("49-39" "49-40" "50-39" "50-40") ("49-40" "49-41" "50-40" "50-41") ("49-41" "49-42" "50-41" "50-42") ("49-42" "49-43" "50-42" "50-43") ("49-43" "49-44" "50-43" "50-44") ("49-44" "49-45" "50-44" "50-45") ("49-45" "49-46" "50-45" "50-46") ("49-46" "49-47" "50-46" "50-47") ("49-47" "49-48" "50-47" "50-48") ("49-48" "49-49" "50-48" "50-49") ("49-49" "49-50" "50-49" "50-50")) Elapsed time : 1328.000000000000 milliseconds... |; ;;; Second test : Elapsed time : 1438.000000000000 milliseconds... Code - Auto/Visual Lisp: [Select]
(repeat n (repeat m ) ) ) ) ) ) ) ) ) ;| Command: RJPFOOUNFOLDMATRIX Specify number of rows of matrix : 50 Specify number of columns of matrix : 50 (("1-1" "1-2" "2-1" "2-2") ("1-2" "1-3" "2-2" "2-3") ("1-3" "1-4" "2-3" "2-4") ("1-4" "1-5" "2-4" "2-5") ("1-5" "1-6" "2-5" "2-6") ("1-6" "1-7" "2-6" "2-7") ("1-7" "1-8" "2-7" "2-8") ("1-8" "1-9" "2-8" "2-9") ("1-9" "1-10" "2-9" "2-10") ("1-10" "1-11" "2-10" "2-11") ("1-11" "1-12" "2-11" "2-12") ("1-12" "1-13" "2-12" "2-13") ("1-13" "1-14" "2-13" "2-14") ("1-14" "1-15" "2-14" "2-15") ("1-15" "1-16" "2-15" "2-16") ("1-16" "1-17" "2-16" "2-17") ("1-17" "1-18" "2-17" "2-18") ("1-18" "1-19" "2-18" "2-19") ("1-19" "1-20" "2-19" "2-20") ("1-20" "1-21" "2-20" "2-21") ("1-21" "1-22" "2-21" "2-22") ("1-22" "1-23" "2-22" "2-23") ("1-23" "1-24" "2-23" "2-24") ("1-24" "1-25" "2-24" "2-25") ("1-25" "1-26" "2-25" "2-26") ("1-26" "1-27" "2-26" "2-27") ("1-27" "1-28" "2-27" "2-28") ("1-28" "1-29" "2-28" "2-29") ("1-29" "1-30" "2-29" "2-30") ("1-30" "1-31" "2-30" "2-31") ("1-31" "1-32" "2-31" "2-32") ("1-32" "1-33" "2-32" "2-33") ("1-33" "1-34" "2-33" "2-34") ("1-34" "1-35" "2-34" "2-35") ("1-35" "1-36" "2-35" "2-36") ("1-36" "1-37" "2-36" "2-37") ("1-37" "1-38" "2-37" "2-38") ("1-38" "1-39" "2-38" "2-39") ("1-39" "1-40" "2-39" "2-40") ("1-40" "1-41" "2-40" "2-41") ("1-41" "1-42" "2-41" "2-42") ("1-42" "1-43" "2-42" "2-43") ("1-43" "1-44" "2-43" "2-44") ("1-44" "1-45" "2-44" "2-45") ("1-45" "1-46" "2-45" "2-46") ("1-46" "1-47" "2-46" "2-47") ("1-47" "1-48" "2-47" "2-48") ("1-48" "1-49" "2-48" "2-49") ("1-49" "1-50" "2-49" "2-50") ... ("49-1" "49-2" "50-1" "50-2") ("49-2" "49-3" "50-2" "50-3") ("49-3" "49-4" "50-3" "50-4") ("49-4" "49-5" "50-4" "50-5") ("49-5" "49-6" "50-5" "50-6") ("49-6" "49-7" "50-6" "50-7") ("49-7" "49-8" "50-7" "50-8") ("49-8" "49-9" "50-8" "50-9") ("49-9" "49-10" "50-9" "50-10") ("49-10" "49-11" "50-10" "50-11") ("49-11" "49-12" "50-11" "50-12") ("49-12" "49-13" "50-12" "50-13") ("49-13" "49-14" "50-13" "50-14") ("49-14" "49-15" "50-14" "50-15") ("49-15" "49-16" "50-15" "50-16") ("49-16" "49-17" "50-16" "50-17") ("49-17" "49-18" "50-17" "50-18") ("49-18" "49-19" "50-18" "50-19") ("49-19" "49-20" "50-19" "50-20") ("49-20" "49-21" "50-20" "50-21") ("49-21" "49-22" "50-21" "50-22") ("49-22" "49-23" "50-22" "50-23") ("49-23" "49-24" "50-23" "50-24") ("49-24" "49-25" "50-24" "50-25") ("49-25" "49-26" "50-25" "50-26") ("49-26" "49-27" "50-26" "50-27") ("49-27" "49-28" "50-27" "50-28") ("49-28" "49-29" "50-28" "50-29") ("49-29" "49-30" "50-29" "50-30") ("49-30" "49-31" "50-30" "50-31") ("49-31" "49-32" "50-31" "50-32") ("49-32" "49-33" "50-32" "50-33") ("49-33" "49-34" "50-33" "50-34") ("49-34" "49-35" "50-34" "50-35") ("49-35" "49-36" "50-35" "50-36 ") ("49-36" "49-37" "50-36" "50-37") ("49-37" "49-38" "50-37" "50-38") ("49-38" "49-39" "50-38" "50-39") ("49-39" "49-40" "50-39" "50-40") ("49-40" "49-41" "50-40" "50-41") ("49-41" "49-42" "50-41" "50-42") ("49-42" "49-43" "50-42" "50-43") ("49-43" "49-44" "50-43" "50-44") ("49-44" "49-45" "50-44" "50-45") ("49-45" "49-46" "50-45" "50-46") ("49-46" "49-47" "50-46" "50-47") ("49-47" "49-48" "50-47" "50-48") ("49-48" "49-49" "50-48" "50-49") ("49-49" "49-50" "50-49" "50-50")) Elapsed time : 3047.000000000000 milliseconds... |; ;;; Second test : Elapsed time : 4735.000000000000 milliseconds...
As you can see, I was perhaps wrong for 1000x1000 matrix and 1 second, but my function is indeed faster than Ron's - testing sample done at 50x50 matrix... For spacing issues, I didn't copy+pasted all return list, but only first and last summing result...
Elapsed time : 234.0000000000000 milliseconds...
Strange .. when I run the test you created 'c:rjpfoounfoldmatrix' with 50x50 speed is waaay faster than what you posted (AutoCAD 2021)may i ask you the same thing, Ron?QuoteElapsed time : 234.0000000000000 milliseconds...
Sure :)Strange .. when I run the test you created 'c:rjpfoounfoldmatrix' with 50x50 speed is waaay faster than what you posted (AutoCAD 2021)may i ask you the same thing, Ron?QuoteElapsed time : 234.0000000000000 milliseconds...
https://www.theswamp.org/index.php?topic=56239.msg601499#msg601499
Command: RJPFOOUNFOLDMATRIX
Specify number of rows of matrix : 50
Specify number of columns of matrix : 50
Elapsed time : 16.00000000000000 milliseconds...
Command: RECUNFOLDMATRIX
Specify number of rows of matrix : 50
Specify number of columns of matrix : 50
Elapsed time : 1438.000000000000 milliseconds...
Sure :)QuoteCommand: RJPFOOUNFOLDMATRIX
Specify number of rows of matrix : 50
Specify number of columns of matrix : 50
Elapsed time : 16.00000000000000 milliseconds...
Command: RECUNFOLDMATRIX
Specify number of rows of matrix : 50
Specify number of columns of matrix : 50
Elapsed time : 1438.000000000000 milliseconds...
That it is :) ... I like your numbers better :2funny:1+
I wanted to add that it can also vary with the CAD software.(BRUNO_F MLIST) is doing
looks like Bricscad is almost 14 times faster :)
AutoCAD 2021 t's even slower...I wanted to add that it can also vary with the CAD software.(BRUNO_F MLIST) is doing
524288 iterations for 1266 ms on Bricscad
and
32768 iterations for 1094 ms on Acad
looks like Bricscad is almost 14 times faster :)
cool
Elapsed milliseconds / relative speed for 32768 iteration(s):
(BRUNO_F MLIST).....1829 / 1.21 <fastest>
(SQUARE MLIST)......2219 / 1 <slowest>
Elapsed milliseconds / relative speed for 32768 iteration(s):
(_RJPFOO MLIST).....1547 / 2.79 <fastest>
(BRUNO_F MLIST).....1890 / 2.28
(SQUARE MLIST)......2328 / 1.85
(VOVKA_F MLIST).....4313 / 1 <slowest>
Considering results from my PC, I somehow don't believe to yours Ron...Yeah the numbers seem strange to me too but I'm just running the test you put together. :wink:
Thank you everyone for your contribution!
Indeed I was (and I'm still) busy in real life, agreed that it seems somewhat discrespectful for not replying on time.
Could've spent a few days figuring it out myself, but then I thought it may be better to post it here -
after all the task is related to a bit challenging list manipulation, while I knew I could rely on some of you.
Personally I don't get mad at the times when I provide a solution to an non-replying OP (like in this thread) rather just letting it sink in the web.
Surely I had the time to reply with just "thanks", which would seem more rude for me instead of non-replying -
because its like someone hands you a cigarette: while for a quick question it might be ok, for an algorithmic solution its not.
BTW I do code in my free time as an aside hobby (not making any $ out of it, but maybe as a part-time draughtsman - which is still not alot),
so not solving anything particular for a client - its more like a self-development thing.
My grid is max around 12x12, but we all agree that more and faster is better.
...nobody dropped the million dollar question for the potential usage of this sub. :idea:
...
Thank you for your response.
May i ask the application of this?