nonlinear_equality_constraint

PURPOSE ^

constructor for the nonlinear_equality_constraint class.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

  constructor for the nonlinear_equality_constraint class.

  [nec]=nonlinear_equality_constraint(varargin)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 %
0002 %  constructor for the nonlinear_equality_constraint class.
0003 %
0004 %  [nec]=nonlinear_equality_constraint(varargin)
0005 %
0006 classdef nonlinear_equality_constraint
0007     properties
0008         descriptor='';
0009         target    = NaN;
0010         scale_type='none';
0011         scale     = 1.;
0012     end
0013     
0014     methods
0015         function [nec]=nonlinear_equality_constraint(varargin)
0016 
0017             switch nargin
0018 
0019 %  create a default object
0020 
0021                 case 0
0022 
0023 %  copy the object
0024 
0025                 case 1
0026                     if isa(varargin{1},'nonlinear_equality_constraint')
0027                         nec=varargin{1};
0028                     else
0029                         error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
0030                             inputname(1),class(varargin{1}),'nonlinear_equality_constraint');
0031                     end
0032 
0033 %  create the object from the input
0034 
0035                 otherwise
0036                     nec.descriptor=varargin{1};
0037                     nec.target    =varargin{2};
0038 
0039                     if (nargin >= 3)
0040                         nec.scale_type=varargin{3};
0041                         if (nargin >= 4)
0042                             nec.scale     =varargin{4};
0043 
0044                             if (nargin > 4)
0045                                 warning('objective_function:extra_arg',...
0046                                     'Extra arguments for object of class ''%s''.',...
0047                                     class(nec));
0048                             end
0049                         end
0050                     end
0051             end
0052 
0053         end
0054         function [desc]  =dresp_desc(nec)
0055             desc=cell(size(nec));
0056             for i=1:numel(nec)
0057                 desc(i)=cellstr(nec(i).descriptor);
0058             end
0059         end
0060         function [stype ]=dresp_stype(nec)
0061             stype=cell(size(nec));
0062             for i=1:numel(nec)
0063                 stype(i)=cellstr(nec(i).scale_type);
0064             end
0065         end
0066         function [scale] =dresp_scale(nec)
0067             scale=zeros(size(nec));
0068             for i=1:numel(nec)
0069                 scale(i)=nec(i).scale;
0070             end
0071         end
0072         function [weight]=dresp_weight(nec)
0073             weight=[];
0074         end
0075         function [lower] =dresp_lower(nec)
0076             lower=[];
0077         end
0078         function [upper] =dresp_upper(nec)
0079             upper=[];
0080         end
0081         function [target]=dresp_target(nec)
0082             target=zeros(size(nec));
0083             for i=1:numel(nec)
0084                 target(i)=nec(i).target;
0085             end
0086         end
0087     end
0088 end

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003