[Pkg-octave-commit] [SCM] octave-nnet branch, master, updated. 52bda440e2713bf32ad7fdb24f98732243ae68e6

Thomas Weber thomas.weber.mail at gmail.com
Thu Dec 31 09:31:07 UTC 2009


The following commit has been merged in the master branch:
commit fca381234b2e187ca661f8566ae5d645f60d54ae
Author: Thomas Weber <thomas.weber.mail at gmail.com>
Date:   Wed Dec 30 00:17:25 2009 +0100

    New patch workaround_octave_bug

diff --git a/debian/changelog b/debian/changelog
index b972770..209fff8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,12 @@
 octave-nnet (0.1.10-2) UNRELEASED; urgency=low
 
+  [ Rafael Laboissiere ]
   * debian/control: Build-depend on octave-pkg-dev >= 0.7.0, such that the
     package is built against octave3.2
 
+  [ Thomas Weber ]
+  * New patch: workaround_octave_bug, necessary for testing subset()
+
  -- Rafael Laboissiere <rafael at debian.org>  Sun, 07 Jun 2009 21:06:54 +0200
 
 octave-nnet (0.1.10-1) unstable; urgency=low
diff --git a/debian/patches/series b/debian/patches/series
index 2e485ca..543139f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
+workaround_octave_bug
 pdfsources.diff
 fix-version-number.diff
diff --git a/debian/patches/workaround_octave_bug b/debian/patches/workaround_octave_bug
new file mode 100644
index 0000000..a1562a1
--- /dev/null
+++ b/debian/patches/workaround_octave_bug
@@ -0,0 +1,497 @@
+--- a/inst/__analyzerows.m
++++ b/inst/__analyzerows.m
+@@ -30,7 +30,10 @@
+ function retmatrix = __analyzerows(matrix)
+ 
+   ## check number of inputs
+-  error(nargchk(1,1,nargin));
++  ncheck = nargchk(1,1,nargin)
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
+ 
+   nRows = size(matrix,1);   # get number or rows
+   retmatrix = zeros(nRows,4);
+--- a/inst/__calcjacobian.m
++++ b/inst/__calcjacobian.m
+@@ -33,7 +33,11 @@
+ 
+ 
+   ## check range of input arguments
+-  error(nargchk(5,5,nargin))
++  ncheck = nargchk(5,5,nargin);
++
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
+ 
+   ## get signals from inside the network
+   bias  = net.b;
+--- a/inst/__copycoltopos1.m
++++ b/inst/__copycoltopos1.m
+@@ -26,8 +26,12 @@
+ function retmatrix = __copycoltopos1(matrix,colIndex)
+ 
+   ## check number of inputs
+-  error(nargchk(2,2,nargin));
++  ncheck = nargchk(2,2,nargin);
+ 
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   temp = matrix(:,colIndex);
+   matrix(:,colIndex) = []; # delete col
+   retmatrix = [temp matrix ];
+--- a/inst/__getx.m
++++ b/inst/__getx.m
+@@ -29,8 +29,12 @@
+ function x = __getx(net)
+ 
+   ## check number of inputs
+-  error(nargchk(1,1,nargin));
+-
++  ncheck = nargchk(1,1,nargin);
++
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   ## check input args
+   ## check "net", must be a net structure
+   if !__checknetstruct(net)
+@@ -51,4 +55,4 @@
+   endfor
+ 
+ 
+-endfunction
+\ No newline at end of file
++endfunction
+--- a/inst/__init.m
++++ b/inst/__init.m
+@@ -36,7 +36,11 @@
+ function net=__init(net)
+ 
+   ## check number of inputs
+-  error(nargchk(1,1,nargin));
++  ncheck = nargchk(1,1,nargin);
++
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
+ 
+   ## check input
+   if ( !__checknetstruct(net) )
+--- a/inst/__mae.m
++++ b/inst/__mae.m
+@@ -34,8 +34,12 @@
+ function perf = __mae(E)
+ 
+   ## check number of inputs
+-  error(nargchk(1,1,nargin));
++  ncheck = nargchk(1,1,nargin);
+ 
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   if iscell(E)
+     perf = 0;
+     elements = 0;
+@@ -51,4 +55,4 @@
+   endif
+ 
+ 
+-endfunction
+\ No newline at end of file
++endfunction
+--- a/inst/__mse.m
++++ b/inst/__mse.m
+@@ -33,8 +33,12 @@
+ function perf = __mse(E)
+ 
+   ## check number of inputs
+-  error(nargchk(1,1,nargin));
++  ncheck = nargchk(1,1,nargin);
+ 
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   if iscell(E)
+     perf = 0;
+     elements = 0;
+@@ -50,4 +54,4 @@
+   endif
+ 
+ 
+-endfunction
+\ No newline at end of file
++endfunction
+--- a/inst/__newnetwork.m
++++ b/inst/__newnetwork.m
+@@ -43,8 +43,12 @@
+ function net = __newnetwork(numInputs,numLayers,numOutputs,networkType)
+ 
+   ## check range of input arguments
+-  error(nargchk(4,4,nargin))
++  ncheck = nargchk(4,4,nargin);
+ 
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   ## check input args
+   if ( !isposint(numInputs) )
+     error("network: at least 1 input must be defined! ")
+@@ -140,8 +144,12 @@
+   function net = newLayers(net,numLayers)
+ 
+     ## check range of input arguments
+-    error(nargchk(2,2,nargin))
++    ncheck = nargchk(2,2,nargin);
+ 
++    if (!isempty(ncheck))
++      error(ncheck);
++    endif
++ 
+     ## check type of arguments
+     if ( !isscalar(numLayers) | !isposint(numLayers) )
+       error("second argument must be a positive integer scalar value!")
+@@ -166,8 +174,12 @@
+   function net = newBiases(net,numLayers)
+ 
+     ## check range of input arguments
+-    error(nargchk(2,2,nargin))
++    ncheck = nargchk(2,2,nargin);
+ 
++    if (!isempty(ncheck))
++      error(ncheck);
++    endif
++ 
+     ## check type of arguments
+     if ( !isscalar(numLayers) | !isposint(numLayers) )
+       error("second argument must be a positive integer scalar value!")
+@@ -192,4 +204,4 @@
+ #
+ # ================================================================
+ 
+-endfunction
+\ No newline at end of file
++endfunction
+--- a/inst/__optimizedatasets.m
++++ b/inst/__optimizedatasets.m
+@@ -33,8 +33,12 @@
+ function retmatrix = __optimizedatasets(matrix,nTrainSets,nTargets,bRand)
+ 
+   ## check number of inputs
+-  error(nargchk(3,4,nargin));
++  ncheck = nargchk(3,4,nargin);
+ 
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   # set default values
+   bRandomise = 1;
+   
+@@ -86,4 +90,4 @@
+ %!assert(retmatrix(1,1)==5);
+ %!assert(retmatrix(2,1)==0);
+ %!assert(retmatrix(3,1)==1);
+-%!assert(retmatrix(4,1)==3);
+\ No newline at end of file
++%!assert(retmatrix(4,1)==3);
+--- a/inst/__randomisecols.m
++++ b/inst/__randomisecols.m
+@@ -26,7 +26,11 @@
+ function [retmatrix] = __randomisecols(matrix)
+ 
+   ## check number of inputs
+-  error(nargchk(1,1,nargin));
++  ncheck = nargchk(1,1,nargin);
++
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
+ 
+   # get number of cols
+   nCols = size(matrix,2);
+--- a/inst/__rerangecolumns.m
++++ b/inst/__rerangecolumns.m
+@@ -30,8 +30,12 @@
+ function retmatrix = __rerangecolumns(matrix,analyzeMatrix,nTrainSets)
+ 
+   ## check number of inputs
+-  error(nargchk(3,3,nargin));
++  ncheck = nargchk(3,3,nargin);
+ 
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   # set default values
+ 
+   # now sort "matrix" with help of analyzeMatrix
+@@ -165,4 +169,4 @@
+ %!assert(returnmatrix(3,1)==1);
+ %!assert(returnmatrix(4,1)==10);
+ %!assert(returnmatrix(5,1)==3);
+-%!assert(returnmatrix(6,1)==2);
+\ No newline at end of file
++%!assert(returnmatrix(6,1)==2);
+--- a/inst/__setx.m
++++ b/inst/__setx.m
+@@ -27,8 +27,12 @@
+ function net = __setx(net,xx)
+ 
+   ## check number of inputs
+-  error(nargchk(2,2,nargin));
+-
++  ncheck = nargchk(2,2,nargin);
++
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   ## check input args
+   ## check "net", must be a net structure
+   if !__checknetstruct(net)
+@@ -58,4 +62,4 @@
+     start = start + nElementsLW + nElementsBx;
+   endfor
+ 
+-endfunction
+\ No newline at end of file
++endfunction
+--- a/inst/__trainlm.m
++++ b/inst/__trainlm.m
+@@ -64,7 +64,11 @@
+ function [net] = __trainlm(net,Im,Pp,Tt,VV)
+ 
+   ## check range of input arguments
+-  error(nargchk(5,5,nargin))
++  ncheck = nargchk(5,5,nargin);
++
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
+ 
+   ## Initialize
+   ##------------
+@@ -357,4 +361,4 @@
+ #
+ # =====================================================================
+ 
+-endfunction
+\ No newline at end of file
++endfunction
+--- a/inst/isposint.m
++++ b/inst/isposint.m
+@@ -34,8 +34,12 @@
+ function f = isposint(n)
+ 
+   ## check range of input arguments
+-  error(nargchk(1,1,nargin))
+-  
++  ncheck = nargchk(1,1,nargin);
++
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   ## check input arg
+   if (length(n)>1)
+     error("Input argument must not be a vector, only scalars are allowed!")
+--- a/inst/min_max.m
++++ b/inst/min_max.m
+@@ -35,8 +35,12 @@
+ function Pr = min_max(Pp)
+ 
+   ## check number of input args
+-  error(nargchk(1,1,nargin))
++  ncheck = nargchk(1,1,nargin);
+ 
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   Pr = []; # returns an empty matrix
+   #if ismatrix(Pp)
+   if (!(size(Pp,1)==1) && !(size(Pp,2)==1)) # ismatrix(1) will return 1!!!
+--- a/inst/newff.m
++++ b/inst/newff.m
+@@ -62,7 +62,11 @@
+   ##  * performFunc is written for the performance function, standard is "mse"
+ 
+   ## check range of input arguments
+-  error(nargchk(2,6,nargin))
++  ncheck = nargchk(2,6,nargin);
++
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
+ 
+   ## set defaults
+   if (nargin <3)
+@@ -266,4 +270,4 @@
+ %!test
+ %! Pr = [1 2 ; 4 6];
+ %! fail("newff(Pr,[-1 1],{'tansig','purelin'},'trainlm','unused','mse')",\
+-%!  "Layer sizes is not a row vector of positive integers.")
+\ No newline at end of file
++%!  "Layer sizes is not a row vector of positive integers.")
+--- a/inst/newp.m
++++ b/inst/newp.m
+@@ -51,8 +51,12 @@
+   ##  * learnFunc is the learning function, standard is "learnp"
+ 
+   ## check range of input arguments
+-  error(nargchk(1,4,nargin))
++  ncheck = nargchk(1,4,nargin);
+ 
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   ## set defaults
+   if (nargin <2)
+     ss = 1; # means one neuron
+@@ -141,4 +145,4 @@
+ # ========================================================  
+ 
+ 
+-endfunction
+\ No newline at end of file
++endfunction
+--- a/inst/poststd.m
++++ b/inst/poststd.m
+@@ -27,7 +27,12 @@
+ function [Pp,Tt] = poststd(Pn,meanp,stdp,Tn,meant,stdt)
+ 
+   ## check range of input arguments
+-  error(nargchk(3,6,nargin))
++  ncheck = nargchk(3,6,nargin);
++
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   if (nargin==4)
+     error("4 input arguments are not allowed!");
+   endif
+@@ -77,4 +82,4 @@
+     Tt = (stdtZero*nColumnsIIIone).*Tn + meantZero*nColumnsIIIone;
+   endif
+ 
+-endfunction
+\ No newline at end of file
++endfunction
+--- a/inst/prestd.m
++++ b/inst/prestd.m
+@@ -41,8 +41,12 @@
+   ##    choose "statistical glossary", choose "standardization"
+ 
+   ## check range of input arguments
+-  error(nargchk(1,2,nargin))
++  ncheck = nargchk(1,2,nargin);
+ 
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   ## do first inputs
+   meanp = mean(Pp')';
+   stdp = std(Pp')';
+@@ -97,4 +101,4 @@
+ %!  Pp = [1 2 3 4; -1 3 2 -1];
+ %!  Tt = [3 4 5 6];
+ %!  [pn,meanp,stdp] = prestd(Pp);
+-%!assert(pn,[-1.16190 -0.38730 0.38730 1.16190; -0.84887 1.09141 0.60634 -0.84887],0.00001);
+\ No newline at end of file
++%!assert(pn,[-1.16190 -0.38730 0.38730 1.16190; -0.84887 1.09141 0.60634 -0.84887],0.00001);
+--- a/inst/sim.m
++++ b/inst/sim.m
+@@ -34,8 +34,12 @@
+ function [netoutput] = sim(net,mInput)
+ 
+   ## check range of input arguments
+-  error(nargchk(2,2,nargin))
++  ncheck = nargchk(2,2,nargin);
+ 
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   ## check input args
+   ## check "net", must be a net structure
+   if !__checknetstruct(net)
+--- a/inst/subset.m
++++ b/inst/subset.m
+@@ -54,7 +54,11 @@
+ function [mTrain, mTest, mVali] = subset(mData,nTargets,iOpti,fTest,fVali)
+ 
+   ## check range of input arguments
+-  error(nargchk(2,5,nargin))
++  ncheck = nargchk(2,5,nargin);
++
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
+   
+   ## check the input arguments ...!
+   if (nTargets==0)
+@@ -82,7 +86,6 @@
+   nTestSets = floor(size(mData,2)*fTest);
+   nValiSets = size(mData,2)-nTrainSets-nTestSets;
+ 
+-
+   ## now let's see if matrix must be optimized!
+   bOptiAgain = 1;
+   while (bOptiAgain)
+--- a/inst/train.m
++++ b/inst/train.m
+@@ -57,7 +57,11 @@
+ function [net] = train(net,Pp,Tt,notUsed1,notUsed2,VV)
+ 
+   ## check range of input arguments
+-  error(nargchk(3,6,nargin))
++  ncheck = nargchk(3,6,nargin);
++
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
+ 
+   ## set defaults
+   doValidation = 0;
+@@ -211,4 +215,4 @@
+ 
+ # ============================================================
+ 
+-endfunction
+\ No newline at end of file
++endfunction
+--- a/inst/trastd.m
++++ b/inst/trastd.m
+@@ -40,9 +40,12 @@
+ function [Pn] = trastd(Pp,meanp,stdp)
+ 
+   ## check number of inputs
+-  error(nargchk(3,3,nargin));
++  ncheck = nargchk(3,3,nargin);
+ 
+-  
++  if (!isempty(ncheck))
++    error(ncheck);
++  endif
++ 
+   [nRows,nColumns]=size(Pp);
+   rowOnes = ones(1,nColumns);
+   
+@@ -88,4 +91,4 @@
+ ## stdp =
+ ##
+ ##     1.2910
+-##     1.2910
+\ No newline at end of file
++##     1.2910

-- 
octave-nnet



More information about the Pkg-octave-commit mailing list