SCM Repository
[matrix] Diff of /pkg/Matrix/src/Mutils.h
Diff of /pkg/Matrix/src/Mutils.h
Parent Directory
|
Revision Log
|
Patch
314 |
return -1; |
return -1; |
315 |
} |
} |
316 |
|
|
317 |
|
/** |
318 |
|
* Return the 0-based index of an is() match in a vector of class-name |
319 |
|
* strings terminated by an empty string. Returns -1 for no match. |
320 |
|
* |
321 |
|
* @param x an R object, about which we want is(x, .) information. |
322 |
|
* @param valid vector of possible matches terminated by an empty string. |
323 |
|
* |
324 |
|
* @return index of match or -1 for no match |
325 |
|
*/ |
326 |
|
static R_INLINE int |
327 |
|
Matrix_check_class_etc(SEXP x, char **valid) |
328 |
|
{ |
329 |
|
SEXP cl = getAttrib(x, R_ClassSymbol), |
330 |
|
pkg = getAttrib(cl, install("package")), /* ==R== packageSlot(class(x)) */ |
331 |
|
rho = (isNull(pkg) ? R_GlobalEnv |
332 |
|
: eval(lang2(install(".M.classEnv"), cl), R_GlobalEnv)); |
333 |
|
return Matrix_check_class_and_super(x, valid, rho); |
334 |
|
} |
335 |
|
|
336 |
|
|
337 |
#ifdef __cplusplus |
#ifdef __cplusplus |
338 |
} |
} |
|
Legend:
Removed from v.2351 |
|
changed lines |
|
Added in v.2354 |
|
|