Re: [eigen] Cholesky on mapped matrices? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Cholesky on mapped matrices?
- From: Ben Goodrich <bgokgm@xxxxxxxxxxxxxx>
- Date: Wed, 9 Jun 2010 20:08:45 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=8be6f7nPWL3wEEokxNiGEq5v+cBz7jbBbyEmp13WJ8k=; b=VV8ipHuOr+y6JLCo3SR6pIxxCqxo8/2O4Z1iDvhLWvZkwPc5WIAMbQpc2Xh4pTRLtC qAGE32Pc5PQAjiKQ7OneeXlojkaXstMGoip2/jtQxXBMmmgzTHdc1mLtRklTGtZCKaTo 8CO0n+jnxMqKytGsWL7/QaoVvzlSDIrvehPSQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=OXWSEtAu81QqFCRIC/pQCKElG3QTumk/SuuKUckguVu4jHakTbn36ujMKRL99H72bW qFTLAUguloUV3WTenrfS4C5TR/vdiZYXwNJ8teHYsDBNxX1fkxc+ZAd+b66H+BN+WOi6 l9Hro8W9hJkr5Evpdm3TRR/b9KQDhB6CRmIqE=
Hi Manoj,
On Wed, Jun 9, 2010 at 7:09 PM, Manoj Rajagopalan <rmanoj@xxxxxxxxx> wrote:
> Hi,
>
> Is it possible to map a region of allocated memory into a square matrix and
> then call llt() and ldlt() on it? A small test program of mine failed. Maybe
> there are tricks to achieve this?
I've been able to do so for a while, calling Eigen code on objects in R's memory
void my_LDLt(const double *A, const int *n, double *D, double *L) {
Map<MatrixXd> AA(A, n[0], n[0]);
LDLT<MatrixXd> AA_factored = AA.ldlt();
Map<VectorXd>(D,n[0]) = AA_factored.vectorD();
Map<MatrixXd>(L,n[0],n[0]) = AA_factored.matrixL();
}
Ben