Displaying 20 results from an estimated 10000 matches similar to: "Re: model.matrix(x ~ y) bug when y is array (PR#6838)"
2012 Dec 10
1
Changing arguments inside .Call. Wise to encourage "const" on all arguments?
I'm continuing my work on finding speedups in generalized inverse
calculations in some simulations. It leads me back to .C and .Call,
and some questions I've never been able to answer for myself. It may
be I can push some calculations to LAPACK in or C BLAS, that's why I
realized again I don't understand the call by reference or value
semantics of .Call
Why aren't users of
2006 Aug 03
1
question about dll crashing R
I have ported some R code to C to make it faster.
I can perform .Call("foobar",....) once and it
works fine. Absolutely correct answer.
If I put a loop inside foobar and run the main code
routine more than 100 times, it crashes R.
Or if I call .Call("foobar"....) seperately more than
two tims it crashes R.
For the most part I am doing matirx multiplies using
EXP
2008 Apr 05
2
Adding a Matrix Exponentiation Operator
Hi all
I recently started to write a matrix exponentiation operator for R (by
adding a new operator definition to names.c, and adding the following code
to arrays.c). It is not finished yet, but I would like to solicit some
comments, as there are a few areas of R's internals that I am still feeling
my way around.
Firstly:
1) Would there be interest in adding a new operator %^% that performs
2010 Sep 08
0
Correction to vec-subset speed patch
I found a bug in one of the fourteen speed patches I posted, namely in
patch-vec-subset. I've fixed this (I now see one does need to
duplicate index vectors sometimes, though one can avoid it most of the
time). I also split this patch in two, since it really has two
different and independent parts. The patch-vec-subset patch now has
only some straightforward (locally-checkable) speedups for
2000 Jul 12
1
getAttrib() and setAttrib()
Hello:
I am looking at "Writing R Extensions", subsection 3.6.4, using R 1.1.0,
under NT4.0, with VC++ 6.0. Under these conditions I can use the first
method given for coding the out() function, but not the second, which uses
getAttrib() and setAttrib(). I hope that someone will tell me how this
second method can also be made to work. Details follow, for anyone kind
enough to help.
2008 Apr 10
1
Computing time when calling C functions - why does an extra function call induce such an overhead?
Dear list,
I am a little puzzled by computing time in connection with calling C functions. With the function mysolve1 given below I solve Ax=B, where the actual matrix operation takes place in mysolve2. Doing this 5000 times takes 3.51 secs. However, if I move the actual matrix inversion part into mysolve1 (by uncommenting the two commented lines and skip the call to mysolve2) then the
2006 Mar 09
0
When calling external C-function repeatedly I get different results; can't figure out why..
Dear all,
I need to calculate tr(xyxy) fast for matrices x and y. Inspired by the R-source code, I've created the following functions (I am *new* to writing external C-functions, so feel free to laugh at my code - or, perhaps, suggest changes):
#include <Rinternals.h>
#include <R_ext/Applic.h> /* for dgemm */
static void matprod(double *x, int nrx, int ncx,
double *y, int
2006 Mar 09
0
When calling external C-function repeatedly I get differentresults; can't figure out why..
Not an expert in programming either, but to me it seems like you've forgotten to initialize the variable "tr". It just picks up garbage from allocated memory previously initialized by other processes.
Med venlig hilsen
Frede Aakmann T?gersen
> -----Oprindelig meddelelse-----
> Fra: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] P?
2002 May 28
0
(PR#1605)When dev.list() is NULL, dev.control() causes core dump
This is of course an incorrect usage, which I've trapped at R level, so as
to give an informative warning.
On Tue, 28 May 2002 NEFTH@pacbell.net wrote:
> The following sequence of commands:
> graphics.off()
> dev.control("inhibit")
>
> causes R to memory-fault and core dump. This is reported
> for a new port of R, but is also reproducible on Windows
> and
2009 Mar 17
1
question on "row.names" attribute of dataframe when called from a compiled package
Why does the following show a class attribute of "character" when
using the interpreter:
x <- data.frame(hat=1:10)
class(rownames(x)) ## returns [1] "character"
but when called from c/cpp, the rownames attribute has no class
attribute, and is in fact a vector of INTSXP?
> .Call("print_class_of_rownames", x, package = "test")
length(x): 10
2006 Mar 27
1
Safe to UNPROTECT() when object is assigned to a list?
Hi,
I'm troubleshooting some native code on Windows that very occationally
(and semi-randomly) crashes R. Already looked at "everything", I just
want to double check that it is safe to UNPROTECT() allocated
variables as soon as they are assigned to, say, a PROTECTed list.
>From (R v2.3.0) Section 5.7.1 "Handling the effects of garbage
collection" in "Writing R
2007 Apr 10
1
list/matrix chimera
Hi all,
If dimensions are added to a list, it will become a matrix-like hybrid
that calls itself a matrix, but returns lists for subset operations.
This was brought to my attention by a user that encountered such an
object and was quite confused by its behavior. Although I have not
found the code that created the object yet, I believe that code is
simply incorrect. Nevertheless, I wonder if
2012 Jun 19
1
R and C pointers
Dear R devel,
Apologies for these (most probably trivial) questions, doing my first
attempt to call C from R (and actually learning C in the process).
I need to pass a matrix to C, and after reading R-exts.pdf (many
times), I was unable to find how to handle matrices at C-level...
except for, what probably is the answer, that matrices are in fact
vectors with dimensions.
This is a sample code I
2007 Jan 22
0
Fwd: Re: aov y lme
Dear Prof. Ripley and Christoph,
thank you very much for your comments. You have helped me a lot.
Thanks,
Tomas Goicoa
>Dear Prof. Ripley
>
>Thank you for your email. Yes, this is of course the correct
>syntax to save us the extra calculation. And I forgot the
>"lower.tail = FALSE" for pf() in my example to obtain the
>p-value.
>
>Thank you for the
2004 Jul 02
0
(PR#7045) Re: homals: Error in y[g[i, j], ] : incorrect number
Function homals() is not part of R. It appears to be in a contributed
package `homals', but you did not say so.
To quote the FAQ
Bug reports on contributed packages should be sent first to the package
maintainer, and only submitted to the R-bugs repository by package
maintainers, mentioning the package in the subject line.
I have closed this bug report on R-bugs.
On Fri, 2 Jul
2009 Jan 05
1
can't get names of R_env
Hi,
I'm quite knew in R, so I might not have the R specific jargon.
But here is my problem,
I'm trying to access and use variabels given by a function environment,
more specifically the rho in do_optim in src/main/optim.c
According to the documentation
http://cran.r-project.org/doc/manuals/R-ints.html#The-_0027data_0027
the envsxp is defined as a tagged pairlist.
"ENVSXP: Pointers
1997 Nov 28
3
R-alpha: Problems with dimnames and names
This message is in MIME format
--_=XFMail.1.1.p0.Linux:971128122615:3052=_
Content-Type: text/plain; charset=us-ascii
I have rounded up three buglets in R-0.50-a4. Two of them I can
fix and a patch is supplied below. I hope this is useful for the
current source (if these haven't been fixed already :)
1) cov
cov() fails when it's argument is a matrix with one column and with
column names
2003 Jan 30
1
empty array indexing with dimnames (PR#2507)
On Thu, 30 Jan 2003 maechler@stat.math.ethz.ch wrote:
> This is a bug that will not often trigger, and only happens for arrays
> (but not matrices) ending up with 0 dimensions:
The bug is a missing else branch of an if condition at line 431 of
subset.c.
I don't think the buglets are wrong. You don't drop length 0 dimensions.
If you did, the object would be of the wrong length.
2012 Dec 15
3
interfacing with .Call
Hi
My code is as following:
#include <R.h>
#include <Rinternals.h>
//* the Projector part *//
void Projector(double *L, int *dimL, double *G, int *dimG, double *W, int
*dimW, int *xymod, int *dimxy, double *modif, int *dimif, double *Lsum)
{ ...}
//* the interface part *//
#define getDim(A) INTEGER(coerceVector(getAttrib(A,R_DimSymbol), INTSXP))
SEXP Projector5(SEXP L, SEXP G,
2002 Jan 17
1
MKL seems to beat ATLAS, but some problems... (was RE: li nkin g R against MKL)
Prof. Ripley,
> From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk]
[snipped...]
> R cannot currently make use of anyone else's LAPACK routines (because
> we've found too many problems with them).
>
> If you are getting no useful diagnostics, try
> dyn.load("RHOME/modules/lapack.so"). That ought to tell you
> why you can't
> load it. My