aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Montgomery-Smith <stephen@FreeBSD.org>2018-05-14 23:28:48 +0000
committerStephen Montgomery-Smith <stephen@FreeBSD.org>2018-05-14 23:28:48 +0000
commit071f84774579de3b58d5c886576cbe5757bc83ba (patch)
tree1cafea0046249d141ef7801b9429f7e40c27c5ae
parentb5a862e7d18a3cf13ef527e87177d661c16de46a (diff)
downloadports-071f84774579de3b58d5c886576cbe5757bc83ba.tar.gz
ports-071f84774579de3b58d5c886576cbe5757bc83ba.zip
Notes
-rw-r--r--math/octave-forge-fuzzy-logic-toolkit/Makefile6
-rw-r--r--math/octave-forge-fuzzy-logic-toolkit/files/patch-inst_defuzz.m62
2 files changed, 65 insertions, 3 deletions
diff --git a/math/octave-forge-fuzzy-logic-toolkit/Makefile b/math/octave-forge-fuzzy-logic-toolkit/Makefile
index a5e49ca9d80c..cd9439911900 100644
--- a/math/octave-forge-fuzzy-logic-toolkit/Makefile
+++ b/math/octave-forge-fuzzy-logic-toolkit/Makefile
@@ -3,7 +3,7 @@
PORTNAME= octave-forge-fuzzy-logic-toolkit
PORTVERSION= 0.4.5
-PORTREVISION= 7
+PORTREVISION= 8
CATEGORIES= math
MAINTAINER= stephen@FreeBSD.org
@@ -12,12 +12,12 @@ COMMENT= Octave-forge package ${OCTAVE_PKGNAME}
LICENSE= GPLv3
LICENSE_FILE= ${WRKDIR}/${OCTSRC}/COPYING
-BROKEN= parse error when installing with octave 4.4.0
-
# OCTSRC is the name of the directory of the package.
# It is usually ${OCTAVE_PKGNAME} or ${DISTNAME}.
OCTSRC= ${OCTAVE_PKGNAME}
+WRKSRC= ${WRKDIR}/${OCTSRC} # Only required so that patch will apply.
+
.include "${.CURDIR}/../../Mk/bsd.octave.mk"
do-build:
diff --git a/math/octave-forge-fuzzy-logic-toolkit/files/patch-inst_defuzz.m b/math/octave-forge-fuzzy-logic-toolkit/files/patch-inst_defuzz.m
new file mode 100644
index 000000000000..1c05c842a56d
--- /dev/null
+++ b/math/octave-forge-fuzzy-logic-toolkit/files/patch-inst_defuzz.m
@@ -0,0 +1,62 @@
+--- inst/defuzz.m.orig 2014-07-02 00:11:06 UTC
++++ inst/defuzz.m
+@@ -1,4 +1,4 @@
+-## Copyright (C) 2011-2014 L. Markowsky <lmarkov@users.sourceforge.net>
++## Copyright (C) 2011-2018 L. Markowsky <lmarkov@users.sourceforge.net>
+ ##
+ ## This file is part of the fuzzy-logic-toolkit.
+ ##
+@@ -162,7 +162,16 @@ endfunction
+ function crisp_x = mom (x, y)
+
+ max_y = max (y);
+- y_val = @(y_val) if (y_val == max_y) 1 else 0 endif;
++
++ function y_val = calc_yval(y_val)
++ if (y_val == max_y)
++ y_val = 1;
++ else
++ y_val = 0;
++ endif
++ endfunction
++
++ y_val = @(y_val) calc_yval(y_val);
+ max_y_locations = arrayfun (y_val, y);
+ crisp_x = sum (x .* max_y_locations) / sum (max_y_locations);
+
+@@ -185,7 +194,16 @@ endfunction
+ function crisp_x = som (x, y)
+
+ max_y = max (y);
+- y_val = @(y_val) if (y_val == max_y) 1 else (NaN) endif;
++
++ function y_val = calc_yval(y_val)
++ if (y_val == max_y)
++ y_val = 1;
++ else
++ y_val = (NaN);
++ endif
++ endfunction
++
++ y_val = @(y_val) calc_yval(y_val);
+ max_y_locations = arrayfun (y_val, y);
+ crisp_x = min (x .* max_y_locations);
+
+@@ -207,7 +225,16 @@ endfunction
+ function crisp_x = lom (x, y)
+
+ max_y = max (y);
+- y_val = @(y_val) if (y_val == max_y) 1 else (NaN) endif;
++
++ function y_val = calc_yval(y_val)
++ if (y_val == max_y)
++ y_val = 1;
++ else
++ y_val = (NaN);
++ endif
++ endfunction
++
++ y_val = @(y_val) calc_yval(y_val);
+ max_y_locations = arrayfun (y_val, y);
+ crisp_x = max (x .* max_y_locations);
+