Displaying 20 results from an estimated 20000 matches similar to: "3d matrix * 1d matrix question"
2008 Jan 20
2
Efficient way for multiplying vectors with a only certain number of rows in a matrix
Dear R-users,
I am working on a problem that I am currently not able to solve efficiently.
It is about multiplying one column of a matrix with only a certain number of
rows of another matrix.
Let me illustrate my problem with an example:
n.obs = 800
n.rowsperobs = 300
n.param = 23
Designmat = matrix(rnorm(n.obs*n.rowsperobs*n.param),ncol=n.param)
Betamat =
2009 Mar 17
2
sweep?
I am having a hard time understanding just what 'sweep' does. The documentation states:
Return an array obtained from an input array by sweeping out a summary statistic.
So what does it mean "weeping out a summary statistic"?
Thank you.
Kevin
2011 Nov 04
6
Matrix element-by-element multiplication
is there a way to do element-by-element multiplication as in Gauss
and MATLAB, as shown below? Thanks.
---
a
1.0000000
2.0000000
3.0000000
x
1.0000000 2.0000000 3.0000000
2.0000000 4.0000000 6.0000000
3.0000000 6.0000000 9.0000000
a.*x
1.0000000 2.0000000 3.0000000
4.0000000
2003 Sep 25
1
apply on a 4D array
I am trying to multiply a 3D array of 4x4x4 by the 4 3D arrays of a 4D array
with dimensions 4x4x4x4 (the last dimension being the one that I want to
split by).
(4x4x4 array)
> hiaAry
, , a1
i1 i2 i3 i4
h1 9.5936098 6.001040 0.08772 0.3138600
h2 1.2003500 1.454570 2.79248 0.0000000
h3 0.1346500 0.201220 0.39256 0.5464000
h4 0.0109000 0.012270 0.16417 0.2766900
,
2012 Apr 20
3
Matrix multiplication by multple constants
Dear R helpers
Suppose
x <- c(1:3)
y <- matrix(1:12, ncol = 3, nrow = 4)
> y
[,1] [,2] [,3]
[1,] 1 5 9
[2,] 2 6 10
[3,] 3 7 11
[4,] 4 8 12
I wish to multiply 1st column of y by first element of x i.e. 1, 2nd column of y by 2nd element of x i.e. 2 an so on. Thus the resultant matrix should be like
> z
[,1] [,2] [,3]
[1,] 1
2011 Nov 16
1
multiplying columns in matrix
Say I have two matrixes: one is 8x28 and other 8x8
I'd like to multiply, for example, first and second column from the 8x8 and
plant them in first column of 8x28.
Then take first and third of 8x8 and plant into second column of 8x28.etc.
Any ideas?
Thanks!
[[alternative HTML version deleted]]
2010 Sep 21
2
multiplying values in data frame by corresponding value in the first column
I am sure there is a simple solution to this... I have a column in a
data frame specifying a grouping (1, -1) for my observations, and need
to mutliply each observation in all the other columns of the data frame
by the corresponding value in the given column. I played with apply, and
saw some suggestions for sweep, but did not manage to get it working.
My table contains NAs....
Example of
2007 Mar 13
0
multiplying matrix by vector of times
On 8/3/07 22:12, "Gad Abraham" <g.abraham at ms.unimelb.edu.au> wrote:
> Laura Hill wrote:
>>
>>
>> On 7/3/07 00:15, "Gad Abraham" <g.abraham at ms.unimelb.edu.au> wrote:
>>
>>>> On 6 Mar 2007, at 08:54, Laura Hill wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> My name is
2008 Jan 30
4
Multiplying each row of a big matrix with a vector
I have a big matrix 'ret'. I want to multiply each row of it with a 2nd vector 'pos', resulting result, I want to save in a vector named 'port'. I wrote following code:
> pos
[1] 2593419 2130220 6198197 1673888 1980000 1784732 2052120 -7490228 -5275000
> dim(ret)
[1] 500 9
> fu # user defined function
function(x)
{
fu = x %*%
2018 Aug 23
3
Condition code in DAGCombiner::visitFADDForFMACombine?
I don't think the global fast math flag should override the NoContraction
decoration as that's mostly the point of that decoration to begin with, to
have fine granular control while still having a broad sweeping
optimization. Did I miss your point? I feel like I did.
On Thu, Aug 23, 2018, 3:42 PM Michael Berg <michael_c_berg at apple.com> wrote:
> Ryan,
>
> Given that the
2019 Sep 04
7
[RFC] changing variable naming rules
Hi all,
To get wider visibility, build a broader consensus and address concerns on
this topic, I'm again raising this as an RFC. This is a proposal to change
the rule for variable names from CamelCase to camelBack _really this time_.
Background:
This has been proposed several times on this mailing list in the past. Most
recent one was by Michael Platings in February this year [1], and there
2017 Jan 09
0
accelerating matrix multiply
> From: "Cohn, Robert S" <robert.s.cohn at intel.com>
>
> 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
2004 Oct 04
7
Strange Matrix Multiplication Behaviour
Hi there fellow R-users,
Im seeing some strange behaviour when I multiply a vector by a matrix
Here is my script:
> tr
1 2 3 4 5 6
0.2217903 0.1560525 0.1487908 0.1671354 0.1590643 0.1471667
>
> ex1
a b c d e f
1 0.2309579 -3.279045 -0.6694697 -1.1024404 0.2303928 -1.5527404
2
2009 Jul 11
0
[LLVMdev] review request for patch
Hi Ryan,
In this case there already is an implementation for this, it's just hard
to find being in the internals of the LoopVR pass. I'm planning to pull
the multiply and udiv support out of there.
Your patch looks good but beyond what Dan mentioned you have a bug
calculating NewUpper: the constant ranges are half-open intervals where
"[5, 10)" includes the value 9 but not
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
Nicolai,
Can you do without the use of -fp-contract=fast (Options.AllowFPOpFusion == FPOpFusion::Fast ) and without Unsafe?
As I SPIR-V’s usage of NoContraction flies in the face of both.
If so, you should be able to get what you want, as then you are down to just IR flags. You will need a model to generate the correct behavior though in your SPIR-V implementation wrt IR flag emissions.
2019 Sep 07
2
[RFC] changing variable naming rules
[just so i don't end up with "why haven't you spoken up"]
On Sun, Sep 8, 2019 at 1:32 AM Philip Reames via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> I do not support this. I feel the benefit is low, and the churn cost is high.
>
> I'm not strongly opposed or anything, I just don't believe this is worthwhile.
Same thoughts.
> Philip
Roman
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 08
2
[RFC] changing variable naming rules
What cost do you see here? Rui has done a significant amount of work to make this effectively zero cost.
The improvements are meaningful, and (as was discussed on the other threads) pretty much every large scale change in the LLVM world has been shot down with objections like “it is too much churn”.
This is a huge problem, because it leads to stagnation in the codebase and does not allow
2009 Dec 02
0
[Fwd: Re: Adding and Multiplying two Unevaluated Expressions]
-------- Original-Nachricht --------
Betreff: Re: [R] Adding and Multiplying two Unevaluated Expressions
Datum: Tue, 01 Dec 2009 23:49:39 +0100
Von: Benjamin M?ller <ben_mueller.bm at web.de>
An: Rolf Turner <r.turner at auckland.ac.nz>
Referenzen: <20091201144125.316310 at gmx.net>
<8E40E49F-E8FC-4FBD-8CC5-93789FFB0E53 at auckland.ac.nz>
This works fine for your
2011 Sep 05
0
[LLVMdev] arithmetical operands signedness
Hi Jonas,
> my target handles operands of multiplying instructions differently based on
> signedness.
since the result of a multiply doesn't depend on the signedness, I find it
strange that your target differentiates between them. What I'm saying is
that if you have (say) two i32 numbers a and b and you do a signed multiply:
c = a *s b
and an unsigned multiply
d = a *u b