Re: [eigen] Re: Map and pointer freeing in unsupported/Eigen/src/SparseExtra/CholmodSupport.h |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Re: Map and pointer freeing in unsupported/Eigen/src/SparseExtra/CholmodSupport.h
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Thu, 18 Aug 2011 17:08:21 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=Gk77POwb8c0heDhaZzDWtHp1dA4carRHBjREMPREAJw=; b=WHNXW6PALzE8kEiByAqoPi8yhg6yVjTrWdvsJ4tyddEFYZMw0RaDeJZu7cjHxCn1YY KS1AHXJGxrMkNRT2mMoFW8se0SA8t8Yi1i62+QEU6iGoEB944Hqsf1623jsiThMT1agl Adq95L3koPf7LJ4ZU5gqsb9BN2crCRw+/dTN0=
> I would say there won't be an easy and save fix, because one can't be sure
> what kind of allocator CholMod uses on different platforms or in future
> versions.
Yes that's why swapping is probably not the right solution. Als,o
swapping would only allow to get rid of the extra copy, not of the
extra allocation.
> A save way would be to do the triangular solve operations with own code (or
> is there a CholMod function which works on views instead of allocating own
> memory?).
This would indeed be better. I quickly checked the user manual, and
there are low levels solvers routines for the supernodal mode only,
but that's all we need because otherwise me can directly use Eigen's
own routines:
cholmod_super_lsolve(...)
cholmod_super_ltsolve(...)
this is however a clear low priority for I because the benefits will
be very marginal.
cheers,
gael
>> viewAsEigen will return a MappedSparseMatrix with pointers to contents
>> that will be freed in the subsequent line, unless I am missing
>> something subtle.
>>
>> The comments about swapping lead me to believe that the dest argument
>> has storage allocated on entry to the function, in which case the
>> values could be copied from the structs&x_cd or&x_cs. I must admit
>> I get a little lost in the details of the sparse_solve_retval struct
>> so if anyone could tell me the status of the Dest argument when the
>> _solve method is called, I would appreciate it. In particular, for a
>> dense return value, has the storage for the data already been
>> allocated?
>
> cholmod_solve allocates its own result vector (stored in x_cs). dest is a
> parameter of _solve(). Currently the values _are_ copied (which technically
> is not necessary).
> If one assigns a solve_retval object to a vector x, then solve_retval's
> evalTo function is called with parameter x.
>
>
> Christoph
>
> --
> ----------------------------------------------
> Dipl.-Inf. Christoph Hertzberg
> Cartesium 0.051
> Universität Bremen
> Enrique-Schmidt-Straße 5
> 28359 Bremen
>
> Tel: (+49) 421-218-64252
> ----------------------------------------------
>
>
>