Dear all, I’m not sure if it is O.K. to ask this question here. But where can I find the code for the function ‘C_Cdqrls’ which is called by the R function ‘lsfit‘. Thank you all. Sorry for being naïve if so. -------------------- Ziqiang Zhao 2013-04-23 [[alternative HTML version deleted]]
On 23.04.2013 09:35, ??? wrote:> Dear all, > > I???m not sure if it is O.K. to ask this question here. > > But where can I find the code for the function ???C_Cdqrls??? which is called by the R function ???lsfit???.Look into the R sources: grepping for dqrls shows the following relevant files: ./src/appl/dqrls.f: subroutine dqrls(x,n,p,y,ny,tol,b,rsd,qty,k,jpvt,qraux,work) ./src/include/R_ext/Applic.h:void F77_NAME(dqrls)(double *x, int *n, int *p, double *y, int *ny, ./src/library/stats/src/init.c: CALLDEF(Cdqrls, 3), ./src/library/stats/src/lm.c: z <- .Fortran("dqrls", ./src/library/stats/src/lm.c:SEXP Cdqrls(SEXP x, SEXP y, SEXP tol) ./src/library/stats/src/lm.c: F77_CALL(dqrls)(REAL(qr), &n, &p, REAL(y), &ny, &rtol, ./src/library/stats/src/statsR.h:SEXP Cdqrls(SEXP x, SEXP y, SEXP tol); Best, Uwe Ligges> > Thank you all. > > Sorry for being na??ve if so. > > -------------------- > > Ziqiang Zhao > > 2013-04-23 > > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
Prof Brian Ripley
2013-Apr-23 13:01 UTC
[Rd] Help: Where can I find the code for 'C_Cdqrls'?
First, it is not a function. It is an R object in the stats namespace and you can look at it like any other object: > stats:::C_Cdqrls $name [1] "Cdqrls" $address <pointer: 0x7f8483499750> attr(,"class") [1] "RegisteredNativeSymbol" $dll DLL name: stats Filename: /Users/ripley/R/R-devel/library/stats/libs/stats.so Dynamic lookup: FALSE $numParameters [1] 3 attr(,"class") [1] "CallRoutine" "NativeSymbolInfo" That tells you it is invoking a C function called Cdqrls: you can search from that in the sources for package stats. In fact it is in src/library/stats/src/lm.c . You would know to look in the stats namespace since you found this in a function from that namespace. Generally R's own code uses the convention of object C_foo for C entry point foo and F_bar for Fortran entry point bar (but there are exceptions, more so in R < 3.0.0). On 23/04/2013 08:35, ??? wrote:> Dear all, > > I???m not sure if it is O.K. to ask this question here. > > But where can I find the code for the function ???C_Cdqrls??? which is called by the R function ???lsfit???. > > Thank you all. > > Sorry for being na??ve if so. > > -------------------- > > Ziqiang Zhao > > 2013-04-23 > > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Maybe Matching Threads
- [LLVMdev] Passing llc options to Clang
- [LLVMdev] How to specify displacement range of a target instruction to llc
- [LLVMdev] Getting basic block address offset from its parent function
- multiple packages using the same native code.
- [LLVMdev] How to see what's going on behind llc through clang/clang++