From: <cde...@us...> - 2010-12-07 21:05:18
|
Revision: 7991 http://octave.svn.sourceforge.net/octave/?rev=7991&view=rev Author: cdemills Date: 2010-12-07 21:05:12 +0000 (Tue, 07 Dec 2010) Log Message: ----------- Added four tests to verify that using a dataframe as index works the same way as for an array Modified Paths: -------------- trunk/octave-forge/extra/dataframe/inst/dataframe Modified: trunk/octave-forge/extra/dataframe/inst/dataframe =================================================================== --- trunk/octave-forge/extra/dataframe/inst/dataframe 2010-12-07 18:12:12 UTC (rev 7990) +++ trunk/octave-forge/extra/dataframe/inst/dataframe 2010-12-07 21:05:12 UTC (rev 7991) @@ -154,10 +154,16 @@ %!assert((y\x).array, y\x.array) %!assert((x\z).array, x.array\z.array) % x=dataframe(randn(4, 3, 2)); y=randn(4, 3, 2); z=dataframe(y); -%!assert((abs(sum(center(x)) < 10*eps).array)) +%!assert((abs(sum(center(x)) < sqrt(eps)).array)) %!assert((x+y).array, x.array+y) %!assert((y+x).array, y+x.array) %!assert((x+z).array, x.array+z.array); +%! [a, b] = sort(x(:)); x=dataframe(reshape((1:9)(b), [3 3])); +%! y = reshape((1:9)(b), [3 3]); z = dataframe(y); +%!assert(x(x(:)), y(x(:))); +%!assert(x(y(:)), y(y(:))); +%!assert(x(x), y(x)); +%!assert(x(y), y(y)); %!demo %! x=dataframe('octave_frame/data_test.csv') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |