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 1654, Fri Oct 27 16:58:15 2006 UTC revision 1725, Wed Jan 17 08:01:10 2007 UTC
# 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 :       \  #define Real_kind(_x_)  (isReal(GET_SLOT(_x_, Matrix_xSym)) ? 0 :       \
94                           (isLogical(GET_SLOT(_x_, Matrix_xSym)) ? 1 :   \                           (isLogical(GET_SLOT(_x_, Matrix_xSym)) ? 1 : -1))
                           -1))  
95    
96    
97  /**  /**
# Line 163  Line 167 
167  SEXP Matrix_expand_pointers(SEXP pP);  SEXP Matrix_expand_pointers(SEXP pP);
168    
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);  SEXP new_dgeMatrix(int nrow, int ncol);
173    
# Line 172  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.1654  
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