From 35fbfdc07a0f1e8a72d967e99822f5004e46fffd Mon Sep 17 00:00:00 2001 From: Oliver Heimlich Date: Thu, 12 Nov 2015 22:46:28 +0100 Subject: [PATCH] Octave API: Added support for interval arithmetic libraries --- client-api/Octave/DESCRIPTION | 3 ++- client-api/Octave/Makefile | 2 +- client-api/Octave/inst/+vibes/drawBox.m | 12 ++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/client-api/Octave/DESCRIPTION b/client-api/Octave/DESCRIPTION index 6289cde..dc53801 100644 --- a/client-api/Octave/DESCRIPTION +++ b/client-api/Octave/DESCRIPTION @@ -17,6 +17,7 @@ Description: VIBes is a visualization system that aims at providing people program to communicate with the viewer in order to draw figures. This package integrates the VIBes API into Octave. The VIBes application - is required for operation and must be installed seperately. + is required for operation and must be installed seperately. Data types from + third-party interval arithmetic libraries for Octave are also supportd. Depends: octave (>= 4.0.0) License: GPLv3+ diff --git a/client-api/Octave/Makefile b/client-api/Octave/Makefile index 892d52a..4f7a818 100644 --- a/client-api/Octave/Makefile +++ b/client-api/Octave/Makefile @@ -115,7 +115,7 @@ run: $(INSTALLED_PACKAGE) .PHONY: clean clean: - rm -f \ + rm -rf \ "$(PACKAGE)-*.tar" \ "$(PACKAGE)-*.tar.gz" \ "$(HTML_DIR)" \ diff --git a/client-api/Octave/inst/+vibes/drawBox.m b/client-api/Octave/inst/+vibes/drawBox.m index fdbf562..0c84f26 100644 --- a/client-api/Octave/inst/+vibes/drawBox.m +++ b/client-api/Octave/inst/+vibes/drawBox.m @@ -19,9 +19,12 @@ ## -*- texinfo -*- ## @documentencoding UTF-8 ## @deftypefn {Function File} {} vibes.drawBox (@var{box}) -## Plot a single box with pairs of lower bounds and upper bounds. The matrix -## @var{box} must be of size either @option{[2 @var{n}]} or +## Plot a single box with pairs of lower bounds and upper bounds. +## +## The matrix @var{box} must be of size either @option{[2 @var{n}]} or ## @option{[@var{n} 2]}, where @var{n} is the number of axes. +## +## Alternatively @var{box} may be an interval vector. ## @end deftypefn ## ## @deftypefn {Function File} {} vibes.drawBox (@var{x_lb}, @var{x_ub}, @var{y_lb}, @var{y_ub}) @@ -42,6 +45,11 @@ function drawBox (varargin) print_usage (); endif +if (any (isa (varargin{1}, {'infsup', 'intval'}))) + varargin{1} = horzcat (vec (inf (varargin{1})), ... + vec (sup (varargin{1}))); +endif + __vibes__ ('drawBox', varargin{:}); endfunction