similar to: patch to improve matrix conformability error message

Displaying 20 results from an estimated 500 matches similar to: "patch to improve matrix conformability error message"

2019 Apr 30
0
patch to improve matrix conformability error message
I think this is a good idea. Is there a reason why it got no interest? Slippery slope? Or maybe others were also just occupied trying to figure out how Joshua's second message had timestamp earlier than his first message? On Fri, Apr 05, 2019 at 12:05:36PM -0400, Joshua N Pritikin wrote: >With this patch, > >> A <- matrix(1, 2, 2) >> B <- matrix(2, 3, 2) >> A
2005 Oct 12
1
Using matprod from array.c
Hi, I was wondering if I could use the matprod function from array.c in my own C routine. I tried the following as a test /* my_matprod.c */ # include <Rinternals.h> /* for REAL, SEXP etc */ # include <R_ext/Applic.h> /* array.c says need for dgemm */ /* following copied from array.c */ static void matprod(double *x, int nrx, int ncx, double *y, int nry, int ncy, double *z)
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
2010 Aug 23
1
Internal state indicating if a data object has NAs/no NAs/not sure (Was: Re: Speeding up matrix multiplies)
Hi, I'm just following your messages the overhead that the code for dealing with possible NA/NaN values brings. When I was setting up part of the matrixStats package, I've also though about this. I was thinking of having an additional logical argument 'hasNA'/'has.na' where you as a user can specify whether there is NA/NaN:s or not, allowing the code to avoid it or not.
2010 Aug 23
1
Speeding up matrix multiplies
I've looked at the code for matrix multiplies in R, and found that it can speeded up quite a bit, for multiplies that are really vector dot products, and for other multiplies in which the result matrix is small. Here's my test program: u <- seq(0,1,length=1000) v <- seq(0,2,length=1000) A2 <- matrix(2.1,2,1000) A5 <- matrix(2.1,5,1000) B3 <- matrix(3.2,1000,3) A4 <-
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?
2017 Jan 07
2
accelerating matrix multiply
I am using R to multiply some large (30k x 30k double) matrices on a 64 core machine (xeon phi). I added some timers to src/main/array.c to see where the time is going. All of the time is being spent in the matprod function, most of that time is spent in dgemm. 15 seconds is in matprod in some code that is checking if there are NaNs. > system.time (C <- B %*% A) nancheck: wall time
2006 Feb 22
2
How can I see how %*% is implemented?
I would like to see how the matrix multiplication operator %*% is implemented (because I want to see which external Fortran/C routines are used). How can I do so? Best S??ren
2013 Apr 25
1
lsfit: Error in formatting error message
Hi, in R-3.0 I get the following error when calling lsfit with more observations than variables, which seems to come from an error in the formatting of the error message (note that this was not happening in 2.15.3): > nobs <- 5; nvar <- 6; lsfit(matrix(runif(nobs*nvar), ncol=nvar), runif(nobs), intercept=FALSE) Error in sprintf(ngettext(nry, "%d response", "%d
2017 Jan 11
2
accelerating matrix multiply
> Do you have R code (including set.seed(.) if relevant) to show on how to generate > the large square matrices you've mentioned in the beginning? So we get to some > reproducible benchmarks? Hi Martin, Here is the program I used. I only generate 2 random numbers and reuse them to make the benchmark run faster. Let me know if there is something I can do to help--alternate
2017 Jan 16
1
accelerating matrix multiply
Hi Tomas, Can you share the full code for your benchmark, compiler options, and performance results so that I can try to reproduce them? There are a lot of variables that can affect the results. Private email is fine if it is too much for the mailing list. I am measuring on Knight's Landing (KNL) that was released in November. KNL is not a co-processor so no offload is necessary. R executes
2017 Oct 09
1
Using response variable in interaction as explanatory variable in glm crashes R
>>>>> Jan van der Laan <rhelp at eoos.dds.nl> >>>>> on Fri, 6 Oct 2017 12:13:39 +0200 writes: > It is actually model.matrix that crashes, not glm. Same > crash occurs with e.g. lm. > model.matrix(dob_mon ~ dob_day*dob_mon, data = tab) > also crashes R. Yes, segmentation fault. It only happens when these are *logical*
2017 Jan 10
0
accelerating matrix multiply
>>>>> Cohn, Robert S <robert.s.cohn at intel.com> >>>>> on Sat, 7 Jan 2017 16:41:42 +0000 writes: > I am using R to multiply some large (30k x 30k double) > matrices on a 64 core machine (xeon phi). I added some timers > to src/main/array.c to see where the time is going. All of the > time is being spent in the matprod function, most of that
2017 Jan 16
0
accelerating matrix multiply
Hi Robert, thanks for the report and your suggestions how to make the NaN checks faster. Based on my experiments it seems that the "break" in the loop actually can have positive impact on performance even in the common case when we don't have NaNs. With gcc on linux (corei7), where isnan is inlined, the "break" version uses a conditional jump while the
2019 Sep 12
0
Fw: Calling a LAPACK subroutine from R
Hi guys, interestingly, my problem seems to be solved by writing a FORTRAN wrapper for the Fortran code! (As long as the check doesn't get smarter...). This is the relevant part of my Fortran code: ----------------------------------------------------------- subroutine gmlfun(what, & totevent, totrs, ns, & antrs, antevents, size, & totsize,
2004 Nov 02
0
how to call function in ../src/main
Hi, This is Kotien Wu from NIH/NCI. We want to use R function for our web: http://cgap.nci.nih.gov It works for functions in R/R-1.9.1/src/nmath/standalone very well. We have function GetPvalueForT.c which has #define MATHLIB_STANDALONE 1 #include <Rmath.h> double GetPvalueForT ( double t, double deg ) { return 2 * pt(t, deg, 0, 0); } We create GetPvalueForT.i, which has /* File :
2019 Apr 30
1
patch to improve matrix conformability error message
On Mon, Apr 29, 2019 at 06:28:46PM -0700, frederik at ofb.net wrote: > I think this is a good idea. Is there a reason why it got no interest? > Slippery slope? What's the next step? Can it get committed? > Or maybe others were also just occupied trying to figure out how > Joshua's second message had timestamp earlier than his first message? As a new subscriber, I guess my
2017 Oct 06
2
Using response variable in interaction as explanatory variable in glm crashes R
The following code crashes R (I know I shouldn't try to estimate such a model; this was a bug in some code of mine). I also tried with R-devel; same result. tab <- structure(list(dob_day = c(FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE), dob_mon = c(FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE), dob_year = c(FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE), n =
2019 Sep 11
4
Fw: Calling a LAPACK subroutine from R
Sorry for cross-posting, but I realized my question might be more appropriate for r-devel... Thank you, Giovanni ________________________________________ From: R-help <r-help-bounces at r-project.org> on behalf of Giovanni Petris <gpetris at uark.edu> Sent: Tuesday, September 10, 2019 16:44 To: r-help at r-project.org Subject: [R] Calling a LAPACK subroutine from R Hello R-helpers!