Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ kernel/matrixfree/.svn
*.o
temp
*.
*.asv
Binary file added kernel/distances/NCCmexC.mexw64
Binary file not shown.
Binary file added kernel/distances/NGFdotMexC.mexw64
Binary file not shown.
Binary file added kernel/distances/SSDmexC.mexw64
Binary file not shown.
Binary file added kernel/distances/rhoSplineC.mexw64
Binary file not shown.
3 changes: 2 additions & 1 deletion kernel/distances/testDistances.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
% - https://github.com/C4IR and
% - http://www.siam.org/books/fa06/
%==============================================================================
% This is a testing environment for the files in the folder kernel/data
% This is a testing environment for the files in the folder
% kernel/distances
% 1. Based on data/contents, a list of required files is generated and it
% is verified, that all files are present; additional files are listed.
% 2. All c-files are compiled.
Expand Down
Binary file added kernel/imgModels/linearInterMexC.mexw64
Binary file not shown.
Binary file added kernel/imgModels/linearInterSmoothMexC.mexw64
Binary file not shown.
Binary file added kernel/imgModels/nnInterMexC.mexw64
Binary file not shown.
Binary file added kernel/imgModels/splineInterMexC.mexw64
Binary file not shown.
10 changes: 5 additions & 5 deletions kernel/imgModels/testOneImgModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ function testOneImgModel(file)
coeff = @(Tdata,dim) getSplineCoefficients(Tdata,'dim',dim);
end

fprintf(2,'%s: test implementation of <%s>, run minimal examples\n',...
fprintf(1,'%s: test implementation of <%s>, run minimal examples\n',...
mfilename,file)

fprintf(2,'check <%s> on 1D example\n',file);
fprintf(1,'check <%s> on 1D example\n',file);
Tdata = [0,1,4,1,0];
omega = [0,10];
m = length(Tdata);
Expand All @@ -51,7 +51,7 @@ function testOneImgModel(file)
title('dT')


fprintf(2,'check <%s> on 2D example\n',mfilename);
fprintf(1,'check <%s> on 2D example\n',mfilename);
omega = [0,10,0,8];
Tdata = [1,2,3,4;1,2,3,4;4,4,4,4]; m = size(Tdata);
Tcoef = coeff(Tdata,2);
Expand All @@ -69,7 +69,7 @@ function testOneImgModel(file)
title('dT')


fprintf(2,'check <%s> on 3D example\n',mfilename);
fprintf(1,'check <%s> on 3D example\n',mfilename);
omega = [0,1,0,2,0,1]; m = [13,16,7];
Xdata = getCellCenteredGrid(omega,m);
Y = reshape(Xdata,[m,3]);
Expand All @@ -84,7 +84,7 @@ function testOneImgModel(file)
subplot(1,2,2); spy(dT);
title('dT')

fprintf(2,'run derivative test for <%s> (note: needs to fail)\n',mfilename);
fprintf(1,'run derivative test for <%s> (note: needs to fail)\n',mfilename);
fctn = @(xc) feval(file,Tcoef,omega,xc);
xc = xc + rand(size(xc));
FAIRfigure(4);
Expand Down
Binary file added kernel/landmarks/TPSmexC.mexw64
Binary file not shown.
3 changes: 2 additions & 1 deletion kernel/landmarks/testLandmarks.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
% - https://github.com/C4IR and
% - http://www.siam.org/books/fa06/
%==============================================================================
% This is a testing environment for the files in the folder kernel/data
% This is a testing environment for the files in the folder
% kernel/landmarks
% 1. Based on data/contents, a list of required files is generated and it
% is verified, that all files are present; additional files are listed.
% 2. All c-files are compiled.
Expand Down
1 change: 1 addition & 0 deletions kernel/numerics/checkDerivative.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
dvf = df*v;
elseif isa(df,'function_handle'),
dvf = df(v);
if isrow(dvf); dvf = dvf'; end;
else
keyboard;
end;
Expand Down
Binary file added kernel/numerics/nodal2centerC.mexw64
Binary file not shown.
Binary file added kernel/regularizers/curvatureDiagMex.mexw64
Binary file not shown.
Binary file added kernel/regularizers/curvatureHessianMex.mexw64
Binary file not shown.
Binary file added kernel/regularizers/curvatureMexC.mexw64
Binary file not shown.
Binary file added kernel/regularizers/geometryMexC.mexw64
Binary file not shown.
7 changes: 4 additions & 3 deletions kernel/regularizers/testRegularizers.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
% - https://github.com/C4IR and
% - http://www.siam.org/books/fa06/
%==============================================================================
% This is a testing environment for the files in the folder kernel/data
% 1. Based on data/contents, a list of required files is generated and it
% This is a testing environment for the files in the folder
% kernel/regularizers
% 1. Based on regularizers/contents.m, a list of required files is generated and it
% is verified, that all files are present; additional files are listed.
% 2. All c-files are compiled.
% 3. All files are executed.
Expand Down Expand Up @@ -149,7 +150,7 @@
'significant difference between matrix-based and matrix free code');

% test dericatives
fprintf('test deivative of [%s]\n',regularizer);
fprintf('test derivative of [%s]\n',regularizer);

fctn = @(Y) regularizer(Y,omega,m);
checkDerivative(fctn,Y);
Expand Down
18 changes: 9 additions & 9 deletions kernel/tools/FAIRcheckFiles.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function FAIRcheckFiles(caller)
%------------------------------------------------------------------------------
% main loop, run over all files
%------------------------------------------------------------------------------

mexall = mexext('all');
for j=1:length(FAIRtestStatus.(caller))
name = FAIRtestStatus.(caller)(j).name;
check = FAIRtestStatus.(caller)(j).check;
Expand All @@ -80,21 +80,21 @@ function FAIRcheckFiles(caller)
case '.m',
OK = 1;
if strcmp(FAIRtestStatus.('FAIRrun'),'on'),
OK = FAIReval(FAIRtestStatus.(caller)(j).name);
OK = FAIReval(name);
end;
if strcmp(FAIRtestStatus.('FAIRedit'),'on') || not(OK),
FAIRopen(FAIRtestStatus.(caller)(j).name);
if strcmp(FAIRtestStatus.('FAIRedit'),'on') || OK==0,
FAIRopen(name);
end;
case {'.cpp','.c'},
if strcmp(FAIRtestStatus.('FAIRcompile'),'on'),
OK = FAIRbuild(file);
else
OK = 1;
end;
case {'.h','.o',lower(['.',mexext])},
case {'.h','.o'},
OK = 1;

case {'.mexa64'},
case strcat({'.'}, {mexall.ext}),
OK = 3;


Expand All @@ -111,10 +111,10 @@ function FAIRcheckFiles(caller)
J = find([FAIRtestStatus.(caller)(:).check] <= 0);

if length(J)>0,
fprintf('none performimg files:\n');
fprintf('non-performing files:\n');
for j=J
fprintf(' - %4d-of-%4d %-30s\n',...
j,length(J),FAIRtestStatus.(caller)(j).name);
j,length(FAIRtestStatus.(caller)),FAIRtestStatus.(caller)(j).name);
end;
end;

Expand Down Expand Up @@ -148,7 +148,7 @@ function FAIRcheckFiles(caller)
eval(sprintf('dbclear in %s',file))
run(file);
OK = 1;
catch
catch e
fprintf('file does not run without errors\n');
OK = -10;
end;
Expand Down
10 changes: 6 additions & 4 deletions kernel/tools/FAIRcheckFolder.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@
%
% if strcmp(FAIRignoreCompiles,'on')
% ignore = zeros(length(credit),1);
% mexall = mexext('all');
% for k=1:length(credit)
% [~,~,ext] = fileparts(credit{k});
% ignore(k) = any(strcmp(ext,{'.o',['.',mexext]}));
% ignore(k) = any(strcmp(ext,[{'.o'},strcat({'.'}, {mexall.ext})]));
% end;
% credit(find(ignore)) = [];
% end;
Expand All @@ -113,7 +114,7 @@
% keyboard
end;

% merge debit and andons, sort by type
% merge debit and addons, sort by type
files = {debit{:},credit{:}};
ext = @(str) str(max(1,find(str=='.',1,'last')):end);
extensions = cellfun(ext,files','UniformOutput',0)';
Expand All @@ -133,7 +134,8 @@

function [C,OK] = sortFiles(list)

ext = {'.cpp','.c','.h','.o',['.',mexext],'.mexa64','.mat','.jpg','.m'};
mexall = mexext('all');
ext = [{'.cpp','.c','.h','.o','.mat','.jpg','.m'}, strcat({'.'}, {mexall.ext})];
C = []; R = 1:length(list);
for p=1:length(ext),
K = find(strcmp(list,ext{p}));
Expand All @@ -142,6 +144,6 @@
end;
OK = isempty(R);
for k=1:length(R)
fprintf(' - %d-of-%d, unknown extension [%s]\n',j,length(R),list{R(k)} )
fprintf(' - %d-of-%d, unknown extension [%s]\n',k,length(R),list{R(k)} )
end;
%==============================================================================
18 changes: 18 additions & 0 deletions kernel/tools/FAIRerror.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function FAIRerror(err)

if nargin == 0
FAIRerror('nice error');
return;
end

fprintf(2,'\n\n ----- FAIRerror.m \n');

if ischar(err)
fprintf(2,'%s',err);
elseif isa(err,'MException')
fprintf(2,'%s - %s',err.identifier,err.message);
else
fprintf(2,'No clue, sry.');
end

fprintf(2,'\n ----- \n\n');
6 changes: 3 additions & 3 deletions kernel/transformations/splineTransformation2D.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@

if isempty(w) || (size(Q,1) ~= numel(x)) || (size(Q,2) ~= numel(w)),
% it is assumed that x is a cell centered grid, extract xi1 and xi2
dim = size(omega,2)/2
n = numel(x)/dim
dim = size(omega,2)/2;
n = numel(x)/dim;
if n == prod(m)
q = m;
elseif n == prod(m+1)
q = m+1
q = m+1;
else
error('can not handle this grid')
end;
Expand Down
2 changes: 1 addition & 1 deletion kernel/viewers/testViewer.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
% - https://github.com/C4IR and
% - http://www.siam.org/books/fa06/
%==============================================================================
% This is a testing environment for the files in the folder kernel/viewer
% This is a testing environment for the files in the folder kernel/viewers
% 1. Based on data/contents, a list of required files is generated and it
% is verified, that all files are present; additional files are listed.
% 2. All c-files are compiled.
Expand Down