check_crossing1.m

来自「一个matlab的将军模型」· M 代码 · 共 30 行

M
30
字号
function [point_index,hyperplane_index] = check_crossing1(Vt,INV)

% Check whether any point of Vt cross the boundary of the invariant INV.
%
% Vt               : Set of vertices (vertices object)
% INV              : Linearcon object contained the boundary of the invariant.
% 
% Returns:
%
% point_index      : A vertices object with the vertices outside the boundary. 
%                    Vertices in the boundary are considered IN. If no vertice 
%                    is found, point_index returns empty.
% hyperplane_index : A matrix where j-th row informs in which side of the hyperplane
%                    the j-th point in point_index is located. If no point_index is
%                    empty, hyperplane_index is also empty.
global_var;

[CE,dE,CI,dI] = linearcon_data(INV);
point_index = vertices;
hyperplane_index = [];
for i = 1: length(Vt)
	var_comp = CI*Vt(i) < dI  + GLOBAL_APPROX_PARAM.poly_epsilon;
	if var_comp
   else
      point_index = point_index | Vt(i);
      hyperplane_index((size(hyperplane_index,1) + 1),:) = var_comp';
	end
end
return

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?