From e69a6a99d0e34b5294ed153424696fccb56a58b4 Mon Sep 17 00:00:00 2001 From: latot Date: Thu, 29 Sep 2016 21:08:21 -0300 Subject: [PATCH] add boundary fix boundary doctest --- inst/@sym/boundary.m | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 inst/@sym/boundary.m diff --git a/inst/@sym/boundary.m b/inst/@sym/boundary.m new file mode 100644 index 000000000..cd6743d0e --- /dev/null +++ b/inst/@sym/boundary.m @@ -0,0 +1,48 @@ +%% Copyright (C) 2016 Lagu +%% +%% This file is part of OctSymPy. +%% +%% OctSymPy 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 software 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 software; see the file COPYING. +%% If not, see . + +%% -*- texinfo -*- +%% @documentencoding UTF-8 +%% @defmethod @@sym boundary (@var{x}) +%% The boundary or frontier of a set. +%% +%% Example: +%% @example +%% @group +%% a = interval (sym (1), 2); +%% b = interval (sym (5), 8); +%% boundary (a + b) +%% @result{} ans = (sym) @{1, 2, 5, 8@} +%% @end group +%% @end example +%% +%% @end defmethod + + +function y = boundary(x) + if (nargin ~= 1) + print_usage (); + end + y = python_cmd ('return _ins[0].boundary,', sym (x)); +end + + +%!test +%! a = interval (sym (0), 1); +%! b = interval (sym (0), 1, true, false); +%! assert( isequal( boundary (a), boundary (b)))