function Valid = isValid(this)
%Check that constraint is a valid constraint

%   Author: A. Stothert 
%   Copyright 1986-2004 The MathWorks, Inc.
%   $Revision: 1.1.6.1 $ $Date: 2004/12/10 19:32:13 $

Valid = true;

%Same number of X and Y coordinates
Valid = Valid && all(size(this.getData('xCoords')) == size(this.getData('yCoords')));
%Correct number of weights
Valid = Valid && size(this.getData('xCoords'),1) == numel(this.getData('Weight'));
%Correct number of links
Valid = Valid && size(this.getData('Linked'),1) == size(this.getData('xCoords'),1)-1;
      
