Re: [eigen] conservative resize ...

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On Mon, Sep 7, 2009 at 4:28 PM, Benoit Jacob<jacob.benoit.1@xxxxxxxxx> wrote:
> There already is: MatrixBase<T>::IsVectorAtCompileTime.

yes, i know.

i  was thinking about something like this...

template <int IsVector>
struct resize_xpr_helper
{
  template <typename Derived, typename OtherDerived>
  static void run(const Eigen::MatrixBase<Derived>& _this, const
Eigen::MatrixBase<OtherDerived>& other)
  {
    std::cout << "Matrix assignment" << std::endl;
  }
};

template <>
struct resize_xpr_helper<1>
{
  template <typename Derived, typename OtherDerived>
  static void run(const Eigen::MatrixBase<Derived>& _this, const
Eigen::MatrixBase<Derived>& other)
  {
    std::cout << "Vector assignment" << std::endl;
  }
};

- hauke



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/