SCM

SCM Repository

[matrix] Diff of /pkg/src/Mutils.c
ViewVC logotype

Diff of /pkg/src/Mutils.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2386, Wed May 27 20:54:45 2009 UTC revision 2387, Fri May 29 12:50:34 2009 UTC
# Line 15  Line 15 
15    
16      if (strlen(typstr) != 1)      if (strlen(typstr) != 1)
17          error(          error(
18              _("argument type[1]='%s' must be a character string of string length 1"),              _("argument type[1]='%s' must be a one-letter character string"),
19              typstr);              typstr);
20      typup = toupper(*typstr);      typup = toupper(*typstr);
21      if (typup == '1')      if (typup == '1')
22          typup = 'O'; /* aliases */          typup = 'O'; /* alias */
23      else if (typup == 'E')      else if (typup == 'E')
24          typup = 'F';          typup = 'F';
25      else if (typup != 'M' && typup != 'O' && typup != 'I' && typup != 'F')      else if (typup != 'M' && typup != 'O' && typup != 'I' && typup != 'F')
# Line 33  Line 33 
33      char typup;      char typup;
34    
35      if (strlen(typstr) != 1)      if (strlen(typstr) != 1)
36          error(_("argument type[1]='%s' must be a character string of string length 1"),          error(
37                _("argument type[1]='%s' must be a one-letter character string"),
38                typstr);                typstr);
39      typup = toupper(*typstr);      typup = toupper(*typstr);
40      if (typup == '1')      if (typup == '1')
# Line 67  Line 68 
68      int i, len = length(obj);      int i, len = length(obj);
69    
70      if ((!isReal(obj)) || (length(obj) > 0 && nms == R_NilValue))      if ((!isReal(obj)) || (length(obj) > 0 && nms == R_NilValue))
71          error("object must be a named, numeric vector");          error(_("object must be a named, numeric vector"));
72      for (i = 0; i < len; i++) {      for (i = 0; i < len; i++) {
73          if (!strcmp(nm, CHAR(STRING_ELT(nms, i)))) {          if (!strcmp(nm, CHAR(STRING_ELT(nms, i)))) {
74              REAL(obj)[i] = val;              REAL(obj)[i] = val;
# Line 114  Line 115 
115      int i, len = length(fac);      int i, len = length(fac);
116    
117      if ((!isNewList(fac)) || (length(fac) > 0 && nms == R_NilValue))      if ((!isNewList(fac)) || (length(fac) > 0 && nms == R_NilValue))
118          error("factors slot must be a named list");          error(_("'factors' slot must be a named list"));
119      for (i = 0; i < len; i++) {      for (i = 0; i < len; i++) {
120          if (!strcmp(nm, CHAR(STRING_ELT(nms, i)))) {          if (!strcmp(nm, CHAR(STRING_ELT(nms, i)))) {
121              return VECTOR_ELT(fac, i);              return VECTOR_ELT(fac, i);
# Line 130  Line 131 
131      int i, len = length(fac);      int i, len = length(fac);
132    
133      if ((!isNewList(fac)) || (length(fac) > 0 && nms == R_NilValue))      if ((!isNewList(fac)) || (length(fac) > 0 && nms == R_NilValue))
134          error("factors slot must be a named list");          error(_("'factors' slot must be a named list"));
135      for (i = 0; i < len; i++) {      for (i = 0; i < len; i++) {
136          if (!strcmp(nm, CHAR(STRING_ELT(nms, i)))) {          if (!strcmp(nm, CHAR(STRING_ELT(nms, i)))) {
137              SET_VECTOR_ELT(fac, i, duplicate(val));              SET_VECTOR_ELT(fac, i, duplicate(val));
# Line 899  Line 900 
900          UNPROTECT(1);          UNPROTECT(1);
901    
902          if(!isEnvironment(rho))          if(!isEnvironment(rho))
903              error("could not find correct environment; please report!");              error(_("could not find correct environment; please report!"));
904      }      }
905  /*     UNPROTECT(1); */  /*     UNPROTECT(1); */
906      return Matrix_check_class_and_super(x, valid, rho);      return Matrix_check_class_and_super(x, valid, rho);

Legend:
Removed from v.2386  
changed lines
  Added in v.2387

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge