HI
I was working on online example, where virus is spread through a graph. The
example is sufficient for small graph i.e. small number of edges and nodes.
But I tried it on very large graph i.e. 1 nodes and 2 edges, but
the below function is not sufficient for large graph because its slow.
Ravi Varadhan; 'r-help@r-project.org'
Subject: Re: [R] Vectorized code for generating the Kac (Clement) matrix
On 26-04-2013, at 14:42, Enrico Schumann wrote:
> On Thu, 25 Apr 2013, Ravi Varadhan writes:
>
>> Hi, I am generating large Kac matrices (also known as Clement mat
On 26-04-2013, at 14:42, Enrico Schumann wrote:
> On Thu, 25 Apr 2013, Ravi Varadhan writes:
>
>> Hi, I am generating large Kac matrices (also known as Clement matrix).
>> This a tridiagonal matrix. I was wondering whether there is a
>> vectorized solution that avoids the `for' loops to the f
On Thu, 25 Apr 2013, Ravi Varadhan writes:
> Hi, I am generating large Kac matrices (also known as Clement matrix).
> This a tridiagonal matrix. I was wondering whether there is a
> vectorized solution that avoids the `for' loops to the following code:
>
> n <- 1000
>
> Kacmat <- matrix(0, n+1,
On 25-04-2013, at 17:18, Ravi Varadhan wrote:
> Hi,
> I am generating large Kac matrices (also known as Clement matrix). This a
> tridiagonal matrix. I was wondering whether there is a vectorized solution
> that avoids the `for' loops to the following code:
>
> n <- 1000
>
> Kacmat <- matr
Hi,
I am generating large Kac matrices (also known as Clement matrix). This a
tridiagonal matrix. I was wondering whether there is a vectorized solution
that avoids the `for' loops to the following code:
n <- 1000
Kacmat <- matrix(0, n+1, n+1)
for (i in 1:n) Kacmat[i, i+1] <- n - i + 1
for
6 matches
Mail list logo