Updates:
Status: ReviewFailed
Comment #83 on issue 72 by
heartofm...@gmail.com: Replace calculation of
Good job, I think that you are almost done and mixed R/X solution makes a
perfect sense. We just need to do some minor refactoring of your code and
then reintegrate.
0) Please merge from trunk.
1) What did you have to introduce the scalar matrix function class for?
Just explain, I do not understand why...
2) Please eliminate a copy-pasting in AGoodDirsContinuous in the following
code:
self.ltGoodDirOneCurveSplineList = cell(nGoodDirs, 1);
self.ltRGoodDirOneCurveSplineList = cell(nGoodDirs, 1);
for iGoodDir = 1:nGoodDirs
lsGoodDirConstColFunc = ...
ConstMatrixFunctionFactory.createInstance(...
lsGoodDirMat(:, iGoodDir));
self.ltGoodDirOneCurveSplineList{iGoodDir} = ...
matOpFactory.rMultiply(self.XstTransDynamics, ...
lsGoodDirConstColFunc);
self.ltRGoodDirOneCurveSplineList{iGoodDir} = ...
matOpFactory.rMultiply(self.RstTransDynamics, ...
lsGoodDirConstColFunc);
end
%
lsGoodDirConstMatFunc = ...
ConstMatrixFunctionFactory.createInstance(lsGoodDirMat);
self.ltGoodDirCurveSpline = matOpFactory.rMultiply(...
self.XstTransDynamics, lsGoodDirConstMatFunc);
self.ltRGoodDirCurveSpline = matOpFactory.rMultiply(...
self.RstTransDynamics, lsGoodDirConstMatFunc);
Probably the best way to do that is to use a nested function parameterized
by a dynamics object
(self.RstTransDynamics or self.XstTransDynamics)
3) You cannot just disable the regression tests for elltool.reach. Instead
please investigate
which of them fail and try to teak the parameters to achieve the same
failure.
If you feel that you are out of options trying to achieve the same failure
- please disable the specific case in the test case
(and remove the corresponding code in elltool.reach.AReach or
ReachContinuous). But before doing so you need to be sure
that this specific exception cannot appear again.
4) The following code from EllTubeBasic needs to be moved to
invprecforillcond function in in
gras.la package.
a) the function needs to be covered with simple tests
b) number of iterations needs to be an input parameter for the function
and should be declared as a constant in EllTubeBasic.
c) Did you use any article/book to come up with the implemented algorithm
for inv precision calcualtion? If so - please specify it in
the help header of the function. If no - just describe shortly in the
help header what are the mathematical considerations for such algorithm.
d) Naming of certain variables needs to be fixed (see the table in Wiki).
For instance we should not use "i" and "j" names for counters.
Also, please rename ierrVec into invErrVec
e) What will happen if in 10 iteration condition if addInvPrecision < eps
doesn't hold. Do you have an examples of such matrices - if so, please
include them into the tests for invprecforillcond function.
g) How big is the slowdown caused by use of this function in EllTubeBasic?
5) The following code in EllTubeTouchCurveBasic needs to be refactored.
cDims = 1:length(valSizeVec)-1;
v1CMat = num2cell(valList{iTuple}{1}, cDims);
v1NormVec = cellfun(@norm, v1CMat);
for iVal=2:nVals
isOk=isequal(valSizeVec,...
size(valList{iTuple}{iVal}));
if ~isOk
throwError('size',fieldName);
end
%
v2CMat = ...
num2cell(valList{iTuple}{iVal}, cDims);
v2NormVec = cellfun(@norm, v2CMat);
%
actAbsTolVec = abs(valList{iTuple}{1}-...
valList{iTuple}{iVal});
actRelTolVec = 2 .* actAbsTolVec ./ ...
repmat(v1NormVec + v2NormVec, ...
[valSizeVec(1:end-1), 1]);
actRelTol = max(actRelTolVec(:));
actAbsTol = max(actAbsTolVec(:));
%
expTol=(tolVec(1)+tolVec(iVal));
isOk=(actRelTol<=expTol) || ...
(actAbsTol<=expTol);
if ~isOk
optMsg=sprintf(...
['relative tolerance=%g,'...
' absolute tolerance=%g,',...
' expected tolerance=%g'], ...
actRelTol, actAbsTol, expTol);
a) You use the same code for calculating v2NormVec and v1NormVec, please
put it into a subfunction/nested function.
b) I'm concerned with the time it might take to calculate these vectors
because of very inefficient num2cell(valList{iTuple}{1}, cDims); call.
I'd suggest to use gras.gen.MatVector methods to calculate norm for
array and matrix fields of EllTube-like relations. To do that please
-- Move evalMFunc methods from gras.gen.SquareMatVector to
gras.gen.MatVector class
-- Check for dimensionality of valList{iTuple}{1} (within the
newly-created sub/nested function). if =3 - use evalMFunc directly. If =2
use shiftdim to transform n x m arrays (like aMat or others) into 1 x n x
m. After that apply evalMFunc. If =1 - no need to calculate norm. If >3 -
throw an exception
saying that such fields are not supported.