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 1866, Mon Jun 4 17:11:11 2007 UTC revision 1867, Mon Jun 4 17:13:02 2007 UTC
# Line 1  Line 1 
1  #include "Mutils.h"  #include "Mutils.h"
2  #include <R_ext/Lapack.h>  #include <R_ext/Lapack.h>
3    
4  char norm_type(char *typstr)  char norm_type(const char *typstr)
5  {  {
6      char typup;      char typup;
7    
# Line 18  Line 18 
18      return typup;      return typup;
19  }  }
20    
21  char rcond_type(char *typstr)  char rcond_type(const char *typstr)
22  {  {
23      char typup;      char typup;
24    
# Line 315  Line 315 
315  SEXP check_scalar_string(SEXP sP, char *vals, char *nm)  SEXP check_scalar_string(SEXP sP, char *vals, char *nm)
316  {  {
317      SEXP val = ScalarLogical(1);      SEXP val = ScalarLogical(1);
318      char *buf, *str;      char *buf;
319      /* only allocate when needed: in good case, none is needed */      /* only allocate when needed: in good case, none is needed */
320  #define SPRINTF buf = Calloc(Matrix_Error_Bufsiz, char); sprintf  #define SPRINTF buf = Calloc(Matrix_Error_Bufsiz, char); sprintf
321    
322      if (length(sP) != 1) {      if (length(sP) != 1) {
323          SPRINTF(buf, _("'%s' slot must have length 1"), nm);          SPRINTF(buf, _("'%s' slot must have length 1"), nm);
324      } else {      } else {
325          str = CHAR(STRING_ELT(sP, 0));          const char *str = CHAR(STRING_ELT(sP, 0));
326          if (strlen(str) != 1) {          if (strlen(str) != 1) {
327              SPRINTF(buf, _("'%s' must have string length 1"), nm);              SPRINTF(buf, _("'%s' must have string length 1"), nm);
328          } else {          } else {
# Line 569  Line 569 
569  SEXP dup_mMatrix_as_geMatrix(SEXP A)  SEXP dup_mMatrix_as_geMatrix(SEXP A)
570  {  {
571      SEXP ans, ad = R_NilValue, an = R_NilValue; /* -Wall */      SEXP ans, ad = R_NilValue, an = R_NilValue; /* -Wall */
572      char *cl = class_P(A),      const char *cl = class_P(A);
573          *valid[] = {"_NOT_A_CLASS_",/* *_CLASSES defined in ./Mutils.h */      char *valid[] = {"_NOT_A_CLASS_",/* *_CLASSES defined in ./Mutils.h */
574                      ddense_CLASSES, /* 14 */                      ddense_CLASSES, /* 14 */
575                      ldense_CLASSES, /* 6  */                      ldense_CLASSES, /* 6  */
576                      ndense_CLASSES, /* 5  */                      ndense_CLASSES, /* 5  */
# Line 723  Line 723 
723  {  {
724      SEXP ans = PROTECT(NEW_OBJECT(MAKE_CLASS("dgeMatrix"))),      SEXP ans = PROTECT(NEW_OBJECT(MAKE_CLASS("dgeMatrix"))),
725          ad = R_NilValue , an = R_NilValue;      /* -Wall */          ad = R_NilValue , an = R_NilValue;      /* -Wall */
726      char *cl = class_P(A),      const char *cl = class_P(A);
727          *valid[] = {"_NOT_A_CLASS_", ddense_CLASSES, ""};      char *valid[] = {"_NOT_A_CLASS_", ddense_CLASSES, ""};
728      int ctype = Matrix_check_class(cl, valid), nprot = 1, sz;      int ctype = Matrix_check_class(cl, valid), nprot = 1, sz;
729      double *ansx;      double *ansx;
730    

Legend:
Removed from v.1866  
changed lines
  Added in v.1867

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