Skip to content

Commit

Permalink
Remove dependency chain breaking code from mins/maxs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sirherrbatka committed Nov 22, 2021
1 parent 0fc0ba8 commit fd42507
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions source/data/functions.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,12 @@
(for j from 1 below data-points-count)
(for k1 = (if (null data-points) j (aref data-points j)))
(iterate
(declare (type fixnum i1 i2))
(for i1 from 0 below attributes-count by 2)
(for i2 = (+ i1 1))
(declare (type fixnum i1))
(for i1 from 0 below attributes-count by 1)
(let ((attribute (if (null attributes)
i1
(aref attributes i1))))
(maxf (sl.data:mref result-max 0 i1) (sl.data:mref data k1 attribute)))
(when (< i2 attributes-count)
(let ((attribute (if (null attributes)
i2
(aref attributes i2))))
(maxf (sl.data:mref result-max 0 i2) (sl.data:mref data k1 attribute)))))
(maxf (sl.data:mref result-max 0 i1) (sl.data:mref data k1 attribute))))
(finally (return result-max)))))


Expand Down Expand Up @@ -223,22 +217,14 @@
(for j from 1 below data-points-count)
(for k1 = (if (null data-points) j (aref data-points j)))
(iterate
(declare (type fixnum i1 i2))
(for i1 from 0 below attributes-count by 2)
(for i2 = (+ i1 1))
(declare (type fixnum i1))
(for i1 from 0 below attributes-count by 1)
(let* ((attribute (if (null attributes)
i1
(aref attributes i1)))
(value (sl.data:mref data k1 attribute)))
(minf (sl.data:mref result-min 0 i1) value)
(maxf (sl.data:mref result-max 0 i1) value))
(when (< i2 attributes-count)
(let* ((attribute (if (null attributes)
i2
(aref attributes i2)))
(value (sl.data:mref data k1 attribute)))
(minf (sl.data:mref result-min 0 i2) value)
(maxf (sl.data:mref result-max 0 i2) value))))
(maxf (sl.data:mref result-max 0 i1) value)))
(finally (return (cons result-min result-max))))))


Expand Down Expand Up @@ -274,18 +260,12 @@
(for j from 1 below data-points-count)
(for k1 = (if (null data-points) j (aref data-points j)))
(iterate
(declare (type fixnum i1 i2))
(for i1 from 0 below attributes-count by 2)
(for i2 = (+ i1 1))
(declare (type fixnum i1))
(for i1 from 0 below attributes-count by 1)
(let ((attribute (if (null attributes)
i1
(aref attributes i1))))
(minf (sl.data:mref result-min 0 i1) (sl.data:mref data k1 attribute)))
(when (< i2 attributes-count)
(let ((attribute (if (null attributes)
i2
(aref attributes i2))))
(minf (sl.data:mref result-min 0 i2) (sl.data:mref data k1 attribute)))))
(minf (sl.data:mref result-min 0 i1) (sl.data:mref data k1 attribute))))
(finally (return result-min)))))


Expand Down

0 comments on commit fd42507

Please sign in to comment.