SCM

SCM Repository

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

Diff of /pkg/src/Mutils.h

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

revision 1517, Wed Sep 6 13:34:03 2006 UTC revision 1725, Wed Jan 17 08:01:10 2007 UTC
# Line 46  Line 46 
46  SEXP set_factors(SEXP obj, SEXP val, char *nm);  SEXP set_factors(SEXP obj, SEXP val, char *nm);
47  SEXP dgCMatrix_set_Dim(SEXP x, int nrow);  SEXP dgCMatrix_set_Dim(SEXP x, int nrow);
48    
49  int csc_unsorted_columns(int ncol, const int p[], const int i[]);  /* int csc_unsorted_columns(int ncol, const int p[], const int i[]); */
50  void csc_sort_columns(int ncol, const int p[], int i[], double x[]);  /* void csc_sort_columns(int ncol, const int p[], int i[], double x[]); */
51  SEXP csc_check_column_sorting(SEXP A);  /* SEXP csc_check_column_sorting(SEXP A); */
52  SEXP Matrix_make_named(int TYP, char **names);  SEXP Matrix_make_named(int TYP, char **names);
53  SEXP check_scalar_string(SEXP sP, char *vals, char *nm);  SEXP check_scalar_string(SEXP sP, char *vals, char *nm);
54  double *packed_getDiag(double *dest, SEXP x);  double *packed_getDiag(double *dest, SEXP x);
# Line 85  Line 85 
85  #define diag_P(_x_) CHAR(STRING_ELT(GET_SLOT(_x_, Matrix_diagSym), 0))  #define diag_P(_x_) CHAR(STRING_ELT(GET_SLOT(_x_, Matrix_diagSym), 0))
86  #define class_P(_x_) CHAR(asChar(getAttrib(_x_, R_ClassSymbol)))  #define class_P(_x_) CHAR(asChar(getAttrib(_x_, R_ClassSymbol)))
87    
88    /* should also work for "matrix" matrices: */
89    #define Real_KIND(_x_)  (IS_S4_OBJECT(_x_) ? Real_kind(_x_) : \
90                             (isReal(_x_) ? 0 : (isLogical(_x_) ? 1 : -1)))
91    
92    /* requires 'x' slot: */
93    #define Real_kind(_x_)  (isReal(GET_SLOT(_x_, Matrix_xSym)) ? 0 :       \
94                             (isLogical(GET_SLOT(_x_, Matrix_xSym)) ? 1 : -1))
95    
96    
97  /**  /**
98   * Check for valid length of a packed triangular array and return the   * Check for valid length of a packed triangular array and return the
99   * corresponding number of columns   * corresponding number of columns
# Line 157  Line 166 
166    
167  SEXP Matrix_expand_pointers(SEXP pP);  SEXP Matrix_expand_pointers(SEXP pP);
168    
 /* Move these to the lme4 sources */  
 SEXP alloc_dgeMatrix(int m, int n, SEXP rownms, SEXP colnms);  
 SEXP alloc_dpoMatrix(int n, char *uplo, SEXP rownms, SEXP colnms);  
 SEXP alloc_dtrMatrix(int n, char *uplo, char *diag, SEXP rownms, SEXP colnms);  
 SEXP alloc_dsCMatrix(int n, int nz, char *uplo, SEXP rownms, SEXP colnms);  
   
169  SEXP dup_mMatrix_as_dgeMatrix(SEXP A);  SEXP dup_mMatrix_as_dgeMatrix(SEXP A);
170    SEXP dup_mMatrix_as_geMatrix (SEXP A);
171    
172    SEXP new_dgeMatrix(int nrow, int ncol);
173    
174  static R_INLINE SEXP  static R_INLINE SEXP
175  mMatrix_as_dgeMatrix(SEXP A)  mMatrix_as_dgeMatrix(SEXP A)
# Line 171  Line 177 
177      return strcmp(class_P(A), "dgeMatrix") ? dup_mMatrix_as_dgeMatrix(A) : A;      return strcmp(class_P(A), "dgeMatrix") ? dup_mMatrix_as_dgeMatrix(A) : A;
178  }  }
179    
180    static R_INLINE SEXP
181    mMatrix_as_geMatrix(SEXP A)
182    {
183        return strcmp(class_P(A) + 1, "geMatrix") ? dup_mMatrix_as_geMatrix(A) : A;
184    }
185    
186  /**  /**
187   * Return the 0-based index of a string match in a vector of strings   * Return the 0-based index of a string match in a vector of strings
188   * terminated by an empty string.  Returns -1 for no match.   * terminated by an empty string.  Returns -1 for no match.

Legend:
Removed from v.1517  
changed lines
  Added in v.1725

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