|Re: [eigen] Question about ColMajor vs. RowMajor|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Question about ColMajor vs. RowMajor
- From: Rhys Ulerich <rhys.ulerich@xxxxxxxxx>
- Date: Mon, 19 Dec 2011 09:27:07 -0600
- Cc: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>, Michael Dixon <mdixon@xxxxxxxxxxxxxxxx>, Suat Gedikli <gedikli@xxxxxxxxxxxxxxxx>
- 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 :cc:content-type; bh=WsqOUeIrP2ZCsfEQfVYW9bn5VEqypo1tOz/AH29ZisM=; b=J0IXGb0xa8ZWKUz+AUTkoMaMdPVgbaZTjJGzuPae6Yi+eJpymtvaKJFIY6f1FLw1QR 8xVLvbTT7n3Vd51oOlF9vrZ5nGWXiUa2nvc5rPHG1/MumThQRvqgsCMfgGuWsKtMmaey 80T/xxVWcaRYaRMbyPm90MOrCkrBhn5wkFbdc=
> For example, if people misuse the () operator and are not reading
> the documentation properly, then every time someone upstream
> adds the -DEIGEN_DEFAULT_TO_ROW_MAJOR flag, their code
> will break in horrible ways without a single warning.
> I am still a bit conflicted on what to tell users.
If the storage ordering of the matrix matters for one of your users'
uses of operator(), add some compile-time assertions to check that the
incoming types are indeed row or column major. Those regions should
have such asserts anyhow to make the storage requirements
There's no fairy dust that can protect people from these types of mistakes.