Re: [eigen] maxCoeff taking reference?

[ Thread Index | Date Index | More Archives ]

We must make sure that this does not introduce overhead if the index(es) is not used. Perhaps with some template magic it is possible to distinguish calling

   auto [value, row,col] = A.maxCoeff();
   auto value = A.maxCoeff();

This would actually be very close to how Matlab "overloads" many functions. If that is not possible, we could of course just give one method a different name.

Btw: I agree on not overloading for references, as it should be obvious that these are out-parameters. O.t.o.h., with pointers there is always the ambiguity if null-pointers are allowed or not.


On 22/03/2019 09.45, Gael Guennebaud wrote:
We chose pointers to emphasise they are out parameters. I would not add
overloads taking references but maybe a version returning everything within
a struct to be used with C++17 structure bindings?

On Thu, Mar 21, 2019 at 3:27 AM Meng Zhu <meng@xxxxxxxxxxxxx> wrote:

hi, I noticed eigen maxCoeff function (
takes pointers to return the max entry coord, and there is no overload to
take reference type. is there a reason to not provide reference access?


 Dr.-Ing. Christoph Hertzberg

 Besuchsadresse der Nebengeschäftsstelle:
 Robotics Innovation Center
 Robert-Hooke-Straße 5
 28359 Bremen, Germany

 Postadresse der Hauptgeschäftsstelle Standort Bremen:
 Robotics Innovation Center
 Robert-Hooke-Straße 1
 28359 Bremen, Germany

 Tel.:     +49 421 178 45-4021
 Zentrale: +49 421 178 45-0
 E-Mail:   christoph.hertzberg@xxxxxxx

 Weitere Informationen:
  Deutsches Forschungszentrum für Künstliche Intelligenz GmbH
  Trippstadter Strasse 122, D-67663 Kaiserslautern, Germany

  Prof. Dr. Jana Koehler (Vorsitzende)
  Dr. Walter Olthoff

  Vorsitzender des Aufsichtsrats:
  Prof. Dr. h.c. Hans A. Aukes
  Amtsgericht Kaiserslautern, HRB 2313

Mail converted by MHonArc 2.6.19+