mathlib-commitlog Mailing List for JMathLib - Octave, Matlab clone in java (Page 43)
Status: Beta
Brought to you by:
st_mueller
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(4) |
Aug
(150) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(233) |
Feb
(86) |
Mar
(32) |
Apr
(26) |
May
(73) |
Jun
(45) |
Jul
(23) |
Aug
(23) |
Sep
(5) |
Oct
(80) |
Nov
(11) |
Dec
(11) |
| 2008 |
Jan
|
Feb
|
Mar
(13) |
Apr
(3) |
May
(7) |
Jun
(30) |
Jul
(12) |
Aug
(12) |
Sep
|
Oct
|
Nov
(78) |
Dec
(78) |
| 2009 |
Jan
(214) |
Feb
(79) |
Mar
(20) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Stefan M. <st_...@us...> - 2007-01-14 08:24:11
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Matrix In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21002/Source/MathLib/Functions/Matrix Modified Files: isEmpty.java Log Message: better handling of a=[] matrices. Index: isEmpty.java =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Matrix/isEmpty.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** isEmpty.java 30 Dec 2006 18:07:11 -0000 1.8 --- isEmpty.java 14 Jan 2007 08:24:07 -0000 1.9 *************** *** 19,23 **** (operands[0] instanceof CharToken) ) { ! // token is not empty return new NumberToken(0.0); } --- 19,28 ---- (operands[0] instanceof CharToken) ) { ! // check for something like a=[] ! if ( (((DataToken)operands[0]).getSizeY()==0) && ! (((DataToken)operands[0]).getSizeX()==0) ) ! return new NumberToken(1.0); ! ! // token is not empty return new NumberToken(0.0); } *************** *** 41,45 **** --- 46,57 ---- @NOTES @EXAMPLES + <programlisting> + isempty([]) -> 1 + + a=[] + isempty(a) -> 1 + </programlisting> @SEE + isfinite, isimaginary, isreal, isnan, isinf */ |
|
From: Stefan M. <st_...@us...> - 2007-01-14 08:22:08
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Matrix In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19866/Source/MathLib/Functions/Matrix Modified Files: repmat.java Log Message: Index: repmat.java =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Matrix/repmat.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** repmat.java 30 Dec 2006 18:07:11 -0000 1.3 --- repmat.java 14 Jan 2007 08:22:01 -0000 1.4 *************** *** 17,38 **** { // three operands (e.g. reshape(A,n,m) ) ! if (operands == null) return null; ! ! if (operands.length != 3) return null; ! if ( (operands[0] == null) ! || (operands[1] == null) ! || (operands[2] == null) ) return null; ! if ( (!(operands[0] instanceof NumberToken)) ! || (!(operands[1] instanceof NumberToken)) ! || (!(operands[2] instanceof NumberToken)) ) return null; // get data from arguments double[][] a = ((NumberToken)operands[0]).getReValues(); ! int m = (int)((NumberToken)operands[1]).getReValues()[0][0]; ! int n = (int)((NumberToken)operands[2]).getReValues()[0][0]; int a_dy = a.length; --- 17,52 ---- { + // two operands (e.g. reshape(A,[n,m]) ) or // three operands (e.g. reshape(A,n,m) ) ! if ((getNArgIn(operands)<2) || ! (getNArgIn(operands)>3) ) ! throwMathLibException("repmat: number of arguments < 2 or >3"); ! if ( (!(operands[0] instanceof NumberToken)) || ! (!(operands[1] instanceof NumberToken)) ) ! throwMathLibException("repmat: works only on NumberTokens"); ! if ( (getNArgIn(operands)==3) && ! (!(operands[2] instanceof NumberToken)) ) ! throwMathLibException("repmat: works only on NumberTokens"); // get data from arguments double[][] a = ((NumberToken)operands[0]).getReValues(); ! int m = 0; ! int n = 0; ! ! if (getNArgIn(operands)==3) ! { ! // repmat(a,2,3) ! m = (int)((NumberToken)operands[1]).getValueRe(); ! n = (int)((NumberToken)operands[2]).getValueRe(); ! } ! else ! { ! // repmat(a,[2,3]) ! m = (int)((NumberToken)operands[1]).getValueRe(0); ! n = (int)((NumberToken)operands[1]).getValueRe(1); ! } int a_dy = a.length; |
|
From: Stefan M. <st_...@us...> - 2007-01-14 08:20:27
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Statistics/base In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19392/Source/MathLib/Functions/Statistics/base Added Files: var.m Log Message: --- NEW FILE: var.m --- ## Copyright (C) 1995, 1996, 1997 Kurt Hornik ## ## This file is part of Octave. ## ## Octave 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, or (at your option) ## any later version. ## ## Octave 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 Octave; see the file COPYING. If not, write to the Free ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. ## -*- texinfo -*- ## @deftypefn {Function File} {} var (@var{x}) ## For vector arguments, return the (real) variance of the values. ## For matrix arguments, return a row vector contaning the variance for ## each column. ## ## The argument @var{opt} determines the type of normalization to use. ## Valid values are ## ## @table @asis ## @item 0: ## Normalizes with N-1, provides the best unbiased estimator of the ## variance [default]. ## @item 1: ## Normalizes with N, this provides the second moment around the mean. ## @end table ## ## The third argument @var{dim} determines the dimension along which the ## variance is calculated. ## @end deftypefn ## Author: KH <Kur...@wu...> ## Description: Compute variance function y = var (x, opt, dim) if (nargin < 1 || nargin > 3) print_usage (); endif if (nargin < 3) dim = find (size (x) > 1, 1); if (isempty (dim)) dim = 1; endif endif if (nargin < 2 ) //|| isempty (opt)) opt = 0; endif sz = size (x); if (prod (sz) < 1) error ("var: x must not be empty"); elseif (sz(dim) == 1) y = 0; else rng = ones (1, length (sz)); rng (dim) = sz (dim); if (opt == 0) y = sumsq (x - repmat(mean (x, dim), rng), dim) / (sz(dim) - 1); else y = sumsq (x - repmat(mean (x, dim), rng), dim) / sz(dim); endif endif endfunction |
|
From: Stefan M. <st_...@us...> - 2007-01-14 08:17:31
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Matrix In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18195/Source/MathLib/Tools/TestSuite/Functions/Matrix Modified Files: AllTests.java Added Files: testFind.java Log Message: --- NEW FILE: testFind.java --- package MathLib.Tools.TestSuite.Functions.Matrix; import MathLib.Tools.junit.framework.*; import MathLib.Tools.TestSuite.*; import MathLib.Interpreter.*; public class testFind extends TestCase { protected Interpreter ml; public testFind(String name) { super(name); } public static void main (String[] args) { MathLib.Tools.junit.textui.TestRunner.run (suite()); } protected void setUp() { ml = new Interpreter(true); } public static Test suite() { return new TestSuite(testFind.class); } /*****************************************************************/ public void testFind01() { ml.executeExpression("a=find([2,3,1]>2);"); assertTrue(2 == ml.getScalarValueRe("a")); } public void testFind02() { ml.executeExpression("a=find([2,3,1]<2);"); assertTrue(3 == ml.getScalarValueRe("a")); } public void testFind03() { ml.executeExpression("a=find([2,3,1]==3);"); assertTrue(2 == ml.getScalarValueRe("a")); } public void testFind04() { double[][] a = {{1.0, 3.0}}; ml.executeExpression("z = find([4,7,5]!=7)"); assertTrue(Compare.ArrayEquals(a, ml.getArrayValueRe("z"))); } public void testFind05() { ml.executeExpression("a=find(1);"); assertTrue(1 == ml.getScalarValueRe("a")); } public void testFind06() { ml.executeExpression("a=find(0);"); ml.executeExpression("b=size(a)"); double[][] b = {{0.0, 0.0}}; assertTrue(Compare.ArrayEquals(b, ml.getArrayValueRe("b"))); } public void testFind07() { ml.executeExpression("a=find([1,4]>3);"); ml.executeExpression("b=size(a)"); double[][] b = {{1.0, 1.0}}; assertTrue(Compare.ArrayEquals(b, ml.getArrayValueRe("b"))); } public void testFind08() { ml.executeExpression("a=find([1,4,7]>3);"); ml.executeExpression("b=size(a)"); double[][] b = {{1.0, 2.0}}; assertTrue(Compare.ArrayEquals(b, ml.getArrayValueRe("b"))); } } Index: AllTests.java =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Matrix/AllTests.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AllTests.java 5 Jan 2007 14:27:02 -0000 1.15 --- AllTests.java 14 Jan 2007 08:17:24 -0000 1.16 *************** *** 33,36 **** --- 33,37 ---- suite.addTest(MathLib.Tools.TestSuite.Functions.Matrix.TestFliplr.suite()); suite.addTest(MathLib.Tools.TestSuite.Functions.Matrix.TestFlipud.suite()); + suite.addTest(MathLib.Tools.TestSuite.Functions.Matrix.testFind.suite()); suite.addTest(MathLib.Tools.TestSuite.Functions.Matrix.testGe.suite()); suite.addTest(MathLib.Tools.TestSuite.Functions.Matrix.testGt.suite()); |
|
From: Stefan M. <st_...@us...> - 2007-01-13 22:37:39
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Statistics/base In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18131/Source/MathLib/Functions/Statistics/base Modified Files: mean.m std.m Log Message: Index: std.m =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Statistics/base/std.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** std.m 13 Jan 2007 18:30:01 -0000 1.1 --- std.m 13 Jan 2007 22:37:35 -0000 1.2 *************** *** 63,67 **** function retval = std (a, opt, dim) - if ((nargin < 1) || (nargin > 3)) print_usage (); --- 63,66 ---- *************** *** 69,73 **** if (nargin < 3) ! dim = find (size(a) > 1, 1) if (isempty(dim)) dim=1; --- 68,72 ---- if (nargin < 3) ! dim = find (size(a) > 1, 1); if (isempty(dim)) dim=1; *************** *** 80,84 **** sz = size(a); - dim if (sz (dim) == 1) --- 79,82 ---- *************** *** 88,97 **** rng (dim) = sz (dim); - rng - - retval = mean (a, dim) - retval = repmat(mean (a, dim), rng) - retval = a - repmat(mean (a, dim), rng) - if (opt == 0) retval = sqrt (sumsq (a - repmat(mean (a, dim), rng), dim) / (sz(dim) - 1)); --- 86,89 ---- Index: mean.m =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Statistics/base/mean.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mean.m 13 Jan 2007 11:45:19 -0000 1.2 --- mean.m 13 Jan 2007 22:37:35 -0000 1.3 *************** *** 101,105 **** else sz = size (x); ! n = sz (dim); endif --- 101,105 ---- else sz = size (x); ! n = sz (dim); endif *************** *** 129,134 **** mean([a,b,3,4]) mean([3,4,5]) -> 4 ! <programlisting> @SEE ! stddev */ --- 129,134 ---- mean([a,b,3,4]) mean([3,4,5]) -> 4 ! </programlisting> @SEE ! std */ |
|
From: Stefan M. <st_...@us...> - 2007-01-13 22:36:11
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Matrix In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17165/Source/MathLib/Functions/Matrix Modified Files: find.java Log Message: Index: find.java =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Matrix/find.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** find.java 6 Jan 2007 09:32:14 -0000 1.9 --- find.java 13 Jan 2007 22:36:02 -0000 1.10 *************** *** 40,43 **** --- 40,47 ---- } + // check if there is at least one element unequal zero + // In case there is no element unequal zero return an empty NumberToken() + if (no==0) + return new NumberToken(); int n = no; *************** *** 114,121 **** @EXAMPLES <programlisting> ! find([0,1,0,1])=[2;4] ! ! find([0,1,0,1],1)=[2] ! </programlisting> @SEE --- 118,123 ---- @EXAMPLES <programlisting> ! find([0,1,0,1]) = [2;4] ! find([0,1,0,1],1) = [2] </programlisting> @SEE |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:41:55
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/base In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16661/Source/MathLib/Tools/TestSuite/Functions/Statistics/base Modified Files: testMean.java Log Message: Index: testMean.java =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/base/testMean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testMean.java 13 Jan 2007 18:21:41 -0000 1.2 --- testMean.java 13 Jan 2007 18:41:52 -0000 1.3 *************** *** 41,45 **** double[][] a = {{4.0, 6.0}}; ml.executeExpression("a = mean([6,8;2,4])"); ! assertTrue(Compare.ArrayEquals(a, ml.getArrayValueIm("a"))); } --- 41,45 ---- double[][] a = {{4.0, 6.0}}; ml.executeExpression("a = mean([6,8;2,4])"); ! assertTrue(Compare.ArrayEquals(a, ml.getArrayValueRe("a"))); } |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:31:40
|
Update of /cvsroot/mathlib/mathlib In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12149 Modified Files: ChangeLog.txt Log Message: Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/mathlib/mathlib/ChangeLog.txt,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** ChangeLog.txt 13 Jan 2007 10:58:56 -0000 1.145 --- ChangeLog.txt 13 Jan 2007 18:31:11 -0000 1.146 *************** *** 25,30 **** Updated functions: ! col.m, diag.java, ndims.java, imag.java, ones.java, rand.java, real.java, ! row.m, size.java, tic.java, whos.java, zeros.java All trigonometric functions have been updated --- 25,30 ---- Updated functions: ! col.m, diag.java, ndims.java, imag.java, isempty.java, ones.java, rand.java, ! real.java, row.m, size.java, tic.java, whos.java, zeros.java All trigonometric functions have been updated *************** *** 34,37 **** --- 34,41 ---- stefan * + 2007/01/12 + stefan + Functions/Statistics/base/mean.m + stefan + Functions/Statistics/base/std.m + 2007/01/11 stefan + moved lots of internal standard functions and trigonometric function |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:30:07
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Statistics/base In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11680/Source/MathLib/Functions/Statistics/base Added Files: std.m Log Message: --- NEW FILE: std.m --- ## Copyright (C) 1996, 1997 John W. Eaton ## ## This file is part of Octave. ## ## Octave 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, or (at your option) ## any later version. ## ## Octave 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 Octave; see the file COPYING. If not, write to the Free ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. ## -*- texinfo -*- ## @deftypefn {Function File} {} std (@var{x}) ## @deftypefnx {Function File} {} std (@var{x}, @var{opt}) ## @deftypefnx {Function File} {} std (@var{x}, @var{opt}, @var{dim}) ## If @var{x} is a vector, compute the standard deviation of the elements ## of @var{x}. ## @iftex ## @tex ## $$ ## {\rm std} (x) = \sigma (x) = \sqrt{{\sum_{i=1}^N (x_i - \bar{x}) \over N - 1}} ## $$ ## @end tex ## @end iftex ## @ifinfo ## ## @example ## @group ## std (x) = sqrt (sumsq (x - mean (x)) / (n - 1)) ## @end group ## @end example ## @end ifinfo ## If @var{x} is a matrix, compute the standard deviation for ## each column and return them in a row vector. ## ## The argument @var{opt} determines the type of normalization to use. Valid values ## are ## ## @table @asis ## @item 0: ## normalizes with N-1, provides the square root of best unbiased estimator of ## the variance [default] ## @item 1: ## normalizes with N, this provides the square root of the second moment around ## the mean ## @end table ## ## The third argument @var{dim} determines the dimension along which the standard ## deviation is calculated. ## @seealso{mean, median} ## @end deftypefn ## Author: jwe function retval = std (a, opt, dim) if ((nargin < 1) || (nargin > 3)) print_usage (); endif if (nargin < 3) dim = find (size(a) > 1, 1) if (isempty(dim)) dim=1; endif endif if ((nargin < 2) ) //|| isempty(opt)) opt = 0; endif sz = size(a); dim if (sz (dim) == 1) retval = zeros(sz); elseif (numel (a) > 0) rng = ones (1, length (sz)); rng (dim) = sz (dim); rng retval = mean (a, dim) retval = repmat(mean (a, dim), rng) retval = a - repmat(mean (a, dim), rng) if (opt == 0) retval = sqrt (sumsq (a - repmat(mean (a, dim), rng), dim) / (sz(dim) - 1)); else retval = sqrt (sumsq (a - repmat(mean (a, dim), rng), dim) / sz(dim)); endif else error ("std: invalid matrix argument"); endif endfunction /* @GROUP statistics @SYNTAX std([2,3,8,...]) @DOC Calculates the standard deviation. @EXAMPLES <programlisting> std([a,b,3,4]) std([3,4,5]) -> 1 <programlisting> @SEE mean */ |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:29:25
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Tokens In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11652/Source/MathLib/Tools/TestSuite/Tokens Modified Files: TestNumberToken.java Log Message: Index: TestNumberToken.java =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Tokens/TestNumberToken.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** TestNumberToken.java 6 Jan 2007 14:25:59 -0000 1.15 --- TestNumberToken.java 13 Jan 2007 18:29:22 -0000 1.16 *************** *** 314,413 **** } - public void testMax1() - { - OperandToken actualResult = val1.max(val2); - - assertEquals(val2, actualResult); - } - - public void testMax2() - { - OperandToken actualResult = val1.max(val4); - - assertEquals(val1, actualResult); - } - - public void testMax3() - { - OperandToken actualResult = val4.max(val5); - - assertEquals(val4, actualResult); - } - - public void testMin1() - { - OperandToken actualResult = val1.min(val2); - - assertEquals(val1, actualResult); - } - - public void testMin2() - { - OperandToken actualResult = val1.min(val4); - - assertEquals(val4, actualResult); - } - - public void testMin3() - { - OperandToken actualResult = val5.min(val5); - - assertEquals(val5, actualResult); - } - - public void testFloor1() - { - NumberToken expectedResult = new NumberToken(3); - - OperandToken actualResult = val6.floor(); - - assertEquals(expectedResult, actualResult); - } - - public void testFloor2() - { - NumberToken expectedResult = new NumberToken(-4); - - OperandToken actualResult = val7.floor(); - - assertEquals(expectedResult, actualResult); - } - - public void testCeil1() - { - NumberToken expectedResult = new NumberToken(4); - - OperandToken actualResult = val6.ceil(); - - assertEquals(expectedResult, actualResult); - } - - public void testCeil2() - { - NumberToken expectedResult = new NumberToken(-3); - - OperandToken actualResult = val7.ceil(); - - assertEquals(expectedResult, actualResult); - } - - public void testRound1() - { - NumberToken expectedResult = new NumberToken(4); - - OperandToken actualResult = val6.round(); - - assertEquals(expectedResult, actualResult); - } - - public void testRound2() - { - NumberToken expectedResult = new NumberToken(-4); - - OperandToken actualResult = val7.round(); - - assertEquals(expectedResult, actualResult); - } - /************* scalar multiply ****************************************/ public void testScalarMultiply01() { --- 314,317 ---- |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:28:52
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/models In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11249/Source/MathLib/Tools/TestSuite/Functions/Statistics/models Added Files: AllTests.java Log Message: --- NEW FILE: AllTests.java --- package MathLib.Tools.TestSuite.Functions.Statistics.models; import MathLib.Tools.junit.framework.*; /** * TestSuite that runs all the tests * */ public class AllTests { public static void main (String[] args) { MathLib.Tools.junit.textui.TestRunner.run (suite()); } public static Test suite ( ) { TestSuite suite= new TestSuite("statistics models functions"); /* include subdirectories here */ // none /* include tests in this directory here */ //suite.addTest(MathLib.Tools.TestSuite.Functions.Statistics.base.testMean.suite()); return suite; } } |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:28:45
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/distributions In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11249/Source/MathLib/Tools/TestSuite/Functions/Statistics/distributions Added Files: AllTests.java Log Message: --- NEW FILE: AllTests.java --- package MathLib.Tools.TestSuite.Functions.Statistics.distributions; import MathLib.Tools.junit.framework.*; /** * TestSuite that runs all the tests * */ public class AllTests { public static void main (String[] args) { MathLib.Tools.junit.textui.TestRunner.run (suite()); } public static Test suite ( ) { TestSuite suite= new TestSuite("statistics distributions functions"); /* include subdirectories here */ // none /* include tests in this directory here */ //suite.addTest(MathLib.Tools.TestSuite.Functions.Statistics.base.testMean.suite()); return suite; } } |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:28:45
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11249/Source/MathLib/Tools/TestSuite/Functions/Statistics Modified Files: AllTests.java Log Message: Index: AllTests.java =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/AllTests.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AllTests.java 13 Jan 2007 18:18:42 -0000 1.3 --- AllTests.java 13 Jan 2007 18:28:42 -0000 1.4 *************** *** 17,20 **** --- 17,23 ---- /* include subdirectories here */ suite.addTest(MathLib.Tools.TestSuite.Functions.Statistics.base.AllTests.suite()); + suite.addTest(MathLib.Tools.TestSuite.Functions.Statistics.distributions.AllTests.suite()); + suite.addTest(MathLib.Tools.TestSuite.Functions.Statistics.models.AllTests.suite()); + suite.addTest(MathLib.Tools.TestSuite.Functions.Statistics.tests.AllTests.suite()); /* include tests in this directory here */ |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:28:45
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/tests In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11249/Source/MathLib/Tools/TestSuite/Functions/Statistics/tests Added Files: AllTests.java Log Message: --- NEW FILE: AllTests.java --- package MathLib.Tools.TestSuite.Functions.Statistics.tests; import MathLib.Tools.junit.framework.*; /** * TestSuite that runs all the tests * */ public class AllTests { public static void main (String[] args) { MathLib.Tools.junit.textui.TestRunner.run (suite()); } public static Test suite ( ) { TestSuite suite= new TestSuite("statistics tests functions"); /* include subdirectories here */ // none /* include tests in this directory here */ //suite.addTest(MathLib.Tools.TestSuite.Functions.Statistics.base.testMean.suite()); return suite; } } |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:28:39
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/tests In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11226/Source/MathLib/Tools/TestSuite/Functions/Statistics/tests Log Message: Directory /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/tests added to the repository |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:28:39
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/distributions In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11226/Source/MathLib/Tools/TestSuite/Functions/Statistics/distributions Log Message: Directory /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/distributions added to the repository |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:28:39
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/models In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11226/Source/MathLib/Tools/TestSuite/Functions/Statistics/models Log Message: Directory /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/models added to the repository |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:21:44
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/base In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8384/Source/MathLib/Tools/TestSuite/Functions/Statistics/base Modified Files: testMean.java Log Message: Index: testMean.java =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/base/testMean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testMean.java 13 Jan 2007 18:18:32 -0000 1.1 --- testMean.java 13 Jan 2007 18:21:41 -0000 1.2 *************** *** 1,4 **** --- 1,5 ---- package MathLib.Tools.TestSuite.Functions.Statistics.base; + import MathLib.Tools.TestSuite.Compare; import MathLib.Tools.junit.framework.*; import MathLib.Interpreter.*; *************** *** 26,33 **** --- 27,36 ---- assertTrue(55 == ml.getScalarValueRe("a")); } + public void testMean02() { ml.executeExpression("a=mean([2,4]);"); assertTrue(3 == ml.getScalarValueRe("a")); } + public void testMean03() { ml.executeExpression("a=mean([2,4,6]);"); *************** *** 35,38 **** --- 38,46 ---- } + public void testMean10() { + double[][] a = {{4.0, 6.0}}; + ml.executeExpression("a = mean([6,8;2,4])"); + assertTrue(Compare.ArrayEquals(a, ml.getArrayValueIm("a"))); + } |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:18:48
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7149/Source/MathLib/Tools/TestSuite/Functions/Statistics Modified Files: AllTests.java Log Message: Index: AllTests.java =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/AllTests.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AllTests.java 19 Aug 2006 10:00:44 -0000 1.2 --- AllTests.java 13 Jan 2007 18:18:42 -0000 1.3 *************** *** 16,20 **** /* include subdirectories here */ ! // none /* include tests in this directory here */ --- 16,20 ---- /* include subdirectories here */ ! suite.addTest(MathLib.Tools.TestSuite.Functions.Statistics.base.AllTests.suite()); /* include tests in this directory here */ |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:18:35
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/base In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7139/Source/MathLib/Tools/TestSuite/Functions/Statistics/base Added Files: AllTests.java testMean.java testStd.java Log Message: --- NEW FILE: AllTests.java --- package MathLib.Tools.TestSuite.Functions.Statistics.base; import MathLib.Tools.junit.framework.*; /** * TestSuite that runs all the tests * */ public class AllTests { public static void main (String[] args) { MathLib.Tools.junit.textui.TestRunner.run (suite()); } public static Test suite ( ) { TestSuite suite= new TestSuite("statistics base functions"); /* include subdirectories here */ // none /* include tests in this directory here */ suite.addTest(MathLib.Tools.TestSuite.Functions.Statistics.base.testMean.suite()); suite.addTest(MathLib.Tools.TestSuite.Functions.Statistics.base.testStd.suite()); return suite; } } --- NEW FILE: testMean.java --- package MathLib.Tools.TestSuite.Functions.Statistics.base; import MathLib.Tools.junit.framework.*; import MathLib.Interpreter.*; public class testMean extends TestCase { protected Interpreter ml; public testMean(String name) { super(name); } public static void main (String[] args) { MathLib.Tools.junit.textui.TestRunner.run (suite()); } protected void setUp() { ml = new Interpreter(true); } public static Test suite() { return new TestSuite(testMean.class); } ////////////////////////////////////////////////////////// public void testMean01() { ml.executeExpression("a=mean(55);"); assertTrue(55 == ml.getScalarValueRe("a")); } public void testMean02() { ml.executeExpression("a=mean([2,4]);"); assertTrue(3 == ml.getScalarValueRe("a")); } public void testMean03() { ml.executeExpression("a=mean([2,4,6]);"); assertTrue(4 == ml.getScalarValueRe("a")); } } --- NEW FILE: testStd.java --- package MathLib.Tools.TestSuite.Functions.Statistics.base; import MathLib.Tools.junit.framework.*; import MathLib.Interpreter.*; public class testStd extends TestCase { protected Interpreter ml; public testStd(String name) { super(name); } public static void main (String[] args) { MathLib.Tools.junit.textui.TestRunner.run (suite()); } protected void setUp() { ml = new Interpreter(true); } public static Test suite() { return new TestSuite(testStd.class); } //////////////////////////////////////////////////////////// public void testStd01() { ml.executeExpression("a=std([2,4,6]);"); assertTrue(2 == ml.getScalarValueRe("a")); } } |
|
From: Stefan M. <st_...@us...> - 2007-01-13 18:18:29
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/base In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7129/Source/MathLib/Tools/TestSuite/Functions/Statistics/base Log Message: Directory /cvsroot/mathlib/mathlib/Source/MathLib/Tools/TestSuite/Functions/Statistics/base added to the repository |
|
From: Stefan M. <st_...@us...> - 2007-01-13 11:45:23
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Statistics/base In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28203/Source/MathLib/Functions/Statistics/base Modified Files: mean.m Log Message: added comments Index: mean.m =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Statistics/base/mean.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mean.m 16 Dec 2006 15:15:37 -0000 1.1 --- mean.m 13 Jan 2007 11:45:19 -0000 1.2 *************** *** 117,118 **** --- 117,134 ---- endfunction + + /* + @GROUP + statistics + @SYNTAX + mean([2,3,8,...,n]) + @DOC + Calculates the mean value of the passed operand. + @EXAMPLES + <programlisting> + mean([a,b,3,4]) + mean([3,4,5]) -> 4 + <programlisting> + @SEE + stddev + */ |
|
From: Stefan M. <st_...@us...> - 2007-01-13 11:41:38
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Statistics In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26578/Source/MathLib/Functions/Statistics Modified Files: Variation.java Log Message: cleanup Index: Variation.java =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Statistics/Variation.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Variation.java 25 Nov 2006 11:42:46 -0000 1.4 --- Variation.java 13 Jan 2007 11:41:34 -0000 1.5 *************** *** 16,23 **** // Check if there's only one or zero parameters if (operands.length < 2) ! { ! // The variation of a number is 0 ! return (OperandToken)(NumberToken.zero); ! } int i; OperandToken ot1 = (OperandToken) new NumberToken(0); --- 16,23 ---- // Check if there's only one or zero parameters if (operands.length < 2) ! { ! // The variation of a number is 0 ! return (OperandToken)(NumberToken.zero); ! } int i; OperandToken ot1 = (OperandToken) new NumberToken(0); |
|
From: Stefan M. <st_...@us...> - 2007-01-13 11:37:59
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Functions/General In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25307/Source/MathLib/Functions/General Modified Files: Sign.java Log Message: Index: Sign.java =================================================================== RCS file: /cvsroot/mathlib/mathlib/Source/MathLib/Functions/General/Sign.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Sign.java 26 Dec 2006 16:22:47 -0000 1.7 --- Sign.java 13 Jan 2007 11:37:54 -0000 1.8 *************** *** 1,9 **** package MathLib.Functions.General; import MathLib.Tokens.NumberToken; ! import MathLib.Tokens.Token; ! import MathLib.Tokens.OperandToken; ! import MathLib.Functions.ExternalFunction; ! import MathLib.Interpreter.Errors; /**External function to calculate sign of a number --- 1,7 ---- package MathLib.Functions.General; + import MathLib.Functions.ExternalElementWiseFunction; import MathLib.Tokens.NumberToken; ! import MathLib.Functions.Matrix.abs; /**External function to calculate sign of a number *************** *** 11,58 **** for a complex number x sign = x/abs x */ ! public class Sign extends ExternalFunction { /**Calculate the sign @param operands[0] = value to calculate sign of @return a matrix of the same size as the operands*/ ! public OperandToken evaluate(Token[] operands) { ! OperandToken result = null; ! ! // at least one operand ! if (getNArgIn(operands) != 1) ! throwMathLibException("sign: number of arguments != 1"); ! ! ! if(operands[0] instanceof NumberToken) ! { ! NumberToken matrix = ((NumberToken)operands[0]); ! OperandToken temp = ((OperandToken)matrix.clone()); ! int sizeX = matrix.getSizeX(); ! int sizeY = matrix.getSizeY(); ! temp = temp.abs(); ! ! double[][] matrixValues = matrix.getReValues(); ! double[][] tempValues = ((NumberToken)temp).getReValues(); ! double[][] results = new double[sizeY][sizeX]; ! for(int yy = 0; yy < sizeY; yy++) ! { ! for(int xx = 0; xx < sizeX; xx++) ! { ! if(tempValues[yy][xx] != 0) ! results[yy][xx] = matrixValues[yy][xx] / tempValues[yy][xx]; ! else ! results[yy][xx] = 0; ! } ! } ! result = new NumberToken(results); ! } ! else ! { ! Errors.throwMathLibException(ERR_INVALID_PARAMETER, new Object[] {"NumberToken", operands[0].getClass().getName()}); ! } ! ! return result; } } --- 9,38 ---- for a complex number x sign = x/abs x */ ! public class Sign extends ExternalElementWiseFunction { /**Calculate the sign @param operands[0] = value to calculate sign of @return a matrix of the same size as the operands*/ ! public double[] evaluateValue(double[] arg) { ! double[] result = new double[2]; ! if (arg[IMAG]==0) ! { ! result[REAL] = Math.abs(arg[REAL]); ! result[IMAG] = 0; ! } ! else ! { ! // for complex number sign is determined ! // like sign(X) = X./abs(X) ! abs absFunc = new abs(); ! NumberToken num = new NumberToken(); ! ! result = absFunc.evaluateValue(arg); ! result = num.divide(arg, result); ! } ! ! return result; } } *************** *** 62,73 **** general @SYNTAX ! answer=SIGN(value) @DOC Returns the sign of value. @EXAMPLES ! SIGN(-10)=-1 ! SIGN(10)=1 @NOTES @SEE */ --- 42,58 ---- general @SYNTAX ! sign(value) @DOC Returns the sign of value. @EXAMPLES ! <programlisting> ! sign(-10) = -1 ! sign(10) = 1 ! sign(3+2i) = 0.832 + 0.555i ! </programlisting> @NOTES + The sign of a complex number is calculated as sign(X) = X./abs(X) @SEE + abs */ |
|
From: Stefan M. <st_...@us...> - 2007-01-13 10:58:59
|
Update of /cvsroot/mathlib/mathlib In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8348 Modified Files: ChangeLog.txt Log Message: Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/mathlib/mathlib/ChangeLog.txt,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** ChangeLog.txt 10 Jan 2007 18:51:08 -0000 1.144 --- ChangeLog.txt 13 Jan 2007 10:58:56 -0000 1.145 *************** *** 27,30 **** --- 27,31 ---- col.m, diag.java, ndims.java, imag.java, ones.java, rand.java, real.java, row.m, size.java, tic.java, whos.java, zeros.java + All trigonometric functions have been updated *************** *** 33,36 **** --- 34,41 ---- stefan * + 2007/01/11 + stefan + moved lots of internal standard functions and trigonometric function + to individual java-classes + 2007/01/10 stefan + ExternalElementWiseFunction.java for evaluation of functions which work |