function [m,b]=gfSpmat(a, varargin)
% gfSpmat class pseudo-constructor
  this_class = 'gfSpmat';
  if (nargin==0) error('cant create an empty spmat reference'); end;
  if (isa(a,this_class)),
    m=a;
  else
    if (isstruct(a) & isfield(a,'id') & isfield(a,'cid'))
      cname = gf_workspace('class name',a);
      if (strcmp(cname, this_class))
	 m = a;
      else
	 m = gf_spmat(a,varargin{:});
      end;
    else
      m = gf_spmat(a,varargin{:});
    end;
    m.txt = '';
    m = class(m, this_class);
  end;
% autogenerated mfile;
