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 2119, Tue Mar 4 21:44:04 2008 UTC revision 2120, Tue Mar 4 21:44:41 2008 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    #include <Rversion.h>
5    
6    #if defined(R_VERSION) && R_VERSION >= R_Version(2, 7, 0)
7    /* La_norm_type() & La_rcond_type() are now in R_ext/Lapack.h */
8    #else
9  char La_norm_type(const char *typstr)  char La_norm_type(const char *typstr)
10  {  {
11      char typup;      char typup;
# Line 10  Line 15 
15              _("argument type[1]='%s' must be a character string of string length 1"),              _("argument type[1]='%s' must be a character string of string length 1"),
16              typstr);              typstr);
17      typup = toupper(*typstr);      typup = toupper(*typstr);
18      if (typup == '1') typup = 'O'; /* aliases */      if (typup == '1')
19      if (typup == 'E') typup = 'F';          typup = 'O'; /* aliases */
20      if (typup != 'M' && typup != 'O' && typup != 'I' && typup != 'F')      else if (typup == 'E')
21            typup = 'F';
22        else if (typup != 'M' && typup != 'O' && typup != 'I' && typup != 'F')
23          error(_("argument type[1]='%s' must be one of 'M','1','O','I','F' or 'E'"),          error(_("argument type[1]='%s' must be one of 'M','1','O','I','F' or 'E'"),
24                typstr);                typstr);
25      return typup;      return typup;
26  }  }
27    
28  char rcond_type(const char *typstr)  char La_rcond_type(const char *typstr)
29  {  {
30      char typup;      char typup;
31    
# Line 26  Line 33 
33          error(_("argument type[1]='%s' must be a character string of string length 1"),          error(_("argument type[1]='%s' must be a character string of string length 1"),
34                typstr);                typstr);
35      typup = toupper(*typstr);      typup = toupper(*typstr);
36      if (typup == '1') typup = 'O'; /* alias */      if (typup == '1')
37      if (typup != 'O' && typup != 'I')          typup = 'O'; /* alias */
38        else if (typup != 'O' && typup != 'I')
39          error(_("argument type[1]='%s' must be one of '1','O', or 'I'"),          error(_("argument type[1]='%s' must be one of '1','O', or 'I'"),
40                typstr);                typstr);
41      return typup;      return typup;
42  }  }
43    #endif
44    
45  double get_double_by_name(SEXP obj, char *nm)  double get_double_by_name(SEXP obj, char *nm)
46  {  {
# Line 455  Line 464 
464   *   *
465   * @return dest   * @return dest
466   */   */
   
467  static double *  static double *
468  install_diagonal(double *dest, SEXP A)  install_diagonal(double *dest, SEXP A)
469  {  {

Legend:
Removed from v.2119  
changed lines
  Added in v.2120

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