SCM

SCM Repository

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

Diff of /pkg/Matrix/src/Mutils.h

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

revision 1395, Sun Aug 20 03:15:25 2006 UTC revision 1416, Tue Aug 22 22:44:14 2006 UTC
# Line 307  Line 307 
307    
308  SEXP dup_mMatrix_as_dgeMatrix(SEXP A, SEXP classed);  SEXP dup_mMatrix_as_dgeMatrix(SEXP A, SEXP classed);
309    
310    
311    /**
312     * Return the 0-based index of a string match in a vector of strings
313     * terminated by an empty string.  Returns -1 for no match.
314     *
315     * @param dest class string to match
316     * @param valid vector of possible matches terminated by an empty string
317     *
318     * @return index of match or -1 for no match
319     */
320    static R_INLINE int
321    Matrix_check_class(char *class, char **valid)
322    {
323        int ans;
324        for (ans = 0; ; ans++) {
325            if (!strlen(valid[ans])) return -1;
326            if (!strcmp(class, valid[ans])) return ans;
327        }
328    }
329    
330  #ifdef __cplusplus  #ifdef __cplusplus
331  }  }
332  #endif  #endif

Legend:
Removed from v.1395  
changed lines
  Added in v.1416

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