No known expression from value to value&… Why?

后端 未结 3 608
长发绾君心
长发绾君心 2021-01-22 01:14

I have tried writing a function which takes a ColXpr value as input:

typedef Eigen::Array Signal2D;

vo         


        
3条回答
  •  死守一世寂寞
    2021-01-22 01:54

    To complete previous answers, you're probably looking for the Ref<> class which will allow you to write a function that accept both columns of a matrix and vectors without templates nor copies:

    void threshold(Ref params) {
        params = (params >= 0 ).cast();
    }
    ArrayXf  a;
    ArrayXXf A;
    /* ... */
    threshold(a);
    threshold(A.col(j));
    

提交回复
热议问题