* Bug #8607 fixed - Some error messages in modules/overloading/macros were not standa... 70/11370/2
Charlotte HECQUET [Tue, 23 Apr 2013 13:38:43 +0000 (15:38 +0200)]
Change-Id: I553ea2474db54b48d4f03f88465329143645b72b

79 files changed:
scilab/CHANGES_5.5.X
scilab/modules/overloading/macros/%0_i_st.sci
scilab/modules/overloading/macros/%3d_i_h.sci
scilab/modules/overloading/macros/%b_i_sp.sci
scilab/modules/overloading/macros/%c_i_lss.sci
scilab/modules/overloading/macros/%c_i_r.sci
scilab/modules/overloading/macros/%c_i_s.sci
scilab/modules/overloading/macros/%cblock_e.sci
scilab/modules/overloading/macros/%ce_c_ce.sci
scilab/modules/overloading/macros/%ce_e.sci
scilab/modules/overloading/macros/%ce_size.sci
scilab/modules/overloading/macros/%ce_t.sci
scilab/modules/overloading/macros/%champdat_i_h.sci
scilab/modules/overloading/macros/%grayplot_i_h.sci
scilab/modules/overloading/macros/%hm_1_hm.sci
scilab/modules/overloading/macros/%hm_1_s.sci
scilab/modules/overloading/macros/%hm_2_hm.sci
scilab/modules/overloading/macros/%hm_2_s.sci
scilab/modules/overloading/macros/%hm_3_hm.sci
scilab/modules/overloading/macros/%hm_3_s.sci
scilab/modules/overloading/macros/%hm_4_hm.sci
scilab/modules/overloading/macros/%hm_4_s.sci
scilab/modules/overloading/macros/%hm_c_hm.sci
scilab/modules/overloading/macros/%hm_d_hm.sci
scilab/modules/overloading/macros/%hm_d_s.sci
scilab/modules/overloading/macros/%hm_e.sci
scilab/modules/overloading/macros/%hm_f_hm.sci
scilab/modules/overloading/macros/%hm_g_hm.sci
scilab/modules/overloading/macros/%hm_h_hm.sci
scilab/modules/overloading/macros/%hm_j_hm.sci
scilab/modules/overloading/macros/%hm_j_s.sci
scilab/modules/overloading/macros/%hm_matrix.sci
scilab/modules/overloading/macros/%hm_q_hm.sci
scilab/modules/overloading/macros/%hm_x_hm.sci
scilab/modules/overloading/macros/%hm_x_p.sci
scilab/modules/overloading/macros/%hm_x_s.sci
scilab/modules/overloading/macros/%i_b_s.sci
scilab/modules/overloading/macros/%l_isequal.sci
scilab/modules/overloading/macros/%lss_i_p.sci
scilab/modules/overloading/macros/%lss_i_s.sci
scilab/modules/overloading/macros/%lss_norm.sci
scilab/modules/overloading/macros/%msp_i_s.sci
scilab/modules/overloading/macros/%p_i_lss.sci
scilab/modules/overloading/macros/%p_j_s.sci
scilab/modules/overloading/macros/%p_p_s.sci
scilab/modules/overloading/macros/%p_v_p.sci
scilab/modules/overloading/macros/%p_v_r.sci
scilab/modules/overloading/macros/%r_norm.sci
scilab/modules/overloading/macros/%r_v_p.sci
scilab/modules/overloading/macros/%r_v_r.sci
scilab/modules/overloading/macros/%r_v_s.sci
scilab/modules/overloading/macros/%s_1_hm.sci
scilab/modules/overloading/macros/%s_2_hm.sci
scilab/modules/overloading/macros/%s_3_hm.sci
scilab/modules/overloading/macros/%s_4_hm.sci
scilab/modules/overloading/macros/%s_b_i.sci
scilab/modules/overloading/macros/%s_b_s.sci
scilab/modules/overloading/macros/%s_i_s.sci
scilab/modules/overloading/macros/%s_i_st.sci
scilab/modules/overloading/macros/%s_pow.sci
scilab/modules/overloading/macros/%s_q_hm.sci
scilab/modules/overloading/macros/%s_v_r.sci
scilab/modules/overloading/macros/%s_v_s.sci
scilab/modules/overloading/macros/%s_x_hm.sci
scilab/modules/overloading/macros/%sp_i_s.sci
scilab/modules/overloading/macros/%sp_i_sp.sci
scilab/modules/overloading/macros/%sp_p_s.sci
scilab/modules/overloading/macros/%st_c_st.sci
scilab/modules/overloading/macros/%st_e.sci
scilab/modules/overloading/macros/%st_size.sci
scilab/modules/overloading/macros/%st_t.sci
scilab/modules/overloading/macros/%ticks_i_h.sci
scilab/modules/overloading/macros/createstruct.sci
scilab/modules/overloading/macros/generic_i_ce.sci
scilab/modules/overloading/macros/generic_i_h.sci
scilab/modules/overloading/macros/generic_i_hm.sci
scilab/modules/overloading/macros/generic_i_s.sci
scilab/modules/overloading/tests/nonreg_tests/bug_8607.dia.ref [new file with mode: 0644]
scilab/modules/overloading/tests/nonreg_tests/bug_8607.tst [new file with mode: 0644]

index e1e5f29..b3df14a 100644 (file)
@@ -87,6 +87,8 @@ Bug fixes
 
 * Bug #8319 fixed - dbphi(hypermat) and phasemag(hypermat) returned a matrix instead of a hypermatrix.
 
+* Bug #8607 fixed - Some error messages in modules/overloading/macros were not standard and not localized.
+
 * Bug #8667 fixed - Handling of %nan in functions min,max,median is not correctly documented.
 
 * Bug #8680 fixed - Output argument "end" of the regexp function has been changed.
index 3bd894a..8cf9d1b 100644 (file)
@@ -8,17 +8,17 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function st=%0_i_st(i,void,st)
-  if type(i)==10 then
-    f=getfield(1,st);
-    k=find(f(3:$)==i);
-    if k<>[] then
-      f(k+2)=[];
-      setfield(k+2,null(),st);
-      setfield(1,f,st);
+    if type(i)==10 then
+        f=getfield(1,st);
+        k=find(f(3:$)==i);
+        if k<>[] then
+            f(k+2)=[];
+            setfield(k+2,null(),st);
+            setfield(1,f,st);
+        else
+            error(msprintf(_("%s: Invalid index.\n"),"%0_i_st"));
+        end
     else
-      error(_("Invalid index.\n"))
+        error(msprintf(_("%s: Wrong type for input argument #%d: String expected.\n"),"%0_i_st",1));
     end
-  else
-    error(_("Incorrect assignment.\n"))
-  end
 endfunction
index ce13966..b698989 100644 (file)
@@ -7,37 +7,37 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function h=%3d_i_h(i,v,h)
- if type(i)==10 then
-    set(h,i,v)
- elseif type(i)==15 then
-    hdl=h
-    p=i($)
-    if type(p)==1|type(p)==4|type(p)==2|type(p)==129|type(p)==15 then
-      index=i($)
-      i($)=null()
+    if type(i)==10 then
+        set(h,i,v)
+    elseif type(i)==15 then
+        hdl=h
+        p=i($)
+        if type(p)==1|type(p)==4|type(p)==2|type(p)==129|type(p)==15 then
+            index=i($)
+            i($)=null()
+        else
+            index=:
+        end
+        n=lstsize(i)
+        for k=1:n-1
+            p=i(k)
+            if type(p)==10 then
+                hdl=get(hdl,p),
+            elseif type(p)==1|type(p)==4|type(p)==2|type(p)==129 then
+                hdl=hdl(p)
+            elseif type(p)==15 then
+                hdl=hdl(p(:))
+            else
+                error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%3d_i_h",1));
+            end
+        end
+        if type(index)==15 then
+            hdl=hdl(index(:))
+        else
+            hdl=hdl(index)
+        end
+        set(hdl,i($),v)
     else
-      index=:
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%3d_i_h",1));
     end
-    n=lstsize(i)
-    for k=1:n-1
-      p=i(k)
-      if type(p)==10 then
-       hdl=get(hdl,p),
-      elseif type(p)==1|type(p)==4|type(p)==2|type(p)==129 then
-       hdl=hdl(p)
-      elseif type(p)==15 then
-       hdl=hdl(p(:))
-      else
-       error('Invalid path')
-      end
-    end
-    if type(index)==15 then
-      hdl=hdl(index(:))
-    else
-      hdl=hdl(index)
-    end
-    set(hdl,i($),v)
-  else
-    error('Invalid path')
-  end
-endfunction
\ No newline at end of file
+endfunction
index 879f625..6ea5dc1 100644 (file)
@@ -8,17 +8,17 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function M=%b_i_sp(varargin)
 
-[lhs,rhs]=argn(0)
-M=varargin(rhs)
-N=bool2s(varargin(rhs-1))//inserted matrix
-if rhs<=4 then
-  if rhs==3 then
-    M(varargin(1))=N
-  else
-    M(varargin(1),varargin(2))=N
-  end
-else
-  error('multidimensional sparse matrices are not handled')
-end
+    [lhs,rhs]=argn(0)
+    M=varargin(rhs)
+    N=bool2s(varargin(rhs-1))//inserted matrix
+    if rhs<=4 then
+        if rhs==3 then
+            M(varargin(1))=N
+        else
+            M(varargin(1),varargin(2))=N
+        end
+    else
+        error(msprintf(_("%s: Multidimensional sparse matrices are not handled.\n"),"%b_i_sp"));
+    end
+
 endfunction
index c5d4759..e057093 100644 (file)
@@ -9,17 +9,17 @@
 
 function s2=%c_i_lss(i,j,s1,s2)
 
-if type(i)==10 then  // sl('dt')
-  [lhs,rhs]=argn(0)
-  if rhs<>3 then  error(21),end
-  if i<>'dt' then
-    error('inserted element '+i+' has inconsistent type')
-  end
-  s2=s1;kf=7
-  if j<>'c'&j<>'d' then 
-    error('inserted element '+i+' must be ''c'' or ''d'' or a scalar')
-  end
-  s2(kf)=j
-  return
-end
+    if type(i)==10 then  // sl('dt')
+        [lhs,rhs]=argn(0)
+        if rhs<>3 then  error(21),end
+        if i<>'dt' then
+            error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%c_i_lss",1));
+        end
+        s2=s1;kf=7
+        if j<>'c'&j<>'d' then 
+            error(msprintf(_("%s: Wrong value for input argument #%d: ''c'', ''d'' or a scalar expected.\n"),"%c_i_lss",2));
+        end
+        s2(kf)=j
+        return
+    end
 endfunction
index 62cdb56..6a7c54f 100644 (file)
@@ -9,17 +9,17 @@
 
 function s2=%c_i_r(i,j,s1,s2)
 
-if type(i)==10 then  // sl('dt')
-  [lhs,rhs]=argn(0)
-  if rhs<>3 then  error(21),end
-  if i<>'dt' then
-    error('inserted element '+i+' has inconsistent type')
-  end
-  s2=s1;kf=4
-  if j<>'c'&j<>'d' then 
-    error('inserted element '+i+' must be ''c'' or ''d'' or a scalar')
-  end
-  s2(kf)=j
-  return
-end
+    if type(i)==10 then  // sl('dt')
+        [lhs,rhs]=argn(0)
+        if rhs<>3 then  error(21),end
+        if i<>'dt' then
+            error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%c_i_r",1));
+        end
+        s2=s1;kf=4
+        if j<>'c'&j<>'d' then 
+            error(msprintf(_("%s: Wrong value for input argument #%d: ''c'', ''d'' or a scalar expected.\n"),"%c_i_r",2));
+        end
+        s2(kf)=j
+        return
+    end
 endfunction
index 1c001a7..412897d 100644 (file)
@@ -8,47 +8,47 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function M=%c_i_s(varargin)
-  [lhs,rhs]=argn(0)
-  M=varargin(rhs)
-  N=varargin(rhs-1)//inserted matrix
-  index=varargin(1) //
-  if size(M,'*')<>0 then
-    error(_("Affection of a string in a matrix of numbers is not implemented."))
-  end
-  if rhs==3 then
-     if type(index)==10 then  //M.x=N or M.entries=N 
-      M=struct()
-      M(index)=N
-      if index=="entries" then //M.entries=N
-       // change struct to cell
-       f=getfield(1,M);f(1)="ce"
-       setfield(1,f,M)
-      end
-      return
-    elseif type(index)==15 then
-      //M(i).x=N or M(i,j,..).x=N or M.x(i,j,..)or M(i,j..)
-      //check for a name in the index list
-      isstr=%f; for ii=index,if type(ii)==10 then  isstr=%t,break,end,end
-      if isstr then
-       M=createstruct(index,N)
-       if type(index(1))<>10 & index(2)=="entries" then
-         // change struct to cell
-         f=getfield(1,M);f(1)="ce"
-         setfield(1,f,M)
-       end
-      else
-       M(index(:))=N
-      end
-      return
+    [lhs,rhs]=argn(0)
+    M=varargin(rhs)
+    N=varargin(rhs-1)//inserted matrix
+    index=varargin(1) //
+    if size(M,'*')<>0 then
+        error(msprintf(_("%s: Affection of a string in a matrix of numbers is not implemented.\n"),"%c_i_s"));
     end
+    if rhs==3 then
+        if type(index)==10 then  //M.x=N or M.entries=N 
+            M=struct()
+            M(index)=N
+            if index=="entries" then //M.entries=N
+                // change struct to cell
+                f=getfield(1,M);f(1)="ce"
+                setfield(1,f,M)
+            end
+            return
+        elseif type(index)==15 then
+            //M(i).x=N or M(i,j,..).x=N or M.x(i,j,..)or M(i,j..)
+            //check for a name in the index list
+            isstr=%f; for ii=index,if type(ii)==10 then  isstr=%t,break,end,end
+            if isstr then
+                M=createstruct(index,N)
+                if type(index(1))<>10 & index(2)=="entries" then
+                    // change struct to cell
+                    f=getfield(1,M);f(1)="ce"
+                    setfield(1,f,M)
+                end
+            else
+                M(index(:))=N
+            end
+            return
+        end
 
-  elseif rhs>4 then //more than 2 indices: insertion of a string in an empty matrix
-    M=varargin($)
-    M=mlist(['hm','dims','entries'],int32(size(M)),M(:))
-    varargin($)=M;
-    M=generic_i_hm('',varargin(:))
-  else //should not occur (hard coded case)
-    M=var
-  end
+    elseif rhs>4 then //more than 2 indices: insertion of a string in an empty matrix
+        M=varargin($)
+        M=mlist(['hm','dims','entries'],int32(size(M)),M(:))
+        varargin($)=M;
+        M=generic_i_hm('',varargin(:))
+    else //should not occur (hard coded case)
+        M=var
+    end
 endfunction
 
index 347e572..28d67d0 100644 (file)
@@ -7,57 +7,57 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function y=%cblock_e(varargin)
-  x=varargin($)
-  dims=[];
-  for k=2:length(x)
-    dims=[dims;size(getfield(k,x))];
-  end
-  m=dims(1,1) // common row number
-  
-  dims=cumsum([1 dims(:,2)']);
-  n=dims($)-1 // number of columns
-  y=mlist('cblock')
-  
-  j=varargin($-1)
-  if type(j)==2|type(j)==129 then 
-    j=horner(j,n)
-  elseif type(j)==4 then
-    j=find(j)
-  elseif and(size(j)==[-1,-1]) then 
-    j=1:n
-  end
-  if length(varargin)==2 then //y=x(i)
-    if m<>1 then 
-      error('Syntax x(j) only allowed for row cblock''s')
+    x=varargin($)
+    dims=[];
+    for k=2:length(x)
+        dims=[dims;size(getfield(k,x))];
     end
-    i=1
-  else //y=x(i,j)
-    i=varargin(1)
-  end
+    m=dims(1,1) // common row number
 
-  first=%t
+    dims=cumsum([1 dims(:,2)']);
+    n=dims($)-1 // number of columns
+    y=mlist('cblock')
 
-  for k=1:size(j,'*')
-    jk=j(k)
-    I=find(jk>=dims(1:$-1)&jk<dims(2:$))
-    if I>1 then jk=jk-dims(I)+1,end
-    v=getfield(I+1,x)
-    if first then
-      temp=v(i,jk)
-      first=%f
+    j=varargin($-1)
+    if type(j)==2|type(j)==129 then 
+        j=horner(j,n)
+    elseif type(j)==4 then
+        j=find(j)
+    elseif and(size(j)==[-1,-1]) then 
+        j=1:n
+    end
+    if length(varargin)==2 then //y=x(i)
+        if m<>1 then 
+            error(msprintf(_("%s: Syntax x(j) only allowed for row cblock''s.\n"),"cblock_e"));
+        end
+        i=1
+    else //y=x(i,j)
+        i=varargin(1)
+    end
+
+    first=%t
+
+    for k=1:size(j,'*')
+        jk=j(k)
+        I=find(jk>=dims(1:$-1)&jk<dims(2:$))
+        if I>1 then jk=jk-dims(I)+1,end
+        v=getfield(I+1,x)
+        if first then
+            temp=v(i,jk)
+            first=%f
+        else
+            if type(v)==type(temp) then
+                temp=[temp v(i,jk)]
+            else
+                setfield(length(y)+1,temp,y)
+                temp=v(i,jk)
+            end
+        end
+    end
+    if length(y)==1 then
+        y=temp
     else
-      if type(v)==type(temp) then
-       temp=[temp v(i,jk)]
-      else
-       setfield(length(y)+1,temp,y)
-       temp=v(i,jk)
-      end
+        setfield(length(y)+1,temp,y)
     end
-  end
-  if length(y)==1 then
-    y=temp
-  else
-    setfield(length(y)+1,temp,y)
-  end
-  
+
 endfunction
index 6dc4639..4395b1e 100644 (file)
@@ -8,30 +8,30 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function r=%ce_c_ce(a,b)
-da=a.dims;if size(da,'*')<2 then da(2)=1,end
-db=b.dims;if size(db,'*')<2 then db(2)=1,end
-da=double(da);db=double(db);
-if size(da,'*')<>size(db,'*') then
-  error('In concatenation the number of dimensions for each component must match');
-end
+    da=a.dims;if size(da,'*')<2 then da(2)=1,end
+    db=b.dims;if size(db,'*')<2 then db(2)=1,end
+    da=double(da);db=double(db);
+    if size(da,'*')<>size(db,'*') then
+        error(msprintf(_("%s: In concatenation the number of dimensions for each component must match.\n"),"ce_c_ce"));
+    end
 
-kd=find(da<>db)
-kd(find(kd==2))=[]
-if kd<>[] then
-  error(5)
-end
-v=[matrix(1:prod(da),da(1)*da(2),prod(da)/(da(1)*da(2)));
+    kd=find(da<>db)
+    kd(find(kd==2))=[]
+    if kd<>[] then
+        error(5)
+    end
+    v=[matrix(1:prod(da),da(1)*da(2),prod(da)/(da(1)*da(2)));
     -matrix(1:prod(db),db(1)*db(2),prod(db)/(db(1)*db(2)))]
-val=list()
-for k=1:size(v,'*') 
-  if v(k)>0 then
-    val(k)=a.entries(v(k))
-  else
-    val(k)=b.entries(-v(k))
-  end
-end
-da(2)=da(2)+db(2)
-r=mlist(['ce','dims','entries'],int32(da),val)
+    val=list()
+    for k=1:size(v,'*') 
+        if v(k)>0 then
+            val(k)=a.entries(v(k))
+        else
+            val(k)=b.entries(-v(k))
+        end
+    end
+    da(2)=da(2)+db(2)
+    r=mlist(['ce','dims','entries'],int32(da),val)
 endfunction
 
 
index f5b0b33..f8846b8 100644 (file)
@@ -7,97 +7,97 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function s=%ce_e(varargin)
-//extraction from struct
-  w=varargin($);
-  if type(varargin(1))==15  //x(i,j,k).f or x.f(i,j,k)
-    index=varargin($-1);
-    if type(index($))==10 then  //x(i,j,k).f
-      f=index($);
-      //ijk=list2vec(index(1));
-      [indx,I]=convertindex(double(w.dims),index(1)(:));
-      // I<->ijk
-      all_fields=getfield(1,w);all_fields=all_fields(3:$);
-      fieldnum=find(f==all_fields);
-      if fieldnum==[] then error("invalid field name");end
-      good_list=getfield(2+fieldnum,w);
-      if size(I,'*')==1 then
-       s=good_list(I)  //list(good_list(I)) ?
-      else
-       s=list();
-       for kk=1:size(I,"*") 
-         s(kk)=good_list(I(kk));end
-      end
-      return;
-    else //x.f(i,j,k)
-      f=index(1);
-      li=w(f);
-      [indx,I]=convertindex(double(w.dims),index($)(:));
-      s=li(I);
-      return;
+    //extraction from struct
+    w=varargin($);
+    if type(varargin(1))==15  //x(i,j,k).f or x.f(i,j,k)
+        index=varargin($-1);
+        if type(index($))==10 then  //x(i,j,k).f
+            f=index($);
+            //ijk=list2vec(index(1));
+            [indx,I]=convertindex(double(w.dims),index(1)(:));
+            // I<->ijk
+            all_fields=getfield(1,w);all_fields=all_fields(3:$);
+            fieldnum=find(f==all_fields);
+            if fieldnum==[] then error(msprintf(_("%s: Invalid field name.\n"),"%ce_e"));end
+            good_list=getfield(2+fieldnum,w);
+            if size(I,'*')==1 then
+                s=good_list(I)  //list(good_list(I)) ?
+            else
+                s=list();
+                for kk=1:size(I,"*") 
+                s(kk)=good_list(I(kk));end
+            end
+            return;
+        else //x.f(i,j,k)
+            f=index(1);
+            li=w(f);
+            [indx,I]=convertindex(double(w.dims),index($)(:));
+            s=li(I);
+            return;
+        end
     end
-  end
 
-  if type(varargin(1))==10 then
-    //field  x.f
-    fields=getfield(1,w);nu=find(fields(3:$)==varargin(1));
-    if nu==[] then
-      error(' '+varargin(1)+' is not a valid field name');return;
+    if type(varargin(1))==10 then
+        //field  x.f
+        fields=getfield(1,w);nu=find(fields(3:$)==varargin(1));
+        if nu==[] then
+            error(msprintf(_("%s: Wrong value for input argument #%d: a valid field name expected.\n"),"%ce_e",1));return;
+        end
+        s=getfield(nu+2,w);
+        if prod(getfield(2,w))==1 then s=s(1);end
+        return; 
     end
-    s=getfield(nu+2,w);
-    if prod(getfield(2,w))==1 then s=s(1);end
-    return; 
-  end
-  
-  //substruct x(i,j,k...)
-  nind=size(varargin)-1
-  
-  dims1=double(w.dims)
-  if nind<size(dims1,'*') then
-    //reduce the dimension according to the number of indexes
-    dims1=[dims1(1:nind-1) prod(dims1(nind:$))]
-    if size(dims1,'*')==1 then dims1=[dims1 1],end
-  end
-  //get the "linear" vector of indexes
-  [indx,I]=convertindex(dims1,varargin(1:$-1)); 
-  dims=zeros(1,nind)
-  
-  //computing dimensions of the result
-  //following loop should be merged in the convertindex code
-  for kk=1:nind
-    ik=varargin(kk)
-    
-    if or(type(ik)==[2 129]) then
-      ik=horner(ik,dims1(kk))
+
+    //substruct x(i,j,k...)
+    nind=size(varargin)-1
+
+    dims1=double(w.dims)
+    if nind<size(dims1,'*') then
+        //reduce the dimension according to the number of indexes
+        dims1=[dims1(1:nind-1) prod(dims1(nind:$))]
+        if size(dims1,'*')==1 then dims1=[dims1 1],end
     end
-    if type(ik)==4 then
-       dims(kk)=max(find(ik))
-    elseif size(ik,1)~=-1 then 
-      dims(kk)=size(ik,'*')
-    else 
-      dims(kk)=dims1(kk)
+    //get the "linear" vector of indexes
+    [indx,I]=convertindex(dims1,varargin(1:$-1)); 
+    dims=zeros(1,nind)
+
+    //computing dimensions of the result
+    //following loop should be merged in the convertindex code
+    for kk=1:nind
+        ik=varargin(kk)
+
+        if or(type(ik)==[2 129]) then
+            ik=horner(ik,dims1(kk))
+        end
+        if type(ik)==4 then
+            dims(kk)=max(find(ik))
+        elseif size(ik,1)~=-1 then 
+            dims(kk)=size(ik,'*')
+        else 
+            dims(kk)=dims1(kk)
+        end
     end
-  end
-  
-  while  dims($)==1 then dims($)=[],end
-  select size(dims,'*')
-  case 0 then
-    dims=[1,1]
-  case 1 then
-    dims=[dims,1]
-  else 
-    dims=matrix(dims,1,-1)
-  end
-  s=mlist(getfield(1,w),int32(dims));
-  sz=size(getfield(1,w),'*');
-  for k=3:sz
-    ww=getfield(k,w);
-    if type(ww)~=15 then ww=list(ww);end
-    if prod(dims)==1
-      setfield(k,ww(I),s); 
-    elseif prod(dims)==0 //VC 27/05/2004 after modification in convertindex
-      setfield(k,list(),s);
+
+    while  dims($)==1 then dims($)=[],end
+    select size(dims,'*')
+    case 0 then
+        dims=[1,1]
+    case 1 then
+        dims=[dims,1]
     else 
-      setfield(k,list(ww(I)),s);
+        dims=matrix(dims,1,-1)
+    end
+    s=mlist(getfield(1,w),int32(dims));
+    sz=size(getfield(1,w),'*');
+    for k=3:sz
+        ww=getfield(k,w);
+        if type(ww)~=15 then ww=list(ww);end
+        if prod(dims)==1
+            setfield(k,ww(I),s); 
+        elseif prod(dims)==0 //VC 27/05/2004 after modification in convertindex
+            setfield(k,list(),s);
+        else 
+            setfield(k,list(ww(I)),s);
+        end
     end
-  end
 endfunction
index 589bb23..f0d8d53 100644 (file)
@@ -15,20 +15,20 @@ if rhs==2 then
     varargout(1)=prod(dims)
     return
   elseif type(job)==1 then
-    if size(job,'*') >1 then error('Second argument is incorrect');end
+    if size(job,'*') >1 then error(msprintf(_("%s: Wrong size for input argument #%d.\n"),"%ce_size",2));end
     if job<=0|job>size(dims,'*') then 
-      error('Second argument is incorrect'); 
+        error(msprintf(_("%s: Wrong size for input argument #%d.\n"),"%ce_size",2));
     end
     varargout(1)=dims(job)
   else
-    error('Second argument is incorrect')
+    error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%ce_size",2));
   end
   return
 end
 if lhs==1 then
   varargout(1)=matrix(dims,1,-1)
 else
-  if lhs>size(dims,'*') then error('Too many LHS args'),end
+  if lhs>size(dims,'*') then error(msprintf(_("%s: Wrong number of output arguments.\n"),"%ce_size")),end
   for k=1:lhs
     varargout(k)=dims(k)
   end
index 1b401dc..8943ffa 100644 (file)
@@ -8,15 +8,15 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function R=%ce_t(M)
-  D=double(M.dims)
-  if size(D,'*')>2 then
-    error('Transpose not defined')
-  end
-  NewInd=matrix(matrix(1:prod(D),D)',1,-1)
-  F=getfield(1,M)
-  R=mlist(F,int32([D(2) D(1)]))
-  for k=3:size(F,'*')
-    v=getfield(k,M)
-    setfield(k,list(v(NewInd)),R)
-  end
+    D=double(M.dims)
+    if size(D,'*')>2 then
+        error(msprintf(_("%s: Wrong size for input argument #%d: Transpose can not be defined.\n"),"%ce_t",1));
+    end
+    NewInd=matrix(matrix(1:prod(D),D)',1,-1)
+    F=getfield(1,M)
+    R=mlist(F,int32([D(2) D(1)]))
+    for k=3:size(F,'*')
+        v=getfield(k,M)
+        setfield(k,list(v(NewInd)),R)
+    end
 endfunction
index 50fca50..c13b7a8 100644 (file)
@@ -28,7 +28,7 @@ elseif type(i)==15 then
     elseif type(p)==15 then
       hdl=hdl(p(:))
     else
-      error('Invalid path')
+      error(msprintf(_("%s: Invalid path.\n"),"%champdat_i_h"));
     end
   end
   if type(index)==15 then
@@ -38,6 +38,6 @@ elseif type(i)==15 then
   end
   set(hdl,i($),v)
 else
-  error('Invalid path')
+  error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%champdat_i_h",1));
 end
-endfunction
\ No newline at end of file
+endfunction
index 1b332c9..ad575da 100644 (file)
@@ -7,37 +7,37 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function h=%grayplot_i_h(i,v,h)
-if type(i)==10 then
-  set(h,i,v)
-elseif type(i)==15 then
-  hdl=h
-  p=i($)
-  if type(p)==1|type(p)==4|type(p)==2|type(p)==129|type(p)==15 then
-    index=i($)
-    i($)=null()
-  else
-    index=:
-  end
-  n=lstsize(i)
-  for k=1:n-1
-    p=i(k)
-    if type(p)==10 then
-      hdl=get(hdl,p),
-    elseif type(p)==1|type(p)==4|type(p)==2|type(p)==129 then
-      hdl=hdl(p)
-    elseif type(p)==15 then
-      hdl=hdl(p(:))
+    if type(i)==10 then
+        set(h,i,v)
+    elseif type(i)==15 then
+        hdl=h
+        p=i($)
+        if type(p)==1|type(p)==4|type(p)==2|type(p)==129|type(p)==15 then
+            index=i($)
+            i($)=null()
+        else
+            index=:
+        end
+        n=lstsize(i)
+        for k=1:n-1
+            p=i(k)
+            if type(p)==10 then
+                hdl=get(hdl,p),
+            elseif type(p)==1|type(p)==4|type(p)==2|type(p)==129 then
+                hdl=hdl(p)
+            elseif type(p)==15 then
+                hdl=hdl(p(:))
+            else
+                error(msprintf(_("%s: Invalid path.\n"),"%grayplot_i_h"));
+            end
+        end
+        if type(index)==15 then
+            hdl=hdl(index(:))
+        else
+            hdl=hdl(index)
+        end
+        set(hdl,i($),v)
     else
-      error('Invalid path')
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%grayplot_i_h",1));
     end
-  end
-  if type(index)==15 then
-    hdl=hdl(index(:))
-  else
-    hdl=hdl(index)
-  end
-  set(hdl,i($),v)
-else
-  error('Invalid path')
-end
-endfunction
\ No newline at end of file
+endfunction
index 22d69ec..cea4d82 100644 (file)
@@ -8,7 +8,7 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function M1=%hm_1_hm(M1,M2)
   if and(M1.dims==M2.dims)==%f then
-    error('< : arguments have incompatible dimensions')
+    error(msprintf(_("%s: Input argument #%d and input argument #%d have incompatible dimensions.\n"),"%hm_1_hm",1,2));
   end
   M1.entries=(M1.entries<M2.entries)
 endfunction
index efea5c3..f8f9ab7 100644 (file)
@@ -10,7 +10,7 @@
 function M=%hm_1_s(M,s)
 //M<s
 if size(s,'*')<> 1 then
-  error('< : arguments have incompatible dimensions')
+  error(msprintf(_("%s: Wrong type for input argument #%d: A scalar expected.\n"),"%hm_1_s",2));
 end
 M('entries')=M('entries')<s
 endfunction
index 3144098..f882516 100644 (file)
@@ -9,7 +9,7 @@
 
 function M1=%hm_2_hm(M1,M2)
   if and(M1.dims==M2.dims)==%f then
-    error('> : arguments have incompatible dimensions')
+    error(msprintf(_("%s: Input argument #%d and input argument #%d have incompatible dimensions.\n"),"%hm_2_hm",1,2));
   end
   M1.entries=(M1.entries>M2.entries)
 endfunction
index c2ceddd..fcc6e9d 100644 (file)
@@ -9,7 +9,7 @@
 function M=%hm_2_s(M,s)
 //M>s
 if size(s,'*')<> 1 then
-  error('> arguments have incompatible dimensions')
+  error(msprintf(_("%s: Wrong type for input argument #%d: A scalar expected.\n"),"%hm_2_s",2));
 end
 M('entries')=M('entries')>s
 endfunction
index b7b0cd7..47e13e6 100644 (file)
@@ -8,7 +8,7 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function M1=%hm_3_hm(M1,M2)
   if and(M1.dims==M2.dims)==%f then
-    error('>= : arguments have incompatible dimensions')
+    error(msprintf(_("%s: Input argument #%d and input argument #%d have incompatible dimensions.\n"),"%hm_3_hm",1,2));
   end
   M1.entries=(M1.entries>=M2.entries)
 endfunction
index 202f0ba..79dd16f 100644 (file)
@@ -7,9 +7,9 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function M=%hm_3_s(M,s)
-//M<=s
-if size(s,'*')<> 1 then
-  error('<= : arguments have incompatible dimensions')
-end
-M('entries')=M('entries')<=s
+    //M<=s
+    if size(s,'*')<> 1 then
+        error(msprintf(_("%s: Wrong type for input argument #%d: A scalar expected.\n"),"%hm_3_s",2));
+    end
+    M('entries')=M('entries')<=s
 endfunction
index db501a2..bd27e47 100644 (file)
@@ -8,7 +8,7 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function M1=%hm_4_hm(M1,M2)
   if and(M1.dims==M2.dims)==%f then
-    error('<= : arguments have incompatible dimensions')
+    error(msprintf(_("%s: Input argument #%d and input argument #%d have incompatible dimensions.\n"),"%hm_4_hm",1,2));
   end
   M1.entries=(M1.entries<=M2.entries)
 endfunction
index fa12d78..00e65ea 100644 (file)
@@ -8,9 +8,9 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function M=%hm_4_s(M,s)
 
-//M>=s
-if size(s,'*')<> 1 then
-  error('>= : arguments have incompatible dimensions')
-end
-M('entries')=M('entries')>=s
+    //M>=s
+    if size(s,'*')<> 1 then
+        error(msprintf(_("%s: Wrong type for input argument #%d: A scalar expected.\n"),"%hm_4_s",2));
+    end
+    M('entries')=M('entries')>=s
 endfunction
index df166ab..eecc1d3 100644 (file)
@@ -12,13 +12,13 @@ function M1=%hm_c_hm(M1,M2)
    d1=M1.dims;
    d2=M2.dims;
    if size(d1,'*')<>size(d2,'*') then
-      error('In concatenation the number of dimensions for each component must match');
+      error(msprintf(_("%s: In concatenation the number of dimensions for each component must match.\n"),"%hm_c_hm"));
    end
 
    kd=find(d1<>d2)
    kd(find(kd==2))=[]
    if kd<>[] then
-      error('inconsistent dimensions')
+      error(msprintf(_("%s: Inconsistent dimensions.\n"),"%hm_c_hm"));
    end
    
    M1.entries=matrix([matrix(M1.entries,double(d1(1)*d1(2)),-1);...
index 18ce158..326819c 100644 (file)
@@ -9,9 +9,9 @@
 
 function M2=%hm_d_hm(M1,M2)
 
-if and(M1('dims')==M2('dims')) then
-  M2('entries')=M1('entries')./M2('entries')
-else
- error('inconsistent element-wise operation')
-end
+    if and(M1('dims')==M2('dims')) then
+        M2('entries')=M1('entries')./M2('entries')
+    else
+        error(msprintf(_("%s: Inconsistent element-wise operation.\n"),"%hm_d_hm"));
+    end
 endfunction
index da8c4a0..11a170b 100644 (file)
@@ -9,9 +9,9 @@
 
 function M1=%hm_d_s(M1,M2)
 
-if size(M2,'*')<>1 then
-  error('inconsistent element-wise operation')
-else
-  M1('entries')=M1('entries')./M2
-end
+    if size(M2,'*')<>1 then
+        error(msprintf(_("%s: Inconsistent element-wise operation.\n"),"%hm_d_s"));
+    else
+        M1('entries')=M1('entries')./M2
+    end
 endfunction
index 83f1067..d501c69 100644 (file)
@@ -18,7 +18,7 @@ function [M] = %hm_e(varargin)
    nb_index_vect = rhs-1;
    
    if nb_index_vect > nbdims then
-      error('Too many subscripts')
+      error(msprintf(_("%s: Too many subscripts.\n"),"%hm_e"));
    elseif nb_index_vect < nbdims then
       nbdims = nb_index_vect;
       dims(nbdims) = prod(dims(nbdims:$))
index 0bac73f..142851a 100644 (file)
@@ -12,13 +12,13 @@ function M1=%hm_f_hm(M1,M2)
 d1=M1.dims;
 d2=M2.dims;
 if size(d1,'*')<>size(d2,'*') then
-  error('In concatenation the number of dimensions for each component must match');
+  error(msprintf(_("%s: In concatenation the number of dimensions for each component must match.\n"),"%hm_f_hm"));
 end
 
 
 kd=find(d1(2:$)<>d2(2:$))
 if kd<>[] then
-  error('inconsistent dimensions')
+  error(msprintf(_("%s: Inconsistent dimensions.\n"),"%hm_f_hm"));
 end
 
 M1.entries=matrix([matrix(M1.entries,double(d1(1)),-1);
index f3e7068..5f28b71 100644 (file)
@@ -13,7 +13,7 @@ function r=%hm_g_hm(a,b)
    //                  and if a and b have the same dimensions
    //                      or if one have only one element
    if type(a.entries) ~= 4 | type(b.entries) ~= 4 then
-      error("operand not a boolean hypermat")
+      error(msprintf(_("%s: Operand not a boolean hypermat.\n"),"%hm_g_hm"));
    end
    if and(a.dims==b.dims) then
       r=hypermat(a.dims,a.entries | b.entries)
@@ -22,6 +22,6 @@ function r=%hm_g_hm(a,b)
    elseif prod(b.dims) == 1 then
       r=hypermat(a.dims,a.entries | b.entries)
    else
-      error("incompatible operand dimensions")
+      error(msprintf(_("%s: incompatible operand dimensions.\n"),"%hm_g_hm"));
    end
 endfunction
index c9dc1ab..fc1060f 100644 (file)
@@ -14,7 +14,7 @@ function r=%hm_h_hm(a,b)
    //                  and if a and b have the same dimensions
    //                      or if one have only one element
    if type(a.entries) ~= 4 | type(b.entries) ~= 4 then
-      error("operand not a boolean hypermat")
+      error(msprintf(_("%s: Wrong type for input argument(s): hypermatrix expected.\n"),"%hm_h_hm"));
    end
    if and(a.dims==b.dims) then
       r=hypermat(a.dims,a.entries & b.entries)
@@ -23,6 +23,6 @@ function r=%hm_h_hm(a,b)
    elseif prod(b.dims) == 1 then
       r=hypermat(a.dims,a.entries & b.entries)
    else
-      error("incompatible operand dimensions")
+      error(msprintf(_("%s: Incompatible operand dimensions.\n"),"%hm_h_hm"));
    end
 endfunction
index 9d30e87..7a09d59 100644 (file)
@@ -9,9 +9,9 @@
 
 function M2=%hm_j_hm(M1,M2)
 
-if and(M1('dims')==M2('dims')) then
-  M2('entries')=M1('entries').^M2('entries')
-else
- error('inconsistent element-wise operation')
-end
+    if and(M1('dims')==M2('dims')) then
+        M2('entries')=M1('entries').^M2('entries')
+    else
+        error(msprintf(_("%s: Inconsistent element-wise operation.\n"),"%hm_j_hm"));
+    end
 endfunction
index 75ca338..356eb49 100644 (file)
@@ -9,9 +9,9 @@
 
 function M1=%hm_j_s(M1,M2)
 
-if size(M2,'*')<>1 then
-  error('inconsistent element-wise operation')
-else
-  M1(:) = M1(:) .^ M2
-end
+    if size(M2,'*')<>1 then
+        error(msprintf(_("%s: Inconsistent element-wise operation.\n"),"%hm_j_s"));
+    else
+        M1(:) = M1(:) .^ M2
+    end
 endfunction
index 2c3986e..280d081 100644 (file)
@@ -14,7 +14,7 @@ function a=%hm_matrix(a,varargin)
     sz=[]
     for k=1:size(varargin)
       if size(varargin(k),'*')<>1|type(varargin(k))<>1 then
-       error('Size arguments must be integer scalars')
+       error(msprintf(_("%s: Wrong size for input argument(s): integer scalars expected.\n"),"%hm_matrix"));
       end
       sz=[sz varargin(k)]
     end
@@ -33,14 +33,13 @@ function a=%hm_matrix(a,varargin)
   P=prod(dims)
   if k<>[] then
     if size(k,'*')>1 then 
-      error('Only one -1 value admitted')
+      error(msprintf(_("%s: Only one -1 value admitted.\n"),"%hm_matrix"));
     end
     sz(k)=floor(P/(prod(sz(sz>0))))
   end
   
   if prod(P)<>prod(sz) then
-    error('MATRIX: input and output matrices  must have the same number"+...
-         " of elements')
+    error(msprintf(_("%s: Input and output matrices  must have the same number of elements"),"%hm_matrix"));
   end
   
   if type(a)<>17 then 
index 151bfe8..abf1d91 100644 (file)
@@ -9,9 +9,9 @@
 
 function M2=%hm_q_hm(M1,M2)
 
-if and(M1('dims')==M2('dims')) then
-  M2('entries')=M1('entries').\M2('entries')
-else
- error('inconsistent element-wise operation')
-end
+    if and(M1('dims')==M2('dims')) then
+        M2('entries')=M1('entries').\M2('entries')
+    else
+        error(msprintf(_("%s: Inconsistent element-wise operation.\n"),"%hm_q_hm"));
+    end
 endfunction
index 14d26cb..b315d4d 100644 (file)
@@ -9,9 +9,9 @@
 
 function M2=%hm_x_hm(M1,M2)
 
-if and(M1('dims')==M2('dims')) then
-  M2('entries')=M1('entries').*M2('entries')
-else
- error('inconsistent element-wise operation')
-end
+    if and(M1('dims')==M2('dims')) then
+        M2('entries')=M1('entries').*M2('entries')
+    else
+        error(msprintf(_("%s: Inconsistent element-wise operation.\n"),"%hm_x_hm"));
+    end
 endfunction
index 61a45f3..8b4b910 100644 (file)
@@ -8,10 +8,10 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function M1=%hm_x_p(M1,M2)
-//author Serge Steer
-  if size(M2,'*')<>1 then
-    error('inconsistent element-wise operation')
-  else
-    M1.entries=M1.entries.*M2
-  end
+    //author Serge Steer
+    if size(M2,'*')<>1 then
+        error(msprintf(_("%s: Inconsistent element-wise operation.\n"),"%hm_x_p"));
+    else
+        M1.entries=M1.entries.*M2
+    end
 endfunction
index 367811f..39a964a 100644 (file)
@@ -10,7 +10,7 @@
 function M1=%hm_x_s(M1,M2)
 //author Serge Steer
   if size(M2,'*')<>1 then
-    error('inconsistent element-wise operation')
+    error(msprintf(_("%s: Inconsistent element-wise operation.\n"),"%hm_x_s"));
   else
     M1.entries=M1.entries.*M2
   end
index 81cf542..5799e90 100644 (file)
@@ -11,7 +11,7 @@ function r=%i_b_s(varargin)
 //a:b where a is int and b double
 //a:b:c where a is int,  b double and c every type
   if round(varargin(1))<>varargin(1) then 
-    error('Colon operands should have integer values")
+    error(msprintf(_("%s: Wrong type for input argument #%d: integer values expected.\n"),"%i_b_s",1));
   end
   if size(varargin)==2 then //a:b
     it=inttype(varargin(1))
index 8b1886d..39f9e62 100644 (file)
@@ -9,7 +9,7 @@
 
 function r=%l_isequal(x1,varargin)
   narg=size(varargin)
-  if narg==0 then error('isequal requires at least two input arguments'),end
+  if narg==0 then error(msprintf(_("%s: Wrong number of input arguments: At least %d expected.\n"),"%l_isequal",2)) ,end
 
   r=%t
   m=lstsize(x1)
index 964487e..5a06ac4 100644 (file)
@@ -25,7 +25,7 @@ if rhs==3 then
     c2(i)=c1
     b2=b1
   else
-    error('Invalid syntax for a MIMO system')
+    error(msprintf(_("%s: Invalid syntax for a MIMO system.\n"),"%lss_i_p"));
   end
   d2(i)=d1;
   s=lsslist(a1,b2,c2,d2,x1,dom1)
index 32fb745..69157a6 100644 (file)
@@ -35,7 +35,7 @@ if rhs==3 then
     c2(i)=c1
     b2=b1
   else
-    error('Invalid syntax for a MIMO system')
+    error(msprintf(_("%s: Invalid syntax for a MIMO system.\n"),"%lss_i_s"));
   end
   d2(i)=d1;
   s=lsslist(a1,b2,c2,d2,x1,dom1)
index 2257a7a..3494e6c 100644 (file)
@@ -8,12 +8,12 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function y=%lss_norm(A,flag)
-  if argn(2)==1 then flag=2,end
-  if flag==2 then
-    y=h2norm(A)
-  elseif flag==%inf|flag=='inf' then
-    y=h_norm(A)
-  else
-    error('flag must be 2 or inf.')
-  end
+    if argn(2)==1 then flag=2,end
+    if flag==2 then
+        y=h2norm(A)
+    elseif flag==%inf|flag=='inf' then
+        y=h_norm(A)
+    else
+        error(msprintf(_("%s: Wrong value for input argument #%d: %d or %s expected.\n"),"%lss_norm",2,2,"inf"));
+    end
 endfunction
index 426bd6e..3b8044a 100644 (file)
@@ -8,37 +8,37 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function M=%msp_i_s(varargin)
-// %msp_i_s(i,j,b,a) insert matlab sparse matrix b into full matrix a
-// M(i,j)=b
-//!
+    // %msp_i_s(i,j,b,a) insert matlab sparse matrix b into full matrix a
+    // M(i,j)=b
+    //!
 
-  [lhs,rhs]=argn(0)
+    [lhs,rhs]=argn(0)
 
-  M=varargin(rhs)
-  N=varargin(rhs-1)//inserted matrix
-  index=varargin(1) //
+    M=varargin(rhs)
+    N=varargin(rhs-1)//inserted matrix
+    index=varargin(1) //
 
-  if rhs==3&(type(index)==10|type(index)==15) then
-    M=createstruct(index,N)
-    if type(index(1))<>10 & index(2)=="entries" then
-      // change struct to cell
-      f=getfield(1,M);f(1)="ce"
-      setfield(1,f,M)
-    end
-  elseif rhs>4 then //more than 2 indices: 
-    
-    //insertion of a sparse matrix in a matrix of numbers
-    error('Insertion of a sparse matrix in a matrix of numbers is not defined')
-  else
-    i=varargin(1);
-    j=varargin(2);
-    M=varargin(4);
-    b=varargin(3);
-    if rhs==4 then
-      M(i,j)=full(b)
+    if rhs==3&(type(index)==10|type(index)==15) then
+        M=createstruct(index,N)
+        if type(index(1))<>10 & index(2)=="entries" then
+            // change struct to cell
+            f=getfield(1,M);f(1)="ce"
+            setfield(1,f,M)
+        end
+    elseif rhs>4 then //more than 2 indices: 
+
+        //insertion of a sparse matrix in a matrix of numbers
+        error(msprintf(_("%s: Insertion of a sparse matrix in a matrix of numbers is not defined.\n"),"%msp_i_s"));
     else
-      M=b;//b=j
-      M(i)=full(j)
+        i=varargin(1);
+        j=varargin(2);
+        M=varargin(4);
+        b=varargin(3);
+        if rhs==4 then
+            M(i,j)=full(b)
+        else
+            M=b;//b=j
+            M(i)=full(j)
+        end
     end
-  end
 endfunction
index 9c06ac8..c1cc7b9 100644 (file)
@@ -15,11 +15,11 @@ if type(i)==10 then  // sl('D')
   [lhs,rhs]=argn(0)
   if rhs<>3 then  error(21),end
   if i<>'D' then
-    error('inserted element '+i+' has inconsistent type')
+    error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%p_i_lss",1));
   end
   s2=s1;kf=5
   if size(s2(kf))<>size(j) then 
-    warning('inserted element '+i+' has inconsistent dimension')
+    warning(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%p_i_lss",1));
   end
   s2(kf)=j
   return
index 12b0ab1..603e8bc 100644 (file)
@@ -12,7 +12,7 @@ function f=%p_j_s(p,s)
 //!
 
 if s==[] then f=[],return,end
-if  or(imag(s)<>0)|or(int(s)<>s) then error('%p_j_s: integer power only'),end
+if  or(imag(s)<>0)|or(int(s)<>s) then error(msprintf(_("%s: Wrong type for input argument #%d: integer expected.\n"),"%p_j_s",2)),end
 [m,n]=size(p)
 [ms,ns]=size(s)
 if ms==1&ns==1 then
index 0dca61d..5884e95 100644 (file)
@@ -8,51 +8,51 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function f=%p_p_s(p,s)
-// %p_p_s(p,s)  computes p^s for p polynomial matrix in special cases
-//!
+    // %p_p_s(p,s)  computes p^s for p polynomial matrix in special cases
+    //!
 
-if s==[] then f=[],return,end
-if  or(imag(s)<>0)|or(int(s)<>s) then error('%p_p_s: integer power only'),end
-[m,n]=size(p)
-[ms,ns]=size(s)
-if ms==1&ns==1 then
-  if m==1|n==1 then //Element wise exponentiation p.^s with p vector
-    if s<0 then 
-      if or(abs(coeff(p(:)))*ones(max(degree(p))+1,1)==0) then
-       error(27)
-      end
-      f = rlist(ones(p),p.^(-s),[])
-    else // this case is in fact hard coded
-      f=p.^s
-    end
-  elseif m==n then //square matrix exponentiation p^s
-    if s<0 then 
-      f=invr(p),
-      s=-s;
-      f1=f;for k=2:s,f=f*f1;end
+    if s==[] then f=[],return,end
+    if  or(imag(s)<>0)|or(int(s)<>s) then  error(msprintf(_("%s: Wrong type for input argument #%d: integer expected.\n"),"%p_p_s",2)),end
+    [m,n]=size(p)
+    [ms,ns]=size(s)
+    if ms==1&ns==1 then
+        if m==1|n==1 then //Element wise exponentiation p.^s with p vector
+            if s<0 then 
+                if or(abs(coeff(p(:)))*ones(max(degree(p))+1,1)==0) then
+                    error(27)
+                end
+                f = rlist(ones(p),p.^(-s),[])
+            else // this case is in fact hard coded
+                f=p.^s
+            end
+        elseif m==n then //square matrix exponentiation p^s
+            if s<0 then 
+                f=invr(p),
+                s=-s;
+                f1=f;for k=2:s,f=f*f1;end
+            else
+                f=p
+                for k=2:s,f=f*p;end
+            end
+        else
+            error(20,1)
+        end
+    elseif ms==1|ns==1 then // Element wise exponentiation f.^s with f "scalar"
+        if m<>1|n<>1 then error(43),end
+
+        kp=find(s>=0)
+        kn=find(s<0)
+        num=ones(s)
+        den=ones(s)
+        num(kp)=p.^s(kp)
+        if abs(coeff(p))*ones(degree(p)+1,1)==0 then
+            error(27)
+        end
+        den(kn)=p.^(-s(kn))
+        f = rlist(num,den,[])
     else
-      f=p
-      for k=2:s,f=f*p;end
+        error(43)
     end
-  else
-    error(20,1)
-  end
-elseif ms==1|ns==1 then // Element wise exponentiation f.^s with f "scalar"
-  if m<>1|n<>1 then error(43),end
-   
-  kp=find(s>=0)
-  kn=find(s<0)
-  num=ones(s)
-  den=ones(s)
-  num(kp)=p.^s(kp)
-  if abs(coeff(p))*ones(degree(p)+1,1)==0 then
-    error(27)
-  end
-  den(kn)=p.^(-s(kn))
-  f = rlist(num,den,[])
-else
-  error(43)
-end
 
-  
+
 endfunction
index 3ecfce8..8949132 100644 (file)
@@ -8,11 +8,11 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function h=%p_v_p(h1,h2)
-// h=%p_v_p(h1,h2) <=> h=(I+h1*h2)\h1 with h1 h2 polynomial matrices
-//!
+    // h=%p_v_p(h1,h2) <=> h=(I+h1*h2)\h1 with h1 h2 polynomial matrices
+    //!
 
-[m1,n1]=size(h1)
-[m2,n2]=size(h2)
-if abs(n1-m2)+abs(m1-n2)<>0 then error('inconsistent dimensions'),end
-h=(eye(m1,m1)+h1*h2)\h1
+    [m1,n1]=size(h1)
+    [m2,n2]=size(h2)
+    if abs(n1-m2)+abs(m1-n2)<>0 then error(msprintf(_("%s: Wrong size for input arguments.\n"),"%p_v_p")),end
+    h=(eye(m1,m1)+h1*h2)\h1
 endfunction
index d174748..38606cd 100644 (file)
@@ -8,13 +8,13 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function h=%p_v_r(h1,h2)
-// h=%p_v_r(h1,h2) <=> (I+h1*h2)\h1. 
-// h1 polynomial matrix
-// h2 rational matrix
-//!
+    // h=%p_v_r(h1,h2) <=> (I+h1*h2)\h1. 
+    // h1 polynomial matrix
+    // h2 rational matrix
+    //!
 
-[m1,n1]=size(h1)
-[m2,n2]=size(h2('num'))
-if abs(n1-m2)+abs(m1-n2)<>0 then error('inconsistent dimensions'),end
-h=(eye(m1,m1)+h1*h2)\h1
+    [m1,n1]=size(h1)
+    [m2,n2]=size(h2('num'))
+    if abs(n1-m2)+abs(m1-n2)<>0 then error(msprintf(_("%s: Wrong size for input argument(s).\n"),"%p_v_r")),end
+    h=(eye(m1,m1)+h1*h2)\h1
 endfunction
index a37840e..1e0496a 100644 (file)
@@ -8,12 +8,12 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function y=%r_norm(A,flag)
-  if argn(2)==1 then flag=2,end
-  if flag==2 then
-    y=h2norm(A)
-  elseif flag==%inf|flag=='inf' then
-    y=h_norm(A)
-  else
-    error('flag must be 2 or inf.')
-  end
+    if argn(2)==1 then flag=2,end
+    if flag==2 then
+        y=h2norm(A)
+    elseif flag==%inf|flag=='inf' then
+        y=h_norm(A)
+    else
+        error(msprintf(_("%s: Wrong value for input argument #%d: %d or %s expected.\n"),"%r_norm",2,2,"inf"));
+    end
 endfunction
index 912c82d..db3afd4 100644 (file)
@@ -8,12 +8,12 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function h=%r_v_p(h1,h2)
-// %r_v_p(h1,h2) computes (I+h1*h2)\h1. h1: rational
-// h2 polynomial
-//!
+    // %r_v_p(h1,h2) computes (I+h1*h2)\h1. h1: rational
+    // h2 polynomial
+    //!
 
-[m1,n1]=size(h1('num'))
-[m2,n2]=size(h2)
-if abs(n1-m2)+abs(m1-n2)<>0 then error('inconsistent dimensions'),end
-h=(eye(m1,m1)+h1*h2)\h1
+    [m1,n1]=size(h1('num'))
+    [m2,n2]=size(h2)
+    if abs(n1-m2)+abs(m1-n2)<>0 then error(msprintf(_("%s: Wrong size for input argument(s).\n"),"%r_v_p")),end
+    h=(eye(m1,m1)+h1*h2)\h1
 endfunction
index db18b02..57a767d 100644 (file)
@@ -8,16 +8,16 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function h=%r_v_r(h1,h2)
-// %r_v_r(h1,h2)=(I+h1*h2)\h1. h1 and h2 rational matrices
-//!
+    // %r_v_r(h1,h2)=(I+h1*h2)\h1. h1 and h2 rational matrices
+    //!
 
-[h1,h2]=sysconv(h1,h2),
-[m1,n1]=size(h1('num'))
-[m2,n2]=size(h2('num'))
-if abs(n1-m2)+abs(m1-n2)<>0 then error('inconsistent dimensions'),end
-if m1*n1==1 then
-  h=rlist(h1('num')*h2('den'),h1('num')*h2('num')+h1('den')*h2('den'),h1('dt'))
-else
-  h=(eye(m1,m1)+h1*h2)\h1
-end
+    [h1,h2]=sysconv(h1,h2),
+    [m1,n1]=size(h1('num'))
+    [m2,n2]=size(h2('num'))
+    if abs(n1-m2)+abs(m1-n2)<>0 then error(msprintf(_("%s: Wrong size for input argument(s).\n"),"%r_v_r")),end
+    if m1*n1==1 then
+        h=rlist(h1('num')*h2('den'),h1('num')*h2('num')+h1('den')*h2('den'),h1('dt'))
+    else
+        h=(eye(m1,m1)+h1*h2)\h1
+    end
 endfunction
index 525babd..0777ba0 100644 (file)
@@ -8,16 +8,16 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function h=%r_v_s(h1,h2)
-// %r_v_s(h1,h2)=(I+h1*h2)\h1. h1: rational
-// h2 constant
-//!
+    // %r_v_s(h1,h2)=(I+h1*h2)\h1. h1: rational
+    // h2 constant
+    //!
 
-[m1,n1]=size(h1('num'))
-[m2,n2]=size(h2)
-if abs(n1-m2)+abs(m1-n2)<>0 then error('inconsistent dimensions'),end
-if m1*n1==1 then
-  h=h1;h('den')=h1('num')*h2+h1('den');
-else
-  h=(eye(m1,m1)+h1*h2)\h1
-end
+    [m1,n1]=size(h1('num'))
+    [m2,n2]=size(h2)
+    if abs(n1-m2)+abs(m1-n2)<>0 then  error(msprintf(_("%s: Wrong size for input argument(s).\n"),"%r_v_s")),end
+    if m1*n1==1 then
+        h=h1;h('den')=h1('num')*h2+h1('den');
+    else
+        h=(eye(m1,m1)+h1*h2)\h1
+    end
 endfunction
index 4862850..f29d530 100644 (file)
@@ -8,9 +8,9 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function M=%s_1_hm(s,M)
 
-//s<M
-if size(s,'*')<> 1 then
-  error('< : arguments have incompatible dimensions')
-end
-M('entries')=s<M('entries')
+    //s<M
+    if size(s,'*')<> 1 then
+        error(msprintf(_("%s: Wrong type for input argument #%d: A scalar expected.\n"),"%s_1_hm",1));
+    end
+    M('entries')=s<M('entries')
 endfunction
index d0851a5..6e87061 100644 (file)
@@ -8,9 +8,9 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function M=%s_2_hm(s,M)
 
-//s>M
-if size(s,'*')<> 1 then
-  error('> : arguments have incompatible dimensions')
-end
-M('entries')=s>M('entries')
+    //s>M
+    if size(s,'*')<> 1 then
+        error(msprintf(_("%s: Wrong type for input argument #%d: A scalar expected.\n"),"%s_2_hm",1));
+    end
+    M('entries')=s>M('entries')
 endfunction
index fcf4057..18d69d6 100644 (file)
@@ -8,9 +8,9 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function M=%s_3_hm(s,M)
 
-//s<=M
-if size(s,'*')<> 1 then
-  error('<= : arguments have incompatible dimensions')
-end
-M('entries')=s<=M('entries')
+    //s<=M
+    if size(s,'*')<> 1 then
+        error(msprintf(_("%s: Wrong type for input argument #%d: A scalar expected.\n"),"%s_3_hm",1));
+    end
+    M('entries')=s<=M('entries')
 endfunction
index b5be190..47b1241 100644 (file)
@@ -8,9 +8,9 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function M=%s_4_hm(s,M)
 
-//s>=M
-if size(s,'*')<> 1 then
-  error('>= : arguments have incompatible dimensions')
-end
-M('entries')=s>=M('entries')
+    //s>=M
+    if size(s,'*')<> 1 then
+        error(msprintf(_("%s: Wrong type for input argument #%d: A scalar expected.\n"),"%s_4_hm",1));
+    end
+    M('entries')=s>=M('entries')
 endfunction
index 617ff50..145297e 100644 (file)
@@ -7,18 +7,18 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function r=%s_b_i(varargin)
-//a:b where a is double and b int
-//a:b:c where a is double,  b int and c every type
-  if round(varargin(1))<>varargin(1) then 
-    error('Colon operands should have integer values")
-  end
-  if size(varargin)==2 then //a:b
-    it=inttype(varargin(2))
-    r=iconvert(varargin(1),it):varargin(2)
-  else
-    it=inttype(varargin(2))
-    r=iconvert(varargin(1),it):varargin(2):iconvert(varargin(3),it)
-  end
+    //a:b where a is double and b int
+    //a:b:c where a is double,  b int and c every type
+    if round(varargin(1))<>varargin(1) then 
+        error(msprintf(_("%s: Wrong type for input argument #%d: integer values expected.\n"),"%s_b_i",1));
+    end
+    if size(varargin)==2 then //a:b
+        it=inttype(varargin(2))
+        r=iconvert(varargin(1),it):varargin(2)
+    else
+        it=inttype(varargin(2))
+        r=iconvert(varargin(1),it):varargin(2):iconvert(varargin(3),it)
+    end
 endfunction
-  
+
 
index f2fb50b..e14bfba 100644 (file)
@@ -7,17 +7,17 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 function r=%s_b_s(varargin)
-  //a:b:c where a and b are double
-  if round(varargin(1))<>varargin(1)|round(varargin(2))<>varargin(2) then 
-    error('Colon operands should have integer values")
-  end
-  select type(varargin(3))
-  case 8 then
-    it=inttype(varargin(3))
-    r=iconvert(varargin(1),it):iconvert(varargin(2),it):varargin(3)
-  else
-    error('Not yet implemented')
-  end
+    //a:b:c where a and b are double
+    if round(varargin(1))<>varargin(1)|round(varargin(2))<>varargin(2) then 
+        error(msprintf(_("%s: Wrong type for input argument #%d and #%d: integer values expected.\n"),"%s_b_s",1,2));
+    end
+    select type(varargin(3))
+    case 8 then
+        it=inttype(varargin(3))
+        r=iconvert(varargin(1),it):iconvert(varargin(2),it):varargin(3)
+    else
+        error(msprintf(_("%s: Not yet implemented.\n"),"%s_b_s"));
+    end
 endfunction
-  
+
 
index ab1fc18..9902691 100644 (file)
 
 function M=%s_i_s(varargin)
 
-//insertion of a matrix in an hypermatrix
-  [lhs,rhs]=argn(0)
-  M=varargin(rhs)
-  N=varargin(rhs-1)//inserted matrix
+    //insertion of a matrix in an hypermatrix
+    [lhs,rhs]=argn(0)
+    M=varargin(rhs)
+    N=varargin(rhs-1)//inserted matrix
 
-  index=varargin(1) //
-  if rhs==3 then
-    //result will be a cell a struct
-    if type(index)==10 then //M.x=N or M.entries=N
-      M=struct()
-      M(index)=N
-      if index=="entries" then //M.entries=N
+    index=varargin(1) //
+    if rhs==3 then
+        //result will be a cell a struct
+        if type(index)==10 then //M.x=N or M.entries=N
+            M=struct()
+            M(index)=N
+            if index=="entries" then //M.entries=N
 
-        // change struct to cell
-        f=getfield(1,M);f(1)="ce"
-        setfield(1,f,M)
-      end
-      return
-    elseif type(index)==15 then
-      //M(i).x=N or M(i,j,..).x=N or M.x(i,j,..)or M(i,j..)
-      //check for a name in the index list
-      isstr=%f; for ii=index,if type(ii)==10 then  isstr=%t,break,end,end
-      if isstr then
-        M=createstruct(index,N)
-        if type(index(1))<>10 & index(2)=="entries" then
-          // change struct to cell
-          f=getfield(1,M);f(1)="ce"
-          setfield(1,f,M)
+                // change struct to cell
+                f=getfield(1,M);f(1)="ce"
+                setfield(1,f,M)
+            end
+            return
+        elseif type(index)==15 then
+            //M(i).x=N or M(i,j,..).x=N or M.x(i,j,..)or M(i,j..)
+            //check for a name in the index list
+            isstr=%f; for ii=index,if type(ii)==10 then  isstr=%t,break,end,end
+            if isstr then
+                M=createstruct(index,N)
+                if type(index(1))<>10 & index(2)=="entries" then
+                    // change struct to cell
+                    f=getfield(1,M);f(1)="ce"
+                    setfield(1,f,M)
+                end
+            else
+                M(index(:))=N
+            end
+            return
         end
-      else
-        M(index(:))=N
-      end
-      return
     end
-  end
 
-  //X(i,j,k)=n  hypermatrix
-  dims=matrix(size(M),-1,1)
-  v=M(:)
+    //X(i,j,k)=n  hypermatrix
+    dims=matrix(size(M),-1,1)
+    v=M(:)
 
-  Ndims=rhs-2
-  nd=size(dims,'*')
-  if Ndims>nd then dims(nd+1:Ndims)=0;end
-  del=N==[];count=[]
-  dims1=[]
-  I=0;I1=0
-  iimp=0
-  for k=Ndims:-1:1
-    ik=varargin(k)//the kth subscript
-    if type(ik)==2 |type(ik)==129 then // size implicit subscript $...
-      ik=round(horner(ik,dims(k))) // explicit subscript
-      dims1(k,1)=max(max(ik),dims(k))
-    elseif type(ik)==4 then // boolean subscript
-      ik=find(ik)
-      dims1(k,1)=max(max(ik),dims(k))
-    elseif min(size(ik))<0 then // :
-      if dims(k)<>0 then
-        ik=1:dims(k)
-      else
-        iimp=iimp+1
+    Ndims=rhs-2
+    nd=size(dims,'*')
+    if Ndims>nd then dims(nd+1:Ndims)=0;end
+    del=N==[];count=[]
+    dims1=[]
+    I=0;I1=0
+    iimp=0
+    for k=Ndims:-1:1
+        ik=varargin(k)//the kth subscript
+        if type(ik)==2 |type(ik)==129 then // size implicit subscript $...
+            ik=round(horner(ik,dims(k))) // explicit subscript
+            dims1(k,1)=max(max(ik),dims(k))
+        elseif type(ik)==4 then // boolean subscript
+            ik=find(ik)
+            dims1(k,1)=max(max(ik),dims(k))
+        elseif min(size(ik))<0 then // :
+            if dims(k)<>0 then
+                ik=1:dims(k)
+            else
+                iimp=iimp+1
 
-        if iimp<=size(size(N),'*') then
+                if iimp<=size(size(N),'*') then
 
-          if iimp==1 then
-            single=%t
-            for kk=1:k-1
-              if size(varargin(kk),1)==-1|size(varargin(kk),'*')>1 then
-                single=%f
-                break
-              end
+                    if iimp==1 then
+                        single=%t
+                        for kk=1:k-1
+                            if size(varargin(kk),1)==-1|size(varargin(kk),'*')>1 then
+                                single=%f
+                                break
+                            end
+                        end
+                        if single then
+                            ik=1:size(N,'*'),
+                        else
+                            ik=1:size(N,size(size(N),'*')+1-iimp)
+                        end
+                    else
+                        ik=1:size(N,size(size(N),'*')+1-iimp)
+                    end
+                else
+                    ik=1
+                end
+            end
+            dims1(k,1)=max(max(ik),dims(k))
+            if k==Ndims then
+                if k<nd then
+                    ik=1:prod(dims(k:$))
+                    dims1(k:nd,1)=dims(k:nd)
+                end
             end
-            if single then
-              ik=1:size(N,'*'),
+        else //floating point subscript
+            ik=round(ik)
+            dims1(k,1)=max(max(ik),dims(k))
+        end
+
+
+        if size(ik,'*')>1 then
+            ik=ik(:)
+            if size(I,'*')>1 then
+                I=(dims1(k)*I).*.ones(ik)+ones(I).*.(ik-1)
             else
-              ik=1:size(N,size(size(N),'*')+1-iimp)
+                I=dims1(k)*I+ik-1
             end
-          else
-            ik=1:size(N,size(size(N),'*')+1-iimp)
-          end
         else
-          ik=1
+            I=dims1(k)*I+ik-1
         end
-      end
-      dims1(k,1)=max(max(ik),dims(k))
-      if k==Ndims then
-        if k<nd then
-          ik=1:prod(dims(k:$))
-          dims1(k:nd,1)=dims(k:nd)
+        if del then
+            if or(ik<>(1:dims1(k))') then
+                count=[count k]
+                nk=size(ik,'*')
+            end
         end
-      end
-    else //floating point subscript
-      ik=round(ik)
-      dims1(k,1)=max(max(ik),dims(k))
-    end
+    end //end of the loop on subscripts
 
-
-    if size(ik,'*')>1 then
-      ik=ik(:)
-      if size(I,'*')>1 then
-        I=(dims1(k)*I).*.ones(ik)+ones(I).*.(ik-1)
-      else
-        I=dims1(k)*I+ik-1
-      end
-    else
-      I=dims1(k)*I+ik-1
+    if ~del&or(dims1>dims) then
+        I1=0
+        for k=size(dims1,'*'):-1:1
+            ik1=(1:dims(k))'
+            if ik1<>[] then
+                if dims1(k)>1 then
+                    if size(I1,'*')>1 then
+                        I1=(dims1(k)*I1).*.ones(ik1)+ones(I1).*.(ik1-1)
+                    else
+                        I1=dims1(k)*I1+ik1-1
+                    end
+                else
+                    I1=dims1(k)*I1+ik1-1
+                end
+            end
+        end
+        v1=zeros(prod(dims1),1)
+        v1(I1+1)=v;v=v1
     end
+    v(I+1)=matrix(N,-1,1)
     if del then
-      if or(ik<>(1:dims1(k))') then
-        count=[count k]
-        nk=size(ik,'*')
-      end
-    end
-  end //end of the loop on subscripts
-
-  if ~del&or(dims1>dims) then
-    I1=0
-    for k=size(dims1,'*'):-1:1
-      ik1=(1:dims(k))'
-      if ik1<>[] then
-        if dims1(k)>1 then
-          if size(I1,'*')>1 then
-            I1=(dims1(k)*I1).*.ones(ik1)+ones(I1).*.(ik1-1)
-          else
-            I1=dims1(k)*I1+ik1-1
-          end
-        else
-          I1=dims1(k)*I1+ik1-1
+        if size(count,'*')>1 then
+            error(msprintf(_("%s: A null assignment can have only one non-colon index.\n"),"%s_i_s"));
         end
-      end
-    end
-    v1=zeros(prod(dims1),1)
-    v1(I1+1)=v;v=v1
-  end
-  v(I+1)=matrix(N,-1,1)
-  if del then
-    if size(count,'*')>1 then
-      error('A null assignment can have only one non-colon index')
+        dims1(count)=dims1(count)-nk
     end
-    dims1(count)=dims1(count)-nk
-  end
 
-  while  dims1($)==1 then dims1($)=[],end
-  select size(dims1,'*')
-  case 0
-    M=v
-  case 1
-    M=v
-  case 2
-    M=matrix(v,dims1(1),dims1(2))
-  else
-    M=mlist(['hm','dims','entries'],int32(matrix(dims1,1,-1)),v)
-  end
+    while  dims1($)==1 then dims1($)=[],end
+    select size(dims1,'*')
+    case 0
+        M=v
+    case 1
+        M=v
+    case 2
+        M=matrix(v,dims1(1),dims1(2))
+    else
+        M=mlist(['hm','dims','entries'],int32(matrix(dims1,1,-1)),v)
+    end
 endfunction
index 587198c..1bb4001 100644 (file)
@@ -30,7 +30,7 @@ function out=%s_i_st(varargin)
       for k=Ndims+1:nindex
         i=varargin(k)
         if size(i,'*')>1|(i<>1&i<>eye()) then
-          error(_("A null assignment can have only one non-colon index"))
+          error(msprintf(_("%s: A null assignment can have only one non-colon index.\n"),"%s_i_st"));
         end
       end
       nindex=Ndims
@@ -63,7 +63,7 @@ function out=%s_i_st(varargin)
           cj=ind 
           loc=k,
         else
-          error(_("A null assignment can have only one non-colon index"))
+          error(msprintf(_("%s: A null assignment can have only one non-colon index.\n"),"%s_i_st"));
         end
       end
     end
@@ -90,6 +90,6 @@ function out=%s_i_st(varargin)
     out=varargin(3);
     out=generic_i_st(i,in,out)
   else
-    error("Not yet implemented")
+    error(msprintf(_("%s: Not yet implemented.\n"),"%s_i_st"));
   end
 endfunction
index 69b7f8e..075b12d 100644 (file)
@@ -8,63 +8,63 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function x=%s_pow(a,p)
-//   g_pow - A^p special cases
-//%CALLING SEQUENCE
-//   X=g_pow(A,p)
-//%PARAMETERS
-//   A   : constant or square hermitian or diagonalizable matrix
-//   X   : square matrix
-//   p   : square matrix or scalar
-//%DESCRIPTION
-//This function is called by the operation ^ to compute A^p in special cases
-// - A scalar and p square matrix
-// - A square matrix p is not an integer
-//!
-[m,n]=size(a)
-[mp,np]=size(p)
-if m*n==1&mp==np then  //a^P
-  flag=or(p<>p')
-  r=and(imag(p)==0)&imag(a)==0
-  if ~flag then 
-    //Hermitian matrix
-    [u,s]=schur(p);
-    w=a.^diag(s);
-    x=u*diag(a.^diag(s))*u';
-    if r then
-      x=real(x)
+    //   g_pow - A^p special cases
+    //%CALLING SEQUENCE
+    //   X=g_pow(A,p)
+    //%PARAMETERS
+    //   A   : constant or square hermitian or diagonalizable matrix
+    //   X   : square matrix
+    //   p   : square matrix or scalar
+    //%DESCRIPTION
+    //This function is called by the operation ^ to compute A^p in special cases
+    // - A scalar and p square matrix
+    // - A square matrix p is not an integer
+    //!
+    [m,n]=size(a)
+    [mp,np]=size(p)
+    if m*n==1&mp==np then  //a^P
+        flag=or(p<>p')
+        r=and(imag(p)==0)&imag(a)==0
+        if ~flag then 
+            //Hermitian matrix
+            [u,s]=schur(p);
+            w=a.^diag(s);
+            x=u*diag(a.^diag(s))*u';
+            if r then
+                x=real(x)
+            end
+        else
+            [s,u,bs]=bdiag(p+0*%i);
+            if max(bs)>1 then
+                error(msprintf(_("%s: unable to diagonalize!"),"%s_pow"));
+            end
+            w=diag(s);
+            x=u*diag(a.^diag(s))*inv(u);
+        end
+        if r then x=real(x), end
+    elseif m==n&mp*np==1 then  //A^p  p non integer
+        flag=or(a<>a')
+        if ~flag then 
+            //Hermitian matrix
+            r=and(imag(a)==0)
+            [u,s]=schur(a);
+            x=u*diag(diag(s).^p)*u';
+            if r then
+                if s>=0&imag(p)==0 then
+                    x=real(x)
+                end
+            end
+        else
+            //General matrix
+            r=and(imag(a)==0)
+            [s,u,bs]=bdiag(a+0*%i);
+            if max(bs)>1 then
+                error(msprintf(_("%s: unable to diagonalize!"),"%s_pow"));
+            end
+            x=u*diag(diag(s).^p)*inv(u);
+        end
+        if int(p)==p&r then x=real(x),end
+    else
+        error(43)
     end
-  else
-    [s,u,bs]=bdiag(p+0*%i);
-    if max(bs)>1 then
-      error('g_pow: unable to diagonalize!');
-    end
-    w=diag(s);
-    x=u*diag(a.^diag(s))*inv(u);
-  end
-  if r then x=real(x), end
-elseif m==n&mp*np==1 then  //A^p  p non integer
-  flag=or(a<>a')
-  if ~flag then 
-    //Hermitian matrix
-    r=and(imag(a)==0)
-    [u,s]=schur(a);
-    x=u*diag(diag(s).^p)*u';
-    if r then
-      if s>=0&imag(p)==0 then
-       x=real(x)
-      end
-    end
-  else
-    //General matrix
-    r=and(imag(a)==0)
-    [s,u,bs]=bdiag(a+0*%i);
-    if max(bs)>1 then
-      error('g_pow: unable to diagonalize!');
-    end
-    x=u*diag(diag(s).^p)*inv(u);
-  end
-  if int(p)==p&r then x=real(x),end
-else
-  error(43)
-end
 endfunction
index 00e3842..b8aad0c 100644 (file)
@@ -9,9 +9,9 @@
 
 function M2=%s_q_hm(M1,M2)
 
-if size(M1,'*')<>1 then
-  error('inconsistent element-wise operation')
-else
-  M2('entries')=M1.\M2('entries')
-end
+    if size(M1,'*')<>1 then
+        error(msprintf(_("%s: Wrong size for input argument #%d.\n"),"%s_q_hm",1));
+    else
+        M2('entries')=M1.\M2('entries')
+    end
 endfunction
index 05ae860..652f24d 100644 (file)
@@ -8,15 +8,15 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function h=%s_v_r(h1,h2)
-// %s_v_r(h1,h2) = (I+h1*h2)\h1. h1 constant h2 rational
-//!
+    // %s_v_r(h1,h2) = (I+h1*h2)\h1. h1 constant h2 rational
+    //!
 
-[m1,n1]=size(h1)
-[m2,n2]=size(h2('num'))
-if abs(n1-m2)+abs(m1-n2)<>0 then error('inconsistent dimensions'),end
-if m1*n1==1 then
-  h=h2;h('num')=h1*h2('den');h('den')=h1*h2('num')+h2('den');
-else
-  h=(eye(m1,m1)+h1*h2)\h1
-end
+    [m1,n1]=size(h1)
+    [m2,n2]=size(h2('num'))
+    if abs(n1-m2)+abs(m1-n2)<>0 then error(msprintf(_("%s: Wrong size for input argument(s).\n'),"%s_v_r")),end
+    if m1*n1==1 then
+        h=h2;h('num')=h1*h2('den');h('den')=h1*h2('num')+h2('den');
+    else
+        h=(eye(m1,m1)+h1*h2)\h1
+    end
 endfunction
index 6bc546b..6960c7c 100644 (file)
@@ -8,10 +8,10 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function [h]=%s_v_s(h1,h2)
-// %s_v_s(h1,h2)  <=> h =(I+h1*h2)\h1 <=> h=h1/.h2
+    // %s_v_s(h1,h2)  <=> h =(I+h1*h2)\h1 <=> h=h1/.h2
 
-[m1,n1]=size(h1)
-[m2,n2]=size(h2)
-if abs(n1-m2)+abs(m1-n2)<>0 then error('inconsistent dimensions'),end
-h=(eye(m1,m1)+h1*h2)\h1
+    [m1,n1]=size(h1)
+    [m2,n2]=size(h2)
+    if abs(n1-m2)+abs(m1-n2)<>0 then error(msprintf(_("%s: Wrong size for input argument(s).\n'),"%s_v_s")),end
+    h=(eye(m1,m1)+h1*h2)\h1
 endfunction
index 7cdd3bf..b543b82 100644 (file)
@@ -9,9 +9,9 @@
 
 function M2=%s_x_hm(M1,M2)
 
-if size(M1,'*')<>1 then
-  error('inconsistent element-wise operation')
-else
-  M2('entries')=M1.*M2('entries')
-end
+    if size(M1,'*')<>1 then
+        error(msprintf(_("%s: Wrong size for input argument #%d.\n"),"%s_x_hm",1));
+    else
+        M2('entries')=M1.*M2('entries')
+    end
 endfunction
index 4968901..70dba57 100644 (file)
@@ -8,37 +8,37 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function M=%sp_i_s(varargin)
-// %sp_i_s(i,j,b,a) insert sparse matrix b into full matrix a
-// M(i,j)=b
-//!
+    // %sp_i_s(i,j,b,a) insert sparse matrix b into full matrix a
+    // M(i,j)=b
+    //!
 
-  [lhs,rhs]=argn(0)
+    [lhs,rhs]=argn(0)
 
-  M=varargin(rhs)
-  N=varargin(rhs-1)//inserted matrix
-  index=varargin(1) //
+    M=varargin(rhs)
+    N=varargin(rhs-1)//inserted matrix
+    index=varargin(1) //
 
-  if rhs==3&(type(index)==10|type(index)==15) then
-    M=createstruct(index,N)
-    if type(index(1))<>10 & index(2)=="entries" then
-      // change struct to cell
-      f=getfield(1,M);f(1)="ce"
-      setfield(1,f,M)
-    end
-  elseif rhs>4 then //more than 2 indices: 
-    
-    //insertion of a sparse matrix in a matrix of numbers
-    error('Insertion of a sparse matrix in a matrix of numbers is not defined')
-  else
-    i=varargin(1);
-    j=varargin(2);
-    M=varargin(4);
-    b=varargin(3);
-    if rhs==4 then
-      M(i,j)=full(b)
+    if rhs==3&(type(index)==10|type(index)==15) then
+        M=createstruct(index,N)
+        if type(index(1))<>10 & index(2)=="entries" then
+            // change struct to cell
+            f=getfield(1,M);f(1)="ce"
+            setfield(1,f,M)
+        end
+    elseif rhs>4 then //more than 2 indices: 
+
+        //insertion of a sparse matrix in a matrix of numbers
+        error(msprintf(_("%s: Insertion of a sparse matrix in a matrix of numbers is not defined.\n"),"sp_i_s"));
     else
-      M=b;//b=j
-      M(i)=full(j)
+        i=varargin(1);
+        j=varargin(2);
+        M=varargin(4);
+        b=varargin(3);
+        if rhs==4 then
+            M(i,j)=full(b)
+        else
+            M=b;//b=j
+            M(i)=full(j)
+        end
     end
-  end
 endfunction
index fd36a52..0387904 100644 (file)
@@ -9,28 +9,28 @@
 
 function a=%sp_i_sp(i,j,b,a)
 
-[lhs,rhs]=argn(0)
-if rhs==3 then
-  a=b;
-  b=j;
-  [m,n]=size(a)
-  a=a(:)
-  a(i)=b(:)
-  a=matrix(a,m,n)
-elseif rhs == 4 then
-      // bruno (feb 20 2006) add the following cases not taken 
-      // into account by the interface spops :
-   if size(b,1) == 1 & size(b,2) == 1 then
-      //   A(i,j) = B with B a 1x1 sparse matrix
-      a(i,j) = full(b)
-   elseif i == : & j == : then
-      //   A(:,:) = B with mA x nA = mB x nB but mA ~= mB
-      //   B is reshaped with the sizes of A
-      [m,n] = size(a)
-      a = matrix(b,m,n)
-   else
-      // print an error 
-      error(" sparse insertion case not treated")
-   end
-end
+    [lhs,rhs]=argn(0)
+    if rhs==3 then
+        a=b;
+        b=j;
+        [m,n]=size(a)
+        a=a(:)
+        a(i)=b(:)
+        a=matrix(a,m,n)
+    elseif rhs == 4 then
+        // bruno (feb 20 2006) add the following cases not taken 
+        // into account by the interface spops :
+        if size(b,1) == 1 & size(b,2) == 1 then
+            //   A(i,j) = B with B a 1x1 sparse matrix
+            a(i,j) = full(b)
+        elseif i == : & j == : then
+            //   A(:,:) = B with mA x nA = mB x nB but mA ~= mB
+            //   B is reshaped with the sizes of A
+            [m,n] = size(a)
+            a = matrix(b,m,n)
+        else
+            // print an error 
+            error(msprintf(_("%s: Sparse insertion case not treated.\n"),"%sp_i_sp"));
+        end
+    end
 endfunction
index cabeec4..85a40ac 100644 (file)
@@ -8,40 +8,40 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function B=%sp_p_s(A,p)
-   // handle A^p for scalar integer p only
+    // handle A^p for scalar integer p only
+
+    if length(p) ~= 1 then
+        error(msprintf(_("%s: Wrong type for input argument #%d: A scalar expected.\n"),"%sp_p_s",2));
+    end
+    if floor(p) ~= p then
+        error(msprintf(_("%s: Wrong type for input argument #%d: An integer expected.\n"),"%sp_p_s",2));
+    end
+    if p == 0 then
+        B = speye(A)
+        return
+    elseif p < 0 then
+        A = inv(A)
+        p = -p
+    end
+
+    select p
+    case 1
+        B = A
+    case 2
+        B = A*A
+    case 3
+        B = A*(A*A)
+    case 4
+        B = A*A
+        B = B*B
+    else
+        B = A
+        for i=2:p   // slow method (we could use the power algorithm)
+            B = A*B
+        end
+    end
 
-   if length(p) ~= 1 then
-      error("A^p with A sparse is not handled for non scalar p")
-   end
-   if floor(p) ~= p then
-      error("A^p with A sparse is not handled for non integer p")
-   end
-   if p == 0 then
-      B = speye(A)
-      return
-   elseif p < 0 then
-      A = inv(A)
-      p = -p
-   end
-   
-   select p
-     case 1
-       B = A
-     case 2
-       B = A*A
-     case 3
-       B = A*(A*A)
-     case 4
-       B = A*A
-       B = B*B
-   else
-      B = A
-      for i=2:p   // slow method (we could use the power algorithm)
-        B = A*B
-      end
-   end
-   
 endfunction
 
-  
-      
+
+
index 3368c61..39c96ab 100644 (file)
@@ -9,27 +9,27 @@
 
 function R=%st_c_st(M1,M2)
 
-  d1=M1.dims;
-  d2=M2.dims;
-  if size(d1,'*')<>size(d2,'*') then
-    error('In concatenation the number of dimensions for each component must match');
-  end
-  F=getfield(1,M1)
-  if or(F<>getfield(1,M2)) then
-    error('field names mismatch')
-  end
-  kd=find(d1<>d2)
+    d1=M1.dims;
+    d2=M2.dims;
+    if size(d1,'*')<>size(d2,'*') then
+        error(msprintf(_("%s: In concatenation the number of dimensions for each component must match.\n"),"%st_c_st"));
+    end
+    F=getfield(1,M1)
+    if or(F<>getfield(1,M2)) then
+        error(msprintf(_("%s: Field names mismatch.\n"),"%st_c_st"));
+    end
+    kd=find(d1<>d2)
 
-  kd(find(kd==2))=[]
+    kd(find(kd==2))=[]
 
-  if kd<>[] then
-    error('inconsistent dimensions')
-  end
-  newdim=d1;newdim(2)=d1(2)+d2(2)
-  R=mlist(F,newdim)
-  for k=3:size(F,'*') //loop on fields
-    x1=getfield(k,M1),if type(x1)<>15 then x1=list(x1),end
-    x2=getfield(k,M2),if type(x2)<>15 then x2=list(x2),end
-    setfield(k,lstcat(x1,x2),R)
-  end
+    if kd<>[] then
+        error(msprintf(_("%s: Inconsistent dimensions.\n"),"%st_c_st"));
+    end
+    newdim=d1;newdim(2)=d1(2)+d2(2)
+    R=mlist(F,newdim)
+    for k=3:size(F,'*') //loop on fields
+        x1=getfield(k,M1),if type(x1)<>15 then x1=list(x1),end
+        x2=getfield(k,M2),if type(x2)<>15 then x2=list(x2),end
+        setfield(k,lstcat(x1,x2),R)
+    end
 endfunction
index 564a73e..80e9af8 100644 (file)
@@ -8,95 +8,95 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function s=%st_e(varargin)
-//extraction from struct
-  w=varargin($);
-  if type(varargin(1))==15  //x(i,j,k).f or x.f(i,j,k)
-    index=varargin($-1);
-    if type(index($))==10 then  //x(i,j,k).f
-      f=index($);
-      //ijk=list2vec(index(1));
-      [indx,I]=convertindex(double(w.dims),index(1)(:));
-      // I<->ijk
-      all_fields=getfield(1,w);all_fields=all_fields(3:$);
-      fieldnum=find(f==all_fields);
-      if fieldnum==[] then error(gettext("Invalid field name.")); end
-      good_list=getfield(2+fieldnum,w);
-      if size(I,'*')==1 then
-       s=good_list(I)  //list(good_list(I)) ?
-      else
-       s=list();
-       for kk=1:size(I,"*") 
-         s(kk)=good_list(I(kk));end
-      end
-      return;
-    else //x.f(i,j,k)
-      f=index(1);
-      li=w(f);
-      [indx,I]=convertindex(double(w.dims),index($)(:));
-      s=li(I);
-      return;
+    //extraction from struct
+    w=varargin($);
+    if type(varargin(1))==15  //x(i,j,k).f or x.f(i,j,k)
+        index=varargin($-1);
+        if type(index($))==10 then  //x(i,j,k).f
+            f=index($);
+            //ijk=list2vec(index(1));
+            [indx,I]=convertindex(double(w.dims),index(1)(:));
+            // I<->ijk
+            all_fields=getfield(1,w);all_fields=all_fields(3:$);
+            fieldnum=find(f==all_fields);
+            if fieldnum==[] then error(msprintf(gettext("%s: Invalid field name.\n"),"%st_e")); end
+            good_list=getfield(2+fieldnum,w);
+            if size(I,'*')==1 then
+                s=good_list(I)  //list(good_list(I)) ?
+            else
+                s=list();
+                for kk=1:size(I,"*") 
+                s(kk)=good_list(I(kk));end
+            end
+            return;
+        else //x.f(i,j,k)
+            f=index(1);
+            li=w(f);
+            [indx,I]=convertindex(double(w.dims),index($)(:));
+            s=li(I);
+            return;
+        end
     end
-  end
 
-  if type(varargin(1))==10 then
-    //field  x.f
-    fields=getfield(1,w);nu=find(fields(3:$)==varargin(1));
-    if nu==[] then
-      error(msprintf(gettext("%s is not a valid field name."),varargin(1)));return;
+    if type(varargin(1))==10 then
+        //field  x.f
+        fields=getfield(1,w);nu=find(fields(3:$)==varargin(1));
+        if nu==[] then
+            error(msprintf(gettext("%s: Wrong value for input argument #%d: not a valid field name.\n"),"%st_e",1));return;
+        end
+        s=getfield(nu+2,w);
+        if prod(getfield(2,w))==1 then s=s(1);end
+        return; 
     end
-    s=getfield(nu+2,w);
-    if prod(getfield(2,w))==1 then s=s(1);end
-    return; 
-  end
-  
-  //substruct x(i,j,k...)
-  nind=size(varargin)-1
-  
-  dims1=double(w.dims)
-  if nind<size(dims1,'*') then
-    //reduce the dimension according to the number of indexes
-    dims1=[dims1(1:nind-1) prod(dims1(nind:$))]
-    if size(dims1,'*')==1 then dims1=[dims1 1],end
-  end
-  //get the "linear" vector of indexes
-  [indx,I]=convertindex(dims1,varargin(1:$-1)); 
-  dims=zeros(1,nind)
-  
-  //computing dimensions of the result
-  //following loop should be merged in the convertindex code
-  for kk=1:nind
-    ik=varargin(kk)
-    
-    if or(type(ik)==[2 129]) then
-      ik=horner(ik,dims1(kk))
+
+    //substruct x(i,j,k...)
+    nind=size(varargin)-1
+
+    dims1=double(w.dims)
+    if nind<size(dims1,'*') then
+        //reduce the dimension according to the number of indexes
+        dims1=[dims1(1:nind-1) prod(dims1(nind:$))]
+        if size(dims1,'*')==1 then dims1=[dims1 1],end
+    end
+    //get the "linear" vector of indexes
+    [indx,I]=convertindex(dims1,varargin(1:$-1)); 
+    dims=zeros(1,nind)
+
+    //computing dimensions of the result
+    //following loop should be merged in the convertindex code
+    for kk=1:nind
+        ik=varargin(kk)
+
+        if or(type(ik)==[2 129]) then
+            ik=horner(ik,dims1(kk))
+        end
+        if type(ik)==4 then
+            dims(kk)=max(find(ik))
+        elseif size(ik,1)~=-1 then 
+            dims(kk)=size(ik,'*')
+        else 
+            dims(kk)=dims1(kk)
+        end
     end
-    if type(ik)==4 then
-       dims(kk)=max(find(ik))
-    elseif size(ik,1)~=-1 then 
-      dims(kk)=size(ik,'*')
+
+    while  dims<>[]&dims($)==1 then dims($)=[],end
+    select size(dims,'*')
+    case 0 then
+        dims=[1,1]
+    case 1 then
+        dims=[dims,1]
     else 
-      dims(kk)=dims1(kk)
+        dims=matrix(dims,1,-1)
     end
-  end
-  
-  while  dims<>[]&dims($)==1 then dims($)=[],end
-  select size(dims,'*')
-  case 0 then
-    dims=[1,1]
-  case 1 then
-    dims=[dims,1]
-  else 
-    dims=matrix(dims,1,-1)
-  end
-  s=mlist(getfield(1,w),int32(dims));
-  //s=mlist(getfield(1,w),int32(indx));
-  sz=size(getfield(1,w),'*');
-  for k=3:sz
-    ww=getfield(k,w);
-    if type(ww)~=15 then ww=list(ww);end
-    //S(2,3).f1=12  -> k=3;I=6;ww(I)=12;s=mlist(["st","dims","f1"],int32([1;1]));
-    if prod(dims)==1
-      setfield(k,ww(I),s); else setfield(k,list(ww(I)),s);
+    s=mlist(getfield(1,w),int32(dims));
+    //s=mlist(getfield(1,w),int32(indx));
+    sz=size(getfield(1,w),'*');
+    for k=3:sz
+        ww=getfield(k,w);
+        if type(ww)~=15 then ww=list(ww);end
+        //S(2,3).f1=12  -> k=3;I=6;ww(I)=12;s=mlist(["st","dims","f1"],int32([1;1]));
+        if prod(dims)==1
+        setfield(k,ww(I),s); else setfield(k,list(ww(I)),s);
+        end
     end
-  end
 endfunction
index 3536f41..e96e427 100644 (file)
@@ -9,30 +9,30 @@
 
 function varargout=%st_size(M,job)
 
-// returns dimensions of an hyper matrix
-[lhs,rhs]=argn(0)
-dims=matrix(double(M.dims),1,-1)
-if rhs==2 then
-  if job=='*' then
-    varargout(1)=prod(dims)
-    return
-  elseif type(job)==1 then
-    if size(job,'*') >1 then error('Second argument is incorrect');end
-    if job<=0|job>size(dims,'*') then 
-      error('Second argument is incorrect'); 
+    // returns dimensions of an hyper matrix
+    [lhs,rhs]=argn(0)
+    dims=matrix(double(M.dims),1,-1)
+    if rhs==2 then
+        if job=='*' then
+            varargout(1)=prod(dims)
+            return
+        elseif type(job)==1 then
+            if size(job,'*') >1 then error(msprintf(_("%s: Wrong size for input argument #%d.\n"),"%st_size",2));end
+            if job<=0|job>size(dims,'*') then 
+                error(msprintf(_("%s: Wrong size or value for input argument #%d.\n"),"%st_size",2));
+            end
+            varargout(1)=dims(job)
+        else
+            error(msprintf(_("%s: Wrong value for input argument #%d.\n"),"%st_size",2))
+        end
+        return
+    end
+    if lhs==1 then
+        varargout(1)=matrix(dims,1,-1)
+    else
+        if lhs>size(dims,'*') then error(msprintf(_("%s: Wrong number of output arguments.\n"),"%st_size")),end
+        for k=1:lhs
+            varargout(k)=dims(k)
+        end
     end
-    varargout(1)=dims(job)
-  else
-    error('Second argument is incorrect')
-  end
-  return
-end
-if lhs==1 then
-  varargout(1)=matrix(dims,1,-1)
-else
-  if lhs>size(dims,'*') then error('Too many LHS args'),end
-  for k=1:lhs
-    varargout(k)=dims(k)
-  end
-end
 endfunction
index 055f2b4..5214e25 100644 (file)
@@ -9,15 +9,15 @@
 
 function R=%st_t(M)
 
-  D=double(M.dims)
-  if size(D,'*')>2 then
-    error('Transpose not defined')
-  end
-  NewInd=matrix(matrix(1:prod(D),D)',1,-1)
-  F=getfield(1,M)
-  R=mlist(F,int32([D(2) D(1)]))
-  for k=3:size(F,'*')
-    v=getfield(k,M)
-    setfield(k,list(v(NewInd)),R)
-  end
+    D=double(M.dims)
+    if size(D,'*')>2 then
+        error(msprintf(_("%s: Wrong size for input argument #%d: Transpose can not be defined.\n"),"%st_t",1));
+    end
+    NewInd=matrix(matrix(1:prod(D),D)',1,-1)
+    F=getfield(1,M)
+    R=mlist(F,int32([D(2) D(1)]))
+    for k=3:size(F,'*')
+        v=getfield(k,M)
+        setfield(k,list(v(NewInd)),R)
+    end
 endfunction
index f8f7d24..58e25e1 100644 (file)
@@ -8,37 +8,37 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function h=%ticks_i_h(i,v,h)
- if type(i)==10 then
-    set(h,i,v)
- elseif type(i)==15 then
-    hdl=h
-    p=i($)
-    if type(p)==1|type(p)==4|type(p)==2|type(p)==129|type(p)==15 then
-      index=i($)
-      i($)=null()
+    if type(i)==10 then
+        set(h,i,v)
+    elseif type(i)==15 then
+        hdl=h
+        p=i($)
+        if type(p)==1|type(p)==4|type(p)==2|type(p)==129|type(p)==15 then
+            index=i($)
+            i($)=null()
+        else
+            index=:
+        end
+        n=lstsize(i)
+        for k=1:n-1
+            p=i(k)
+            if type(p)==10 then
+                hdl=get(hdl,p),
+            elseif type(p)==1|type(p)==4|type(p)==2|type(p)==129 then
+                hdl=hdl(p)
+            elseif type(p)==15 then
+                hdl=hdl(p(:))
+            else
+                error(msprintf(_("%s: Invalid path.\n"),"%ticks_i_h"));
+            end
+        end
+        if type(index)==15 then
+            hdl=hdl(index(:))
+        else
+            hdl=hdl(index)
+        end
+        set(hdl,i($),v)
     else
-      index=:
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%ticks_i_h",1));
     end
-    n=lstsize(i)
-    for k=1:n-1
-      p=i(k)
-      if type(p)==10 then
-       hdl=get(hdl,p),
-      elseif type(p)==1|type(p)==4|type(p)==2|type(p)==129 then
-       hdl=hdl(p)
-      elseif type(p)==15 then
-       hdl=hdl(p(:))
-      else
-       error('Invalid path')
-      end
-    end
-    if type(index)==15 then
-      hdl=hdl(index(:))
-    else
-      hdl=hdl(index)
-    end
-    set(hdl,i($),v)
-  else
-    error('Invalid path')
-  end
-endfunction
\ No newline at end of file
+endfunction
index ab157c3..a05437e 100644 (file)
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function  M=createstruct(index,N)
-// Create a struct with field pointed by index equal to N
+    // Create a struct with field pointed by index equal to N
 
-// If index is not a list, creation is done by routines
-  if type(index)==15 then
-    
-    // When only two indexes
-    if size(index)==2 then
-      
-      // Second index is a fieldname
-      if type(index(2))==10 then
-       
-       // First index is a numerical value or a vector of numerical values
-       if type(index(1))==1 then
-         // X(p).f = y  -> index=list(p,f)
-         I=index(1)
-         if mtlb_mode() then
-           Dims=[1 max(I)]
-         else
-           Dims=[max(I) 1]
-         end
-         nmax=prod(Dims);
-         if nmax==1 then
-           M=mlist(["st","dims",index(2)],int32(Dims),N);
-         else
-           M=mlist(["st","dims",index(2)],int32(Dims));
-           //initialize the structure with empty fields
-           Li=list();for kl=1:nmax, Li(kl)=[];end
-           //set fields pointed to by index(1) to N
-           for kl=1:size(I,'*'), Li(I(kl))=N;end
-           setfield(3,Li,M);
-         end
-         return;
-         // First index is a list of numerical values  
-       elseif type(index(1))==15
-         // X(p,q[,...]).f=z -> index=list(list(p,q[,...]),f)
-         I=index(1)
-         Ndims=lstsize(I) //the number of dimensions
-         
-         //compute the struct dimensions from max indices values
-         Dims=[];for kDims=1:Ndims, Dims=[Dims,max(I(kDims)) ];end
-         
-         //initialize the structure with empty fields
-         Li=list();for kl=1:prod(Dims),Li(kl)=[];end
-         
-         //set fields pointed to by I to N
-         I1=sub2ind(Dims,I(:)) // build one dimensional index equivalent to I
-         for kl=1:size(I1,'*'), Li(I1(kl))=N;end
-         
-         M=mlist(["st","dims",index(2)],int32(Dims),Li);
-         return;
-         // First index is also a fieldname    
-       else
-         // X.f.g=y -> index=list(f,g)
-         M=mlist(["st","dims",index(1)],int32([1,1]),...
-                 mlist(["st","dims",index(2)],int32([1,1]),N));
-         return;
-       end
-       
-       // Second index is a fieldname  
-      else
-       // X.f(p[,q,...])=y : index=list(f,list(p[,q,...]))  
-       
-       if typeof(N)=="st" then // When recursive call of createstruct
-         if type(index(2))==15 then // index=list(f,list(p,q[,...])) 
-           Dims=list2vec(index(2))'
-         else // index=list(f,p)
-           if mtlb_mode() then
-             Dims=[1 index(2)]
-           else
-             Dims=[index(2) 1]
-           end
-         end
-         kmax=prod(Dims)
-         z=list()
-         for kl=1:kmax
-           z(kl)=[]
-         end
-         z(kmax)=getfield(3,N)
-         z=mlist(getfield(1,N),int32(Dims),z);
-       else
-         z(index(2)(:))=N;
-       end
-       if type(index(1))<>10 then pause,end
-       M=mlist(["st","dims",index(1)],int32([1,1]),z);
-       return;
-      end
-      
-      // Any number of indexes <> 2  
-    else
-      // Last index is a fieldname -> init struct
-      if type(index($))==10 then
-       M=mlist(["st","dims",index($)],int32([1,1]),N);
-       index($)=null();
-       // Last index is a numerical value or a list of numerical values  
-      elseif type(index($))==1 | type(index($))==15 then
-       
-       // If only one index value (happens when recursive calls to createstruct)
-       if size(index)==1 then
-         if typeof(N)=="st" then
-           if type(index($))==15 then
-             Dims=list2vec(index($))'
-           else
-             if mtlb_mode() then
-               Dims=[1 index($)]
-             else
-               Dims=[index($) 1]
-             end
-           end
-           kmax=prod(Dims)
-           if kmax==1 then
-             M=N
-           else
-             z=list()
-             for kl=1:kmax
-               z(kl)=[]
-             end
-             z(kmax)=getfield(3,N)
-             M=mlist(getfield(1,N),int32(Dims),z);
-           end
-         else
-           M(index($)(:))=N;
-         end
-         index($)=null()
-         // More than one index value  
-       else
-         if typeof(N)=="st" then
-           if type(index($))==15 then
-             Dims=list2vec(index($))'
-           else
-             if mtlb_mode() then
-               Dims=[1 index($)]
-             else
-               Dims=[index($) 1]
-             end
-           end
-           kmax=prod(Dims)
-           z=list()
-           for kl=1:kmax
-             z(kl)=[]
-           end
-           z(kmax)=getfield(3,N)
-           z=mlist(getfield(1,N),int32(Dims),z);
-         else
-           z(index($)(:))=N;
-         end
-         M=mlist(["st","dims",index($-1)],int32([1,1]),z);
-         index($)=null()
-         index($)=null()
-       end
-      else
-       // This case should not happen (unknown kind of index)
-       error("Not implemented");
-      end
-      if index==list() then
-       return
-      end
-      M=createstruct(index,M);
-      return;
-    end
-  else
-    if type(index)==10 then
-      M=mlist(["st","dims",index($)],int32([1,1]),N);
+    // If index is not a list, creation is done by routines
+    if type(index)==15 then
+
+        // When only two indexes
+        if size(index)==2 then
+
+            // Second index is a fieldname
+            if type(index(2))==10 then
+
+                // First index is a numerical value or a vector of numerical values
+                if type(index(1))==1 then
+                    // X(p).f = y  -> index=list(p,f)
+                    I=index(1)
+                    if mtlb_mode() then
+                        Dims=[1 max(I)]
+                    else
+                        Dims=[max(I) 1]
+                    end
+                    nmax=prod(Dims);
+                    if nmax==1 then
+                        M=mlist(["st","dims",index(2)],int32(Dims),N);
+                    else
+                        M=mlist(["st","dims",index(2)],int32(Dims));
+                        //initialize the structure with empty fields
+                        Li=list();for kl=1:nmax, Li(kl)=[];end
+                        //set fields pointed to by index(1) to N
+                        for kl=1:size(I,'*'), Li(I(kl))=N;end
+                        setfield(3,Li,M);
+                    end
+                    return;
+                    // First index is a list of numerical values       
+                elseif type(index(1))==15
+                    // X(p,q[,...]).f=z -> index=list(list(p,q[,...]),f)
+                    I=index(1)
+                    Ndims=lstsize(I) //the number of dimensions
+
+                    //compute the struct dimensions from max indices values
+                    Dims=[];for kDims=1:Ndims, Dims=[Dims,max(I(kDims)) ];end
+
+                    //initialize the structure with empty fields
+                    Li=list();for kl=1:prod(Dims),Li(kl)=[];end
+
+                    //set fields pointed to by I to N
+                    I1=sub2ind(Dims,I(:)) // build one dimensional index equivalent to I
+                    for kl=1:size(I1,'*'), Li(I1(kl))=N;end
+
+                    M=mlist(["st","dims",index(2)],int32(Dims),Li);
+                    return;
+                    // First index is also a fieldname 
+                else
+                    // X.f.g=y -> index=list(f,g)
+                    M=mlist(["st","dims",index(1)],int32([1,1]),...
+                    mlist(["st","dims",index(2)],int32([1,1]),N));
+                    return;
+                end
+
+                // Second index is a fieldname  
+            else
+                // X.f(p[,q,...])=y : index=list(f,list(p[,q,...]))  
+
+                if typeof(N)=="st" then // When recursive call of createstruct
+                    if type(index(2))==15 then // index=list(f,list(p,q[,...])) 
+                        Dims=list2vec(index(2))'
+                    else // index=list(f,p)
+                        if mtlb_mode() then
+                            Dims=[1 index(2)]
+                        else
+                            Dims=[index(2) 1]
+                        end
+                    end
+                    kmax=prod(Dims)
+                    z=list()
+                    for kl=1:kmax
+                        z(kl)=[]
+                    end
+                    z(kmax)=getfield(3,N)
+                    z=mlist(getfield(1,N),int32(Dims),z);
+                else
+                    z(index(2)(:))=N;
+                end
+                if type(index(1))<>10 then pause,end
+                M=mlist(["st","dims",index(1)],int32([1,1]),z);
+                return;
+            end
+
+            // Any number of indexes <> 2  
+        else
+            // Last index is a fieldname -> init struct
+            if type(index($))==10 then
+                M=mlist(["st","dims",index($)],int32([1,1]),N);
+                index($)=null();
+                // Last index is a numerical value or a list of numerical values  
+            elseif type(index($))==1 | type(index($))==15 then
+
+                // If only one index value (happens when recursive calls to createstruct)
+                if size(index)==1 then
+                    if typeof(N)=="st" then
+                        if type(index($))==15 then
+                            Dims=list2vec(index($))'
+                        else
+                            if mtlb_mode() then
+                                Dims=[1 index($)]
+                            else
+                                Dims=[index($) 1]
+                            end
+                        end
+                        kmax=prod(Dims)
+                        if kmax==1 then
+                            M=N
+                        else
+                            z=list()
+                            for kl=1:kmax
+                                z(kl)=[]
+                            end
+                            z(kmax)=getfield(3,N)
+                            M=mlist(getfield(1,N),int32(Dims),z);
+                        end
+                    else
+                        M(index($)(:))=N;
+                    end
+                    index($)=null()
+                    // More than one index value       
+                else
+                    if typeof(N)=="st" then
+                        if type(index($))==15 then
+                            Dims=list2vec(index($))'
+                        else
+                            if mtlb_mode() then
+                                Dims=[1 index($)]
+                            else
+                                Dims=[index($) 1]
+                            end
+                        end
+                        kmax=prod(Dims)
+                        z=list()
+                        for kl=1:kmax
+                            z(kl)=[]
+                        end
+                        z(kmax)=getfield(3,N)
+                        z=mlist(getfield(1,N),int32(Dims),z);
+                    else
+                        z(index($)(:))=N;
+                    end
+                    M=mlist(["st","dims",index($-1)],int32([1,1]),z);
+                    index($)=null()
+                    index($)=null()
+                end
+            else
+                // This case should not happen (unknown kind of index)
+                error(msprintf(_("%s: Not implemented.\n"),"createstruct"));
+            end
+            if index==list() then
+                return
+            end
+            M=createstruct(index,M);
+            return;
+        end
     else
-      error("Not implemented");
+        if type(index)==10 then
+            M=mlist(["st","dims",index($)],int32([1,1]),N);
+        else
+            error(msprintf(_("%s: Not implemented.\n"),"createstruct"));
+        end
     end
-  end
 endfunction
index f72d5df..1481633 100644 (file)
@@ -8,6 +8,6 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function M=generic_i_ce(varargin)
-// Generic function for insertion of any type of data in a cell
-error("Invalid assignement: for insertion in cell, use e.g. x(i,j).entries=y");
+    // Generic function for insertion of any type of data in a cell
+    error(msprintf(_("%s: Invalid assignement: for insertion in cell, use e.g. x(i,j).entries=y.\n"),"generic_i_ce"));
 endfunction
index 9d9be25..d928047 100644 (file)
@@ -8,62 +8,62 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function h=generic_i_h(i,v,h)
-  hsave=h
-//  if v==[] then error('Field property cannot be []'),end
-  if type(i)==10 then set(h,i,v),return,end
-  if type(i)<>15 then  error('Invalid path'),end
+    hsave=h
+    //  if v==[] then error('Field property cannot be []'),end
+    if type(i)==10 then set(h,i,v),return,end
+    if type(i)<>15 then  error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"generic_i_h",1)),end
 
-  if and(type(i($))<>[1 2 4 8 129 15]) then
-    i($+1)=: 
-  end
-  n=lstsize(i)
-  hdl=h;hind=[]
-  for k=1:lstsize(i)// walk down in the handle tree
-    p=i(k)
-    lasthandle=hdl,
-    if type(p)==10 then
-      hdl=get(hdl,p),
-    elseif or(type(p)==[1 2 4 8 129]) then
-      hdl=hdl(p)
-    elseif type(p)==15 then
-      hdl=hdl(p(:))
-    else
-      error('Invalid path')
+    if and(type(i($))<>[1 2 4 8 129 15]) then
+        i($+1)=: 
     end
-    
-    if type(hdl)<>9 then //a leaf found
-      property=hdl
-      hdl=lasthandle
-      hind=p
-      if (k+1)==size(i) then
-       index=i($)
-      else
-       index=list(i(k+1:$))
-      end
-      break
+    n=lstsize(i)
+    hdl=h;hind=[]
+    for k=1:lstsize(i)// walk down in the handle tree
+        p=i(k)
+        lasthandle=hdl,
+        if type(p)==10 then
+            hdl=get(hdl,p),
+        elseif or(type(p)==[1 2 4 8 129]) then
+            hdl=hdl(p)
+        elseif type(p)==15 then
+            hdl=hdl(p(:))
+        else
+            error('Invalid path')
+        end
+
+        if type(hdl)<>9 then //a leaf found
+            property=hdl
+            hdl=lasthandle
+            hind=p
+            if (k+1)==size(i) then
+                index=i($)
+            else
+                index=list(i(k+1:$))
+            end
+            break
+        end
     end
-  end
-  if hind<>[] then // a property found
-    if type(index)==15 & and(type(property)<>[15 16 17]) then
-      property(index(:))=v
+    if hind<>[] then // a property found
+        if type(index)==15 & and(type(property)<>[15 16 17]) then
+            property(index(:))=v
+        else
+            if or(size(index)<>[-1 -1]) then
+                property(index)=v
+            else
+                property=v
+            end
+        end
+        if size(hdl,'*')==1 then //a single handle
+            hdl(hind)=property
+        else //mutiple handle 
+            np=size(hdl,'*')
+            for k=1:np
+                h=hdl(k);h(hind)=property
+            end
+
+        end
     else
-      if or(size(index)<>[-1 -1]) then
-       property(index)=v
-      else
-       property=v
-      end
-    end
-    if size(hdl,'*')==1 then //a single handle
-      hdl(hind)=property
-    else //mutiple handle 
-      np=size(hdl,'*')
-      for k=1:np
-       h=hdl(k);h(hind)=property
-      end
-      
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"generic_i_h",1));
     end
-  else
-    error('Invalid path')
-  end
- h= hsave
+    h= hsave
 endfunction
index bc05757..1e19899 100644 (file)
@@ -48,7 +48,7 @@ function M=generic_i_hm(default_value,varargin)
         if or(dk<>(dims(k):-1:1)) then
           if dk(1)<1|dk($)>dims(k) then error(21),end
           if ok<>[] then
-            error('A null assignment can have only one non-colon index')
+            error(msprintf(_("%s: A null assignment can have only one non-colon index.\n"),"generic_i_hm"));
           end
           ok=k
           I1=1:dims(k);I1(dk)=[]
index 031f94c..afd8d51 100644 (file)
@@ -9,26 +9,28 @@
 
 function M=generic_i_s(varargin)
 
-  [lhs,rhs]=argn(0)
-  M=varargin(rhs)
-  N=varargin(rhs-1)//inserted matrix
-  index=varargin(1) //
-  if rhs==3&(type(index)==10|type(index)==15) then
-    if type(index)<>15 then
-      M=struct()
-      M(index)=N
-    else
-      M=createstruct(index,N)
+    [lhs,rhs]=argn(0)
+    M=varargin(rhs)
+    N=varargin(rhs-1)//inserted matrix
+    index=varargin(1) //
+    if rhs==3&(type(index)==10|type(index)==15) then
+        if type(index)<>15 then
+            M=struct()
+            M(index)=N
+        else
+            M=createstruct(index,N)
 
+        end
+        if index($)=='entries' then
+            // change struct to cell
+            f=getfield(1,M);f(1)='ce'
+            setfield(1,f,M)
+        end
+        return
+    elseif rhs==3 &(type(index)<>10 & type(index)<>15) then
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"generic_i_s",1));
+    else
+        error(msprintf(_("%s: Wrong number of input arguments: %d expected.\n"),"generic_i_s",3));
     end
-    if index($)=='entries' then
-      // change struct to cell
-      f=getfield(1,M);f(1)='ce'
-      setfield(1,f,M)
-    end
-    return
-  else
-    error(_("Incorrect assignment."))
-  end
 endfunction
 
diff --git a/scilab/modules/overloading/tests/nonreg_tests/bug_8607.dia.ref b/scilab/modules/overloading/tests/nonreg_tests/bug_8607.dia.ref
new file mode 100644 (file)
index 0000000..bf82dab
--- /dev/null
@@ -0,0 +1,32 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- Non-regression test for bug 8607 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=8607
+//
+// <-- Short Description -->
+// Some error messages in modules/overloading/macros are not standard and not localized
+b=cell(3,1);
+errmsg1=msprintf(_("%s: Wrong size for input argument #%d.\n"),"%ce_size",2);
+assert_checkerror("size(b,3)", errmsg1);
+A(:,:,2)=[1;1;1];
+B(:,:,2)=[1,1,1];
+errmsg2=msprintf(_("%s: Input argument #%d and input argument #%d have incompatible dimensions.\n"),"%hm_1_hm",1,2);
+assert_checkerror("A<B", errmsg2);
+s=poly(0,"s");
+P=[2*s+1;s];
+Q=[3*s+2,s,s];
+errmsg3=msprintf(_("%s: Wrong size for input arguments.\n"),"%p_v_p");
+assert_checkerror("P/.Q", errmsg3);
+errmsg4=msprintf(_("%s: Wrong value for input argument #%d: %d or %s expected.\n"),"%r_norm",2,2,"inf");
+assert_checkerror("norm(P(1)/Q(1),1)", errmsg4);
+errmsg5=msprintf(_("%s: Wrong type for input argument #%d: A scalar expected.\n"),"%s_1_hm",1);
+assert_checkerror("[1 1]<A", errmsg5);
+sys=tf2ss(P(1)/Q(1));
+errmsg6=msprintf(_("%s: Wrong value for input argument #%d: %d or %s expected.\n"),"%lss_norm",2,2,"inf");
+assert_checkerror("norm(sys,1)",errmsg6);
diff --git a/scilab/modules/overloading/tests/nonreg_tests/bug_8607.tst b/scilab/modules/overloading/tests/nonreg_tests/bug_8607.tst
new file mode 100644 (file)
index 0000000..747f2d4
--- /dev/null
@@ -0,0 +1,39 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- Non-regression test for bug 8607 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=8607
+//
+// <-- Short Description -->
+// Some error messages in modules/overloading/macros are not standard and not localized
+
+b=cell(3,1);
+errmsg1=msprintf(_("%s: Wrong size for input argument #%d.\n"),"%ce_size",2);
+assert_checkerror("size(b,3)", errmsg1);
+
+A(:,:,2)=[1;1;1];
+B(:,:,2)=[1,1,1];
+errmsg2=msprintf(_("%s: Input argument #%d and input argument #%d have incompatible dimensions.\n"),"%hm_1_hm",1,2);
+assert_checkerror("A<B", errmsg2);
+
+s=poly(0,"s");
+P=[2*s+1;s];
+Q=[3*s+2,s,s];
+errmsg3=msprintf(_("%s: Wrong size for input arguments.\n"),"%p_v_p");
+assert_checkerror("P/.Q", errmsg3);
+
+errmsg4=msprintf(_("%s: Wrong value for input argument #%d: %d or %s expected.\n"),"%r_norm",2,2,"inf");
+assert_checkerror("norm(P(1)/Q(1),1)", errmsg4);
+
+errmsg5=msprintf(_("%s: Wrong type for input argument #%d: A scalar expected.\n"),"%s_1_hm",1);
+assert_checkerror("[1 1]<A", errmsg5);
+
+sys=tf2ss(P(1)/Q(1));
+errmsg6=msprintf(_("%s: Wrong value for input argument #%d: %d or %s expected.\n"),"%lss_norm",2,2,"inf");
+assert_checkerror("norm(sys,1)",errmsg6);