comparison scripts/optimization/sqp.m @ 7017:a1dbe9d80eee

[project @ 2007-10-12 21:27:11 by jwe]
author jwe
date Fri, 12 Oct 2007 21:27:37 +0000
parents 93c65f2a5668
children 120f3135952f
comparison
equal deleted inserted replaced
7016:93c65f2a5668 7017:a1dbe9d80eee
1 ## Copyright (C) 2005 John W. Eaton 1 ## Copyright (C) 2005, 2006, 2007 John W. Eaton
2 ## 2 ##
3 ## This file is part of Octave. 3 ## This file is part of Octave.
4 ## 4 ##
5 ## Octave is free software; you can redistribute it and/or modify it 5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by 6 ## under the terms of the GNU General Public License as published by
676 ## __sqp_cifcn__ = constraint function without gradients and lb or ub 676 ## __sqp_cifcn__ = constraint function without gradients and lb or ub
677 jac = fdjac (__sqp_cifcn__, x); 677 jac = fdjac (__sqp_cifcn__, x);
678 678
679 ### endfunction 679 ### endfunction
680 680
681
681 function res = cf_ub_lb (x) 682 function res = cf_ub_lb (x)
682 683
683 ## combine constraint function with ub and lb 684 ## combine constraint function with ub and lb
684 global __sqp_cifcn__ __sqp_lb__ __sqp_ub__ 685 global __sqp_cifcn__ __sqp_lb__ __sqp_ub__
685 686
688 if (! isempty (__sqp_cifcn__)) 689 if (! isempty (__sqp_cifcn__))
689 res = [feval(__sqp_cifcn__,x); x-__sqp_lb__; __sqp_ub__-x]; 690 res = [feval(__sqp_cifcn__,x); x-__sqp_lb__; __sqp_ub__-x];
690 endif 691 endif
691 692
692 ### endfunction 693 ### endfunction
694
693 695
694 function res = cigrad_ub_lb (x) 696 function res = cigrad_ub_lb (x)
695 697
696 global __sqp_cif__ 698 global __sqp_cif__
697 699