Skip to content

Commit

Permalink
fix display of face array classes + overload single.m and double.m
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelforget committed May 27, 2018
1 parent 3c46380 commit a8d5673
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
6 changes: 4 additions & 2 deletions @gcmfaces/display.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ function display(a)

stg = sprintf(' nFaces: %d\n',a.nFaces);
for iFace=1:a.nFaces;
eval(['tmp1=a.f' num2str(iFace) ';']); tmp1=size(tmp1);
eval(['tmp1=a.f' num2str(iFace) ';']);
tmp0=class(tmp1);
tmp1=size(tmp1);
tmp2='[';
for ii=1:length(tmp1); tmp2=[tmp2 num2str(tmp1(ii)) 'x']; end;
tmp2=[tmp2(1:end-1) ' ' class(tmp1) ']'];
tmp2=[tmp2(1:end-1) ' ' tmp0 ']'];
stg=strvcat(stg,[' f' num2str(iFace) ': ' tmp2]);
end;
disp(stg)
Expand Down
11 changes: 11 additions & 0 deletions @gcmfaces/double.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function r = double(p)
%overloaded gcmfaces double function :
% simply calls double double function for each face data

r=p;
for iFace=1:r.nFaces;
iF=num2str(iFace);
eval(['r.f' iF '=double(p.f' iF ');']);
end;


11 changes: 11 additions & 0 deletions @gcmfaces/single.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function r = single(p)
%overloaded gcmfaces single function :
% simply calls double single function for each face data

r=p;
for iFace=1:r.nFaces;
iF=num2str(iFace);
eval(['r.f' iF '=single(p.f' iF ');']);
end;


0 comments on commit a8d5673

Please sign in to comment.