[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Sparse API
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Tue, 3 Feb 2009 14:21:44 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=sfQJUOcebu4Ii5lfVQ5JwVSrhoi5EjxtQrzK//YFC3Y=; b=lBGP0rhHbOgrRNtjJdTFqUJIv66OrllsceDQRl7t6Sx8rrT2hSvRAl8UulLP9b9YMa VRbdU3jq5XmwjdtZAHMugiyI+7il9P5mTzg7vd6Q8WoOVC0p/KnlDTY88+TmvR5bbmTJ Fwf7DLb0Idp+JUC/LHbtw7xbXKa+tpe1x3nus=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=wiv54knYH4esGYjvxWi/OZyDMrHQAJW+oRMRcDc8wT90SgpqULX2bS2dplCZL0797E UNyU6wyjhX6MPNirmk3EXTtMCk0lbU4wKTlCln5aI7tdau5HFQxfK+1WfpLTT50vr8Vw MAl0nmO409YjaH0TAFklHdkn8AzKQy3R5+phY=
2009/2/3 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
> mat.insert(i,j, value);
>
> the drawback is that makes difficult to remember the order of the
> arguments, i.e., do I have to write mat.insert(value, i, j) or
> mat.insert(i,j,value) ?? I have myself the same "problem" with
> setConstant(). Any idea, suggestion regarding this part of the sparse
> API ? Other possible changes include:
Have you thought of having a fill() returning a proxy having an
operator= so you can do:
mat.fill(i,j) = value;
? (maybe under a different name then... typically you'd call that
coefficient(), always prefer calling a function by the
name-of-what-it-returns rather than the verb-describing-what-it-does.)
One might even consider having operator() do that but then if you want
read access too with operator() it's tricky, i guess you need a
conversion operator from this proxy type to Scalar, not sure if that's
doable.
Cheers,
Benoit