This list is closed, nobody may subscribe to it.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
(5) |
Sep
(3) |
Oct
(41) |
Nov
(41) |
Dec
(33) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(75) |
Feb
(10) |
Mar
(170) |
Apr
(174) |
May
(66) |
Jun
(11) |
Jul
(10) |
Aug
(44) |
Sep
(73) |
Oct
(28) |
Nov
(139) |
Dec
(52) |
2003 |
Jan
(35) |
Feb
(93) |
Mar
(62) |
Apr
(10) |
May
(55) |
Jun
(70) |
Jul
(37) |
Aug
(16) |
Sep
(56) |
Oct
(31) |
Nov
(57) |
Dec
(83) |
2004 |
Jan
(85) |
Feb
(67) |
Mar
(27) |
Apr
(37) |
May
(75) |
Jun
(85) |
Jul
(160) |
Aug
(68) |
Sep
(104) |
Oct
(25) |
Nov
(39) |
Dec
(23) |
2005 |
Jan
(10) |
Feb
(45) |
Mar
(43) |
Apr
(19) |
May
(108) |
Jun
(31) |
Jul
(41) |
Aug
(23) |
Sep
(65) |
Oct
(58) |
Nov
(44) |
Dec
(54) |
2006 |
Jan
(96) |
Feb
(27) |
Mar
(69) |
Apr
(59) |
May
(67) |
Jun
(35) |
Jul
(13) |
Aug
(461) |
Sep
(160) |
Oct
(399) |
Nov
(32) |
Dec
(72) |
2007 |
Jan
(316) |
Feb
(305) |
Mar
(318) |
Apr
(54) |
May
(194) |
Jun
(173) |
Jul
(282) |
Aug
(91) |
Sep
(227) |
Oct
(365) |
Nov
(168) |
Dec
(18) |
2008 |
Jan
(71) |
Feb
(111) |
Mar
(155) |
Apr
(173) |
May
(70) |
Jun
(67) |
Jul
(55) |
Aug
(83) |
Sep
(32) |
Oct
(68) |
Nov
(80) |
Dec
(29) |
2009 |
Jan
(46) |
Feb
(18) |
Mar
(95) |
Apr
(76) |
May
(140) |
Jun
(98) |
Jul
(84) |
Aug
(123) |
Sep
(94) |
Oct
(131) |
Nov
(142) |
Dec
(125) |
2010 |
Jan
(128) |
Feb
(158) |
Mar
(172) |
Apr
(134) |
May
(94) |
Jun
(84) |
Jul
(32) |
Aug
(127) |
Sep
(167) |
Oct
(109) |
Nov
(69) |
Dec
(78) |
2011 |
Jan
(39) |
Feb
(58) |
Mar
(52) |
Apr
(47) |
May
(56) |
Jun
(76) |
Jul
(55) |
Aug
(54) |
Sep
(165) |
Oct
(255) |
Nov
(328) |
Dec
(263) |
2012 |
Jan
(82) |
Feb
(147) |
Mar
(400) |
Apr
(216) |
May
(209) |
Jun
(160) |
Jul
(86) |
Aug
(141) |
Sep
(156) |
Oct
(6) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(2) |
2016 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
(8) |
Jul
(2) |
Aug
(5) |
Sep
(9) |
Oct
|
Nov
|
Dec
|
From: <par...@us...> - 2012-03-16 18:08:58
|
Revision: 9922 http://octave.svn.sourceforge.net/octave/?rev=9922&view=rev Author: paramaniac Date: 2012-03-16 18:08:52 +0000 (Fri, 16 Mar 2012) Log Message: ----------- control-devel: finish oct-file for n4sid & moesp identification Modified Paths: -------------- trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc trunk/octave-forge/extra/control-devel/src/slident.cc Added Paths: ----------- trunk/octave-forge/extra/control-devel/devel/test_slident.m Added: trunk/octave-forge/extra/control-devel/devel/test_slident.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/test_slident.m (rev 0) +++ trunk/octave-forge/extra/control-devel/devel/test_slident.m 2012-03-16 18:08:52 UTC (rev 9922) @@ -0,0 +1,2090 @@ +% IB01AD EXAMPLE PROGRAM DATA +% 15 0 1 1 1000 0.0 -1.0 M C N O N N +% nobr, n, m, l, nsmp, rcond, tol, meth, alg, jobd, batch,conct,ctrl + +% IB01BD EXAMPLE PROGRAM DATA +% 15 0 1 1 1000 0.0 -1.0 C C N O N N A K + + +U = [ + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 3.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 + 6.41 +]; + +Y = [ + 4.766099 + 4.763659 + 4.839359 + 5.002979 + 5.017629 + 5.056699 + 5.154379 + 5.361949 + 5.425439 + 5.569519 + 5.681849 + 5.742899 + 5.803949 + 5.918729 + 5.821049 + 5.447419 + 5.061589 + 4.629349 + 4.267939 + 4.011519 + 3.850349 + 3.711159 + 3.569519 + 3.518239 + 3.652549 + 3.818609 + 3.862559 + 4.011519 + 4.353409 + 4.705049 + 5.083559 + 5.344859 + 5.274039 + 5.127519 + 4.761219 + 4.451089 + 4.221539 + 4.045709 + 3.874769 + 3.730689 + 3.662319 + 3.576849 + 3.542659 + 3.479169 + 3.454749 + 3.359509 + 3.298459 + 3.225199 + 3.200779 + 3.225199 + 3.227639 + 3.274039 + 3.457189 + 3.867449 + 4.321659 + 4.492599 + 4.431549 + 4.243519 + 4.050599 + 3.857679 + 3.730689 + 3.791739 + 3.921169 + 3.955359 + 3.847909 + 3.725809 + 3.611039 + 3.716039 + 4.092109 + 4.480389 + 4.814939 + 5.054259 + 5.303339 + 5.486489 + 5.672089 + 5.779529 + 5.799069 + 5.664759 + 5.291129 + 4.880879 + 4.558529 + 4.184909 + 3.889419 + 3.708719 + 3.623249 + 3.569519 + 3.718479 + 4.033499 + 4.412009 + 4.629349 + 4.558529 + 4.394919 + 4.180019 + 4.197119 + 4.431549 + 4.714819 + 4.961459 + 5.300899 + 5.567079 + 5.681849 + 5.545099 + 5.188569 + 4.883319 + 4.600049 + 4.270379 + 4.038389 + 3.838139 + 3.711159 + 3.591499 + 3.535329 + 3.486489 + 3.476729 + 3.425439 + 3.381489 + 3.369279 + 3.364389 + 3.347299 + 3.381489 + 3.420559 + 3.413229 + 3.452309 + 3.635459 + 4.038389 + 4.375379 + 4.727029 + 5.056699 + 5.298459 + 5.532889 + 5.466959 + 5.195899 + 4.885759 + 4.763659 + 4.875989 + 5.042049 + 5.283809 + 5.491379 + 5.596379 + 5.672089 + 5.772209 + 5.830819 + 5.933379 + 5.899189 + 5.935819 + 5.894309 + 5.918729 + 5.994429 + 5.957799 + 6.031059 + 6.062809 + 6.040829 + 6.096999 + 6.123859 + 6.162929 + 6.040829 + 5.845469 + 5.772209 + 5.799069 + 5.923609 + 5.928499 + 6.001759 + 6.001759 + 6.060369 + 5.882099 + 5.510909 + 5.322879 + 5.371719 + 5.454749 + 5.437649 + 5.159269 + 4.902859 + 4.587839 + 4.502369 + 4.595159 + 4.824709 + 5.064029 + 5.271599 + 5.466959 + 5.615919 + 5.528009 + 5.254499 + 4.883319 + 4.517019 + 4.197119 + 4.001759 + 3.806399 + 3.904079 + 3.923609 + 3.869889 + 3.806399 + 3.720929 + 3.818609 + 4.140949 + 4.529229 + 4.805179 + 5.086009 + 5.339969 + 5.532889 + 5.576849 + 5.667199 + 5.791739 + 5.850349 + 5.923609 + 5.921169 + 5.977339 + 5.740459 + 5.388809 + 5.000539 + 4.849129 + 4.944369 + 5.173919 + 5.369279 + 5.447419 + 5.603709 + 5.730689 + 5.850349 + 5.979779 + 5.991989 + 6.084789 + 5.940709 + 5.803949 + 5.791739 + 5.603709 + 5.264269 + 4.946809 + 4.619579 + 4.514579 + 4.433989 + 4.285029 + 4.121419 + 3.945589 + 3.984659 + 4.219099 + 4.546319 + 4.873549 + 5.154379 + 5.388809 + 5.613479 + 5.835699 + 5.884539 + 5.955359 + 5.762439 + 5.459629 + 5.061589 + 4.707499 + 4.458409 + 4.267939 + 4.053039 + 3.943149 + 3.825929 + 3.967569 + 4.280149 + 4.480389 + 4.492599 + 4.390039 + 4.197119 + 4.111649 + 3.982219 + 3.867449 + 3.767319 + 3.872329 + 4.236189 + 4.663539 + 4.971229 + 5.066469 + 4.902859 + 4.675749 + 4.392479 + 4.099439 + 4.114089 + 4.326539 + 4.643999 + 4.971229 + 5.159269 + 5.388809 + 5.576849 + 5.652549 + 5.803949 + 5.913839 + 5.886979 + 5.799069 + 5.730689 + 5.762439 + 5.813719 + 5.821049 + 5.928499 + 6.013969 + 5.764879 + 5.413229 + 5.098219 + 4.678189 + 4.372939 + 4.392479 + 4.590279 + 4.919949 + 5.017629 + 4.858899 + 4.675749 + 4.619579 + 4.834479 + 5.090889 + 5.376599 + 5.681849 + 5.823489 + 5.952919 + 6.062809 + 6.089669 + 6.075019 + 6.026179 + 5.994429 + 6.077459 + 5.857679 + 5.701389 + 5.730689 + 5.784419 + 5.823489 + 5.894309 + 5.762439 + 5.415679 + 4.961459 + 4.595159 + 4.331429 + 4.297239 + 4.582949 + 4.861339 + 5.173919 + 5.166589 + 4.919949 + 4.607369 + 4.370499 + 4.182469 + 4.038389 + 4.145839 + 4.431549 + 4.556089 + 4.480389 + 4.375379 + 4.370499 + 4.558529 + 4.858899 + 4.895529 + 4.741679 + 4.744129 + 4.875989 + 5.105539 + 5.239849 + 5.518239 + 5.652549 + 5.723369 + 5.855239 + 5.962679 + 5.984659 + 5.984659 + 6.055479 + 6.062809 + 6.055479 + 6.070129 + 5.784419 + 5.440099 + 5.056699 + 4.941929 + 5.010299 + 5.134849 + 5.313109 + 5.479169 + 5.623249 + 5.562199 + 5.330209 + 5.010299 + 4.665979 + 4.414459 + 4.201999 + 4.048159 + 4.079899 + 4.189789 + 4.131179 + 4.004199 + 3.916289 + 3.960239 + 4.199559 + 4.624469 + 4.883319 + 5.137289 + 5.379049 + 5.623249 + 5.762439 + 5.833259 + 5.686739 + 5.366839 + 5.225199 + 5.239849 + 5.354629 + 5.508469 + 5.596379 + 5.752669 + 5.874769 + 5.906519 + 5.894309 + 5.742899 + 5.447419 + 5.024959 + 4.883319 + 4.885759 + 4.893089 + 4.714819 + 4.451089 + 4.233749 + 4.043269 + 3.864999 + 3.757559 + 3.669639 + 3.593939 + 3.547539 + 3.506029 + 3.454749 + 3.398579 + 3.361949 + 3.339969 + 3.374159 + 3.520679 + 3.713599 + 3.757559 + 3.779529 + 3.696509 + 3.777089 + 3.886979 + 3.904079 + 3.850349 + 3.965129 + 4.282589 + 4.521899 + 4.714819 + 4.971229 + 5.220319 + 5.532889 + 5.652549 + 5.781979 + 5.955359 + 6.035939 + 6.118969 + 6.133629 + 6.153159 + 6.192229 + 6.143389 + 6.167809 + 5.991989 + 5.652549 + 5.459629 + 5.437649 + 5.339969 + 5.098219 + 4.785639 + 4.492599 + 4.236189 + 4.067689 + 3.933379 + 3.823489 + 3.730689 + 3.611039 + 3.564639 + 3.549989 + 3.557309 + 3.513359 + 3.515799 + 3.694059 + 4.072579 + 4.480389 + 4.705049 + 4.612259 + 4.385149 + 4.201999 + 4.026179 + 3.904079 + 3.774649 + 3.691619 + 3.845469 + 4.201999 + 4.585399 + 4.902859 + 5.256949 + 5.510909 + 5.640339 + 5.843029 + 5.974889 + 5.935819 + 5.821049 + 5.528009 + 5.171479 + 4.810059 + 4.453529 + 4.380269 + 4.565859 + 4.805179 + 5.125079 + 5.354629 + 5.589059 + 5.764879 + 5.923609 + 5.940709 + 5.857679 + 5.694059 + 5.486489 + 5.149499 + 4.844249 + 4.541439 + 4.267939 + 4.060369 + 3.960239 + 3.789299 + 3.642779 + 3.525569 + 3.498699 + 3.454749 + 3.408349 + 3.379049 + 3.376599 + 3.361949 + 3.359509 + 3.369279 + 3.398579 + 3.579289 + 3.948029 + 4.412009 + 4.585399 + 4.514579 + 4.343639 + 4.155599 + 3.984659 + 4.043269 + 4.307009 + 4.421779 + 4.353409 + 4.223979 + 4.053039 + 3.940709 + 3.838139 + 3.730689 + 3.652549 + 3.611039 + 3.564639 + 3.496259 + 3.462069 + 3.454749 + 3.425439 + 3.379049 + 3.432769 + 3.623249 + 3.974889 + 4.380269 + 4.714819 + 5.073799 + 5.369279 + 5.603709 + 5.745349 + 5.652549 + 5.401019 + 5.015189 + 4.709939 + 4.416899 + 4.236189 + 4.236189 + 4.248399 + 4.221539 + 4.297239 + 4.590279 + 4.893089 + 5.134849 + 5.427889 + 5.379049 + 5.364389 + 5.452309 + 5.567079 + 5.672089 + 5.769769 + 5.830819 + 5.923609 + 5.965129 + 6.057919 + 6.050599 + 6.072579 + 6.111649 + 6.070129 + 5.896749 + 5.755109 + 5.718479 + 5.821049 + 6.001759 + 6.001759 + 5.901629 + 5.557309 + 5.173919 + 4.800289 + 4.431549 + 4.194679 + 4.006639 + 3.850349 + 3.747789 + 3.642779 + 3.591499 + 3.569519 + 3.528009 + 3.537779 + 3.554869 + 3.493819 + 3.447419 + 3.440099 + 3.408349 + 3.410789 + 3.452309 + 3.681849 + 4.060369 + 4.441319 + 4.854019 + 5.154379 + 5.425439 + 5.596379 + 5.586619 + 5.354629 + 5.027399 + 4.863779 + 4.761219 + 4.570739 + 4.368059 + 4.397359 + 4.573189 + 4.841809 + 5.203219 + 5.452309 + 5.652549 + 5.855239 + 5.906519 + 5.952919 + 5.828369 + 5.791739 + 5.799069 + 5.813719 + 5.877209 + 5.955359 + 5.781979 + 5.518239 + 5.127519 + 4.763659 + 4.492599 + 4.233749 + 4.011519 + 3.855239 + 3.691619 + 3.635459 + 3.818609 + 4.155599 + 4.590279 + 4.988329 + 5.076239 + 4.907739 + 4.648889 + 4.377829 + 4.216649 + 4.287469 + 4.590279 + 4.846689 + 5.139729 + 5.388809 + 5.689179 + 5.884539 + 6.043269 + 6.170259 + 6.211769 + 6.250839 + 6.209329 + 6.013969 + 5.701389 + 5.469399 + 5.479169 + 5.557309 + 5.728249 + 5.882099 + 5.984659 + 5.901629 + 5.581729 + 5.371719 + 5.418119 + 5.510909 + 5.667199 + 5.791739 + 5.698949 + 5.484049 + 5.154379 + 4.980999 + 5.061589 + 5.195899 + 5.359509 + 5.615919 + 5.762439 + 5.857679 + 5.948029 + 5.835699 + 5.706269 + 5.498699 + 5.188569 + 5.117749 + 5.191009 + 5.315549 + 5.532889 + 5.444979 + 5.396139 + 5.274039 + 5.027399 + 4.744129 + 4.668419 + 4.651329 + 4.514579 + 4.267939 + 4.260609 + 4.263049 + 4.189789 + 4.277699 + 4.600049 + 4.932159 + 5.283809 + 5.528009 + 5.740459 + 5.874769 + 5.955359 + 5.991989 + 5.845469 + 5.528009 + 5.061589 + 4.734359 + 4.534109 + 4.534109 + 4.697729 + 4.744129 + 4.619579 + 4.643999 + 4.832039 + 5.132399 + 5.410789 + 5.625689 + 5.603709 + 5.315549 + 4.961459 + 4.619579 + 4.358289 + 4.155599 + 4.033499 + 3.886979 + 3.772209 + 3.640339 + 3.532889 + 3.435209 + 3.427889 + 3.422999 + 3.398579 + 3.603709 + 4.023729 + 4.451089 + 4.792969 + 4.902859 + 4.780759 + 4.590279 + 4.336309 + 4.145839 + 4.216649 + 4.433989 + 4.714819 + 5.098219 + 5.359509 + 5.569519 + 5.772209 + 5.921169 + 6.055479 + 5.962679 + 5.642779 + 5.435209 + 5.388809 + 5.537779 + 5.681849 + 5.701389 + 5.615919 + 5.667199 + 5.740459 + 5.803949 + 5.882099 + 5.950469 + 6.072579 + 6.148279 + 6.116529 + 6.177579 + 6.201999 + 6.206889 + 5.991989 + 5.564639 + 5.178799 + 4.998089 + 5.051819 + 5.232529 + 5.484049 + 5.686739 + 5.899189 + 5.869889 + 5.977339 + 6.053039 + 6.079899 + 6.128739 + 6.079899 + 6.167809 + 6.194679 + 6.236189 + 6.053039 + 5.652549 + 5.274039 + 4.858899 + 4.534109 + 4.455969 + 4.619579 + 4.866229 + 5.117749 + 5.166589 + 5.056699 + 5.002979 + 5.098219 + 5.325319 + 5.567079 + 5.466959 + 5.252059 + 4.946809 + 4.880879 + 4.980999 + 5.225199 + 5.459629 + 5.723369 + 5.791739 + 5.906519 + 5.991989 + 5.835699 + 5.528009 + 5.142169 + 4.775869 + 4.490159 + 4.236189 + 4.023729 + 3.886979 + 3.752669 + 3.681849 + 3.806399 + 4.145839 + 4.600049 + 5.002979 + 5.303339 + 5.552429 + 5.615919 + 5.523119 + 5.611039 + 5.713599 + 5.845469 + 5.899189 + 5.994429 + 6.092109 + 6.092109 + 6.143389 + 6.153159 + 6.233749 + 6.187349 + 6.013969 + 5.835699 + 5.774649 + 5.686739 + 5.537779 + 5.327759 + 5.054259 + 4.700169 + 4.394919 + 4.180019 + 4.043269 + 3.877209 + 3.752669 + 3.728249 + 3.869889 + 4.206889 + 4.355849 + 4.426669 + 4.453529 + 4.521899 + 4.392479 + 4.155599 + 3.965129 + 3.877209 + 3.970009 + 4.258169 + 4.421779 + 4.336309 + 4.299679 + 4.392479 + 4.675749 + 4.761219 + 4.658659 + 4.490159 + 4.307009 + 4.126299 + 3.972449 + 4.077459 + 4.372939 + 4.741679 + 5.088449 + 5.186129 + 5.037169 + 4.785639 + 4.563419 + 4.534109 + 4.705049 + 4.741679 + 4.648889 + 4.431549 + 4.238629 + 4.065249 + 3.943149 + 3.811279 + 3.691619 + 3.652549 + 3.825929 + 4.223979 + 4.424219 + 4.429109 + 4.319219 + 4.138509 + 3.965129 + 3.886979 + 3.801509 + 3.701389 + 3.640339 + 3.767319 + 4.150719 + 4.648889 + 4.990769 + 5.088449 + 5.022509 + 4.783199 + 4.685519 + 4.665979 + 4.707499 + 4.912619 + 5.195899 + 5.415679 + 5.623249 + 5.740459 + 5.899189 + 5.928499 + 6.050599 + 6.153159 + 5.965129 + 5.586619 + 5.381489 + 5.371719 + 5.486489 + 5.567079 + 5.821049 + 5.913839 + 5.994429 + 6.011519 + 5.999309 + 6.018849 + 5.821049 + 5.728249 + 5.740459 + 5.764879 + 5.882099 + 5.926049 + 5.750229 + 5.415679 + 4.995649 + 4.861339 + 4.902859 + 5.103099 + 5.364389 + 5.596379 + 5.752669 + 5.845469 + 5.928499 + 6.006639 + 5.840579 + 5.518239 + 5.173919 + 4.739239 + 4.458409 + 4.426669 + 4.602489 + 4.822269 + 5.183689 + 5.430329 + 5.652549 + 5.821049 + 5.706269 + 5.369279 + 5.027399 + 4.705049 + 4.414459 + 4.145839 + 3.965129 + 4.033499 + 4.372939 + 4.683079 +]; + +dat = iddata (Y, U) + +% IB01AD EXAMPLE PROGRAM DATA +% 15 0 1 1 1000 0.0 -1.0 M C N O N N +% nobr, n, m, l, nsmp, rcond, tol, meth, alg, jobd, batch,conct,ctrl + +% IB01BD EXAMPLE PROGRAM DATA +% 15 0 1 1 1000 0.0 -1.0 C C N O N N A K + +nobr = 15; +meth = 2; +alg = 0; +jobd = 1; +batch = 3; +conct = 1; +ctrl = 1; +rcond = 0.0; +tol = -1.0; + +[a, b, c, d, q, ry, s, k] = slident (Y, U, nobr, meth, alg, jobd, batch, conct, ctrl, rcond, tol); + +n +sv + +%{ + IB01AD EXAMPLE PROGRAM RESULTS + + The order of the system is 4 + The singular values are + 69.8841 14.9963 3.6675 1.9677 0.3000 0.2078 0.1651 0.1373 + 0.1133 0.1059 0.0856 0.0784 0.0733 0.0678 0.0571 + + + IB01BD EXAMPLE PROGRAM RESULTS + + + The system state matrix A is + 0.8924 0.3887 0.1285 0.1716 + -0.0837 0.6186 -0.6273 -0.4582 + 0.0052 0.1307 0.6685 -0.6755 + 0.0055 0.0734 -0.2148 0.4788 + + The system output matrix C is + -0.4442 0.6663 0.3961 0.4102 + + The system input matrix B is + -0.2142 + -0.1968 + 0.0525 + 0.0361 + + The system input-output matrix D is + -0.0041 + + The Kalman gain matrix K is + -1.9513 + -0.1867 + 0.6348 + -0.3486 + + The state covariance matrix Q is + 0.0052 0.0005 -0.0017 0.0009 + 0.0005 0.0000 -0.0002 0.0001 + -0.0017 -0.0002 0.0006 -0.0003 + 0.0009 0.0001 -0.0003 0.0002 + + The output covariance matrix Ry is + 0.0012 + + The state-output cross-covariance matrix S is + -0.0025 + -0.0002 + 0.0008 + -0.0005 + +%} Modified: trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc 2012-03-16 15:03:53 UTC (rev 9921) +++ trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc 2012-03-16 18:08:52 UTC (rev 9922) @@ -1,2 +1,2 @@ -#include "slib01ad.cc" // preprocess the input-output data +// #include "slib01ad.cc" // preprocess the input-output data #include "slident.cc" // system identification Modified: trunk/octave-forge/extra/control-devel/src/slident.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slident.cc 2012-03-16 15:03:53 UTC (rev 9921) +++ trunk/octave-forge/extra/control-devel/src/slident.cc 2012-03-16 18:08:52 UTC (rev 9922) @@ -79,7 +79,7 @@ int nargin = args.length (); octave_value_list retval; - if (nargin != 12) + if (nargin != 11) { print_usage (); } @@ -92,6 +92,8 @@ char batch; char conct; char ctrl; + char metha; + char jobda; Matrix y = args(0).matrix_value (); Matrix u = args(1).matrix_value (); @@ -106,13 +108,23 @@ double rcond = args(9).double_value (); double tol = args(10).double_value (); - double tolb = args(11).double_value (); - + double tolb = args(9).double_value (); // tolb = rcond - if (imeth == 0) - meth = 'M'; - else - meth = 'N'; + + switch (imeth) + { + case 0: + meth = 'M'; + metha = 'M'; + case 1: + meth = 'N'; + metha = 'N'; + case 3: + meth = 'C'; + metha = 'N'; // no typo here + default: + error ("slib01ad: argument 'meth' invalid"); + } switch (ialg) { @@ -129,7 +141,9 @@ error ("slib01ad: argument 'alg' invalid"); } - if (ijobd == 0) + if (meth == 'C') + jobd = 'N'; + else if (ijobd == 0) jobd = 'M'; else jobd = 'N'; @@ -182,9 +196,9 @@ int n; int ldr; - if (meth == 'M' && jobd == 'M') + if (metha == 'M' && jobd == 'M') ldr = max (2*(m+l)*nobr, 3*m*nobr); - else if (meth == 'N' || (meth == 'M' && jobd == 'N')) + else if (metha == 'N' || (metha == 'M' && jobd == 'N')) ldr = 2*(m+l)*nobr; else error ("slib01ad: could not handle 'ldr' case"); @@ -195,7 +209,7 @@ // workspace int liwork; - if (meth == 'N') // if METH = 'N' + if (metha == 'N') // if METH = 'N' liwork = (m+l)*nobr; else if (alg == 'F') // if METH = 'M' and ALG = 'F' liwork = m+l; @@ -205,8 +219,6 @@ // TODO: Handle 'k' for DWORK int ldwork; - - ldwork = 0; if (alg == 'C') { @@ -217,7 +229,7 @@ else // (conct == 'N') ldwork = 1; } - else if (meth == 'M') // && (batch == 'L' || batch == 'O') + else if (metha == 'M') // && (batch == 'L' || batch == 'O') { if (conct == 'C' && batch == 'L') ldwork = max ((4*nobr-2)*(m+l), 5*l*nobr); @@ -233,44 +245,11 @@ } else if (alg == 'F') { -/* -For the second LDWORK case, code and documentation don't match: -doc line 276: BATCH = 'F', 'I' -code line 586: BATCH = 'F', 'I', 'O' -The third case with BATCH = 'O' is never reached. - - -IB01AD.f Lines 273-279: -C LDWORK >= (M+L)*2*NOBR*(M+L+3), if ALG = 'F', -C BATCH <> 'O' and CONCT = 'C'; -C LDWORK >= (M+L)*2*NOBR*(M+L+1), if ALG = 'F', -C BATCH = 'F', 'I' and CONCT = 'N'; -C LDWORK >= (M+L)*4*NOBR*(M+L+1)+(M+L)*2*NOBR, if ALG = 'F', -C BATCH = 'L' and CONCT = 'N', or -C BATCH = 'O'; - - -IB01AD.f Lines 499-500: - ONEBCH = LSAME( BATCH, 'O' ) - FIRST = LSAME( BATCH, 'F' ) .OR. ONEBCH - - -IB01AD.f Lines 583-591: - ELSE IF ( FQRALG ) THEN - IF ( .NOT.ONEBCH .AND. CONNEC ) THEN - MINWRK = NR*( M + L + 3 ) - ELSE IF ( FIRST .OR. INTERM ) THEN // (batch = F || O) || batch = I - MINWRK = NR*( M + L + 1 ) ^ - ELSE | - MINWRK = 2*NR*( M + L + 1 ) + NR ??? - END IF - ELSE -*/ if (batch != 'O' && conct == 'C') ldwork = (m+l)*2*nobr*(m+l+3); - else if (batch == 'F' || batch == 'O' || batch == 'I') // && conct == 'N' + else if (batch == 'F' || batch == 'I') // && conct == 'N' ldwork = (m+l)*2*nobr*(m+l+1); - else // (batch == 'L' && conct == 'N') + else // (batch == 'L' || '0' && conct == 'N') ldwork = (m+l)*4*nobr*(m+l+1)+(m+l)*2*nobr; } else // (alg == 'Q') @@ -283,7 +262,7 @@ } else if (ldr >= ns && batch == 'O') { - if (meth == 'M') + if (metha == 'M') ldwork = max (4*(m+l)*nobr, 5*l*nobr); else // (meth == 'N') ldwork = 5*(m+l)*nobr + 1; @@ -321,7 +300,7 @@ // SLICOT routine IB01AD F77_XFCN (ib01ad, IB01AD, - (meth, alg, jobd, + (metha, alg, jobd, batch, conct, ctrl, nobr, m, l, nsmp, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-03-16 15:04:02
|
Revision: 9921 http://octave.svn.sourceforge.net/octave/?rev=9921&view=rev Author: carandraug Date: 2012-03-16 15:03:53 +0000 (Fri, 16 Mar 2012) Log Message: ----------- strings: fixing typos on help text Modified Paths: -------------- trunk/octave-forge/main/strings/inst/strsort.m trunk/octave-forge/main/strings/src/pcregexp.cc Modified: trunk/octave-forge/main/strings/inst/strsort.m =================================================================== --- trunk/octave-forge/main/strings/inst/strsort.m 2012-03-16 14:47:37 UTC (rev 9920) +++ trunk/octave-forge/main/strings/inst/strsort.m 2012-03-16 15:03:53 UTC (rev 9921) @@ -2,7 +2,7 @@ ## This program is granted to the public domain. ## -*- texinfo -*- -## @deftypefn {Function File} {[@ldots{}] =} strsort (@ldots{}) +## @deftypefn {Function File} {[@dots{}] =} strsort (@dots{}) ## Overloads the sort function to operate on strings. ## ## @seealso {sort} Modified: trunk/octave-forge/main/strings/src/pcregexp.cc =================================================================== --- trunk/octave-forge/main/strings/src/pcregexp.cc 2012-03-16 14:47:37 UTC (rev 9920) +++ trunk/octave-forge/main/strings/src/pcregexp.cc 2012-03-16 15:03:53 UTC (rev 9921) @@ -29,7 +29,7 @@ //FIXME This function needs some documentation DEFUN_DLD(pcregexp, args, nargout, "\ -*- texinfo -*-\n\ -@deftypefn {Loadable Function} {[@ldots{}] =} pcregexp (@ldots{})\n\ +@deftypefn {Loadable Function} {[@dots{}] =} pcregexp (@dots{})\n\ Perl-compatible regular expression matching.\n\ \n\ Check your system's @code{pcre} man page.\n\ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpi...@us...> - 2012-03-16 14:47:47
|
Revision: 9920 http://octave.svn.sourceforge.net/octave/?rev=9920&view=rev Author: jpicarbajal Date: 2012-03-16 14:47:37 +0000 (Fri, 16 Mar 2012) Log Message: ----------- linear-algebra: adding dependency to general 1.3.0 Modified Paths: -------------- trunk/octave-forge/main/linear-algebra/DESCRIPTION Modified: trunk/octave-forge/main/linear-algebra/DESCRIPTION =================================================================== --- trunk/octave-forge/main/linear-algebra/DESCRIPTION 2012-03-16 14:08:44 UTC (rev 9919) +++ trunk/octave-forge/main/linear-algebra/DESCRIPTION 2012-03-16 14:47:37 UTC (rev 9920) @@ -6,7 +6,7 @@ Title: Linear Algebra. Description: Additional linear algebra code, including general SVD and matrix functions. Categories: Linear-Algebra -Depends: octave (>= 3.2.3) +Depends: octave (>= 3.2.3), general (>= 1.3.0) Autoload: yes License: GPL version 3 or later Url: http://octave.sf.net This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mma...@us...> - 2012-03-16 14:08:51
|
Revision: 9919 http://octave.svn.sourceforge.net/octave/?rev=9919&view=rev Author: mmarzolla Date: 2012-03-16 14:08:44 +0000 (Fri, 16 Mar 2012) Log Message: ----------- bug fixes Modified Paths: -------------- trunk/octave-forge/main/queueing/inst/dtmc.m trunk/octave-forge/main/queueing/inst/dtmc_check_P.m trunk/octave-forge/main/queueing/inst/dtmc_fpt.m trunk/octave-forge/main/queueing/inst/dtmc_is_irreducible.m trunk/octave-forge/main/queueing/inst/dtmc_mtta.m Modified: trunk/octave-forge/main/queueing/inst/dtmc.m =================================================================== --- trunk/octave-forge/main/queueing/inst/dtmc.m 2012-03-16 11:24:04 UTC (rev 9918) +++ trunk/octave-forge/main/queueing/inst/dtmc.m 2012-03-16 14:08:44 UTC (rev 9919) @@ -24,14 +24,16 @@ ## @cindex Discrete time Markov chain ## @cindex Markov chain, stationary probabilities ## @cindex Stationary probabilities +## @cindex Markov chain, transient probabilities +## @cindex Transient probabilities ## -## With a single argument, compute the steady-state probability vector -## @code{@var{p}(1), @dots{}, @var{p}(N)} for a -## Discrete-Time Markov Chain given the @math{N \times N} transition -## probability matrix @var{P}. With three arguments, compute the -## probability vector @code{@var{p}(1), @dots{}, @var{p}(N)} -## after @var{n} steps, given initial probability vector @var{p0} at -## time 0. +## Compute steady-state or transient state occupancy probabilities for a +## Discrete-Time Markov Chain. With a single argument, compute the +## steady-state occupancy probability vector @code{@var{p}(1), @dots{}, +## @var{p}(N)} given the @math{N \times N} transition probability matrix +## @var{P}. With three arguments, compute the state occupancy +## probabilities @code{@var{p}(1), @dots{}, @var{p}(N)} after @var{n} +## steps, given initial occupancy probability vector @var{p0}. ## ## @strong{INPUTS} ## @@ -145,6 +147,15 @@ %! p = dtmc(P, 100, [1 0]); %! assert( plim, p, 1e-5 ); +%!test +%! P = [0 1 0 0 0; \ +%! .25 0 .75 0 0; \ +%! 0 .5 0 .5 0; \ +%! 0 0 .75 0 .25; \ +%! 0 0 0 1 0 ]; +%! p = dtmc(P); +%! assert( p, [.0625 .25 .375 .25 .0625], 10*eps ); + %!demo %! a = 0.2; %! b = 0.15; Modified: trunk/octave-forge/main/queueing/inst/dtmc_check_P.m =================================================================== --- trunk/octave-forge/main/queueing/inst/dtmc_check_P.m 2012-03-16 11:24:04 UTC (rev 9918) +++ trunk/octave-forge/main/queueing/inst/dtmc_check_P.m 2012-03-16 14:08:44 UTC (rev 9919) @@ -17,14 +17,14 @@ ## -*- texinfo -*- ## -## @deftypefn {Function File} {[@var{result} @var{err}] =} dtmc_check_P (@var{P}) +## @deftypefn {Function File} {[@var{r} @var{err}] =} dtmc_check_P (@var{P}) ## ## @cindex Markov chain, discrete time ## -## If @var{P} is a valid transition probability matrix, return -## the size (number of rows or columns) of @var{P}. If @var{P} is not -## a transition probability matrix, set @var{result} to zero, and -## @var{err} to an appropriate error string. +## Check if @var{P} is a valid transition probability matrix. If @var{P} +## is valid, @var{r} is the size (number of rows or columns) of @var{P}. +## If @var{P} is not a transition probability matrix, @var{r} is set to +## zero, and @var{err} to an appropriate error string. ## ## @end deftypefn @@ -40,19 +40,19 @@ endif result = 0; + err = ""; if ( !issquare(P) ) err = "P is not a square matrix"; return; endif - if ( any(any(P <0)) || norm( sum(P,2) - 1, "inf" ) > epsilon ) + if ( any(any(P<-epsilon)) || norm( sum(P,2) - 1, "inf" ) > epsilon ) err = "P is not a stochastic matrix"; return; endif result = rows(P); - err = ""; endfunction %!test %! [r err] = dtmc_check_P( [1 1 1; 1 1 1] ); Modified: trunk/octave-forge/main/queueing/inst/dtmc_fpt.m =================================================================== --- trunk/octave-forge/main/queueing/inst/dtmc_fpt.m 2012-03-16 11:24:04 UTC (rev 9918) +++ trunk/octave-forge/main/queueing/inst/dtmc_fpt.m 2012-03-16 14:08:44 UTC (rev 9919) @@ -84,6 +84,10 @@ ( N>0 ) || \ error(err); + if ( any(diag(P) == 1) ) + error("Cannot compute first passage times for absorbing chains"); + endif + if ( nargin == 1 ) M = zeros(N,N); ## M(i,j) = 1 + sum_{k \neq j} P(i,k) M(k,j) @@ -119,7 +123,14 @@ %! 0.1 0.0 0.9; \ %! 0.9 0.1 0.0 ]; %! M = dtmc_fpt(P); +%! w = dtmc(P); +%! N = rows(P); +%! W = repmat(w,N,1); +%! Z = inv(eye(N)-P+W); +%! M1 = (repmat(diag(Z)',1,N) - Z) ./ repmat(w',1,N); +%! assert(M, M1); + %!shared P %! P = [ 0.0 0.9 0.1; \ %! 0.1 0.0 0.9; \ @@ -138,10 +149,9 @@ %!test %! m = dtmc_fpt(P, 1, [2 3]); -## FIXME: check this (matrix not ergodic???) -%!xtest +%!test %! P = dtmc_bd([1 1 1], [ 0 0 0] ); -%! dtmc_fpt(P); +%! fail( "dtmc_fpt(P)", "absorbing" ); ## Example on p. 461 of ## http://www.cs.virginia.edu/~gfx/Courses/2006/DataDriven/bib/texsyn/Chapter11.pdf Modified: trunk/octave-forge/main/queueing/inst/dtmc_is_irreducible.m =================================================================== --- trunk/octave-forge/main/queueing/inst/dtmc_is_irreducible.m 2012-03-16 11:24:04 UTC (rev 9918) +++ trunk/octave-forge/main/queueing/inst/dtmc_is_irreducible.m 2012-03-16 14:08:44 UTC (rev 9919) @@ -21,10 +21,11 @@ ## ## @cindex Markov chain, discrete time ## @cindex Discrete time Markov chain +## @cindex Irreducible Markov chain ## -## Check if @var{P} is irreducible, and identify strongly connected -## components in the transition graph of the discrete-time Markov chain -## with transition probability matrix @var{P}. +## Check if @var{P} is irreducible, and identify Strongly Connected +## Components (SCC) in the transition graph of the DTMC with transition +## probability matrix @var{P}. ## ## @strong{INPUTS} ## @@ -45,10 +46,10 @@ ## 1 if @var{P} irreducible, 0 otherwise. ## ## @item s -## @code{@var{s}(i)} is the strongly connected component that state @math{i} -## belongs to. Strongly connected components are numbered as 1, 2, -## @dots{}. If the graph is strongly connected, then there is a single -## SCC and the predicate @code{all(s == 1)} evaluates to true. +## @code{@var{s}(i)} is the SCC that state @math{i} belongs to. SCCs are +## numbered as 1, 2, @dots{}. If the graph is strongly connected, then +## there is a single SCC and the predicate @code{all(s == 1)} evaluates +## to true. ## ## @end table ## @@ -59,19 +60,23 @@ function [r s] = dtmc_is_irreducible( P ) - persistent epsilon = 10*eps; - if ( nargin != 1 ) print_usage(); endif - # dtmc_check_P(P); - + [N err] = dtmc_check_P(P); + if ( N == 0 ) + error(err); + endif s = __scc(P); r = (max(s) == 1); endfunction %!test +%! P = [0 .5 0; 0 0 0]; +%! fail( "dtmc_is_irresudible(P)" ); + +%!test %! P = [0 1 0; 0 .5 .5; 0 1 0]; %! [r s] = dtmc_is_irreducible(P); %! assert( r == 0 ); Modified: trunk/octave-forge/main/queueing/inst/dtmc_mtta.m =================================================================== --- trunk/octave-forge/main/queueing/inst/dtmc_mtta.m 2012-03-16 11:24:04 UTC (rev 9918) +++ trunk/octave-forge/main/queueing/inst/dtmc_mtta.m 2012-03-16 14:08:44 UTC (rev 9919) @@ -22,6 +22,7 @@ ## ## @cindex Markov chain, disctete time ## @cindex Mean time to absorption +## @cindex Absorption probabilities ## ## Compute the expected number of steps before absorption for the ## DTMC with @math{N \times N} transition probability matrix @var{P}. @@ -53,9 +54,10 @@ ## @item B ## When called with a single argument, @var{B} is a @math{N \times N} ## matrix where @code{@var{B}(i,j)} is the probability of being absorbed -## in state @math{j}, starting from state @math{i}; if @math{j} is not -## absorbing, @code{@var{B}(i,j) = 0}; if @math{i} is absorbing, then -## @code{@var{B}(i,i) = 1}. When called with two arguments, @var{B} is a +## in state @math{j}, starting from transient state @math{i}; if +## @math{j} is not absorbing, @code{@var{B}(i,j) = 0}; if @math{i} is +## absorbing, then @code{@var{B}(i,i) = 1}. +## When called with two arguments, @var{B} is a ## vector with @math{N} elements where @code{@var{B}(j)} is the ## probability of being absorbed in state @var{j}, given initial state ## occupancy probabilities @var{p0}. @@ -82,7 +84,7 @@ if ( nargin == 2 ) ( isvector(p0) && length(p0) == K && all(p0>=0) && abs(sum(p0)-1.0)<epsilon ) || \ - usage( "p0 must be a probability vector" ); + usage( "p0 must be a state occupancy probability vector" ); endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpi...@us...> - 2012-03-16 11:24:15
|
Revision: 9918 http://octave.svn.sourceforge.net/octave/?rev=9918&view=rev Author: jpicarbajal Date: 2012-03-16 11:24:04 +0000 (Fri, 16 Mar 2012) Log Message: ----------- linear-algebra: Beginning to add nonnegative matrix factorization Added Paths: ----------- trunk/octave-forge/main/linear-algebra/devel/ trunk/octave-forge/main/linear-algebra/devel/nmf_pg.m Added: trunk/octave-forge/main/linear-algebra/devel/nmf_pg.m =================================================================== --- trunk/octave-forge/main/linear-algebra/devel/nmf_pg.m (rev 0) +++ trunk/octave-forge/main/linear-algebra/devel/nmf_pg.m 2012-03-16 11:24:04 UTC (rev 9918) @@ -0,0 +1,249 @@ +## Copyright (C) 2005-2006 Chih-Jen Lin <cj...@cs...> +## All rights reserved. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions are met: +## +## 1 Redistributions of source code must retain the above copyright notice, +## this list of conditions and the following disclaimer. +## 2 Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## +## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' +## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +## ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +## SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +## CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +## +## The views and conclusions contained in the software and documentation are +## those of the authors and should not be interpreted as representing official +## policies, either expressed or implied, of the copyright holders. + +## -*- texinfo -*- +## @deftypefn {Function File} {[@var{W}, @var{H}] =} nmf_pg (@var{V}, @var{Winit}, @ +## @var{Hinit}, @var{tol}, @var{timelimit}, @var{maxiter}) +## +## Non-negative matrix factorization by alternative non-negative least squares +## using projected gradients. +## +## The matrix @var{V} is factorized into two possitive matrices @var{W} and +## @var{H} such that @code{V = W*H + U}. Where @var{U} is a matrix of residuals +## that can be negative or positive. When the matrix @var{V} is positive the order +## of the elements in @var{U} is bounded by the optional named argument @var{tol} +## (default value @code{1e-9}). +## +## The factorization is not unique and depends on the inital guess for the matrices +## @var{W} and @var{H}. You can pass this initalizations using the optional +## named arguments @var{Winit} and @var{Hinit}. +## +## timelimit, maxiter: limit of time and iterations +## +## Examples: +## +## @example +## A = rand(10,5); +## [W H] = nmf_pg(A,tol=1e-3); +## U = W*H -A; +## disp(max(abs(U))); +## @end example +## +## @end deftypefn + +## 2012 - Modified and adapted to Octave 3.6.1 by +## Juan Pablo Carbajal <car...@if...> + +function [W, H] = nmf_pg (V, Winit=[], Hinit=[], tol=1e-6, timelimit=1, maxiter=100) +# JuanPi Fri 16 Mar 2012 10:49:11 AM CET +# TODO: +# - finish docstring +# - verbose optional +# - avoid multiple transpositions +# - vectorize loops + [r c] = size (V); + Hgiven = !isempty (Hinit) + Wgiven = !isempty (Winit) + if Wgiven && !Hgiven + + W = Winit; + H = ones (size (W,2),c); + + elseif !Wgiven && Hgiven + + H = Hinit; + W = ones (r, size(H,2)); + + elseif !Wgiven && !Hgiven + + if r == c + W = ones (r) + H = W + else + W = ones (r); + H = ones (r,c); + end + + else + + W = Winit; + H = Hinit; + + end + + initt = cputime (); + + gradW = W*(H*H') - V*H'; + gradH = (W'*W)*H - W'*V; + + initgrad = norm([gradW; gradH'],'fro'); + + fprintf('Init gradient norm %f\n', initgrad); + + tolW = max(0.001,tol)*initgrad; + tolH = tolW; + + for iter=1:maxiter, + + % stopping condition + projnorm = norm ( [ gradW(gradW<0 | W>0); gradH(gradH<0 | H>0) ] ); + if projnorm < tol*initgrad || cputime-initt > timelimit, + break; + end + + [W, gradW, iterW] = nlssubprob(V', H', W', tolW, 1000); + W = W'; + gradW = gradW'; + + if iterW == 1, + tolW = 0.1 * tolW; + end + + [H, gradH, iterH] = nlssubprob(V, W, H, tolH, 1000); + if iterH == 1, + tolH = 0.1 * tolH; + end + + if (iterW == 1 && iterH == 1 && tolH + tolW < tol*initgrad), + fprintf('Failed to move\n'); break; + end + + if rem(iter,10)==0 + fprintf('.'); + end + + end + + fprintf('\nIter = %d Final proj-grad norm %f\n', iter, projnorm); + +endfunction + +function [H, grad,iter] = nlssubprob(V,W,Hinit,tol,maxiter) +% H, grad: output solution and gradient +% iter: #iterations used +% V, W: constant matrices +% Hinit: initial solution +% tol: stopping tolerance +% maxiter: limit of iterations + + H = Hinit; + WtV = W'*V; + WtW = W'*W; + + alpha = 1; + beta = 0.1; + + for iter=1:maxiter + grad = WtW*H - WtV; + projgrad = norm ( grad(grad < 0 | H >0) ); + + if projgrad < tol, + break + end + + % search step size + Hn = max(H - alpha*grad, 0); + d = Hn-H; + gradd = sum ( sum (grad.*d) ); + dQd = sum ( sum ((WtW*d).*d) ); + + if gradd + 0.5*dQd > 0.01*gradd, + % decrease alpha + while 1, + alpha *= beta; + Hn = max (H - alpha*grad, 0); + d = Hn-H; + gradd = sum (sum (grad.*d) ); + dQd = sum (sum ((WtW*d).*d)); + + if gradd + 0.5*dQd <= 0.01*gradd || alpha < 1e-20 + H = Hn; + break + end + + endwhile + + else + % increase alpha + while 1, + Hp = Hn; + alpha /= beta; + Hn = max(H - alpha*grad, 0); + d = Hn-H; + gradd = sum ( sum (grad.*d) ); + dQd = sum (sum ( (WtW*d).*d ) ); + + if gradd + 0.5*dQd > 0.01*gradd || Hn == Hp || alpha > 1e10 + H = Hp; + alpha *= beta; + break + end + + endwhile + end + + endfor + + if iter == maxiter + fprintf('Max iter in nlssubprob\n'); + end + +endfunction + +%!demo +%! t = linspace (0,1,100)'; +%! +%! % Build hump functions of different frequency +%! W_true = arrayfun ( @(f)sin(2*pi*f*t).^2, linspace (0.5,2,4), ... +%! 'uniformoutput', false ); +%! W_true = cell2mat (W_true); +%! +%! % Build combinator vectors +%! c = (1:4)'; +%! H_true = arrayfun ( @(f)circshift(c,f), linspace (0,3,4), ... +%! 'uniformoutput', false ); +%! H_true = cell2mat (H_true); +%! +%! % Mix them +%! V = W_true*H_true; +%! +%! % give good inital guesses +%! Winit = W_true + 0.4*randn(size(W_true)); +%! Hinit = H_true + 0.2*randn(size(H_true)); +%! +%! Factorize +%! [W H] = nmf_pg(V,Winit,Hinit,1e-6,1,1e3); +%! disp('True mixer') +%! disp(H_true) +%! disp('Rounded factorized mixer') +%! disp(round(H)) +%! +%! plot(t,W,'o;factorized;') +%! hold on +%! plot(t,W_true,'-;True;') +%! hold off +%! axis tight This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpi...@us...> - 2012-03-16 09:15:45
|
Revision: 9917 http://octave.svn.sourceforge.net/octave/?rev=9917&view=rev Author: jpicarbajal Date: 2012-03-16 09:15:38 +0000 (Fri, 16 Mar 2012) Log Message: ----------- admin: releasePKG, ask before installing Modified Paths: -------------- trunk/octave-forge/admin/releasePKG.m Modified: trunk/octave-forge/admin/releasePKG.m =================================================================== --- trunk/octave-forge/admin/releasePKG.m 2012-03-16 03:58:03 UTC (rev 9916) +++ trunk/octave-forge/admin/releasePKG.m 2012-03-16 09:15:38 UTC (rev 9917) @@ -104,14 +104,16 @@ printf("Tared to %s\n", pkgtar); fflush(stdout); - % Install package - printf("Installing...\n"); - fflush(stdout); - pkg ('install', pkgtar); do_doc = input("\nCreate documentation for Octave-Forge? [y|Yes|Y] / [n|No|N] ","s"); do_doc = strcmpi(do_doc(1),'y'); if do_doc + % Install package + printf("Installing...\n"); + fflush(stdout); + pkg ('install', pkgtar); + + % Load package and generate_html printf("Generating html...\n"); fflush(stdout); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-03-16 03:58:10
|
Revision: 9916 http://octave.svn.sourceforge.net/octave/?rev=9916&view=rev Author: carandraug Date: 2012-03-16 03:58:03 +0000 (Fri, 16 Mar 2012) Log Message: ----------- help text: functions in oct files are {Loadable Functions}, not {Function Files}. Fixing help texts accordingly Modified Paths: -------------- trunk/octave-forge/extra/ocs/src/Mshichmanhodgesmosfet.cc trunk/octave-forge/main/fits/src/read_fits_image.cc trunk/octave-forge/main/fits/src/save_fits_image.cc trunk/octave-forge/main/fits/src/save_fits_image_multi_ext.cc trunk/octave-forge/main/image/src/__boundary__.cc trunk/octave-forge/main/image/src/__bwdist.cc trunk/octave-forge/main/image/src/bwfill.cc trunk/octave-forge/main/image/src/bwlabel.cc trunk/octave-forge/main/image/src/bwlabeln.cc trunk/octave-forge/main/image/src/graycomatrix.cc trunk/octave-forge/main/image/src/nonmax_supress.cc trunk/octave-forge/main/image/src/rotate_scale.cc trunk/octave-forge/main/io/src/cell2csv.cc trunk/octave-forge/main/io/src/csv2cell.cc trunk/octave-forge/main/io/src/csvconcat.cc trunk/octave-forge/main/io/src/csvexplode.cc trunk/octave-forge/main/io/src/xmlread.cc trunk/octave-forge/main/miscellaneous/src/text_waitbar.cc trunk/octave-forge/main/odepkg/src/odepkg_octsolver_rodas.cc trunk/octave-forge/main/strings/src/pcregexp.cc Modified: trunk/octave-forge/extra/ocs/src/Mshichmanhodgesmosfet.cc =================================================================== --- trunk/octave-forge/extra/ocs/src/Mshichmanhodgesmosfet.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/extra/ocs/src/Mshichmanhodgesmosfet.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -222,7 +222,7 @@ DEFUN_DLD(Mshichmanhodgesmosfet,args,nargout, "-*- texinfo -*-\n\ \n\ -@deftypefn{Function File} @\n\ +@deftypefn{Loadable Function} @\n\ {[@var{a},@var{b},@var{c}]=} Mshichmanhodgesmosfet@\n\ (@var{string}, @var{parameters}, @var{parameternames}, @\n\ @var{extvar},@var{intvar},@var{t})\n\ Modified: trunk/octave-forge/main/fits/src/read_fits_image.cc =================================================================== --- trunk/octave-forge/main/fits/src/read_fits_image.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/fits/src/read_fits_image.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -19,7 +19,7 @@ DEFUN_DLD( read_fits_image, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Function File} {[@var{image},@var{header}]} = read_fits_image(@var{filename},@var{hdu})\n\ +@deftypefn {Loadable Function} {[@var{image},@var{header}]} = read_fits_image(@var{filename},@var{hdu})\n\ Read FITS file @var{filename} and return image data in @var{image}, and the image header in @var{header}.\n\ \n\ @var{filename} can be concatenated with filters provided by libcfitsio. See:\ Modified: trunk/octave-forge/main/fits/src/save_fits_image.cc =================================================================== --- trunk/octave-forge/main/fits/src/save_fits_image.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/fits/src/save_fits_image.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -11,7 +11,7 @@ DEFUN_DLD( save_fits_image, args, nargout, "-*- texinfo -*-\n\ - @deftypefn {Function File} save_fits_image(@var{filename}, @var{image}, @var{bit_per_pixel})\n\ + @deftypefn {Loadable Function} save_fits_image(@var{filename}, @var{image}, @var{bit_per_pixel})\n\ Write @var{IMAGE} to FITS file @var{filename}.\n\n\ Datacubes will be saved with NAXIS=3.\n\n\ The optional parameter @var{bit_per_pixel} specifies the data type of the pixel values. Accepted string values are BYTE_IMG, SHORT_IMG, LONG_IMG, LONGLONG_IMG, FLOAT_IMG, and DOUBLE_IMG (default). Alternatively, corresponding numbers may be passed, i.e. 8, 16, 32, 64, -32, and -64.\n\n\ Modified: trunk/octave-forge/main/fits/src/save_fits_image_multi_ext.cc =================================================================== --- trunk/octave-forge/main/fits/src/save_fits_image_multi_ext.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/fits/src/save_fits_image_multi_ext.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -11,7 +11,7 @@ DEFUN_DLD( save_fits_image_multi_ext, args, nargout, "-*- texinfo -*-\n\ - @deftypefn {Function File} save_fits_image_multi_ext(@var{filename}, @var{image}, @var{bit_per_pixel})\n\ + @deftypefn {Loadable Function} save_fits_image_multi_ext(@var{filename}, @var{image}, @var{bit_per_pixel})\n\ Write @var{IMAGE} to FITS file @var{filename}.\n\n\ Datacubes will be saved as multi-image extensions.\n\n\ The optional parameter @var{bit_per_pixel} specifies the data type of the pixel values. Accepted string values are BYTE_IMG, SHORT_IMG, LONG_IMG, LONGLONG_IMG, FLOAT_IMG, and DOUBLE_IMG (default). Alternatively, corresponding numbers may be passed, i.e. 8, 16, 32, 64, -32, and -64.\n\n\ Modified: trunk/octave-forge/main/image/src/__boundary__.cc =================================================================== --- trunk/octave-forge/main/image/src/__boundary__.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/image/src/__boundary__.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -27,8 +27,8 @@ DEFUN_DLD(__boundary__, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Function File} {@var{b} = } boundary(@var{region})\n\ -@deftypefnx {Function File} {@var{b} = } boundary(@var{region}, @var{conn})\n\ +@deftypefn {Loadable Function} {@var{b} = } boundary(@var{region})\n\ +@deftypefnx {Loadable Function} {@var{b} = } boundary(@var{region}, @var{conn})\n\ Trace the boundary of an object in a binary image.\n\ \n\ @code{boundary} computes the exterior clockwise boundary of the single \ Modified: trunk/octave-forge/main/image/src/__bwdist.cc =================================================================== --- trunk/octave-forge/main/image/src/__bwdist.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/image/src/__bwdist.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -64,7 +64,7 @@ DEFUN_DLD ( __bwdist, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Function File} {@var{D} =} __bwdist(@var{bw})\n\ +@deftypefn {Loadable Function} {@var{D} =} __bwdist(@var{bw})\n\ Computes the distance transform of the image @var{bw}.\n\ @var{bw} should be a binary 2D array, either a Boolean array or a\n\ numeric array containing only the values 0 and 1.\n\ @@ -75,7 +75,7 @@ metric) to the closest object pixel. For each object pixel the\n\ return value is 0.\n\ \n\ -@deftypefnx{Function File} {@var{D} =} __bwdist(@var{bw}, @var{method})\n\ +@deftypefnx{Loadable Function} {@var{D} =} __bwdist(@var{bw}, @var{method})\n\ \n\ @var{method} is a string to choose the distance metric. Currently\n\ available metrics are 'euclidean', 'chessboard', 'cityblock' and\n\ @@ -83,7 +83,7 @@ to any string starting with 'e', 'ch', 'ci' and 'q', respectively.\n\ If @var{method} is not specified, 'euclidean' is the default.\n\ \n\ -@deftypefnx {Function File} {[@var{D},@var{C}] =} __bwdist(@var{bw}, @var{method})\n\ +@deftypefnx {Loadable Function} {[@var{D},@var{C}] =} __bwdist(@var{bw}, @var{method})\n\ \n\ If a second output argument is given, the linear index for the\n\ closest object pixel is returned for each pixel. (For object\n\ Modified: trunk/octave-forge/main/image/src/bwfill.cc =================================================================== --- trunk/octave-forge/main/image/src/bwfill.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/image/src/bwfill.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -25,7 +25,7 @@ DEFUN_DLD (bwfill, args, ,"\ -*- texinfo -*-\n\ -@deftypefn {Function File} {[@var{bw2}, @var{idx}] =} bwfill(@var{bw1}, @var{c}, @var{r}, @var{n})\n\ +@deftypefn {Loadable Function} {[@var{bw2}, @var{idx}] =} bwfill(@var{bw1}, @var{c}, @var{r}, @var{n})\n\ Perform a flood-fill operation on the binary image @var{bw1}.\n\ The flood-filling starts in the pixel (@var{r}, @var{c}). If @var{r} and @var{c}\n\ are vectors of the same length, each pixel pair (@var{r}(i), @var{c}(i)) will\n\ @@ -35,7 +35,7 @@ \n\ The output is the processed image @var{bw2} and the indexes of the filled\n\ pixels @var{idx}\n\ -@deftypefnx{Function File} {[@var{bw2}, @var{idx}] =} bwfill(@var{bw1}, \"holes\", @var{n})\n\ +@deftypefnx{Loadable Function} {[@var{bw2}, @var{idx}] =} bwfill(@var{bw1}, \"holes\", @var{n})\n\ If the string \"holes\" is given instead of starting points for the flood-fill\n\ operation, the function finds interior holes in @var{bw1} and fills them.\n\ @end deftypefn\n\ Modified: trunk/octave-forge/main/image/src/bwlabel.cc =================================================================== --- trunk/octave-forge/main/image/src/bwlabel.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/image/src/bwlabel.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -61,7 +61,7 @@ DEFUN_DLD(bwlabel, args, , "\ -*- texinfo -*-\n\ -@deftypefn {Function File} {[@var{l}, @var{num}] =} bwlabel(@var{bw}, @var{n})\n\ +@deftypefn {Loadable Function} {[@var{l}, @var{num}] =} bwlabel(@var{bw}, @var{n})\n\ Labels foreground objects in the binary image @var{bw}.\n\ The output @var{l} is a matrix where 0 indicates a background pixel,\n\ 1 indicates that the pixel belong to object number 1, 2 that the pixel\n\ Modified: trunk/octave-forge/main/image/src/bwlabeln.cc =================================================================== --- trunk/octave-forge/main/image/src/bwlabeln.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/image/src/bwlabeln.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -214,7 +214,7 @@ DEFUN_DLD(bwlabeln, args, , "\ -*- texinfo -*-\n\ -@deftypefn {Function File} {[@var{l}, @var{num}] =} bwlabeln(@var{bw}, @var{n})\n\ +@deftypefn {Loadable Function} {[@var{l}, @var{num}] =} bwlabeln(@var{bw}, @var{n})\n\ Label foreground objects in the n-dimensional binary image @var{bw}.\n\ \n\ The optional argument @var{n} sets the connectivity and defaults 26.\n\ Modified: trunk/octave-forge/main/image/src/graycomatrix.cc =================================================================== --- trunk/octave-forge/main/image/src/graycomatrix.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/image/src/graycomatrix.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -26,7 +26,7 @@ DEFUN_DLD(graycomatrix, args, , "\ -*- texinfo -*-\n\ -@deftypefn {Function File} {@var{P} =} graycomatrix(@var{im}, @var{levels}, @var{distances}, @var{angles})\n\ +@deftypefn {Loadable Function} {@var{P} =} graycomatrix(@var{im}, @var{levels}, @var{distances}, @var{angles})\n\ Calculates the gray-level co-occurrence matrix @var{P} of a gray-level image @var{im}.\n\ \n\ @var{P} is a 4-dimensional matrix (histogram). The value @var{P}(@var{i},@var{j},@var{d},@var{theta})\n\ Modified: trunk/octave-forge/main/image/src/nonmax_supress.cc =================================================================== --- trunk/octave-forge/main/image/src/nonmax_supress.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/image/src/nonmax_supress.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -47,13 +47,13 @@ DEFUN_DLD(nonmax_supress,args,nargout,"\ -*- texinfo -*-\n\ -@deftypefn {Function File} nonmax_supress (@var{Es}, @var{Eo})\n\ +@deftypefn {Loadable Function} nonmax_supress (@var{Es}, @var{Eo})\n\ Performs non-maximum supression on the given edge data. \ @var{Es} is a matrix containing the edge strength (the length of \ the gradient), and @var{Eo} is the edge normal orientation (the \ direction of the gradient).\n\ \n\ -@deftypefnx {Function File} nonmax_supress (@var{Es}, @var{Eo},\ +@deftypefnx {Loadable Function} nonmax_supress (@var{Es}, @var{Eo},\ @var{low}, @var{high} )\n\ Performs non-maximum supression and hysteresis thresholdong, using \ @var{low} and @var{high} as thresholds.\n\ Modified: trunk/octave-forge/main/image/src/rotate_scale.cc =================================================================== --- trunk/octave-forge/main/image/src/rotate_scale.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/image/src/rotate_scale.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -31,7 +31,7 @@ DEFUN_DLD (rotate_scale, args, , "\ -*- texinfo -*-\n\ -@deftypefn {Function File} {@var{im1} =} rotate_scale(@var{im0}, @var{lm0}, @var{lm1}, @var{out_size})\n\ +@deftypefn {Loadable Function} {@var{im1} =} rotate_scale(@var{im0}, @var{lm0}, @var{lm1}, @var{out_size})\n\ Arbitrary rotation and scaling of a gray-scale image using fast bilinear interpolation.\n\ \n\ The image @var{im0} will be rotated and scaled such that the landmark points in\n\ Modified: trunk/octave-forge/main/io/src/cell2csv.cc =================================================================== --- trunk/octave-forge/main/io/src/cell2csv.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/io/src/cell2csv.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -20,9 +20,9 @@ DEFUN_DLD (cell2csv, args, nargout, "-*- texinfo -*-\n" - "@deftypefn {Function File} {} cell2csv (@var{file}, @var{c})\n" - "@deftypefnx {Function File} {} cell2csv (@var{file}, @var{c}, @var{sep})\n" - "@deftypefnx {Function File} {} cell2csv (@var{file}, @var{c}, @var{sep}, @var{prot})\n" + "@deftypefn {Loadable Function} {} cell2csv (@var{file}, @var{c})\n" + "@deftypefnx {Loadable Function} {} cell2csv (@var{file}, @var{c}, @var{sep})\n" + "@deftypefnx {Loadable Function} {} cell2csv (@var{file}, @var{c}, @var{sep}, @var{prot})\n" "\n" "Create a CSV file from a cell. " "@var{sep} changes the character used to separate two fields. By " Modified: trunk/octave-forge/main/io/src/csv2cell.cc =================================================================== --- trunk/octave-forge/main/io/src/csv2cell.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/io/src/csv2cell.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -22,9 +22,9 @@ DEFUN_DLD (csv2cell, args, nargout, "-*- texinfo -*-\n" - "@deftypefn {Function File} {@var{c} = } csv2cell (@var{file})\n" - "@deftypefnx {Function File} {@var{c} = } csv2cell (@var{file}, @var{sep})\n" - "@deftypefnx {Function File} {@var{c} = } csv2cell (@var{file}, @var{sep}, @var{prot})\n" + "@deftypefn {Loadable Function} {@var{c} = } csv2cell (@var{file})\n" + "@deftypefnx {Loadable Function} {@var{c} = } csv2cell (@var{file}, @var{sep})\n" + "@deftypefnx {Loadable Function} {@var{c} = } csv2cell (@var{file}, @var{sep}, @var{prot})\n" "\n" "Read a CSV (Comma Separated Values) file and convert it into a " "cell. " Modified: trunk/octave-forge/main/io/src/csvconcat.cc =================================================================== --- trunk/octave-forge/main/io/src/csvconcat.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/io/src/csvconcat.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -18,9 +18,9 @@ DEFUN_DLD (csvconcat, args, nargout, "-*- texinfo -*-\n" - "@deftypefn {Function File} {@var{str} = } csvconcat (@var{c})\n" - "@deftypefnx {Function File} {@var{str} = } csvconcat (@var{c}, @var{sep})\n" - "@deftypefnx {Function File} {@var{str} = } csvconcat (@var{c}, @var{sep}, @var{prot})\n" + "@deftypefn {Loadable Function} {@var{str} = } csvconcat (@var{c})\n" + "@deftypefnx {Loadable Function} {@var{str} = } csvconcat (@var{c}, @var{sep})\n" + "@deftypefnx {Loadable Function} {@var{str} = } csvconcat (@var{c}, @var{sep}, @var{prot})\n" "\n" "Concatenate a cell into a CSV string or array of strings. " "@var{sep} changes the character used to separate two fields. By " Modified: trunk/octave-forge/main/io/src/csvexplode.cc =================================================================== --- trunk/octave-forge/main/io/src/csvexplode.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/io/src/csvexplode.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -18,9 +18,9 @@ DEFUN_DLD (csvexplode, args, nargout, "-*- texinfo -*-\n" - "@deftypefn {Function File} {@var{c} = } csvexplode (@var{str})\n" - "@deftypefnx {Function File} {@var{c} = } csvexplode (@var{str}, @var{sep})\n" - "@deftypefnx {Function File} {@var{c} = } csvexplode (@var{str}, @var{sep}, @var{prot})\n" + "@deftypefn {Loadable Function} {@var{c} = } csvexplode (@var{str})\n" + "@deftypefnx {Loadable Function} {@var{c} = } csvexplode (@var{str}, @var{sep})\n" + "@deftypefnx {Loadable Function} {@var{c} = } csvexplode (@var{str}, @var{sep}, @var{prot})\n" "\n" "Explode a CSV string into a cell. " "@var{sep} changes the character used to separate two fields. By " Modified: trunk/octave-forge/main/io/src/xmlread.cc =================================================================== --- trunk/octave-forge/main/io/src/xmlread.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/io/src/xmlread.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -127,7 +127,7 @@ DEFUN_DLD (xmlread, args, nargout, "-*- texinfo -*-\n" - "@deftypefn {Function File} {@var{value}} xmlread(@var{filename})\n" + "@deftypefn {Loadable Function} {@var{value}} xmlread(@var{filename})\n" "\n" "Read a @var{value} from @var{filename} as an XML file\n" "@end deftypefn") { Modified: trunk/octave-forge/main/miscellaneous/src/text_waitbar.cc =================================================================== --- trunk/octave-forge/main/miscellaneous/src/text_waitbar.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/miscellaneous/src/text_waitbar.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -36,9 +36,9 @@ DEFUN_DLD(text_waitbar, args, nargout, " -*- texinfo -*-\n\ -@deftypefn {Function File} {} text_waitbar (@var{frac})\n\ -@deftypefnx {Function File} {} text_waitbar (@var{frac}, @var{msg})\n\ -@deftypefnx {Function File} {} text_waitbar (0, @var{n})\n\ +@deftypefn {Loadable Function} {} text_waitbar (@var{frac})\n\ +@deftypefnx {Loadable Function} {} text_waitbar (@var{frac}, @var{msg})\n\ +@deftypefnx {Loadable Function} {} text_waitbar (0, @var{n})\n\ Display text-based waitbar/progress bar.\n\ \n\ This function is similar to the @code{waitbar} function but is a text, rather\n\ Modified: trunk/octave-forge/main/odepkg/src/odepkg_octsolver_rodas.cc =================================================================== --- trunk/octave-forge/main/odepkg/src/odepkg_octsolver_rodas.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/odepkg/src/odepkg_octsolver_rodas.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -461,7 +461,7 @@ // PKG_ADD: autoload ("oders", "dldsolver.oct"); DEFUN_DLD (oders, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Function File} {[@var{}] =} oders (@var{@@fun}, @var{slot}, @var{init}, [@var{opt}], [@var{par1}, @var{par2}, @dots{}])\n\ +@deftypefn {Loadable Function} {[@var{}] =} oders (@var{@@fun}, @var{slot}, @var{init}, [@var{opt}], [@var{par1}, @var{par2}, @dots{}])\n\ @deftypefnx {Command} {[@var{sol}] =} oders (@var{@@fun}, @var{slot}, @var{init}, [@var{opt}], [@var{par1}, @var{par2}, @dots{}])\n\ @deftypefnx {Command} {[@var{t}, @var{y}, [@var{xe}, @var{ye}, @var{ie}]] =} oders (@var{@@fun}, @var{slot}, @var{init}, [@var{opt}], [@var{par1}, @var{par2}, @dots{}])\n\ \n\ Modified: trunk/octave-forge/main/strings/src/pcregexp.cc =================================================================== --- trunk/octave-forge/main/strings/src/pcregexp.cc 2012-03-16 03:18:23 UTC (rev 9915) +++ trunk/octave-forge/main/strings/src/pcregexp.cc 2012-03-16 03:58:03 UTC (rev 9916) @@ -29,7 +29,7 @@ //FIXME This function needs some documentation DEFUN_DLD(pcregexp, args, nargout, "\ -*- texinfo -*-\n\ -@deftypefn {Function File} {[@ldots{}] =} pcregexp (@ldots{})\n\ +@deftypefn {Loadable Function} {[@ldots{}] =} pcregexp (@ldots{})\n\ Perl-compatible regular expression matching.\n\ \n\ Check your system's @code{pcre} man page.\n\ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-03-16 03:18:29
|
Revision: 9915 http://octave.svn.sourceforge.net/octave/?rev=9915&view=rev Author: carandraug Date: 2012-03-16 03:18:23 +0000 (Fri, 16 Mar 2012) Log Message: ----------- pccregexp: replace tabs per spaces, use texinfo for help text (even though help text doesn't help much) Modified Paths: -------------- trunk/octave-forge/main/strings/src/pcregexp.cc Modified: trunk/octave-forge/main/strings/src/pcregexp.cc =================================================================== --- trunk/octave-forge/main/strings/src/pcregexp.cc 2012-03-16 03:05:24 UTC (rev 9914) +++ trunk/octave-forge/main/strings/src/pcregexp.cc 2012-03-16 03:18:23 UTC (rev 9915) @@ -26,24 +26,31 @@ #include <iostream> #include <vector> +//FIXME This function needs some documentation DEFUN_DLD(pcregexp, args, nargout, "\ +-*- texinfo -*-\n\ +@deftypefn {Function File} {[@ldots{}] =} pcregexp (@ldots{})\n\ Perl-compatible regular expression matching.\n\ \n\ -See also \"help regexp\" and the manpage for 'pcre'.\n\ -" ) { +Check your system's @code{pcre} man page.\n\ +\n\ +@seealso{regexp}\n\ +@end deftypefn\n\ +") +{ octave_value_list retval = octave_value_list(); if (args.length() != 2) { - print_usage (); - return retval; + print_usage (); + return retval; } std::string pattern = args(0).string_value(); std::string input = args(1).string_value(); if (error_state) { - gripe_wrong_type_arg("pcregexp", args(0)); - return retval; + gripe_wrong_type_arg("pcregexp", args(0)); + return retval; } // Compile expression @@ -53,8 +60,8 @@ re = pcre_compile(pattern.c_str(), 0, &err, &erroffset, NULL); if (re == NULL) { - error("pcregexp: %s at position %d of expression", err, erroffset); - return retval; + error("pcregexp: %s at position %d of expression", err, erroffset); + return retval; } // Get nr of subpatterns @@ -66,37 +73,37 @@ int matches = pcre_exec(re, NULL, input.c_str(), input.length(), 0, 0, ovector, (subpatterns+1)*3); if (matches == PCRE_ERROR_NOMATCH) { - for (int i=nargout-1; i>=0; i--) retval(i) = ""; - retval(0) = Matrix(); - pcre_free(re); - return retval; + for (int i=nargout-1; i>=0; i--) retval(i) = ""; + retval(0) = Matrix(); + pcre_free(re); + return retval; } else if (matches < -1) { - error("pcregexp: internal error calling pcre_exec"); - return retval; + error("pcregexp: internal error calling pcre_exec"); + return retval; } const char **listptr; status = pcre_get_substring_list(input.c_str(), ovector, matches, &listptr); if (status == PCRE_ERROR_NOMEMORY) { - error("pcregexp: cannot allocate memory in pcre_get_substring_list"); - pcre_free(re); - return retval; + error("pcregexp: cannot allocate memory in pcre_get_substring_list"); + pcre_free(re); + return retval; } // Pack indeces Matrix indeces = Matrix(matches, 2); for (int i = 0; i < matches; i++) { - indeces(i, 0) = ovector[2*i]+1; - indeces(i, 1) = ovector[2*i+1]; - if (indeces(i, 0) == 0) indeces(i, 1) = 0; + indeces(i, 0) = ovector[2*i]+1; + indeces(i, 1) = ovector[2*i+1]; + if (indeces(i, 0) == 0) indeces(i, 1) = 0; } retval(0) = indeces; // Pack substrings retval.resize(nargout + 1); for (int i = 0; i < matches; i++) { - retval(i+1) = *(listptr+i+1); + retval(i+1) = *(listptr+i+1); } // Free memory @@ -104,8 +111,8 @@ pcre_free(re); if (nargout > matches) { - error("pcregexp: too many return values requested"); - return octave_value_list(); + error("pcregexp: too many return values requested"); + return octave_value_list(); } return retval; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-03-16 03:05:31
|
Revision: 9914 http://octave.svn.sourceforge.net/octave/?rev=9914&view=rev Author: carandraug Date: 2012-03-16 03:05:24 +0000 (Fri, 16 Mar 2012) Log Message: ----------- strings: use of print_usage, texinfo guidelines, aesthetical changes, fix indentation, prune unecessary return statements before endfunction Modified Paths: -------------- trunk/octave-forge/main/strings/inst/base64decode.m trunk/octave-forge/main/strings/inst/base64encode.m trunk/octave-forge/main/strings/inst/editdistance.m trunk/octave-forge/main/strings/inst/strjoin.m trunk/octave-forge/main/strings/inst/strsort.m Modified: trunk/octave-forge/main/strings/inst/base64decode.m =================================================================== --- trunk/octave-forge/main/strings/inst/base64decode.m 2012-03-16 02:59:01 UTC (rev 9913) +++ trunk/octave-forge/main/strings/inst/base64decode.m 2012-03-16 03:05:24 UTC (rev 9914) @@ -14,9 +14,9 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} @var{rval}= {} base64decode(@var{code}) -## @deftypefnx {Function File} @var{rval}= {} base64decode(@var{code},@var{as_string}) -## convert a base64 @var{code} (a string of printable characters according to RFC 2045) +## @deftypefn {Function File} {@var{rval} =} base64decode (@var{code}) +## @deftypefnx {Function File} {@var{rval} =} base64decode (@var{code}, @var{as_string}) +## Convert a base64 @var{code} (a string of printable characters according to RFC 2045) ## into the original ASCII data set of range 0-255. If option @var{as_string} is ## passed, the return value is converted into a string. ## @@ -27,21 +27,15 @@ ## ##returns 'Hakuna Matata' ## @end group ## @end example -## @end deftypefn -## @seealso {base64encode} ## - -## -## Y = base64decode(X) -## -## Convert X into string of printable characters according to RFC 2045. -## The input may be a string or a matrix of integers in the range 0..255. -## ## See: http://www.ietf.org/rfc/rfc2045.txt ## -function z = base64decode(X,as_string) +## @seealso {base64encode} +## @end deftypefn + +function z = base64decode (X, as_string) if (nargin < 1 ) - usage("Y = base64decode(X); X need to be a 4-row N-col matrix"); + print_usage; elseif nargin == 1 as_string=false; endif @@ -50,32 +44,28 @@ error("base64decode is expecting integers in the range 0 .. 255"); endif - ## ## decompose strings into the 4xN matrices ## formatting issues. - ## if( rows(X) == 1 ) - Y=[]; - L=length(X); - for z=4:4:L - Y=[Y X(z-3:z)']; #keep adding columns - end - if min(size(Y))==1 - Y=reshape(Y,[L, 1]); - else - Y=reshape(Y,[4,L/4]); - end - X=Y; - Y=[]; + Y=[]; + L=length(X); + for z=4:4:L + Y=[Y X(z-3:z)']; #keep adding columns + end + if min(size(Y))==1 + Y=reshape(Y,[L, 1]); + else + Y=reshape(Y,[4,L/4]); + end + X=Y; + Y=[]; end X = toascii(X); Xa= X; - ## ## Work backwards. Starting at step in table, ## lookup the index of the element in the table. - ## ## 6-bit encoding table, plus 1 for padding ## 26*2 + 10 + 2 + 1 = 64 + 1, '=' is EOF stop mark. @@ -96,18 +86,18 @@ iaz = (Xa >= 'a').*(Xa <= 'z') > 0; Va(iaz)=Xa(iaz)-'a'+26; - i09 = (Xa >= '0').*(Xa <= '9') > 0; + i09 = (Xa >= '0').*(Xa <= '9') > 0; Va(i09)=Xa(i09)-'0'+52; is = (Xa == '/') ; Va(is) = 63; ip = (Xa == '+') ; Va(ip) = 62; ieq = (Xa == '=') ; Va(ieq) = 0; - clear is; clear ieq; clear ip; clear i09; + clear is; clear ieq; clear ip; clear i09; clear iaz; clear iAZ; clear Xa; clear X; Y=Va; clear Va; Y1=Y(1,:); - if (SRows > 1) + if (SRows > 1) Y2=Y(2,:); else Y2=zeros(1,SCols); @@ -119,7 +109,7 @@ Y3=zeros(1,SCols); end; - if (SRows > 3) + if (SRows > 3) Y4=Y(4,:); else Y4=zeros(1,SCols); @@ -147,10 +137,8 @@ z(3:3:end)=[]; end - ## ## FIXME ## is this expected behaviour? - ## if ( as_string ) L=length(z); while ( ( L > 0) && ( z(L)==0 ) ) @@ -159,14 +147,11 @@ z=char(z(1:L)); end - return - endfunction -%! + %!assert(base64decode(base64encode('Hakuna Matata'),true),'Hakuna Matata') %!assert(base64decode(base64encode([1:255])),[1:255]) %!assert(base64decode(base64encode('taken'),true),'taken') %!assert(base64decode(base64encode('sax'),true),'sax') %!assert(base64decode(base64encode('H'),true),'H') %!assert(base64decode(base64encode('Ta'),true),'Ta') -%! Modified: trunk/octave-forge/main/strings/inst/base64encode.m =================================================================== --- trunk/octave-forge/main/strings/inst/base64encode.m 2012-03-16 02:59:01 UTC (rev 9913) +++ trunk/octave-forge/main/strings/inst/base64encode.m 2012-03-16 03:05:24 UTC (rev 9914) @@ -2,8 +2,8 @@ ## This program is granted to the public domain. ## -*- texinfo -*- -## @deftypefn @var{Y} = {Function File} {} base64encode(@var{X}) -## @deftypefnx @var{Y} = {Function File} {} base64encode(@var{X}, @var{do_reshape}) +## @deftypefn {Function File} {@var{Y} =} base64encode (@var{X}) +## @deftypefnx {Function File} {@var{Y} =} base64encode (@var{X}, @var{do_reshape}) ## Convert X into string of printable characters according to RFC 2045. ## The input may be a string or a matrix of integers in the range 0..255. ## If want the output in the 1-row of strings format, pass the @@ -11,17 +11,19 @@ ## ## Example: ## @example +## @group ## base64encode('Hakuna Matata',true) ## ##returns 'SGFrdW5hIE1hdGF0YQ==' ## +## @end group ## @end example +## @seealso{base64decode} ## @end deftypefn -## @seealso{base64decode} -function Y = base64encode(X,do_reshape) +function Y = base64encode (X, do_reshape) if (nargin < 1) - usage("Y = base64encode(X,[do_reshape])"); + print_usage; elseif nargin != 2 do_reshape=false; endif @@ -71,6 +73,5 @@ Y = reshape(Y,[1, prod(size(Y))]); end endfunction -%! + %!assert(base64encode('Hakuna Matata',true),'SGFrdW5hIE1hdGF0YQ==') -%! Modified: trunk/octave-forge/main/strings/inst/editdistance.m =================================================================== --- trunk/octave-forge/main/strings/inst/editdistance.m 2012-03-16 02:59:01 UTC (rev 9913) +++ trunk/octave-forge/main/strings/inst/editdistance.m 2012-03-16 03:05:24 UTC (rev 9914) @@ -14,9 +14,10 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} [@var{dist},@var{L}] = {} editdistance(@var{string1},@var{string2},@var{weights}) -## computes the Levenshtein edit distance between the two strings. -## @var{string1} and @var{string2}. This operation is symmetrical. +## @deftypefn {Function File} {[@var{dist},@var{L}] =} editdistance (@var{string1}, @var{string2}, @var{weights}) +## Compute the Levenshtein edit distance between the strings @var{string1} and +## @var{string2}. This operation is symmetrical. +## ## The optional argument @var{weights} specifies weights for the ## deletion, matched, and insertion operations; by default it is set to ## +1, 0, +1 respectively, so that a least editdistance means a @@ -29,53 +30,50 @@ ## the other return value @var{L} is the distance matrix. ## ## @example -## @group +## @group ## editdistance('marry','marie') ## ##returns value +2 for the distance. ## @end group ## @end example ## ## @end deftypefn -## -function [dist,L]=editdistance(str1,str2,weights) - if(nargin < 2 || (nargin == 3 && length(weights) < 3) ) - print_usage(); - end - - L1=length(str1)+1; - L2=length(str2)+1; - L=zeros(L1,L2); - - if(nargin < 3) - g=+1;%insertion - m=+0;%match - d=+1;%deletion - else - g=weights(1); - m=weights(2); - d=weights(3); - end - +function [dist, L] = editdistance (str1, str2, weights) + if(nargin < 2 || (nargin == 3 && length(weights) < 3) ) + print_usage(); + end + + L1=length(str1)+1; + L2=length(str2)+1; + L=zeros(L1,L2); + + if(nargin < 3) + g=+1;%insertion + m=+0;%match + d=+1;%deletion + else + g=weights(1); + m=weights(2); + d=weights(3); + end - L(:,1)=[0:L1-1]'*g; - L(1,:)=[0:L2-1]*g; - - m4=0; - for idx=2:L1; - for idy=2:L2 - if(str1(idx-1)==str2(idy-1)) - score=m; - else - score=d; - end - m1=L(idx-1,idy-1) + score; - m2=L(idx-1,idy) + g; - m3=L(idx,idy-1) + g; - L(idx,idy)=min(m1,min(m2,m3)); - end + L(:,1)=[0:L1-1]'*g; + L(1,:)=[0:L2-1]*g; + + m4=0; + for idx=2:L1; + for idy=2:L2 + if(str1(idx-1)==str2(idy-1)) + score=m; + else + score=d; + end + m1=L(idx-1,idy-1) + score; + m2=L(idx-1,idy) + g; + m3=L(idx,idy-1) + g; + L(idx,idy)=min(m1,min(m2,m3)); end - - dist=L(L1,L2); - return -end + end + + dist=L(L1,L2); +endfunction Modified: trunk/octave-forge/main/strings/inst/strjoin.m =================================================================== --- trunk/octave-forge/main/strings/inst/strjoin.m 2012-03-16 02:59:01 UTC (rev 9913) +++ trunk/octave-forge/main/strings/inst/strjoin.m 2012-03-16 03:05:24 UTC (rev 9914) @@ -14,9 +14,9 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} @var{rval}= {} strjoin(@var{prefixstr},@var{stringcell}) -## @deftypefnx {Function File} @var{rval}= {} strjoin(@var{prefixstr},@var{varargs}) -## joins the strings in @var{stringcell} with the @var{prefixstr} like the list-join +## @deftypefn {Function File} {@var{rval} =} strjoin (@var{prefixstr}, @var{stringcell}) +## @deftypefnx {Function File} {@var{rval} =} strjoin (@var{prefixstr}, @var{varargs}) +## Joins the strings in @var{stringcell} with the @var{prefixstr} like the list-join ## function in Python; the second version allows usage with variable number of arguments. ## Note that, if using cell-array as a second argument, only 2 arguments are accepted. ## Also note that, both the arguments are strings or containers of strings (cells). @@ -30,17 +30,16 @@ ## ##returns 'Octave*Scilab*Lush*Yorick' ## @end group ## @end example -## @end deftypefn ## @seealso {strcmp} -## +## @end deftypefn -function rval=strjoin(spacer,varargin) +function rval = strjoin (spacer, varargin) if (nargin < 2) || (nargin > 2 && iscell(varargin{1}) ) print_usage(); end if iscell(varargin{1}) - varargin=varargin{1}; + varargin=varargin{1}; end rval=""; @@ -49,9 +48,7 @@ rval=strcat(rval,sprintf('%s%s',varargin{idx},spacer)); end rval=strcat(rval,varargin{L}); - return; -end -%! +endfunction + %!assert(strjoin("-","hello"),"hello") %!assert(strjoin('*',{'Octave','Scilab','Lush','Yorick'}),'Octave*Scilab*Lush*Yorick') -%! Modified: trunk/octave-forge/main/strings/inst/strsort.m =================================================================== --- trunk/octave-forge/main/strings/inst/strsort.m 2012-03-16 02:59:01 UTC (rev 9913) +++ trunk/octave-forge/main/strings/inst/strsort.m 2012-03-16 03:05:24 UTC (rev 9914) @@ -1,13 +1,17 @@ ## Author: Paul Kienzle <pki...@us...> ## This program is granted to the public domain. -# ... = strsort(...) -# Overloads the sort function to operate on strings. +## -*- texinfo -*- +## @deftypefn {Function File} {[@ldots{}] =} strsort (@ldots{}) +## Overloads the sort function to operate on strings. +## +## @seealso {sort} +## @end deftypefn # PKG_ADD dispatch ("sort", "strsort", "string") function [sorted,idx] = strsort(string,varargin) if nargout == 2 - [s,idx] = sort(toascii(string),varargin{:}); + [s,idx] = sort(toascii(string),varargin{:}); else s = sort(toascii(string),varargin{:}); endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-03-16 02:59:07
|
Revision: 9913 http://octave.svn.sourceforge.net/octave/?rev=9913&view=rev Author: carandraug Date: 2012-03-16 02:59:01 +0000 (Fri, 16 Mar 2012) Log Message: ----------- cstrcmp: complete rewrite of the function. Fix bugs and tests and implements same API as strcmp Modified Paths: -------------- trunk/octave-forge/main/strings/NEWS trunk/octave-forge/main/strings/inst/cstrcmp.m Modified: trunk/octave-forge/main/strings/NEWS =================================================================== --- trunk/octave-forge/main/strings/NEWS 2012-03-15 22:39:10 UTC (rev 9912) +++ trunk/octave-forge/main/strings/NEWS 2012-03-16 02:59:01 UTC (rev 9913) @@ -7,3 +7,7 @@ strtrim ** Package is no longer automatically loaded. + + ** The function `cstrcmp' has been completely rewritten. It should + perform faster and will accept arguments exactly the same way as + Octave's core `strcmp'. Modified: trunk/octave-forge/main/strings/inst/cstrcmp.m =================================================================== --- trunk/octave-forge/main/strings/inst/cstrcmp.m 2012-03-15 22:39:10 UTC (rev 9912) +++ trunk/octave-forge/main/strings/inst/cstrcmp.m 2012-03-16 02:59:01 UTC (rev 9913) @@ -1,4 +1,5 @@ ## Copyright (C) 2007 Muthiah Annamalai <mut...@ut...> +## Copyright (C) 2012 Carnë Draug <car...@gm...> ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software @@ -14,68 +15,97 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} @var{rval}= {} cstrcmp(@var{string1},@var{string2}) -## compares the @var{string1} and @var{string2} like the C-library -## function, returning 0 on match, +1 if @var{string1} > @var{string2} -## and -1 if @var{string1} < @var{string2}. -## This operation is asymmetrical. If either @var{string1} or -## @var{string2} are cell-arrays (not both simultaneously), then the -## return value @var{rval} will be a similar cell-array of strings. +## @deftypefn {Function File} {@var{rval} =} cstrcmp (@var{s1}, @var{s2}) +## Compare strings @var{s1} and @var{s2} like the C function. ## +## Aside the difference to the return values, this function API is exactly the +## same as Octave's @code{strcmp} and will accept cell arrays as well. +## +## @var{rval} indicates the relationship between the strings: +## @itemize @bullet +## @item +## A value of 0 indicates that both strings are equal; +## @item +## A value of +1 indicates that the first character that does not match has a +## greater value in @var{s1} than in @var{s2}. +## @item +## A value of -1 indicates that the first character that does not match has a +## match has a smaller value in @var{s1} than in @var{s2}. +## @end itemize +## ## @example ## @group -## cstrcmp('marry','marie') -## ##returns value +1 +## cstrcmp("marry","marry") +## @result{} 0 +## cstrcmp("marry","marri") +## @result{} +1 +## cstrcmp("marri","marry") +## @result{} -1 ## @end group ## @end example +## +## @seealso {strcmp, strcmpi} ## @end deftypefn -## @seealso {strcmp} function rval = cstrcmp (s1, s2) - if nargin < 2 + if (nargin != 2) print_usage(); endif - v1 = iscell (s1); - v2 = iscell (s2); - if (v1+v2) == 2; - error("only one argument can be a cell-array"); - endif + ## this function is just like Octave's strcmp but the 0 and 1 need to be + ## inverted. Once is done, if there are 1, we need to decide if they will + ## be positive or negative. Also, since it's possible that the value needs + ## to be negative, class must be double (strcmp returns logical) + rval = double(!strcmp (s1, s2)); - if (v1+v2) == 0 - rval = do_cstrcmp (s1, s2); + if (!any (rval)) + ## all zeros, no need to do anything else return endif - if(v2) - [s1, s2] = deal (s1, s2); + ## get index of the ones we have to "fix" + idx = find (rval == 1); + ## if any is not a cell, this simplifies the code that follows + if (!iscell (s1)), s1 = {s1}; endif + if (!iscell (s2)), s2 = {s2}; endif + ## there's 2 hypothesis: + ## - arrays have same length (even if it's only one cell) + ## - arrays have different lengths (in which case, one will have a single cell) + if (numel (s1) == numel (s2)) + rval(idx) = cellfun (@get_sign, s1(idx), s2(idx)); + elseif (numel (s1) > 1) + rval(idx) = cellfun (@get_sign, s1(idx), s2(1)); + elseif (numel (s2) > 1) + rval(idx) = cellfun (@get_sign, s1(1), s2(idx)); endif - - L = length (s1); - rval = zeros (1, L); - for idx=1:L - rval(idx )= do_cstrcmp (s1{idx}, s2); - endfor endfunction -function v = do_cstrcmp (s1, s2) - L2 = length (s2); - L1 = length (s1); - L = min (L1, L2); - for idx=1:L - p = s1(idx); - q = s2(idx); - if (p != q) - v = sign (p-q); - return - endif - endfor - v = sign (L1-L2); +function r = get_sign (s1, s2) + ## strings may have different lengths which kinda complicates things + ## in case the strings are of different size, we need to make them equal + ## If once "trimmed", the strings are equal, the "shortest" string is + ## considered smaller since the comparison is made by filling it with null + + ns1 = numel (s1); + ns2 = numel (s2); + nmin = min (ns1, ns2); + + ## if one of the strings is empty, we are already done + if (nmin == 0), r = sign (ns1 - ns2); return endif + + s = sign (s1(1:nmin) - s2(1:nmin)); + if (any (s)) + ## if there's any difference between this part of the two strings, get the + ## index of the first occurence and return its value + r = s(find (s != 0, 1)); + else + r = sign (ns1 - ns2); + endif endfunction -%!assert(cstrcmp("hello","hello"),0,0) -%!assert(cstrcmp('marry','marie'),+1,0) -%!assert(cstrcmp('Matlab','Octave'),-1,0) -%!assert(cstrcmp('Matlab',{'Octave','Scilab','Lush','Yorick'}),[-1,-1,+1,-1],[]) -%!assert(cstrcmp({'Octave','Scilab','Lush','Yorick'},'Matlab'),[+1,+1,-1,+1],[]) +%!assert(cstrcmp("hello","hello"),0); +%!assert(cstrcmp("marry","marie"),+1); +%!assert(cstrcmp("Matlab","Octave"),-1); +%!assert(cstrcmp("Matlab",{"Octave","Scilab","Lush"}), [-1 -1 +1]); +%!assert(cstrcmp({"Octave","Scilab","Lush"},"Matlab"), [+1 +1 -1]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-03-15 22:39:16
|
Revision: 9912 http://octave.svn.sourceforge.net/octave/?rev=9912&view=rev Author: carandraug Date: 2012-03-15 22:39:10 +0000 (Thu, 15 Mar 2012) Log Message: ----------- cstrcmp: aesthetics only Modified Paths: -------------- trunk/octave-forge/main/strings/inst/cstrcmp.m Modified: trunk/octave-forge/main/strings/inst/cstrcmp.m =================================================================== --- trunk/octave-forge/main/strings/inst/cstrcmp.m 2012-03-15 22:24:43 UTC (rev 9911) +++ trunk/octave-forge/main/strings/inst/cstrcmp.m 2012-03-15 22:39:10 UTC (rev 9912) @@ -31,54 +31,51 @@ ## @end deftypefn ## @seealso {strcmp} -function rval=cstrcmp(s1,s2) +function rval = cstrcmp (s1, s2) + if nargin < 2 print_usage(); - end - v1=iscell(s1); - v2=iscell(s2); + endif + v1 = iscell (s1); + v2 = iscell (s2); if (v1+v2) == 2; - error(' Only one argument can be a cell-array; see help cstrcmp;'); - end + error("only one argument can be a cell-array"); + endif if (v1+v2) == 0 - rval=do_cstrcmp(s1,s2); - return; - end + rval = do_cstrcmp (s1, s2); + return + endif if(v2) [s1, s2] = deal (s1, s2); - end + endif - L=length(s1); - rval=zeros(1,L); + L = length (s1); + rval = zeros (1, L); for idx=1:L - rval(idx)=do_cstrcmp(s1{idx},s2); - end + rval(idx )= do_cstrcmp (s1{idx}, s2); + endfor +endfunction - return; -end -%! +function v = do_cstrcmp (s1, s2) + L2 = length (s2); + L1 = length (s1); + L = min (L1, L2); + for idx=1:L + p = s1(idx); + q = s2(idx); + if (p != q) + v = sign (p-q); + return + endif + endfor + v = sign (L1-L2); +endfunction + %!assert(cstrcmp("hello","hello"),0,0) %!assert(cstrcmp('marry','marie'),+1,0) %!assert(cstrcmp('Matlab','Octave'),-1,0) %!assert(cstrcmp('Matlab',{'Octave','Scilab','Lush','Yorick'}),[-1,-1,+1,-1],[]) %!assert(cstrcmp({'Octave','Scilab','Lush','Yorick'},'Matlab'),[+1,+1,-1,+1],[]) -%! - -function v=do_cstrcmp(s1,s2) - L2=length(s2); - L1=length(s1); - L=min(L1,L2); - for idx=1:L - p=s1(idx); - q=s2(idx); - if ( p ~= q ) - v=sign(p-q); - return - end - end - v=sign(L1-L2); - return -end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-03-15 22:24:49
|
Revision: 9911 http://octave.svn.sourceforge.net/octave/?rev=9911&view=rev Author: carandraug Date: 2012-03-15 22:24:43 +0000 (Thu, 15 Mar 2012) Log Message: ----------- strings: swap is no longer part of control. Use deal and remove package dependency Modified Paths: -------------- trunk/octave-forge/main/strings/DESCRIPTION trunk/octave-forge/main/strings/NEWS trunk/octave-forge/main/strings/inst/cstrcmp.m Modified: trunk/octave-forge/main/strings/DESCRIPTION =================================================================== --- trunk/octave-forge/main/strings/DESCRIPTION 2012-03-15 22:23:18 UTC (rev 9910) +++ trunk/octave-forge/main/strings/DESCRIPTION 2012-03-15 22:24:43 UTC (rev 9911) @@ -5,7 +5,7 @@ Maintainer: The Octave Community Title: String Handling. Description: Additional manipulation functions -Depends: octave (>= 3.6.0), control +Depends: octave (>= 3.6.0) Autoload: no BuildRequires: pcre-devel License: See individual files Modified: trunk/octave-forge/main/strings/NEWS =================================================================== --- trunk/octave-forge/main/strings/NEWS 2012-03-15 22:23:18 UTC (rev 9910) +++ trunk/octave-forge/main/strings/NEWS 2012-03-15 22:24:43 UTC (rev 9911) @@ -6,6 +6,4 @@ strtrim - ** string 1.1.0 now depends on the control package - ** Package is no longer automatically loaded. Modified: trunk/octave-forge/main/strings/inst/cstrcmp.m =================================================================== --- trunk/octave-forge/main/strings/inst/cstrcmp.m 2012-03-15 22:23:18 UTC (rev 9910) +++ trunk/octave-forge/main/strings/inst/cstrcmp.m 2012-03-15 22:24:43 UTC (rev 9911) @@ -48,7 +48,7 @@ end if(v2) - [s1,s2]=swap(s1,s2); + [s1, s2] = deal (s1, s2); end L=length(s1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-03-15 22:23:24
|
Revision: 9910 http://octave.svn.sourceforge.net/octave/?rev=9910&view=rev Author: carandraug Date: 2012-03-15 22:23:18 +0000 (Thu, 15 Mar 2012) Log Message: ----------- strings: do not autoload the package Modified Paths: -------------- trunk/octave-forge/main/strings/DESCRIPTION trunk/octave-forge/main/strings/NEWS Modified: trunk/octave-forge/main/strings/DESCRIPTION =================================================================== --- trunk/octave-forge/main/strings/DESCRIPTION 2012-03-15 22:19:13 UTC (rev 9909) +++ trunk/octave-forge/main/strings/DESCRIPTION 2012-03-15 22:23:18 UTC (rev 9910) @@ -6,7 +6,7 @@ Title: String Handling. Description: Additional manipulation functions Depends: octave (>= 3.6.0), control -Autoload: yes +Autoload: no BuildRequires: pcre-devel License: See individual files Url: http://octave.sf.net Modified: trunk/octave-forge/main/strings/NEWS =================================================================== --- trunk/octave-forge/main/strings/NEWS 2012-03-15 22:19:13 UTC (rev 9909) +++ trunk/octave-forge/main/strings/NEWS 2012-03-15 22:23:18 UTC (rev 9910) @@ -7,3 +7,5 @@ strtrim ** string 1.1.0 now depends on the control package + + ** Package is no longer automatically loaded. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-03-15 22:19:20
|
Revision: 9909 http://octave.svn.sourceforge.net/octave/?rev=9909&view=rev Author: carandraug Date: 2012-03-15 22:19:13 +0000 (Thu, 15 Mar 2012) Log Message: ----------- strings: update licenses to GPLv3+ or move them to top of file Modified Paths: -------------- trunk/octave-forge/main/strings/inst/base64decode.m trunk/octave-forge/main/strings/inst/base64encode.m trunk/octave-forge/main/strings/inst/cstrcmp.m trunk/octave-forge/main/strings/inst/editdistance.m trunk/octave-forge/main/strings/inst/strjoin.m trunk/octave-forge/main/strings/inst/strsort.m trunk/octave-forge/main/strings/src/pcregexp.cc Modified: trunk/octave-forge/main/strings/inst/base64decode.m =================================================================== --- trunk/octave-forge/main/strings/inst/base64decode.m 2012-03-15 21:34:38 UTC (rev 9908) +++ trunk/octave-forge/main/strings/inst/base64decode.m 2012-03-15 22:19:13 UTC (rev 9909) @@ -1,20 +1,17 @@ ## Copyright (C) 2007 Muthiah Annamalai <mut...@ut...> ## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +## This program is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free Software +## Foundation; either version 3 of the License, or (at your option) any later +## version. ## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +## This program is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +## details. ## -## You should have received a copy of the GNU General Public License -## along with this program; if not, see <http://www.gnu.org/licenses/>. -## -## This code was adapted from, Paul Kienzle <pki...@us...> -## +## You should have received a copy of the GNU General Public License along with +## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {Function File} @var{rval}= {} base64decode(@var{code}) Modified: trunk/octave-forge/main/strings/inst/base64encode.m =================================================================== --- trunk/octave-forge/main/strings/inst/base64encode.m 2012-03-15 21:34:38 UTC (rev 9908) +++ trunk/octave-forge/main/strings/inst/base64encode.m 2012-03-15 22:19:13 UTC (rev 9909) @@ -1,3 +1,6 @@ +## Author: Paul Kienzle <pki...@us...> +## This program is granted to the public domain. + ## -*- texinfo -*- ## @deftypefn @var{Y} = {Function File} {} base64encode(@var{X}) ## @deftypefnx @var{Y} = {Function File} {} base64encode(@var{X}, @var{do_reshape}) @@ -14,11 +17,7 @@ ## @end example ## @end deftypefn ## @seealso{base64decode} -## -## This program is in the public domain -## Author: Paul Kienzle <pki...@us...> -## function Y = base64encode(X,do_reshape) if (nargin < 1) Modified: trunk/octave-forge/main/strings/inst/cstrcmp.m =================================================================== --- trunk/octave-forge/main/strings/inst/cstrcmp.m 2012-03-15 21:34:38 UTC (rev 9908) +++ trunk/octave-forge/main/strings/inst/cstrcmp.m 2012-03-15 22:19:13 UTC (rev 9909) @@ -1,18 +1,17 @@ ## Copyright (C) 2007 Muthiah Annamalai <mut...@ut...> -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. ## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +## This program is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free Software +## Foundation; either version 3 of the License, or (at your option) any later +## version. ## -## You should have received a copy of the GNU General Public License -## along with this program; If not, see <http://www.gnu.org/licenses/>. +## This program is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +## details. ## +## You should have received a copy of the GNU General Public License along with +## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {Function File} @var{rval}= {} cstrcmp(@var{string1},@var{string2}) @@ -31,9 +30,7 @@ ## @end example ## @end deftypefn ## @seealso {strcmp} -## - function rval=cstrcmp(s1,s2) if nargin < 2 print_usage(); Modified: trunk/octave-forge/main/strings/inst/editdistance.m =================================================================== --- trunk/octave-forge/main/strings/inst/editdistance.m 2012-03-15 21:34:38 UTC (rev 9908) +++ trunk/octave-forge/main/strings/inst/editdistance.m 2012-03-15 22:19:13 UTC (rev 9909) @@ -1,18 +1,17 @@ ## Copyright (C) 2006 Muthiah Annamalai <mut...@ut...> -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. ## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +## This program is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free Software +## Foundation; either version 3 of the License, or (at your option) any later +## version. ## -## You should have received a copy of the GNU General Public License -## along with this program; If not, see <http://www.gnu.org/licenses/>. +## This program is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +## details. ## +## You should have received a copy of the GNU General Public License along with +## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {Function File} [@var{dist},@var{L}] = {} editdistance(@var{string1},@var{string2},@var{weights}) Modified: trunk/octave-forge/main/strings/inst/strjoin.m =================================================================== --- trunk/octave-forge/main/strings/inst/strjoin.m 2012-03-15 21:34:38 UTC (rev 9908) +++ trunk/octave-forge/main/strings/inst/strjoin.m 2012-03-15 22:19:13 UTC (rev 9909) @@ -1,18 +1,17 @@ ## Copyright (C) 2007 Muthiah Annamalai <mut...@ut...> -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. ## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +## This program is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free Software +## Foundation; either version 3 of the License, or (at your option) any later +## version. ## -## You should have received a copy of the GNU General Public License -## along with this program; If not, see <http://www.gnu.org/licenses/>. +## This program is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +## details. ## +## You should have received a copy of the GNU General Public License along with +## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {Function File} @var{rval}= {} strjoin(@var{prefixstr},@var{stringcell}) Modified: trunk/octave-forge/main/strings/inst/strsort.m =================================================================== --- trunk/octave-forge/main/strings/inst/strsort.m 2012-03-15 21:34:38 UTC (rev 9908) +++ trunk/octave-forge/main/strings/inst/strsort.m 2012-03-15 22:19:13 UTC (rev 9909) @@ -1,9 +1,9 @@ +## Author: Paul Kienzle <pki...@us...> +## This program is granted to the public domain. + # ... = strsort(...) # Overloads the sort function to operate on strings. -# Author: Paul Kienzle -# This program is public domain - # PKG_ADD dispatch ("sort", "strsort", "string") function [sorted,idx] = strsort(string,varargin) if nargout == 2 Modified: trunk/octave-forge/main/strings/src/pcregexp.cc =================================================================== --- trunk/octave-forge/main/strings/src/pcregexp.cc 2012-03-15 21:34:38 UTC (rev 9908) +++ trunk/octave-forge/main/strings/src/pcregexp.cc 2012-03-15 22:19:13 UTC (rev 9909) @@ -1,27 +1,26 @@ -/* Copyright (C) 2004 Stefan van der Walt <st...@su...> +// Copyright (C) 2004 Stefan van der Walt <st...@su...> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1 Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// 2 Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #include <octave/oct.h> #include <pcre.h> #include <iostream> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mma...@us...> - 2012-03-15 21:34:45
|
Revision: 9908 http://octave.svn.sourceforge.net/octave/?rev=9908&view=rev Author: mmarzolla Date: 2012-03-15 21:34:38 +0000 (Thu, 15 Mar 2012) Log Message: ----------- Fixed typos Modified Paths: -------------- trunk/octave-forge/main/queueing/doc/markovchains.txi trunk/octave-forge/main/queueing/doc/queueing.html trunk/octave-forge/main/queueing/doc/queueing.pdf trunk/octave-forge/main/queueing/inst/ctmc_taexps.m Modified: trunk/octave-forge/main/queueing/doc/markovchains.txi =================================================================== --- trunk/octave-forge/main/queueing/doc/markovchains.txi 2012-03-15 21:26:25 UTC (rev 9907) +++ trunk/octave-forge/main/queueing/doc/markovchains.txi 2012-03-15 21:34:38 UTC (rev 9908) @@ -53,10 +53,10 @@ The evolution of a Markov chain with finite state space @math{@{1, 2, @dots{}, N@}} can be fully described by a stochastic matrix @math{{\bf P}(n) = P_{i,j}(n)} such that @math{P_{i, j}(n) = P( X_{n+1} = j\ |\ -X_n = j )}. If the Markov chain is homogeneous (that is, the +X_n = i )}. If the Markov chain is homogeneous (that is, the transition probability matrix @math{{\bf P}(n)} is time-independent), we can simply write @math{{\bf P} = P_{i, j}}, where @math{P_{i, j} = -P( X_{n+1} = j\ |\ X_n = j )} for all @math{n=0, 1, 2, @dots{}}. +P( X_{n+1} = j\ |\ X_n = i )} for all @math{n=0, 1, 2, @dots{}}. The transition probability matrix @math{\bf P} must satisfy the following two properties: (1) @math{P_{i, j} @geq{} 0} for all @@ -65,9 +65,17 @@ @c @DOCSTRING(dtmc_check_P) +@menu +* State occupancy probabilities (DTMC):: +* Birth-death process (DTMC):: +* First passage times (DTMC):: +* Mean time to absorption (DTMC):: +@end menu + @c @c @c +@node State occupancy probabilities (DTMC) @subsection State occupancy probabilities We denote with @math{{\bf \pi}(n) = (\pi_1(n), \pi_2(n), @dots{}, @@ -112,12 +120,15 @@ @end group @end example -@subsection Birth-Death process +@c +@node Birth-death process (DTMC) +@subsection Birth-death process @c @DOCSTRING(dtmc_bd) -@subsection First passage times +@node First passage times (DTMC) +@subsection First Passage Times The First Passage Time @math{M_{i j}} is defined as the average number of transitions needed to visit state @math{j} for the first @@ -145,6 +156,7 @@ @DOCSTRING(dtmc_fpt) @c +@node Mean time to absorption (DTMC) @subsection Mean Time to Absorption @DOCSTRING(dtmc_mtta) @@ -179,15 +191,15 @@ @DOCSTRING(ctmc_check_Q) @menu -* State occupancy probabilities:: -* Birth-Death process:: -* Expected Sojourn Time:: -* Time-Averaged Expected Sojourn Time:: -* Mean Time to Absorption:: -* First Passage Times:: +* State occupancy probabilities (CTMC):: +* Birth-death process (CTMC):: +* Expected sojourn times (CTMC):: +* Time-averaged expected sojourn times (CTMC):: +* Mean time to absorption (CTMC):: +* First passage times (CTMC):: @end menu -@node State occupancy probabilities +@node State occupancy probabilities (CTMC) @subsection State occupancy probabilities Similarly to the discrete case, we denote with @math{{\bf \pi}(t) = @@ -238,16 +250,16 @@ @c @c @c -@node Birth-Death process -@subsection Birth-Death process +@node Birth-death process (CTMC) +@subsection Birth-Death Process @DOCSTRING(ctmc_bd) @c @c @c -@node Expected Sojourn Time -@subsection Expected Sojourn Time +@node Expected sojourn times (CTMC) +@subsection Expected Sojourn Times Given a @math{N} state continuous-time Markov Chain with infinitesimal generator matrix @math{\bf Q}, we define the vector @math{{\bf L}(t) = @@ -277,7 +289,7 @@ @iftex @tex -$$ {\bf L}(t) = \int_{u=0}^t {\bf \pi}(u) du$$ +$$ {\bf L}(t) = \int_0^t {\bf \pi}(u) du$$ @end tex @end iftex @ifnottex @@ -312,8 +324,8 @@ @c @c @c -@node Time-Averaged Expected Sojourn Time -@subsection Time-Averaged Expected Sojourn Time +@node Time-averaged expected sojourn times (CTMC) +@subsection Time-Averaged Expected Sojourn Times @DOCSTRING(ctmc_taexps) @@ -328,7 +340,7 @@ @c @c @c -@node Mean Time to Absorption +@node Mean time to absorption (CTMC) @subsection Mean Time to Absorption If we consider a Markov Chain with absorbing states, it is possible to @@ -400,7 +412,7 @@ @c @c @c -@node First Passage Times +@node First passage times (CTMC) @subsection First Passage Times @DOCSTRING(ctmc_fpt) Modified: trunk/octave-forge/main/queueing/doc/queueing.html =================================================================== --- trunk/octave-forge/main/queueing/doc/queueing.html 2012-03-15 21:26:25 UTC (rev 9907) +++ trunk/octave-forge/main/queueing/doc/queueing.html 2012-03-15 21:34:38 UTC (rev 9908) @@ -56,19 +56,19 @@ <ul> <li><a href="#Discrete_002dTime-Markov-Chains">4.1 Discrete-Time Markov Chains</a> <ul> -<li><a href="#Discrete_002dTime-Markov-Chains">4.1.1 State occupancy probabilities</a> -<li><a href="#Discrete_002dTime-Markov-Chains">4.1.2 Birth-Death process</a> -<li><a href="#Discrete_002dTime-Markov-Chains">4.1.3 First passage times</a> -<li><a href="#Discrete_002dTime-Markov-Chains">4.1.4 Mean Time to Absorption</a> +<li><a href="#State-occupancy-probabilities-_0028DTMC_0029">4.1.1 State occupancy probabilities</a> +<li><a href="#Birth_002ddeath-process-_0028DTMC_0029">4.1.2 Birth-death process</a> +<li><a href="#First-passage-times-_0028DTMC_0029">4.1.3 First Passage Times</a> +<li><a href="#Mean-time-to-absorption-_0028DTMC_0029">4.1.4 Mean Time to Absorption</a> </li></ul> <li><a href="#Continuous_002dTime-Markov-Chains">4.2 Continuous-Time Markov Chains</a> <ul> -<li><a href="#State-occupancy-probabilities">4.2.1 State occupancy probabilities</a> -<li><a href="#Birth_002dDeath-process">4.2.2 Birth-Death process</a> -<li><a href="#Expected-Sojourn-Time">4.2.3 Expected Sojourn Time</a> -<li><a href="#Time_002dAveraged-Expected-Sojourn-Time">4.2.4 Time-Averaged Expected Sojourn Time</a> -<li><a href="#Mean-Time-to-Absorption">4.2.5 Mean Time to Absorption</a> -<li><a href="#First-Passage-Times">4.2.6 First Passage Times</a> +<li><a href="#State-occupancy-probabilities-_0028CTMC_0029">4.2.1 State occupancy probabilities</a> +<li><a href="#Birth_002ddeath-process-_0028CTMC_0029">4.2.2 Birth-Death Process</a> +<li><a href="#Expected-sojourn-times-_0028CTMC_0029">4.2.3 Expected Sojourn Times</a> +<li><a href="#Time_002daveraged-expected-sojourn-times-_0028CTMC_0029">4.2.4 Time-Averaged Expected Sojourn Times</a> +<li><a href="#Mean-time-to-absorption-_0028CTMC_0029">4.2.5 Mean Time to Absorption</a> +<li><a href="#First-passage-times-_0028CTMC_0029">4.2.6 First Passage Times</a> </li></ul> </li></ul> <li><a name="toc_Single-Station-Queueing-Systems" href="#Single-Station-Queueing-Systems">5 Single Station Queueing Systems</a> @@ -805,10 +805,10 @@ <p>The evolution of a Markov chain with finite state space {1, 2, <small class="dots">...</small>, N} can be fully described by a stochastic matrix \bf P(n) = P_i,j(n) such that P_i, j(n) = P( X_n+1 = j\ |\ -X_n = j ). If the Markov chain is homogeneous (that is, the +X_n = i ). If the Markov chain is homogeneous (that is, the transition probability matrix \bf P(n) is time-independent), we can simply write \bf P = P_i, j, where P_i, j = -P( X_n+1 = j\ |\ X_n = j ) for all n=0, 1, 2, <small class="dots">...</small>. +P( X_n+1 = j\ |\ X_n = i ) for all n=0, 1, 2, <small class="dots">...</small>. <p>The transition probability matrix \bf P must satisfy the following two properties: (1) P_i, j ≥ 0 for all @@ -827,6 +827,22 @@ </blockquote></div> +<ul class="menu"> +<li><a accesskey="1" href="#State-occupancy-probabilities-_0028DTMC_0029">State occupancy probabilities (DTMC)</a> +<li><a accesskey="2" href="#Birth_002ddeath-process-_0028DTMC_0029">Birth-death process (DTMC)</a> +<li><a accesskey="3" href="#First-passage-times-_0028DTMC_0029">First passage times (DTMC)</a> +<li><a accesskey="4" href="#Mean-time-to-absorption-_0028DTMC_0029">Mean time to absorption (DTMC)</a> +</ul> + +<div class="node"> +<a name="State-occupancy-probabilities-(DTMC)"></a> +<a name="State-occupancy-probabilities-_0028DTMC_0029"></a> +<p><hr> +Next: <a rel="next" accesskey="n" href="#Birth_002ddeath-process-_0028DTMC_0029">Birth-death process (DTMC)</a>, +Up: <a rel="up" accesskey="u" href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a> + +</div> + <h4 class="subsection">4.1.1 State occupancy probabilities</h4> <p>We denote with \bf \pi(n) = (\pi_1(n), \pi_2(n), <small class="dots">...</small>, @@ -911,8 +927,18 @@ T, ss(2)*ones(size(T)), "r;Steady State;" ); xlabel("Time Step");</pre> </pre> - <h4 class="subsection">4.1.2 Birth-Death process</h4> + <div class="node"> +<a name="Birth-death-process-(DTMC)"></a> +<a name="Birth_002ddeath-process-_0028DTMC_0029"></a> +<p><hr> +Next: <a rel="next" accesskey="n" href="#First-passage-times-_0028DTMC_0029">First passage times (DTMC)</a>, +Previous: <a rel="previous" accesskey="p" href="#State-occupancy-probabilities-_0028DTMC_0029">State occupancy probabilities (DTMC)</a>, +Up: <a rel="up" accesskey="u" href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a> +</div> + +<h4 class="subsection">4.1.2 Birth-death process</h4> + <p><a name="doc_002ddtmc_005fbd"></a> <div class="defun"> @@ -942,8 +968,18 @@ </blockquote></div> -<h4 class="subsection">4.1.3 First passage times</h4> +<div class="node"> +<a name="First-passage-times-(DTMC)"></a> +<a name="First-passage-times-_0028DTMC_0029"></a> +<p><hr> +Next: <a rel="next" accesskey="n" href="#Mean-time-to-absorption-_0028DTMC_0029">Mean time to absorption (DTMC)</a>, +Previous: <a rel="previous" accesskey="p" href="#Birth_002ddeath-process-_0028DTMC_0029">Birth-death process (DTMC)</a>, +Up: <a rel="up" accesskey="u" href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a> +</div> + +<h4 class="subsection">4.1.3 First Passage Times</h4> + <p>The First Passage Time M_i j is defined as the average number of transitions needed to visit state j for the first time, starting from state i. Matrix \bf M satisfies the @@ -1001,6 +1037,15 @@ </blockquote></div> +<div class="node"> +<a name="Mean-time-to-absorption-(DTMC)"></a> +<a name="Mean-time-to-absorption-_0028DTMC_0029"></a> +<p><hr> +Previous: <a rel="previous" accesskey="p" href="#First-passage-times-_0028DTMC_0029">First passage times (DTMC)</a>, +Up: <a rel="up" accesskey="u" href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a> + +</div> + <h4 class="subsection">4.1.4 Mean Time to Absorption</h4> <p><a name="doc_002ddtmc_005fmtta"></a> @@ -1084,18 +1129,19 @@ </blockquote></div> <ul class="menu"> -<li><a accesskey="1" href="#State-occupancy-probabilities">State occupancy probabilities</a> -<li><a accesskey="2" href="#Birth_002dDeath-process">Birth-Death process</a> -<li><a accesskey="3" href="#Expected-Sojourn-Time">Expected Sojourn Time</a> -<li><a accesskey="4" href="#Time_002dAveraged-Expected-Sojourn-Time">Time-Averaged Expected Sojourn Time</a> -<li><a accesskey="5" href="#Mean-Time-to-Absorption">Mean Time to Absorption</a> -<li><a accesskey="6" href="#First-Passage-Times">First Passage Times</a> +<li><a accesskey="1" href="#State-occupancy-probabilities-_0028CTMC_0029">State occupancy probabilities (CTMC)</a> +<li><a accesskey="2" href="#Birth_002ddeath-process-_0028CTMC_0029">Birth-death process (CTMC)</a> +<li><a accesskey="3" href="#Expected-sojourn-times-_0028CTMC_0029">Expected sojourn times (CTMC)</a> +<li><a accesskey="4" href="#Time_002daveraged-expected-sojourn-times-_0028CTMC_0029">Time-averaged expected sojourn times (CTMC)</a> +<li><a accesskey="5" href="#Mean-time-to-absorption-_0028CTMC_0029">Mean time to absorption (CTMC)</a> +<li><a accesskey="6" href="#First-passage-times-_0028CTMC_0029">First passage times (CTMC)</a> </ul> <div class="node"> -<a name="State-occupancy-probabilities"></a> +<a name="State-occupancy-probabilities-(CTMC)"></a> +<a name="State-occupancy-probabilities-_0028CTMC_0029"></a> <p><hr> -Next: <a rel="next" accesskey="n" href="#Birth_002dDeath-process">Birth-Death process</a>, +Next: <a rel="next" accesskey="n" href="#Birth_002ddeath-process-_0028CTMC_0029">Birth-death process (CTMC)</a>, Up: <a rel="up" accesskey="u" href="#Continuous_002dTime-Markov-Chains">Continuous-Time Markov Chains</a> </div> @@ -1177,16 +1223,16 @@ q = ctmc(Q)</pre> ⇒ q = 0.50000 0.50000 </pre> <div class="node"> -<a name="Birth-Death-process"></a> -<a name="Birth_002dDeath-process"></a> +<a name="Birth-death-process-(CTMC)"></a> +<a name="Birth_002ddeath-process-_0028CTMC_0029"></a> <p><hr> -Next: <a rel="next" accesskey="n" href="#Expected-Sojourn-Time">Expected Sojourn Time</a>, -Previous: <a rel="previous" accesskey="p" href="#State-occupancy-probabilities">State occupancy probabilities</a>, +Next: <a rel="next" accesskey="n" href="#Expected-sojourn-times-_0028CTMC_0029">Expected sojourn times (CTMC)</a>, +Previous: <a rel="previous" accesskey="p" href="#State-occupancy-probabilities-_0028CTMC_0029">State occupancy probabilities (CTMC)</a>, Up: <a rel="up" accesskey="u" href="#Continuous_002dTime-Markov-Chains">Continuous-Time Markov Chains</a> </div> -<h4 class="subsection">4.2.2 Birth-Death process</h4> +<h4 class="subsection">4.2.2 Birth-Death Process</h4> <p><a name="doc_002dctmc_005fbd"></a> @@ -1218,15 +1264,16 @@ </blockquote></div> <div class="node"> -<a name="Expected-Sojourn-Time"></a> +<a name="Expected-sojourn-times-(CTMC)"></a> +<a name="Expected-sojourn-times-_0028CTMC_0029"></a> <p><hr> -Next: <a rel="next" accesskey="n" href="#Time_002dAveraged-Expected-Sojourn-Time">Time-Averaged Expected Sojourn Time</a>, -Previous: <a rel="previous" accesskey="p" href="#Birth_002dDeath-process">Birth-Death process</a>, +Next: <a rel="next" accesskey="n" href="#Time_002daveraged-expected-sojourn-times-_0028CTMC_0029">Time-averaged expected sojourn times (CTMC)</a>, +Previous: <a rel="previous" accesskey="p" href="#Birth_002ddeath-process-_0028CTMC_0029">Birth-death process (CTMC)</a>, Up: <a rel="up" accesskey="u" href="#Continuous_002dTime-Markov-Chains">Continuous-Time Markov Chains</a> </div> -<h4 class="subsection">4.2.3 Expected Sojourn Time</h4> +<h4 class="subsection">4.2.3 Expected Sojourn Times</h4> <p>Given a N state continuous-time Markov Chain with infinitesimal generator matrix \bf Q, we define the vector \bf L(t) = @@ -1322,16 +1369,16 @@ ylabel("Expected sojourn time");</pre> </pre> <div class="node"> -<a name="Time-Averaged-Expected-Sojourn-Time"></a> -<a name="Time_002dAveraged-Expected-Sojourn-Time"></a> +<a name="Time-averaged-expected-sojourn-times-(CTMC)"></a> +<a name="Time_002daveraged-expected-sojourn-times-_0028CTMC_0029"></a> <p><hr> -Next: <a rel="next" accesskey="n" href="#Mean-Time-to-Absorption">Mean Time to Absorption</a>, -Previous: <a rel="previous" accesskey="p" href="#Expected-Sojourn-Time">Expected Sojourn Time</a>, +Next: <a rel="next" accesskey="n" href="#Mean-time-to-absorption-_0028CTMC_0029">Mean time to absorption (CTMC)</a>, +Previous: <a rel="previous" accesskey="p" href="#Expected-sojourn-times-_0028CTMC_0029">Expected sojourn times (CTMC)</a>, Up: <a rel="up" accesskey="u" href="#Continuous_002dTime-Markov-Chains">Continuous-Time Markov Chains</a> </div> -<h4 class="subsection">4.2.4 Time-Averaged Expected Sojourn Time</h4> +<h4 class="subsection">4.2.4 Time-Averaged Expected Sojourn Times</h4> <p><a name="doc_002dctmc_005ftaexps"></a> @@ -1364,7 +1411,7 @@ <dl> <dt><var>M</var><dd>If this function is called with three parameters, <var>M</var><code>(i)</code> -is the expected fraction of the interval 0,t] spent in state +is the expected fraction of the interval [0,t] spent in state i assuming that the state occupancy probability at time zero is <var>p</var>. If this function is called with two parameters, <var>M</var><code>(i)</code> is the expected fraction of time until absorption @@ -1397,10 +1444,11 @@ ylabel("Time-averaged Expected sojourn time");</pre> </pre> <div class="node"> -<a name="Mean-Time-to-Absorption"></a> +<a name="Mean-time-to-absorption-(CTMC)"></a> +<a name="Mean-time-to-absorption-_0028CTMC_0029"></a> <p><hr> -Next: <a rel="next" accesskey="n" href="#First-Passage-Times">First Passage Times</a>, -Previous: <a rel="previous" accesskey="p" href="#Time_002dAveraged-Expected-Sojourn-Time">Time-Averaged Expected Sojourn Time</a>, +Next: <a rel="next" accesskey="n" href="#First-passage-times-_0028CTMC_0029">First passage times (CTMC)</a>, +Previous: <a rel="previous" accesskey="p" href="#Time_002daveraged-expected-sojourn-times-_0028CTMC_0029">Time-averaged expected sojourn times (CTMC)</a>, Up: <a rel="up" accesskey="u" href="#Continuous_002dTime-Markov-Chains">Continuous-Time Markov Chains</a> </div> @@ -1490,9 +1538,10 @@ <p><a name="index-Bolch_002c-G_002e-42"></a><a name="index-Greiner_002c-S_002e-43"></a><a name="index-de-Meer_002c-H_002e-44"></a><a name="index-Trivedi_002c-K_002e-45"></a> <div class="node"> -<a name="First-Passage-Times"></a> +<a name="First-passage-times-(CTMC)"></a> +<a name="First-passage-times-_0028CTMC_0029"></a> <p><hr> -Previous: <a rel="previous" accesskey="p" href="#Mean-Time-to-Absorption">Mean Time to Absorption</a>, +Previous: <a rel="previous" accesskey="p" href="#Mean-time-to-absorption-_0028CTMC_0029">Mean time to absorption (CTMC)</a>, Up: <a rel="up" accesskey="u" href="#Continuous_002dTime-Markov-Chains">Continuous-Time Markov Chains</a> </div> @@ -5516,8 +5565,8 @@ <li><a href="#index-Approximate-MVA-179">Approximate MVA</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> <li><a href="#index-Asymmetric-_0040math_007bM_002fM_002fm_007d-system-79">Asymmetric M/M/m system</a>: <a href="#The-Asymmetric-M_002fM_002fm-System">The Asymmetric M/M/m System</a></li> <li><a href="#index-BCMP-network-134">BCMP network</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> -<li><a href="#index-Birth_002ddeath-process-30">Birth-death process</a>: <a href="#Birth_002dDeath-process">Birth-Death process</a></li> -<li><a href="#index-Birth_002ddeath-process-11">Birth-death process</a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> +<li><a href="#index-Birth_002ddeath-process-30">Birth-death process</a>: <a href="#Birth_002ddeath-process-_0028CTMC_0029">Birth-death process (CTMC)</a></li> +<li><a href="#index-Birth_002ddeath-process-11">Birth-death process</a>: <a href="#Birth_002ddeath-process-_0028DTMC_0029">Birth-death process (DTMC)</a></li> <li><a href="#index-blocking-queueing-network-229">blocking queueing network</a>: <a href="#Algorithms-for-non-Product_002dform-QNs">Algorithms for non Product-form QNs</a></li> <li><a href="#index-bounds_002c-asymptotic-241">bounds, asymptotic</a>: <a href="#Bounds-on-performance">Bounds on performance</a></li> <li><a href="#index-bounds_002c-balanced-system-256">bounds, balanced system</a>: <a href="#Bounds-on-performance">Bounds on performance</a></li> @@ -5534,13 +5583,13 @@ <li><a href="#index-Closed-network_002c-single-class-180">Closed network, single class</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> <li><a href="#index-closed-network_002c-single-class-150">closed network, single class</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> <li><a href="#index-CMVA-171">CMVA</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> -<li><a href="#index-Continuous-time-Markov-chain-25">Continuous time Markov chain</a>: <a href="#State-occupancy-probabilities">State occupancy probabilities</a></li> +<li><a href="#index-Continuous-time-Markov-chain-25">Continuous time Markov chain</a>: <a href="#State-occupancy-probabilities-_0028CTMC_0029">State occupancy probabilities (CTMC)</a></li> <li><a href="#index-convolution-algorithm-113">convolution algorithm</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> <li><a href="#index-copyright-295">copyright</a>: <a href="#Copying">Copying</a></li> -<li><a href="#index-Discrete-time-Markov-chain-6">Discrete time Markov chain</a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> -<li><a href="#index-Expected-sojourn-time-34">Expected sojourn time</a>: <a href="#Expected-Sojourn-Time">Expected Sojourn Time</a></li> -<li><a href="#index-First-passage-times-49">First passage times</a>: <a href="#First-Passage-Times">First Passage Times</a></li> -<li><a href="#index-First-passage-times-15">First passage times</a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> +<li><a href="#index-Discrete-time-Markov-chain-6">Discrete time Markov chain</a>: <a href="#State-occupancy-probabilities-_0028DTMC_0029">State occupancy probabilities (DTMC)</a></li> +<li><a href="#index-Expected-sojourn-time-34">Expected sojourn time</a>: <a href="#Expected-sojourn-times-_0028CTMC_0029">Expected sojourn times (CTMC)</a></li> +<li><a href="#index-First-passage-times-49">First passage times</a>: <a href="#First-passage-times-_0028CTMC_0029">First passage times (CTMC)</a></li> +<li><a href="#index-First-passage-times-15">First passage times</a>: <a href="#First-passage-times-_0028DTMC_0029">First passage times (DTMC)</a></li> <li><a href="#index-Jackson-network-104">Jackson network</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> <li><a href="#index-load_002ddependent-service-center-123">load-dependent service center</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> <li><a href="#index-g_t_0040math_007bM_002fG_002f1_007d-system-85">M/G/1 system</a>: <a href="#The-M_002fG_002f1-System">The M/G/1 System</a></li> @@ -5550,19 +5599,22 @@ <li><a href="#index-g_t_0040math_007bM_002fM_002f_007dinf-system-64">M/M/inf system</a>: <a href="#The-M_002fM_002finf-System">The M/M/inf System</a></li> <li><a href="#index-g_t_0040math_007bM_002fM_002fm_007d-system-58">M/M/m system</a>: <a href="#The-M_002fM_002fm-System">The M/M/m System</a></li> <li><a href="#index-g_t_0040math_007bM_002fM_002fm_002fK_007d-system-73">M/M/m/K system</a>: <a href="#The-M_002fM_002fm_002fK-System">The M/M/m/K System</a></li> -<li><a href="#index-Markov-chain_002c-continuous-time-48">Markov chain, continuous time</a>: <a href="#First-Passage-Times">First Passage Times</a></li> -<li><a href="#index-Markov-chain_002c-continuous-time-40">Markov chain, continuous time</a>: <a href="#Mean-Time-to-Absorption">Mean Time to Absorption</a></li> -<li><a href="#index-Markov-chain_002c-continuous-time-37">Markov chain, continuous time</a>: <a href="#Time_002dAveraged-Expected-Sojourn-Time">Time-Averaged Expected Sojourn Time</a></li> -<li><a href="#index-Markov-chain_002c-continuous-time-33">Markov chain, continuous time</a>: <a href="#Expected-Sojourn-Time">Expected Sojourn Time</a></li> -<li><a href="#index-Markov-chain_002c-continuous-time-29">Markov chain, continuous time</a>: <a href="#Birth_002dDeath-process">Birth-Death process</a></li> -<li><a href="#index-Markov-chain_002c-continuous-time-24">Markov chain, continuous time</a>: <a href="#State-occupancy-probabilities">State occupancy probabilities</a></li> +<li><a href="#index-Markov-chain_002c-continuous-time-48">Markov chain, continuous time</a>: <a href="#First-passage-times-_0028CTMC_0029">First passage times (CTMC)</a></li> +<li><a href="#index-Markov-chain_002c-continuous-time-40">Markov chain, continuous time</a>: <a href="#Mean-time-to-absorption-_0028CTMC_0029">Mean time to absorption (CTMC)</a></li> +<li><a href="#index-Markov-chain_002c-continuous-time-37">Markov chain, continuous time</a>: <a href="#Time_002daveraged-expected-sojourn-times-_0028CTMC_0029">Time-averaged expected sojourn times (CTMC)</a></li> +<li><a href="#index-Markov-chain_002c-continuous-time-33">Markov chain, continuous time</a>: <a href="#Expected-sojourn-times-_0028CTMC_0029">Expected sojourn times (CTMC)</a></li> +<li><a href="#index-Markov-chain_002c-continuous-time-29">Markov chain, continuous time</a>: <a href="#Birth_002ddeath-process-_0028CTMC_0029">Birth-death process (CTMC)</a></li> +<li><a href="#index-Markov-chain_002c-continuous-time-24">Markov chain, continuous time</a>: <a href="#State-occupancy-probabilities-_0028CTMC_0029">State occupancy probabilities (CTMC)</a></li> <li><a href="#index-Markov-chain_002c-continuous-time-21">Markov chain, continuous time</a>: <a href="#Continuous_002dTime-Markov-Chains">Continuous-Time Markov Chains</a></li> +<li><a href="#index-Markov-chain_002c-discrete-time-14">Markov chain, discrete time</a>: <a href="#First-passage-times-_0028DTMC_0029">First passage times (DTMC)</a></li> +<li><a href="#index-Markov-chain_002c-discrete-time-10">Markov chain, discrete time</a>: <a href="#Birth_002ddeath-process-_0028DTMC_0029">Birth-death process (DTMC)</a></li> +<li><a href="#index-Markov-chain_002c-discrete-time-5">Markov chain, discrete time</a>: <a href="#State-occupancy-probabilities-_0028DTMC_0029">State occupancy probabilities (DTMC)</a></li> <li><a href="#index-Markov-chain_002c-discrete-time-2">Markov chain, discrete time</a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> -<li><a href="#index-Markov-chain_002c-disctete-time-18">Markov chain, disctete time</a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> -<li><a href="#index-Markov-chain_002c-state-occupancy-probabilities-26">Markov chain, state occupancy probabilities</a>: <a href="#State-occupancy-probabilities">State occupancy probabilities</a></li> -<li><a href="#index-Markov-chain_002c-stationary-probabilities-7">Markov chain, stationary probabilities</a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> -<li><a href="#index-Mean-time-to-absorption-41">Mean time to absorption</a>: <a href="#Mean-Time-to-Absorption">Mean Time to Absorption</a></li> -<li><a href="#index-Mean-time-to-absorption-19">Mean time to absorption</a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> +<li><a href="#index-Markov-chain_002c-disctete-time-18">Markov chain, disctete time</a>: <a href="#Mean-time-to-absorption-_0028DTMC_0029">Mean time to absorption (DTMC)</a></li> +<li><a href="#index-Markov-chain_002c-state-occupancy-probabilities-26">Markov chain, state occupancy probabilities</a>: <a href="#State-occupancy-probabilities-_0028CTMC_0029">State occupancy probabilities (CTMC)</a></li> +<li><a href="#index-Markov-chain_002c-stationary-probabilities-7">Markov chain, stationary probabilities</a>: <a href="#State-occupancy-probabilities-_0028DTMC_0029">State occupancy probabilities (DTMC)</a></li> +<li><a href="#index-Mean-time-to-absorption-41">Mean time to absorption</a>: <a href="#Mean-time-to-absorption-_0028CTMC_0029">Mean time to absorption (CTMC)</a></li> +<li><a href="#index-Mean-time-to-absorption-19">Mean time to absorption</a>: <a href="#Mean-time-to-absorption-_0028DTMC_0029">Mean time to absorption (DTMC)</a></li> <li><a href="#index-Mean-Value-Analysys-_0028MVA_0029-149">Mean Value Analysys (MVA)</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> <li><a href="#index-Mean-Value-Analysys-_0028MVA_0029_002c-approximate-178">Mean Value Analysys (MVA), approximate</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> <li><a href="#index-mixed-network-221">mixed network</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> @@ -5575,9 +5627,9 @@ <li><a href="#index-queueing-network-with-blocking-228">queueing network with blocking</a>: <a href="#Algorithms-for-non-Product_002dform-QNs">Algorithms for non Product-form QNs</a></li> <li><a href="#index-queueing-networks-88">queueing networks</a>: <a href="#Queueing-Networks">Queueing Networks</a></li> <li><a href="#index-RS-blocking-239">RS blocking</a>: <a href="#Algorithms-for-non-Product_002dform-QNs">Algorithms for non Product-form QNs</a></li> -<li><a href="#index-Stationary-probabilities-27">Stationary probabilities</a>: <a href="#State-occupancy-probabilities">State occupancy probabilities</a></li> -<li><a href="#index-Stationary-probabilities-8">Stationary probabilities</a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> -<li><a href="#index-Time_002dalveraged-sojourn-time-38">Time-alveraged sojourn time</a>: <a href="#Time_002dAveraged-Expected-Sojourn-Time">Time-Averaged Expected Sojourn Time</a></li> +<li><a href="#index-Stationary-probabilities-27">Stationary probabilities</a>: <a href="#State-occupancy-probabilities-_0028CTMC_0029">State occupancy probabilities (CTMC)</a></li> +<li><a href="#index-Stationary-probabilities-8">Stationary probabilities</a>: <a href="#State-occupancy-probabilities-_0028DTMC_0029">State occupancy probabilities (DTMC)</a></li> +<li><a href="#index-Time_002dalveraged-sojourn-time-38">Time-alveraged sojourn time</a>: <a href="#Time_002daveraged-expected-sojourn-times-_0028CTMC_0029">Time-averaged expected sojourn times (CTMC)</a></li> <li><a href="#index-traffic-intensity-65">traffic intensity</a>: <a href="#The-M_002fM_002finf-System">The M/M/inf System</a></li> <li><a href="#index-warranty-294">warranty</a>: <a href="#Copying">Copying</a></li> </ul><div class="node"> @@ -5594,18 +5646,18 @@ <ul class="index-fn" compact> -<li><a href="#index-ctmc-22"><code>ctmc</code></a>: <a href="#State-occupancy-probabilities">State occupancy probabilities</a></li> -<li><a href="#index-ctmc_005fbd-28"><code>ctmc_bd</code></a>: <a href="#Birth_002dDeath-process">Birth-Death process</a></li> +<li><a href="#index-ctmc-22"><code>ctmc</code></a>: <a href="#State-occupancy-probabilities-_0028CTMC_0029">State occupancy probabilities (CTMC)</a></li> +<li><a href="#index-ctmc_005fbd-28"><code>ctmc_bd</code></a>: <a href="#Birth_002ddeath-process-_0028CTMC_0029">Birth-death process (CTMC)</a></li> <li><a href="#index-ctmc_005fcheck_005fQ-20"><code>ctmc_check_Q</code></a>: <a href="#Continuous_002dTime-Markov-Chains">Continuous-Time Markov Chains</a></li> -<li><a href="#index-ctmc_005fexps-31"><code>ctmc_exps</code></a>: <a href="#Expected-Sojourn-Time">Expected Sojourn Time</a></li> -<li><a href="#index-ctmc_005ffpt-46"><code>ctmc_fpt</code></a>: <a href="#First-Passage-Times">First Passage Times</a></li> -<li><a href="#index-ctmc_005fmtta-39"><code>ctmc_mtta</code></a>: <a href="#Mean-Time-to-Absorption">Mean Time to Absorption</a></li> -<li><a href="#index-ctmc_005ftaexps-35"><code>ctmc_taexps</code></a>: <a href="#Time_002dAveraged-Expected-Sojourn-Time">Time-Averaged Expected Sojourn Time</a></li> -<li><a href="#index-dtmc-3"><code>dtmc</code></a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> -<li><a href="#index-dtmc_005fbd-9"><code>dtmc_bd</code></a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> +<li><a href="#index-ctmc_005fexps-31"><code>ctmc_exps</code></a>: <a href="#Expected-sojourn-times-_0028CTMC_0029">Expected sojourn times (CTMC)</a></li> +<li><a href="#index-ctmc_005ffpt-46"><code>ctmc_fpt</code></a>: <a href="#First-passage-times-_0028CTMC_0029">First passage times (CTMC)</a></li> +<li><a href="#index-ctmc_005fmtta-39"><code>ctmc_mtta</code></a>: <a href="#Mean-time-to-absorption-_0028CTMC_0029">Mean time to absorption (CTMC)</a></li> +<li><a href="#index-ctmc_005ftaexps-35"><code>ctmc_taexps</code></a>: <a href="#Time_002daveraged-expected-sojourn-times-_0028CTMC_0029">Time-averaged expected sojourn times (CTMC)</a></li> +<li><a href="#index-dtmc-3"><code>dtmc</code></a>: <a href="#State-occupancy-probabilities-_0028DTMC_0029">State occupancy probabilities (DTMC)</a></li> +<li><a href="#index-dtmc_005fbd-9"><code>dtmc_bd</code></a>: <a href="#Birth_002ddeath-process-_0028DTMC_0029">Birth-death process (DTMC)</a></li> <li><a href="#index-dtmc_005fcheck_005fP-1"><code>dtmc_check_P</code></a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> -<li><a href="#index-dtmc_005ffpt-12"><code>dtmc_fpt</code></a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> -<li><a href="#index-dtmc_005fmtta-16"><code>dtmc_mtta</code></a>: <a href="#Discrete_002dTime-Markov-Chains">Discrete-Time Markov Chains</a></li> +<li><a href="#index-dtmc_005ffpt-12"><code>dtmc_fpt</code></a>: <a href="#First-passage-times-_0028DTMC_0029">First passage times (DTMC)</a></li> +<li><a href="#index-dtmc_005fmtta-16"><code>dtmc_mtta</code></a>: <a href="#Mean-time-to-absorption-_0028DTMC_0029">Mean time to absorption (DTMC)</a></li> <li><a href="#index-population_005fmix-284"><code>population_mix</code></a>: <a href="#Utility-functions">Utility functions</a></li> <li><a href="#index-qnammm-78"><code>qnammm</code></a>: <a href="#The-Asymmetric-M_002fM_002fm-System">The Asymmetric M/M/m System</a></li> <li><a href="#index-qnclosed-278"><code>qnclosed</code></a>: <a href="#Utility-functions">Utility functions</a></li> @@ -5662,7 +5714,7 @@ <li><a href="#index-Bolch_002c-G_002e-66">Bolch, G.</a>: <a href="#The-M_002fM_002finf-System">The M/M/inf System</a></li> <li><a href="#index-Bolch_002c-G_002e-59">Bolch, G.</a>: <a href="#The-M_002fM_002fm-System">The M/M/m System</a></li> <li><a href="#index-Bolch_002c-G_002e-52">Bolch, G.</a>: <a href="#The-M_002fM_002f1-System">The M/M/1 System</a></li> -<li><a href="#index-Bolch_002c-G_002e-42">Bolch, G.</a>: <a href="#Mean-Time-to-Absorption">Mean Time to Absorption</a></li> +<li><a href="#index-Bolch_002c-G_002e-42">Bolch, G.</a>: <a href="#Mean-time-to-absorption-_0028CTMC_0029">Mean time to absorption (CTMC)</a></li> <li><a href="#index-Buzen_002c-J_002e-P_002e-114">Buzen, J. P.</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> <li><a href="#index-Casale_002c-G_002e-269">Casale, G.</a>: <a href="#Bounds-on-performance">Bounds on performance</a></li> <li><a href="#index-Casale_002c-G_002e-172">Casale, G.</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> @@ -5672,7 +5724,7 @@ <li><a href="#index-de-Meer_002c-H_002e-68">de Meer, H.</a>: <a href="#The-M_002fM_002finf-System">The M/M/inf System</a></li> <li><a href="#index-de-Meer_002c-H_002e-61">de Meer, H.</a>: <a href="#The-M_002fM_002fm-System">The M/M/m System</a></li> <li><a href="#index-de-Meer_002c-H_002e-54">de Meer, H.</a>: <a href="#The-M_002fM_002f1-System">The M/M/1 System</a></li> -<li><a href="#index-de-Meer_002c-H_002e-44">de Meer, H.</a>: <a href="#Mean-Time-to-Absorption">Mean Time to Absorption</a></li> +<li><a href="#index-de-Meer_002c-H_002e-44">de Meer, H.</a>: <a href="#Mean-time-to-absorption-_0028CTMC_0029">Mean time to absorption (CTMC)</a></li> <li><a href="#index-Graham_002c-G_002e-S_002e-245">Graham, G. S.</a>: <a href="#Bounds-on-performance">Bounds on performance</a></li> <li><a href="#index-Graham_002c-G_002e-S_002e-144">Graham, G. S.</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> <li><a href="#index-Greiner_002c-S_002e-106">Greiner, S.</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> @@ -5681,7 +5733,7 @@ <li><a href="#index-Greiner_002c-S_002e-67">Greiner, S.</a>: <a href="#The-M_002fM_002finf-System">The M/M/inf System</a></li> <li><a href="#index-Greiner_002c-S_002e-60">Greiner, S.</a>: <a href="#The-M_002fM_002fm-System">The M/M/m System</a></li> <li><a href="#index-Greiner_002c-S_002e-53">Greiner, S.</a>: <a href="#The-M_002fM_002f1-System">The M/M/1 System</a></li> -<li><a href="#index-Greiner_002c-S_002e-43">Greiner, S.</a>: <a href="#Mean-Time-to-Absorption">Mean Time to Absorption</a></li> +<li><a href="#index-Greiner_002c-S_002e-43">Greiner, S.</a>: <a href="#Mean-time-to-absorption-_0028CTMC_0029">Mean time to absorption (CTMC)</a></li> <li><a href="#index-Hsieh_002c-C_002e-H-267">Hsieh, C. H</a>: <a href="#Bounds-on-performance">Bounds on performance</a></li> <li><a href="#index-Jain_002c-R_002e-154">Jain, R.</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> <li><a href="#index-Kobayashi_002c-H_002e-126">Kobayashi, H.</a>: <a href="#Algorithms-for-Product_002dForm-QNs">Algorithms for Product-Form QNs</a></li> @@ -5704,7 +5756,7 @@ <li><a href="#index-Trivedi_002c-K_002e-69">Trivedi, K.</a>: <a href="#The-M_002fM_002finf-System">The M/M/inf System</a></li> <li><a href="#index-Trivedi_002c-K_002e-62">Trivedi, K.</a>: <a href="#The-M_002fM_002fm-System">The M/M/m System</a></li> <li><a href="#index-Trivedi_002c-K_002e-55">Trivedi, K.</a>: <a href="#The-M_002fM_002f1-System">The M/M/1 System</a></li> -<li><a href="#index-Trivedi_002c-K_002e-45">Trivedi, K.</a>: <a href="#Mean-Time-to-Absorption">Mean Time to Absorption</a></li> +<li><a href="#index-Trivedi_002c-K_002e-45">Trivedi, K.</a>: <a href="#Mean-time-to-absorption-_0028CTMC_0029">Mean time to absorption (CTMC)</a></li> <li><a href="#index-Wong_002c-E_002e-293">Wong, E.</a>: <a href="#Utility-functions">Utility functions</a></li> <li><a href="#index-Zahorjan_002c-J_002e-292">Zahorjan, J.</a>: <a href="#Utility-functions">Utility functions</a></li> <li><a href="#index-Zahorjan_002c-J_002e-244">Zahorjan, J.</a>: <a href="#Bounds-on-performance">Bounds on performance</a></li> Modified: trunk/octave-forge/main/queueing/doc/queueing.pdf =================================================================== (Binary files differ) Modified: trunk/octave-forge/main/queueing/inst/ctmc_taexps.m =================================================================== --- trunk/octave-forge/main/queueing/inst/ctmc_taexps.m 2012-03-15 21:26:25 UTC (rev 9907) +++ trunk/octave-forge/main/queueing/inst/ctmc_taexps.m 2012-03-15 21:34:38 UTC (rev 9908) @@ -53,7 +53,7 @@ ## ## @item M ## If this function is called with three parameters, @code{@var{M}(i)} -## is the expected fraction of the interval @math{0,t]} spent in state +## is the expected fraction of the interval @math{[0,t]} spent in state ## @math{i} assuming that the state occupancy probability at time zero ## is @var{p}. If this function is called with two parameters, ## @code{@var{M}(i)} is the expected fraction of time until absorption This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-03-15 21:26:31
|
Revision: 9907 http://octave.svn.sourceforge.net/octave/?rev=9907&view=rev Author: paramaniac Date: 2012-03-15 21:26:25 +0000 (Thu, 15 Mar 2012) Log Message: ----------- control-devel: quicksave id draft code (3) Modified Paths: -------------- trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc trunk/octave-forge/extra/control-devel/src/slident.cc Modified: trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc 2012-03-15 20:04:50 UTC (rev 9906) +++ trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc 2012-03-15 21:26:25 UTC (rev 9907) @@ -1 +1,2 @@ #include "slib01ad.cc" // preprocess the input-output data +#include "slident.cc" // system identification Modified: trunk/octave-forge/extra/control-devel/src/slident.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slident.cc 2012-03-15 20:04:50 UTC (rev 9906) +++ trunk/octave-forge/extra/control-devel/src/slident.cc 2012-03-15 21:26:25 UTC (rev 9907) @@ -390,14 +390,14 @@ int nsmpl = nsmp; // arguments out - lda = max (1, n); - ldc = max (1, l); - ldb = max (1, n); - ldd = max (1, l); - ldq = n; // if JOBCK = 'C' or 'K' - ldry = l; // if JOBCK = 'C' or 'K' - lds = n; // if JOBCK = 'C' or 'K' - ldk = n; // if JOBCK = 'K' + int lda = max (1, n); + int ldc = max (1, l); + int ldb = max (1, n); + int ldd = max (1, l); + int ldq = n; // if JOBCK = 'C' or 'K' + int ldry = l; // if JOBCK = 'C' or 'K' + int lds = n; // if JOBCK = 'C' or 'K' + int ldk = n; // if JOBCK = 'K' Matrix a (lda, n); Matrix c (ldc, n); @@ -410,18 +410,74 @@ Matrix k (ldk, l); // workspace - int liwork; + int liwork_b; + int liw1; + int liw2; + + liw1 = max (n, m*nobr+n, l*nobr, m*(n+l)); + liw2 = n*n; // if JOBCK = 'K' + liwork_b = max (liw1, liw2); - int ldwork; + int ldwork_b; + int ldw1; + int ldw2; + int ldw3; + + if (meth == 'M') + { + int ldw1a = max (2*(l*nobr-l)*n+2*n, (l*nobr-l)*n+n*n+7*n); + int ldw1b = max (2*(l*nobr-l)*n+n*n+7*n, + (l*nobr-l)*n+n+6*m*nobr, + (l*nobr-l)*n+n+max (l+m*nobr, l*nobr + max (3*l*nobr+1, m))); + ldw1 = max (ldw1a, ldw1b); + + int aw; + + if (m == 0 || job == 'C') + aw = n + n*n; + else + aw = 0; + + ldw2 = l*nobr*n + max ((l*nobr-l)*n+aw+2*n+max(5*n,(2*m+l)*nobr+l), 4*(m*nobr+n)+1, m*nobr+2*n+l ); + } + else if (meth == 'N') + { + ldw1 = l*nobr*n + max ((l*nobr-l)*n+2*n+(2*m+l)*nobr+l, + 2*(l*nobr-l)*n+n*n+8*n, + n+4*(m*nobr+n)+1, + m*nobr+3*n+l); + + if (m == 0 || job == 'C') + ldw2 = 0; + else + ldw2 = l*nobr*n+m*nobr*(n+l)*(m*(n+l)+1)+ max ((n+l)*(n+l), 4*m*(n+l)+1); + } + else // (meth == 'C') + { + int ldw1a = max (2*(l*nobr-l)*n+2*n, (l*nobr-l)*n+n*n+7*n); + int ldw1b = l*nobr*n + max ((l*nobr-l)*n+2*n+(2*m+l)*nobr+l, + 2*(l*nobr-l)*n+n*n+8*n, + n+4*(m*nobr+n)+1, + m*nobr+3*n+l); + + ldw1 = max (ldw1a, ldw1b); + + ldw2 = l*nobr*n+m*nobr*(n+l)*(m*(n+l)+1)+ max ((n+l)*(n+l), 4*m*(n+l)+1); - OCTAVE_LOCAL_BUFFER (int, iwork, liwork); - OCTAVE_LOCAL_BUFFER (double, dwork, ldwork); + } + + ldw3 = max(4*n*n + 2*n*l + l*l + max (3*l, n*l), 14*n*n + 12*n + 5); + ldwork_b = max (ldw1, ldw2, ldw3); + OCTAVE_LOCAL_BUFFER (int, iwork_b, liwork_b); + OCTAVE_LOCAL_BUFFER (double, dwork_b, ldwork_b); + OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n); + // error indicators - int iwarn = 0; - int info = 0; + int iwarn_b = 0; + int info_b = 0; // SLICOT routine IB01BD @@ -439,10 +495,10 @@ s.fortran_vec (), lds, k.fortran_vec (), ldk, tolb, - iwork, - dwork, ldwork, + iwork_b, + dwork_b, ldwork_b, bwork, - iwarn, info)); + iwarn_b, info_b)); if (f77_exception_encountered) @@ -481,8 +537,8 @@ "gain matrix is set to zero"}; - error_msg ("ident", info, 10, err_msg_b); - warning_msg ("ident", iwarn, 5, warn_msg_b); + error_msg ("ident", info_b, 10, err_msg_b); + warning_msg ("ident", iwarn_b, 5, warn_msg_b); // resize a.resize (n, n); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-03-15 20:04:56
|
Revision: 9906 http://octave.svn.sourceforge.net/octave/?rev=9906&view=rev Author: paramaniac Date: 2012-03-15 20:04:50 +0000 (Thu, 15 Mar 2012) Log Message: ----------- control-devel: quicksave id draft code (2) Modified Paths: -------------- trunk/octave-forge/extra/control-devel/src/slident.cc Modified: trunk/octave-forge/extra/control-devel/src/slident.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slident.cc 2012-03-15 19:24:20 UTC (rev 9905) +++ trunk/octave-forge/extra/control-devel/src/slident.cc 2012-03-15 20:04:50 UTC (rev 9906) @@ -79,7 +79,7 @@ int nargin = args.length (); octave_value_list retval; - if (nargin != 11) + if (nargin != 12) { print_usage (); } @@ -106,6 +106,7 @@ double rcond = args(9).double_value (); double tol = args(10).double_value (); + double tolb = args(11).double_value (); if (imeth == 0) @@ -389,7 +390,35 @@ int nsmpl = nsmp; // arguments out + lda = max (1, n); + ldc = max (1, l); + ldb = max (1, n); + ldd = max (1, l); + ldq = n; // if JOBCK = 'C' or 'K' + ldry = l; // if JOBCK = 'C' or 'K' + lds = n; // if JOBCK = 'C' or 'K' + ldk = n; // if JOBCK = 'K' + + Matrix a (lda, n); + Matrix c (ldc, n); + Matrix b (ldb, m); + Matrix d (ldd, m); + + Matrix q (ldq, n); + Matrix ry (ldry, l); + Matrix s (lds, l); + Matrix k (ldk, l); + + // workspace + int liwork; + int ldwork; + + + OCTAVE_LOCAL_BUFFER (int, iwork, liwork); + OCTAVE_LOCAL_BUFFER (double, dwork, ldwork); + + // error indicators int iwarn = 0; int info = 0; @@ -409,7 +438,7 @@ ry.fortran_vec (), ldry, s.fortran_vec (), lds, k.fortran_vec (), ldk, - tol, + tolb, iwork, dwork, ldwork, bwork, @@ -455,8 +484,27 @@ error_msg ("ident", info, 10, err_msg_b); warning_msg ("ident", iwarn, 5, warn_msg_b); + // resize + a.resize (n, n); + c.resize (l, n); + b.resize (n, m); + d.resize (l, m); + q.resize (n, n); + ry.resize (l, l); + s.resize (n, l); + k.resize (n, l); + // return values + retval(0) = a; + retval(1) = b; + retval(2) = c; + retval(3) = d; + + retval(4) = q; + retval(5) = ry; + retval(6) = s; + retval(7) = k; //retval(0) = octave_value (n); //retval(1) = r; //retval(2) = sv; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-03-15 19:24:27
|
Revision: 9905 http://octave.svn.sourceforge.net/octave/?rev=9905&view=rev Author: paramaniac Date: 2012-03-15 19:24:20 +0000 (Thu, 15 Mar 2012) Log Message: ----------- control-devel: quicksave id draft code Modified Paths: -------------- trunk/octave-forge/extra/control-devel/src/slib01bd.cc Added Paths: ----------- trunk/octave-forge/extra/control-devel/src/slident.cc Modified: trunk/octave-forge/extra/control-devel/src/slib01bd.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slib01bd.cc 2012-03-15 17:44:49 UTC (rev 9904) +++ trunk/octave-forge/extra/control-devel/src/slib01bd.cc 2012-03-15 19:24:20 UTC (rev 9905) @@ -63,7 +63,7 @@ int nargin = args.length (); octave_value_list retval; - if (nargin != 11) + if (nargin != 5) { print_usage (); } @@ -71,81 +71,37 @@ { // arguments in char meth; - char alg; - char jobd; - char batch; - char conct; - char ctrl; + char job = 'A'; + char jobck = 'K'; - Matrix y = args(0).matrix_value (); - Matrix u = args(1).matrix_value (); - int nobr = args(2).int_value (); - + Matrix r = args(0).matrix_value (); + int nsmpl = args(1).int_value (); + int n = args(2).int_value (); const int imeth = args(3).int_value (); - const int ialg = args(4).int_value (); - const int ijobd = args(5).int_value (); - const int ibatch = args(6).int_value (); - const int iconct = args(7).int_value (); - const int ictrl = args(8).int_value (); - - double rcond = args(9).double_value (); - double tol = args(10).double_value (); - + double tol = args(4).double_value (); - if (imeth == 0) - meth = 'M'; - else - meth = 'N'; - switch (ialg) + switch (imeth) { case 0: - alg = 'C'; + meth = 'M'; break; case 1: - alg = 'F'; + meth = 'N'; break; case 2: - alg = 'Q'; + meth = 'C'; break; default: - error ("slib01bd: argument 'alg' invalid"); + error ("slib01bd: argument 'meth' invalid"); } + + // TODO: if meth == 'C', which meth should be taken for IB01AD.f, 'M' or 'N'? - if (ijobd == 0) - jobd = 'M'; - else - jobd = 'N'; + int m = + int nobr = r.rows () / (2*(m+l)); - switch (ibatch) - { - case 0: - batch = 'F'; - break; - case 1: - batch = 'I'; - break; - case 2: - batch = 'L'; - break; - case 3: - batch = 'O'; - break; - default: - error ("slib01bd: argument 'batch' invalid"); - } - - if (iconct == 0) - conct = 'C'; - else - conct = 'N'; - - if (ictrl == 0) - ctrl = 'C'; - else - ctrl = 'N'; - - + int m = u.columns (); // m: number of inputs int l = y.columns (); // l: number of outputs int nsmp = y.rows (); // nsmp: number of samples @@ -178,60 +134,13 @@ // workspace int liwork; - if (meth == 'N') // if METH = 'N' - liwork = (m+l)*nobr; - else if (alg == 'F') // if METH = 'M' and ALG = 'F' - liwork = m+l; - else // if METH = 'M' and ALG = 'C' or 'Q' - liwork = 0; - // TODO: Handle 'k' for DWORK int ldwork; - ldwork = 0; - if (alg == 'C' && (batch == 'F' || batch == 'I') && conct = 'C') - ldwork = (4*nobr-2)*(m+l); - else if (alg == 'C' && (batch == 'F' || batch == 'I') && conct = 'N') - ldwork = 1; - else if (meth == 'M' && alg == 'C' && batch == 'L' && conct == 'C') - ldwork = max ((4*nobr-2)*(m+l), 5*l*nobr); - else if ((meth == 'M' && jobd = 'M' && alg == 'C' && batch == 'O') || (batch == 'L' && conct == 'N')) - ldwork = max ((2*m-1)*nobr, (m+l)*nobr, 5*l*nobr); - else if ((meth == 'M' && jobd == 'N' && alg == 'C' && batch == 'O') || (batch == 'L' && conct == 'N')) - ldwork = 5*l*nobr; - // FIXME : two times || (batch == 'L' && conct == 'N') doesn't make sense -C LDWORK >= 5*(M+L)*NOBR+1, if METH = 'N', ALG = 'C', and -C BATCH = 'L' or 'O'; -C LDWORK >= (M+L)*2*NOBR*(M+L+3), if ALG = 'F', -C BATCH <> 'O' and CONCT = 'C'; -C LDWORK >= (M+L)*2*NOBR*(M+L+1), if ALG = 'F', -C BATCH = 'F', 'I' and CONCT = 'N'; -C LDWORK >= (M+L)*4*NOBR*(M+L+1)+(M+L)*2*NOBR, if ALG = 'F', -C BATCH = 'L' and CONCT = 'N', or -C BATCH = 'O'; -C LDWORK >= 4*(M+L)*NOBR, if ALG = 'Q', BATCH = 'F', and -C LDR >= NS = NSMP - 2*NOBR + 1; -C LDWORK >= max(4*(M+L)*NOBR, 5*L*NOBR), if METH = 'M', -C ALG = 'Q', BATCH = 'O', and LDR >= NS; -C LDWORK >= 5*(M+L)*NOBR+1, if METH = 'N', ALG = 'Q', -C BATCH = 'O', and LDR >= NS; -C LDWORK >= 6*(M+L)*NOBR, if ALG = 'Q', (BATCH = 'F' or 'O', -C and LDR < NS), or (BATCH = 'I' or -C 'L' and CONCT = 'N'); -C LDWORK >= 4*(NOBR+1)*(M+L)*NOBR, if ALG = 'Q', BATCH = 'I' -C or 'L' and CONCT = 'C'. -C The workspace used for ALG = 'Q' is -C LDRWRK*2*(M+L)*NOBR + 4*(M+L)*NOBR, -C where LDRWRK = LDWORK/(2*(M+L)*NOBR) - 2; recommended -C value LDRWRK = NS, assuming a large enough cache size. -C For good performance, LDWORK should be larger. - - - OCTAVE_LOCAL_BUFFER (int, iwork, liwork); OCTAVE_LOCAL_BUFFER (double, dwork, ldwork); Added: trunk/octave-forge/extra/control-devel/src/slident.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slident.cc (rev 0) +++ trunk/octave-forge/extra/control-devel/src/slident.cc 2012-03-15 19:24:20 UTC (rev 9905) @@ -0,0 +1,466 @@ +/* + +Copyright (C) 2012 Lukas F. Reichlin + +This file is part of LTI Syncope. + +LTI Syncope is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +LTI Syncope is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +SLICOT system identification +Uses SLICOT IB01AD, IB01BD and IB01CD by courtesy of NICONET e.V. +<http://www.slicot.org> + +Author: Lukas Reichlin <luk...@gm...> +Created: March 2012 +Version: 0.1 + +*/ + +#include <octave/oct.h> +#include <f77-fcn.h> +#include "common.h" + +extern "C" +{ + int F77_FUNC (ib01ad, IB01AD) + (char& METH, char& ALG, char& JOBD, + char& BATCH, char& CONCT, char& CTRL, + int& NOBR, int& M, int& L, + int& NSMP, + double* U, int& LDU, + double* Y, int& LDY, + int& N, + double* R, int& LDR, + double* SV, + double& RCOND, double& TOL, + int* IWORK, + double* DWORK, int& LDWORK, + int& IWARN, int& INFO); + + int F77_FUNC (ib01bd, IB01BD) + (char& METH, char& JOB, char& JOBCK, + int& NOBR, int& N, int& M, int& L, + int& NSMPL, + double* R, int& LDR, + double* A, int& LDA, + double* C, int& LDC, + double* B, int& LDB, + double* D, int& LDD, + double* Q, int& LDQ, + double* RY, int& LDRY, + double* S, int& LDS, + double* K, int& LDK, + double& TOL, + int* IWORK, + double* DWORK, int& LDWORK, + bool* BWORK, + int& IWARN, int& INFO); + +} + +// PKG_ADD: autoload ("slident", "devel_slicot_functions.oct"); +DEFUN_DLD (slident, args, nargout, + "-*- texinfo -*-\n\ +Slicot IB01AD Release 5.0\n\ +No argument checking.\n\ +For internal use only.") +{ + int nargin = args.length (); + octave_value_list retval; + + if (nargin != 11) + { + print_usage (); + } + else + { + // arguments in + char meth; + char alg; + char jobd; + char batch; + char conct; + char ctrl; + + Matrix y = args(0).matrix_value (); + Matrix u = args(1).matrix_value (); + int nobr = args(2).int_value (); + + const int imeth = args(3).int_value (); + const int ialg = args(4).int_value (); + const int ijobd = args(5).int_value (); + const int ibatch = args(6).int_value (); + const int iconct = args(7).int_value (); + const int ictrl = args(8).int_value (); + + double rcond = args(9).double_value (); + double tol = args(10).double_value (); + + + if (imeth == 0) + meth = 'M'; + else + meth = 'N'; + + switch (ialg) + { + case 0: + alg = 'C'; + break; + case 1: + alg = 'F'; + break; + case 2: + alg = 'Q'; + break; + default: + error ("slib01ad: argument 'alg' invalid"); + } + + if (ijobd == 0) + jobd = 'M'; + else + jobd = 'N'; + + switch (ibatch) + { + case 0: + batch = 'F'; + break; + case 1: + batch = 'I'; + break; + case 2: + batch = 'L'; + break; + case 3: + batch = 'O'; + break; + default: + error ("slib01ad: argument 'batch' invalid"); + } + + if (iconct == 0) + conct = 'C'; + else + conct = 'N'; + + if (ictrl == 0) + ctrl = 'C'; + else + ctrl = 'N'; + + + int m = u.columns (); // m: number of inputs + int l = y.columns (); // l: number of outputs + int nsmp = y.rows (); // nsmp: number of samples + // y.rows == u.rows is checked by iddata class + // TODO: check minimal nsmp size + + int ldu; + + if (m == 0) + ldu = 1; + else // m > 0 + ldu = nsmp; + + int ldy = nsmp; + + // arguments out + int n; + int ldr; + + if (meth == 'M' && jobd == 'M') + ldr = max (2*(m+l)*nobr, 3*m*nobr); + else if (meth == 'N' || (meth == 'M' && jobd == 'N')) + ldr = 2*(m+l)*nobr; + else + error ("slib01ad: could not handle 'ldr' case"); + + Matrix r (ldr, 2*(m+l)*nobr); + ColumnVector sv (l*nobr); + + // workspace + int liwork; + + if (meth == 'N') // if METH = 'N' + liwork = (m+l)*nobr; + else if (alg == 'F') // if METH = 'M' and ALG = 'F' + liwork = m+l; + else // if METH = 'M' and ALG = 'C' or 'Q' + liwork = 0; + + // TODO: Handle 'k' for DWORK + + int ldwork; + + ldwork = 0; + + if (alg == 'C') + { + if (batch == 'F' || batch == 'I') + { + if (conct == 'C') + ldwork = (4*nobr-2)*(m+l); + else // (conct == 'N') + ldwork = 1; + } + else if (meth == 'M') // && (batch == 'L' || batch == 'O') + { + if (conct == 'C' && batch == 'L') + ldwork = max ((4*nobr-2)*(m+l), 5*l*nobr); + else if (jobd == 'M') + ldwork = max ((2*m-1)*nobr, (m+l)*nobr, 5*l*nobr); + else // (jobd == 'N') + ldwork = 5*l*nobr; + } + else // meth == 'N' && (batch == 'L' || batch == 'O') + { + ldwork = 5*(m+l)*nobr + 1; + } + } + else if (alg == 'F') + { +/* +For the second LDWORK case, code and documentation don't match: +doc line 276: BATCH = 'F', 'I' +code line 586: BATCH = 'F', 'I', 'O' +The third case with BATCH = 'O' is never reached. + + +IB01AD.f Lines 273-279: +C LDWORK >= (M+L)*2*NOBR*(M+L+3), if ALG = 'F', +C BATCH <> 'O' and CONCT = 'C'; +C LDWORK >= (M+L)*2*NOBR*(M+L+1), if ALG = 'F', +C BATCH = 'F', 'I' and CONCT = 'N'; +C LDWORK >= (M+L)*4*NOBR*(M+L+1)+(M+L)*2*NOBR, if ALG = 'F', +C BATCH = 'L' and CONCT = 'N', or +C BATCH = 'O'; + + +IB01AD.f Lines 499-500: + ONEBCH = LSAME( BATCH, 'O' ) + FIRST = LSAME( BATCH, 'F' ) .OR. ONEBCH + + +IB01AD.f Lines 583-591: + ELSE IF ( FQRALG ) THEN + IF ( .NOT.ONEBCH .AND. CONNEC ) THEN + MINWRK = NR*( M + L + 3 ) + ELSE IF ( FIRST .OR. INTERM ) THEN // (batch = F || O) || batch = I + MINWRK = NR*( M + L + 1 ) ^ + ELSE | + MINWRK = 2*NR*( M + L + 1 ) + NR ??? + END IF + ELSE +*/ + if (batch != 'O' && conct == 'C') + ldwork = (m+l)*2*nobr*(m+l+3); + else if (batch == 'F' || batch == 'O' || batch == 'I') // && conct == 'N' + ldwork = (m+l)*2*nobr*(m+l+1); + else // (batch == 'L' && conct == 'N') + ldwork = (m+l)*4*nobr*(m+l+1)+(m+l)*2*nobr; + } + else // (alg == 'Q') + { + int ns = nsmp - 2*nobr + 1; + + if (ldr >= ns && batch == 'F') + { + ldwork = 4*(m+l)*nobr; + } + else if (ldr >= ns && batch == 'O') + { + if (meth == 'M') + ldwork = max (4*(m+l)*nobr, 5*l*nobr); + else // (meth == 'N') + ldwork = 5*(m+l)*nobr + 1; + } + else if (conct == 'C' && (batch == 'I' || batch == 'L')) + { + ldwork = 4*(nobr+1)*(m+l)*nobr; + } + else // if ALG = 'Q', (BATCH = 'F' or 'O', and LDR < NS), or (BATCH = 'I' or 'L' and CONCT = 'N') + { + ldwork = 6*(m+l)*nobr; + } + } + +/* +IB01AD.f Lines 291-195: +c the workspace used for alg = 'q' is +c ldrwrk*2*(m+l)*nobr + 4*(m+l)*nobr, +c where ldrwrk = ldwork/(2*(m+l)*nobr) - 2; recommended +c value ldrwrk = ns, assuming a large enough cache size. +c for good performance, ldwork should be larger. + +somehow ldrwrk and ldwork must have been mixed up here + +*/ + + + OCTAVE_LOCAL_BUFFER (int, iwork, liwork); + OCTAVE_LOCAL_BUFFER (double, dwork, ldwork); + + // error indicators + int iwarn = 0; + int info = 0; + + + // SLICOT routine IB01AD + F77_XFCN (ib01ad, IB01AD, + (meth, alg, jobd, + batch, conct, ctrl, + nobr, m, l, + nsmp, + u.fortran_vec (), ldu, + y.fortran_vec (), ldy, + n, + r.fortran_vec (), ldr, + sv.fortran_vec (), + rcond, tol, + iwork, + dwork, ldwork, + iwarn, info)); + + + if (f77_exception_encountered) + error ("ident: exception in SLICOT subroutine IB01AD"); + + static const char* err_msg[] = { + "0: OK", + "1: a fast algorithm was requested (ALG = 'C', or 'F') " + "in sequential data processing, but it failed; the " + "routine can be repeatedly called again using the " + "standard QR algorithm", + "2: the singular value decomposition (SVD) algorithm did " + "not converge"}; + + static const char* warn_msg[] = { + "0: OK", + "1: the number of 100 cycles in sequential data " + "processing has been exhausted without signaling " + "that the last block of data was get; the cycle " + "counter was reinitialized", + "2: a fast algorithm was requested (ALG = 'C' or 'F'), " + "but it failed, and the QR algorithm was then used " + "(non-sequential data processing)", + "3: all singular values were exactly zero, hence N = 0 " + "(both input and output were identically zero)", + "4: the least squares problems with coefficient matrix " + "U_f, used for computing the weighted oblique " + "projection (for METH = 'N'), have a rank-deficient " + "coefficient matrix", + "5: the least squares problem with coefficient matrix " + "r_1 [6], used for computing the weighted oblique " + "projection (for METH = 'N'), has a rank-deficient " + "coefficient matrix"}; + + + error_msg ("ident", info, 2, err_msg); + warning_msg ("ident", iwarn, 5, warn_msg); + + + // resize + int rs = 2*(m+l)*nobr; + r.resize (rs, rs); + +////////////////////////////////////////////////////////// +// SLICOT IB01BD - A, B, C, D // +////////////////////////////////////////////////////////// + + // arguments in + char job = 'A'; + char jobck = 'K'; + + // TODO: if meth == 'C', which meth should be taken for IB01AD.f, 'M' or 'N'? + + int nsmpl = nsmp; + + // arguments out + + // error indicators + int iwarn = 0; + int info = 0; + + + // SLICOT routine IB01BD + F77_XFCN (ib01bd, IB01BD, + (meth, job, jobck, + nobr, n, m, l, + nsmpl, + r.fortran_vec (), ldr, + a.fortran_vec (), lda, + c.fortran_vec (), ldc, + b.fortran_vec (), ldb, + d.fortran_vec (), ldd, + q.fortran_vec (), ldq, + ry.fortran_vec (), ldry, + s.fortran_vec (), lds, + k.fortran_vec (), ldk, + tol, + iwork, + dwork, ldwork, + bwork, + iwarn, info)); + + + if (f77_exception_encountered) + error ("ident: exception in SLICOT subroutine IB01BD"); + + static const char* err_msg_b[] = { + "0: OK", + "1: error message not specified", + "2: the singular value decomposition (SVD) algorithm did " + "not converge", + "3: a singular upper triangular matrix was found", + "4: matrix A is (numerically) singular in discrete-" + "time case", + "5: the Hamiltonian or symplectic matrix H cannot be " + "reduced to real Schur form", + "6: the real Schur form of the Hamiltonian or " + "symplectic matrix H cannot be appropriately ordered", + "7: the Hamiltonian or symplectic matrix H has less " + "than N stable eigenvalues", + "8: the N-th order system of linear algebraic " + "equations, from which the solution matrix X would " + "be obtained, is singular to working precision", + "9: the QR algorithm failed to complete the reduction " + "of the matrix Ac to Schur canonical form, T", + "10: the QR algorithm did not converge"}; + + static const char* warn_msg_b[] = { + "0: OK", + "1: warning message not specified", + "2: warning message not specified", + "3: warning message not specified", + "4: a least squares problem to be solved has a " + "rank-deficient coefficient matrix", + "5: the computed covariance matrices are too small. " + "The problem seems to be a deterministic one; the " + "gain matrix is set to zero"}; + + + error_msg ("ident", info, 10, err_msg_b); + warning_msg ("ident", iwarn, 5, warn_msg_b); + + + // return values + //retval(0) = octave_value (n); + //retval(1) = r; + //retval(2) = sv; + } + + return retval; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-03-15 17:44:55
|
Revision: 9904 http://octave.svn.sourceforge.net/octave/?rev=9904&view=rev Author: carandraug Date: 2012-03-15 17:44:49 +0000 (Thu, 15 Mar 2012) Log Message: ----------- normalise_distribution: upper limit on version check for workaround since octave core fixed bug as of 3.6.2 Modified Paths: -------------- trunk/octave-forge/main/statistics/inst/normalise_distribution.m Modified: trunk/octave-forge/main/statistics/inst/normalise_distribution.m =================================================================== --- trunk/octave-forge/main/statistics/inst/normalise_distribution.m 2012-03-15 12:43:09 UTC (rev 9903) +++ trunk/octave-forge/main/statistics/inst/normalise_distribution.m 2012-03-15 17:44:49 UTC (rev 9904) @@ -190,13 +190,11 @@ ## A regression in the 3.4 series made this no longer work so we behave ## differently depending on octave version. This applies the fix for all - ## 3.4 releases but it probably only appeared on 3.4.3 (can someone check?) + ## 3.4 releases but it may have appeared on 3.2.4 (can someone check?) ## See https://savannah.gnu.org/bugs/index.php?34765 - ## Turns out that the bug was not completely fixed the first time and is - ## still present in 3.6.1 ## FIXME Once package dependency increases beyond an octave version that ## has this fixed, remove this - if (compare_versions (OCTAVE_VERSION, "3.4", "<")) + if (compare_versions (OCTAVE_VERSION, "3.4", "<") || compare_versions (OCTAVE_VERSION, "3.6.2", ">=")) ## this is how it should work f_remap = @( k ) ( normal ( k ) ); normalised ( :, k ) = arrayfun ( f_remap, target_indices ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-03-15 12:43:20
|
Revision: 9903 http://octave.svn.sourceforge.net/octave/?rev=9903&view=rev Author: carandraug Date: 2012-03-15 12:43:09 +0000 (Thu, 15 Mar 2012) Log Message: ----------- iscolormap: new function to image package Modified Paths: -------------- trunk/octave-forge/main/image/NEWS Added Paths: ----------- trunk/octave-forge/main/image/inst/iscolormap.m Modified: trunk/octave-forge/main/image/NEWS =================================================================== --- trunk/octave-forge/main/image/NEWS 2012-03-15 02:49:14 UTC (rev 9902) +++ trunk/octave-forge/main/image/NEWS 2012-03-15 12:43:09 UTC (rev 9903) @@ -18,6 +18,7 @@ iptchecknargin iptcheckstrs iptnum2ordinal + iscolormap normxcorr2 wavelength2rgb Added: trunk/octave-forge/main/image/inst/iscolormap.m =================================================================== --- trunk/octave-forge/main/image/inst/iscolormap.m (rev 0) +++ trunk/octave-forge/main/image/inst/iscolormap.m 2012-03-15 12:43:09 UTC (rev 9903) @@ -0,0 +1,39 @@ +## Copyright (C) 2012 Carnë Draug <car...@gm...> +## +## This program is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free Software +## Foundation; either version 3 of the License, or (at your option) any later +## version. +## +## This program is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +## details. +## +## You should have received a copy of the GNU General Public License along with +## this program; if not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {} iscolormap (@var{cm}) +## Return true if @var{cm} is a colormap. +## +## A colormap is an @var{n} row by 3 column matrix. The columns contain red, +## green, and blue intensities respectively. All entries should be between 0 +## and 1 inclusive. +## +## @seealso{colormap} +## @end deftypefn + +function bool = iscolormap (cm) + + if (nargin != 1) + print_usage; + endif + + bool = false; + if (ismatrix (cm) && isnumeric (cm) && columns(cm) == 3 && + min (cm(:)) >= 0 && max (cm(:)) <= 1) + bool = true; + endif + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sla...@us...> - 2012-03-15 02:49:21
|
Revision: 9902 http://octave.svn.sourceforge.net/octave/?rev=9902&view=rev Author: slackydeb Date: 2012-03-15 02:49:14 +0000 (Thu, 15 Mar 2012) Log Message: ----------- ga: avoid printing test output Modified Paths: -------------- trunk/octave-forge/main/ga/inst/ga.m Modified: trunk/octave-forge/main/ga/inst/ga.m =================================================================== --- trunk/octave-forge/main/ga/inst/ga.m 2012-03-15 02:27:43 UTC (rev 9901) +++ trunk/octave-forge/main/ga/inst/ga.m 2012-03-15 02:49:14 UTC (rev 9902) @@ -119,9 +119,9 @@ ## type of arguments -%!test x = ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("FitnessLimit", 1e-7, "Generations", 1000))) +%!test x = ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("FitnessLimit", 1e-7, "Generations", 1000))); -%!test x = ga (struct ("fitnessfcn", @(x) rastriginsfcn (x(1:2)) + ((x(3) ** 2) - (cos (2 * pi * x(3))) + 1) + (x(4) ** 2), "nvars", 4, "options", gaoptimset ("EliteCount", 5, "FitnessLimit", 1e-7, "PopInitRange", [-2; 2], "PopulationSize", 200))) +%!test x = ga (struct ("fitnessfcn", @(x) rastriginsfcn (x(1:2)) + ((x(3) ** 2) - (cos (2 * pi * x(3))) + 1) + (x(4) ** 2), "nvars", 4, "options", gaoptimset ("EliteCount", 5, "FitnessLimit", 1e-7, "PopInitRange", [-2; 2], "PopulationSize", 200))); ## nvars == 1 and min == zeros (1, nvars) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sla...@us...> - 2012-03-15 02:27:49
|
Revision: 9901 http://octave.svn.sourceforge.net/octave/?rev=9901&view=rev Author: slackydeb Date: 2012-03-15 02:27:43 +0000 (Thu, 15 Mar 2012) Log Message: ----------- ga: comment all demos-yet-tests in demo_ga Avoid people complaining about the unit test suit after running "test demo_ga" instead of executing "test_ga". Modified Paths: -------------- trunk/octave-forge/main/ga/inst/demo_ga.m Modified: trunk/octave-forge/main/ga/inst/demo_ga.m =================================================================== --- trunk/octave-forge/main/ga/inst/demo_ga.m 2012-03-15 02:24:25 UTC (rev 9900) +++ trunk/octave-forge/main/ga/inst/demo_ga.m 2012-03-15 02:27:43 UTC (rev 9901) @@ -32,30 +32,30 @@ ## This code is a simple example of the usage of ga # TODO: convert to demo -%!xtest assert (ga (@rastriginsfcn, 2), [0, 0], 1e-3) +# %!xtest assert (ga (@rastriginsfcn, 2), [0, 0], 1e-3) ## This code shows that ga optimizes also functions whose minimum is not ## in zero # TODO: convert to demo -%!xtest -%! min = [-1, 2]; -%! assert (ga (struct ("fitnessfcn", @(x) rastriginsfcn (x - min), "nvars", 2, "options", gaoptimset ("FitnessLimit", 1e-7, "Generations", 1000, "PopInitRange", [-5; 5], "PopulationSize", 200))), min, 1e-5) +# %!xtest +# %! min = [-1, 2]; +# %! assert (ga (struct ("fitnessfcn", @(x) rastriginsfcn (x - min), "nvars", 2, "options", gaoptimset ("FitnessLimit", 1e-7, "Generations", 1000, "PopInitRange", [-5; 5], "PopulationSize", 200))), min, 1e-5) ## This code shows that the "Vectorize" option usually speeds up execution # TODO: convert to demo -%!test -%! -%! tic (); -%! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200))); -%! elapsed_time = toc (); -%! -%! tic (); -%! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200, "Vectorized", "on"))); -%! elapsed_time_with_vectorized = toc (); -%! -%! assert (elapsed_time > elapsed_time_with_vectorized); +# %!test +# %! +# %! tic (); +# %! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200))); +# %! elapsed_time = toc (); +# %! +# %! tic (); +# %! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200, "Vectorized", "on"))); +# %! elapsed_time_with_vectorized = toc (); +# %! +# %! assert (elapsed_time > elapsed_time_with_vectorized); ## The "UseParallel" option should speed up execution # TODO: write demo (after implementing This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sla...@us...> - 2012-03-15 02:24:31
|
Revision: 9900 http://octave.svn.sourceforge.net/octave/?rev=9900&view=rev Author: slackydeb Date: 2012-03-15 02:24:25 +0000 (Thu, 15 Mar 2012) Log Message: ----------- ga: update NEWS and INDEX Modified Paths: -------------- trunk/octave-forge/main/ga/INDEX trunk/octave-forge/main/ga/NEWS Modified: trunk/octave-forge/main/ga/INDEX =================================================================== --- trunk/octave-forge/main/ga/INDEX 2012-03-15 02:24:13 UTC (rev 9899) +++ trunk/octave-forge/main/ga/INDEX 2012-03-15 02:24:25 UTC (rev 9900) @@ -19,4 +19,7 @@ mutationgaussian Utility - rastriginsfcn \ No newline at end of file + rastriginsfcn + +Miscellaneous + test_ga Modified: trunk/octave-forge/main/ga/NEWS =================================================================== --- trunk/octave-forge/main/ga/NEWS 2012-03-15 02:24:13 UTC (rev 9899) +++ trunk/octave-forge/main/ga/NEWS 2012-03-15 02:24:25 UTC (rev 9900) @@ -8,3 +8,11 @@ Octave version 3.4.0 (or better). The "communications" package was used only for its "randint" function; now the "randi" function, introduced on Octave 3.4.0, is used instead. + +** Reorganize the unit test suite. All available tests can be + executed by running "test_ga". Fix bug #3287917 (Debian bug + #622929). + +** Rename the package from "Genetic Algorithm and Direct Search" to + "Genetic Algorithm" as only the Genetic Algorithm is implemented. + Direct Search will not be implemented in the foreseeable future. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sla...@us...> - 2012-03-15 02:24:19
|
Revision: 9899 http://octave.svn.sourceforge.net/octave/?rev=9899&view=rev Author: slackydeb Date: 2012-03-15 02:24:13 +0000 (Thu, 15 Mar 2012) Log Message: ----------- ga: remove "Direct Search" from the title of the package Rename the package from "Genetic Algorithm and Direct Search" to "Genetic Algorithm" as only the genetic algorithm is implemented. Direct Search will not be implemented in the foreseeable future. Modified Paths: -------------- trunk/octave-forge/main/ga/DESCRIPTION Modified: trunk/octave-forge/main/ga/DESCRIPTION =================================================================== --- trunk/octave-forge/main/ga/DESCRIPTION 2012-03-15 02:24:02 UTC (rev 9898) +++ trunk/octave-forge/main/ga/DESCRIPTION 2012-03-15 02:24:13 UTC (rev 9899) @@ -1,9 +1,9 @@ Name: ga Version: 0.9.9 -Date: 2012-03-13 +Date: 2012-03-15 Author: Luca Favatella <sla...@gm...> Maintainer: Luca Favatella <sla...@gm...> -Title: Genetic Algorithm and Direct Search +Title: Genetic Algorithm Description: Genetic optimization code Categories: Optimization Depends: octave (>= 3.4.0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sla...@us...> - 2012-03-15 02:24:10
|
Revision: 9898 http://octave.svn.sourceforge.net/octave/?rev=9898&view=rev Author: slackydeb Date: 2012-03-15 02:24:02 +0000 (Thu, 15 Mar 2012) Log Message: ----------- ga: rename ga_{test,demo}.m to {test,demo}_ga.m Mimic the naming scheme of test_control.m from the control package, as there is no official best practice yet for exposing the unit test suite. References: http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/control/inst/test_control.m?revision=9663&view=markup http://sourceforge.net/mailarchive/message.php?msg_id=28977037 Added Paths: ----------- trunk/octave-forge/main/ga/inst/demo_ga.m trunk/octave-forge/main/ga/inst/test_ga.m Removed Paths: ------------- trunk/octave-forge/main/ga/inst/ga_demo.m trunk/octave-forge/main/ga/inst/ga_test.m Copied: trunk/octave-forge/main/ga/inst/demo_ga.m (from rev 9897, trunk/octave-forge/main/ga/inst/ga_demo.m) =================================================================== --- trunk/octave-forge/main/ga/inst/demo_ga.m (rev 0) +++ trunk/octave-forge/main/ga/inst/demo_ga.m 2012-03-15 02:24:02 UTC (rev 9898) @@ -0,0 +1,62 @@ +## Copyright (C) 2012 Luca Favatella <sla...@gm...> +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn{Script File} {} demo_ga +## Run a demo of the genetic algorithm package. The current +## implementation is only a placeholder. +## @end deftypefn + +## Author: Luca Favatella <sla...@gm...> +## Created: March 2012 +## Version: 0.0.3 + +demo ga_demo + + +%!demo +%! % TODO + + +## This code is a simple example of the usage of ga + # TODO: convert to demo +%!xtest assert (ga (@rastriginsfcn, 2), [0, 0], 1e-3) + + +## This code shows that ga optimizes also functions whose minimum is not +## in zero + # TODO: convert to demo +%!xtest +%! min = [-1, 2]; +%! assert (ga (struct ("fitnessfcn", @(x) rastriginsfcn (x - min), "nvars", 2, "options", gaoptimset ("FitnessLimit", 1e-7, "Generations", 1000, "PopInitRange", [-5; 5], "PopulationSize", 200))), min, 1e-5) + + +## This code shows that the "Vectorize" option usually speeds up execution + # TODO: convert to demo +%!test +%! +%! tic (); +%! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200))); +%! elapsed_time = toc (); +%! +%! tic (); +%! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200, "Vectorized", "on"))); +%! elapsed_time_with_vectorized = toc (); +%! +%! assert (elapsed_time > elapsed_time_with_vectorized); + +## The "UseParallel" option should speed up execution + # TODO: write demo (after implementing + # UseParallel) - low priority Deleted: trunk/octave-forge/main/ga/inst/ga_demo.m =================================================================== --- trunk/octave-forge/main/ga/inst/ga_demo.m 2012-03-15 02:23:42 UTC (rev 9897) +++ trunk/octave-forge/main/ga/inst/ga_demo.m 2012-03-15 02:24:02 UTC (rev 9898) @@ -1,62 +0,0 @@ -## Copyright (C) 2012 Luca Favatella <sla...@gm...> -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn{Script File} {} ga_demo -## Run a demo of the genetic algorithm package. The current -## implementation is only a placeholder. -## @end deftypefn - -## Author: Luca Favatella <sla...@gm...> -## Created: March 2012 -## Version: 0.0.2 - -demo ga_demo - - -%!demo -%! % TODO - - -## This code is a simple example of the usage of ga - # TODO: convert to demo -%!xtest assert (ga (@rastriginsfcn, 2), [0, 0], 1e-3) - - -## This code shows that ga optimizes also functions whose minimum is not -## in zero - # TODO: convert to demo -%!xtest -%! min = [-1, 2]; -%! assert (ga (struct ("fitnessfcn", @(x) rastriginsfcn (x - min), "nvars", 2, "options", gaoptimset ("FitnessLimit", 1e-7, "Generations", 1000, "PopInitRange", [-5; 5], "PopulationSize", 200))), min, 1e-5) - - -## This code shows that the "Vectorize" option usually speeds up execution - # TODO: convert to demo -%!test -%! -%! tic (); -%! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200))); -%! elapsed_time = toc (); -%! -%! tic (); -%! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200, "Vectorized", "on"))); -%! elapsed_time_with_vectorized = toc (); -%! -%! assert (elapsed_time > elapsed_time_with_vectorized); - -## The "UseParallel" option should speed up execution - # TODO: write demo (after implementing - # UseParallel) - low priority Deleted: trunk/octave-forge/main/ga/inst/ga_test.m =================================================================== --- trunk/octave-forge/main/ga/inst/ga_test.m 2012-03-15 02:23:42 UTC (rev 9897) +++ trunk/octave-forge/main/ga/inst/ga_test.m 2012-03-15 02:24:02 UTC (rev 9898) @@ -1,49 +0,0 @@ -## Copyright (C) 2012 Luca Favatella <sla...@gm...> -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn{Script File} {} ga_test -## Execute all available tests at once. -## @end deftypefn - -## Author: Luca Favatella <sla...@gm...> -## Created: March 2012 -## Version: 0.1.1 - -## Creation -test gacreationuniform - -## Fitness Scaling -test fitscalingrank - -## Selection -test selectionstochunif - -## Crossover -test crossoverscattered - -## Mutation -test mutationgaussian - -## Utility -test rastriginsfcn - -## Genetic Algorithm -test gaoptimset -test ga -## TODO: split performance tests - -## TODO: review all unit tests (DONE: rastriginsfcn) -## TODO: write missing unit tests, or write per-function TODOs Copied: trunk/octave-forge/main/ga/inst/test_ga.m (from rev 9897, trunk/octave-forge/main/ga/inst/ga_test.m) =================================================================== --- trunk/octave-forge/main/ga/inst/test_ga.m (rev 0) +++ trunk/octave-forge/main/ga/inst/test_ga.m 2012-03-15 02:24:02 UTC (rev 9898) @@ -0,0 +1,49 @@ +## Copyright (C) 2012 Luca Favatella <sla...@gm...> +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn{Script File} {} test_ga +## Execute all available tests at once. +## @end deftypefn + +## Author: Luca Favatella <sla...@gm...> +## Created: March 2012 +## Version: 0.2 + +## Creation +test gacreationuniform + +## Fitness Scaling +test fitscalingrank + +## Selection +test selectionstochunif + +## Crossover +test crossoverscattered + +## Mutation +test mutationgaussian + +## Utility +test rastriginsfcn + +## Genetic Algorithm +test gaoptimset +test ga +## TODO: split performance tests + +## TODO: review all unit tests (DONE: rastriginsfcn) +## TODO: write missing unit tests, or write per-function TODOs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |