-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- cosmetic and structured problems fixed - some small bugs fixed
- Loading branch information
Showing
21 changed files
with
147 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
82 changes: 41 additions & 41 deletions
82
.../elltoolboxcore/@ellipsoid/isdegenerate.m → ...+elltool/+core/@AEllipsoid/isdegenerate.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
function isPositiveArr = isdegenerate(myEllArr) | ||
% | ||
% ISDEGENERATE - checks if the ellipsoid is degenerate. | ||
% | ||
% Input: | ||
% regular: | ||
% myEllArr: ellipsoid[nDims1,nDims2,...,nDimsN] - array of ellipsoids. | ||
% | ||
% Output: | ||
% isPositiveArr: logical[nDims1,nDims2,...,nDimsN], | ||
% isPositiveArr(iCount) = true if ellipsoid myEllMat(iCount) | ||
% is degenerate, false - otherwise. | ||
% | ||
% Example: | ||
% ellObj = ellipsoid([1; 1], eye(2)); | ||
% isdegenerate(ellObj) | ||
% | ||
% ans = | ||
% | ||
% 0 | ||
% | ||
% $Author: Alex Kurzhanskiy <[email protected]> | ||
% $Copyright: The Regents of the University of California | ||
% 2004-2008 $ | ||
% | ||
% $Author: Guliev Rustam <[email protected]> $ | ||
% $Date: Dec-2012$ | ||
% $Author: Peter Gagarinov <[email protected]> $ $Date: 25-04-2013$ | ||
% $Copyright: Moscow State University, | ||
% Faculty of Computational Mathematics and Computer Science, | ||
% System Analysis Department 2012 $ | ||
% | ||
ellipsoid.checkIsMe(myEllArr); | ||
modgen.common.checkvar(myEllArr,'~any(x(:).isEmpty())',... | ||
'errorTag','wrongInput:emptyEllipsoid',... | ||
'errorMessage','input argument contains empty ellipsoid.'); | ||
if isempty(myEllArr) | ||
isPositiveArr = true(size(myEllArr)); | ||
else | ||
isPositiveArr = ~arrayfun(@(x)gras.la.ismatposdef(x.shapeMat,x.absTol),... | ||
myEllArr); | ||
function isPositiveArr=isdegenerate(myEllArr) | ||
% | ||
% ISDEGENERATE - checks if the ellipsoid is degenerate. | ||
% | ||
% Input: | ||
% regular: | ||
% myEllArr: ellipsoid[nDims1,nDims2,...,nDimsN] - array of ellipsoids. | ||
% | ||
% Output: | ||
% isPositiveArr: logical[nDims1,nDims2,...,nDimsN], | ||
% isPositiveArr(iCount) = true if ellipsoid myEllMat(iCount) | ||
% is degenerate, false - otherwise. | ||
% | ||
% Example: | ||
% ellObj = ellipsoid([1; 1], eye(2)); | ||
% isdegenerate(ellObj) | ||
% | ||
% ans = | ||
% | ||
% 0 | ||
% | ||
% $Author: Alex Kurzhanskiy <[email protected]> | ||
% $Copyright: The Regents of the University of California | ||
% 2004-2008 $ | ||
% | ||
% $Author: Guliev Rustam <[email protected]> $ | ||
% $Date: Dec-2012$ | ||
% $Author: Peter Gagarinov <[email protected]> $ $Date: 25-04-2013$ | ||
% $Copyright: Moscow State University, | ||
% Faculty of Computational Mathematics and Computer Science, | ||
% System Analysis Department 2012 $ | ||
% | ||
checkIsMeVirtual(myEllArr); | ||
modgen.common.checkvar(myEllArr,'~any(x(:).isEmpty())',... | ||
'errorTag','wrongInput:emptyEllipsoid',... | ||
'errorMessage','input argument contains empty ellipsoid.'); | ||
if isempty(myEllArr) | ||
isPositiveArr = true(size(myEllArr)); | ||
else | ||
isPositiveArr = ~arrayfun(@(x)gras.la.ismatposdef(x.getShapeMat(),... | ||
x.absTol),myEllArr); | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
function volArr=volume(ellArr) | ||
% | ||
% EllSINGLEVOLUME - returns the volume of the each AEllipsoid in array. | ||
% | ||
% volArr=VOLUME(ellArr) Computes the volume of AEllipsoids | ||
% | ||
% | ||
% Input: | ||
% regular: | ||
% ellObj: AEllipsoid [nDims1,nDims2,...,nDimsN] - array | ||
% of AEllipsoids. | ||
% | ||
% Output: | ||
% volArr: double [nDims1,nDims2,...,nDimsN] - array of | ||
% volume values, same size as ellObj. | ||
% | ||
% Example: | ||
% firstEllObj=ellipsoid([4 -1; -1 1]); | ||
% secEllObj=ell_unitball(2); | ||
% ellVec=[firstEllObj secEllObj] | ||
% volVec=ellVec.volume() | ||
% | ||
% volVec = | ||
% | ||
% 5.4414 3.1416 | ||
% | ||
% $Author: Alex Kurzhanskiy <[email protected]> | ||
% $Copyright: The Regents of the University of California | ||
% 2004-2008 $ | ||
% | ||
% $Author: Guliev Rustam <[email protected]> $ | ||
% $Date: Dec-2012$ | ||
% $Copyright: Moscow State University, | ||
% Faculty of Computational Mathematics and Computer Science, | ||
% System Analysis Department 2012 $ | ||
% | ||
checkIsMeVirtual(ellArr); | ||
modgen.common.checkvar(ellArr,'~any(x(:).isEmpty())',... | ||
'errorTag','wrongInput:emptyEllipsoid',... | ||
'errorMessage','input argument is empty.'); | ||
volArr=arrayfun(@(x) fSingleVolume(x), ellArr); | ||
function volVal=fSingleVolume(ellObj) | ||
if isdegenerate(ellObj) | ||
volVal=0; | ||
else | ||
qMat=ellObj.getShapeMat(); | ||
nDim=ellObj.dimension(); | ||
if mod(nDim,2) | ||
k=(nDim-1)*0.5; | ||
s=((2^(2*k + 1))*(pi^k)*factorial(k))/factorial(2*k + 1); | ||
else | ||
k=nDim *0.5; | ||
s=(pi^k)/factorial(k); | ||
end | ||
volVal=s*realsqrt(det(qMat)); | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
products/+elltool/+core/@GenEllipsoid/changeShapeMatInternal.m
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,14 +30,13 @@ | |
modgen.common.checkvar(myEllArr,'~any(x(:).isEmpty())',... | ||
'errorTag','wrongInput:emptyEllipsoid',... | ||
'errorMessage','input argument contains empty GenEllipsoid.'); | ||
if isempty(myEllArr) | ||
isPositiveArr=true(size(myEllArr)); | ||
else | ||
isPositiveArr=~arrayfun(@(x)fIsSingleDegenerate(x),myEllArr); | ||
isPositiveArr=true(size(myEllArr)); | ||
if ~isempty(myEllArr) | ||
for iElem=1:numel(myEllArr) | ||
qInfMat=myEllArr(iElem).getQInfMat(); | ||
isDegenerate=all(qInfMat(:)==0)&&... | ||
[email protected](myEllArr(iElem)); | ||
isPositiveArr(iElem)=isDegenerate; | ||
end | ||
end | ||
end | ||
function isDegenerate=fIsSingleDegenerate(ellObj) | ||
isDegenerate=... | ||
gras.la.ismatnotdeg(ellObj.getShapeMat(),ellObj.getAbsTol())&&... | ||
gras.la.ismatnotdeg(ellObj.getQInfMat(),ellObj.getAbsTol()); | ||
end |
2 changes: 1 addition & 1 deletion
2
...l/+core/@GenEllipsoid/fSingleProjection.m → .../@GenEllipsoid/projectionSingleInternal.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
function fSingleProjection(ellObj,ortBasisMat) | ||
function projectionSingleInternal(ellObj,ortBasisMat) | ||
ellObj.eigvMat=ortBasisMat'*ellObj.eigvMat; | ||
ellObj.centerVec=ortBasisMat'*ellObj.centerVec; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function shapeSingleInternal(ellObj,isModScal,modMat) %#ok<INUSL> | ||
eigvMat=modMat*ellObj.eigvMat; | ||
ellObj.eigvMat=eigvMat; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,19 +34,14 @@ | |
% Faculty of Computational Mathematics and Computer Science, | ||
% System Analysis Department 2015 $ | ||
% | ||
volArr = arrayfun(@(x) fSingleVolume(x), ellArr); | ||
end | ||
% | ||
function volVal=fSingleVolume(ellObj) | ||
qInfMat=ellObj.getQInfMat(); | ||
if any(qInfMat(:)>0) | ||
volVal=Inf; | ||
else | ||
if ellObj.isEmpty() | ||
simpleEllObj=ellipsoid(); | ||
elltool.core.GenEllipsoid.checkIsMe(ellArr); | ||
volArr=zeros(size(ellArr)); | ||
for iElem=1:numel(ellArr) | ||
qInfMat=ellArr(iElem).getQInfMat(); | ||
if any(qInfMat(:)>0) | ||
volArr(iElem)=Inf; | ||
else | ||
simpleEllObj=ellipsoid(ellObj.centerVec,ellObj.getShapeMat()); | ||
volArr(iElem)[email protected](ellArr(iElem)); | ||
end | ||
volVal=ellSingleVolume(simpleEllObj); | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.