Institut de Robòtica i Informàtica Industrial

Interval

PURPOSE ^

Interval constructor

SYNOPSIS ^

function I=Interval(varargin)

DESCRIPTION ^

  Interval constructor

  Possible inputs are; another interval, a real matrix (a punctual interval
  is created), two real matrices (one for the lower bounds and another for 
  upper ones).

  NOTE: this interval arithmetics implementation is NOT numerically
  save. Rounding effects are not taken into account. However, for our
  purposes this is not relevant.
  Check this
       http://www.ti3.tu-harburg.de/rump/intlab
  If you need a proper implementation of interval arithmetics in Matlab.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size Number of poses in a trajectory.
  • size Size of the state estimated in the filter
  • Interval Interval constructor
  • size Size (rows/columns) of an interval matrix.
  • size Number of parameters of the pose.
  • size Number of readings stored in the Sensor.
This function is called by:
  • get Get function for trajectories.
  • ProbDistance2PoseDataAboveThreshold p=ProbDistance2PoseDataAboveThreshold(PD,F,t,pt)
  • Union Iout=Union(d1,d2)
  • Interval Interval constructor
  • ctranspose Transpos an interval matrix.
  • diag Extracts the diagonal of an interval matrix.
  • pi2pi Forces an angular interval to be in [-pi,pi].
  • sqrt Element-wise square root of an interval matrix (operator: .^0.5).
  • transpose Transpose of an interval matrix (operator: .').
  • onesInt Interval matrix with ones.
  • zerosInt Iout=zerosInt(varargin)

SOURCE CODE ^

0001 function I=Interval(varargin)
0002  %  Interval constructor
0003  %
0004  %  Possible inputs are; another interval, a real matrix (a punctual interval
0005  %  is created), two real matrices (one for the lower bounds and another for
0006  %  upper ones).
0007  %
0008  %  NOTE: this interval arithmetics implementation is NOT numerically
0009  %  save. Rounding effects are not taken into account. However, for our
0010  %  purposes this is not relevant.
0011  %  Check this
0012  %       http://www.ti3.tu-harburg.de/rump/intlab
0013  %  If you need a proper implementation of interval arithmetics in Matlab.
0014  
0015    switch nargin
0016      case 1
0017        if isa(varargin{1},'Interval')
0018          I=varargin{1};
0019        else
0020          if isa(varargin{1},'double')
0021            I=Interval(varargin{1},varargin{1});
0022          else
0023            error('Wrong parameter type in interval creation');
0024          end
0025        end
0026      case 2
0027        if isa(varargin{1},'double') && isa(varargin{2},'double')
0028          [r1 c1]=size(varargin{1});
0029          [r2 c2]=size(varargin{1});
0030          if (r1==r2) && (c1==c2)
0031            I.lower=zeros(r1,c1);
0032            I.upper=zeros(r1,c1);
0033            for i=1:r1
0034              for j=1:c1
0035                a=varargin{1}(i,j);
0036                b=varargin{2}(i,j);
0037                if b<a
0038                  error('Empty range in interval creation');
0039                end
0040                I.lower(i,j)=a;
0041                I.upper(i,j)=b;
0042              end
0043            end
0044            I.r=r1;
0045            I.c=c1;
0046            I=class(I,'Interval');
0047          else
0048            error('Parameter of diferent sizez in interval creation');
0049          end
0050        else
0051          error('Wrong parameter type in interval creation');
0052        end
0053      otherwise
0054        error('Wrong number of parameters in interval creation');
0055    end


Institut de Robòtica i Informàtica Industrial

Generated on Fri 24-Jul-2009 12:32:50 by m2html © 2003