Skip to content

Commit

Permalink
add boundary
Browse files Browse the repository at this point in the history
fix boundary doctest
  • Loading branch information
latot committed Sep 30, 2016
1 parent f8df642 commit e69a6a9
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions inst/@sym/boundary.m
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.

%% -*- 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)))

0 comments on commit e69a6a9

Please sign in to comment.