Re: [eigen] Recursion and block matrices

 Thanks for the redirect.  Also, Gael's recent example ``` VectorXd Block_Solve(Ref A, const Ref& b ) ... ``` was very helpful. Here is code that works using Ref: ////////////////////////////////////////////////////////// #include using namespace Eigen; #include using namespace std; void incr( Ref< MatrixXd >& matV ) {   ++matV(0,0);   if( ( 1 == matV.rows() ) ||       ( 1 == matV.cols() ) )   {     return;   }   Ref< MatrixXd > sub( matV.block( 1,                                                          1,                                                          matV.rows() - 1,                                                         matV.cols() - 1 ) );     incr( sub ); }// incr int main( int argc, char* argv[] ) {   MatrixXd mat( 3, 4 );   mat << 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120;   cout << "Before:\n" << mat << endl;   Ref< MatrixXd > sub( mat );   incr( sub );   cout << "After:\n" << mat << endl;   return 0; }// main ///////////////////////////////////////////////////////////////////////////////////////////////// I would like to upgrade Ref, further, and have some questions: -- What was it about the Eigen class designs that made it convenient to restrict Ref to innerStride==1? Would it be a major development to remove this restriction?  (convenient for transposing and even/odd subscripting). -- Is there a signature for incr() that would allow me to pass in the MatrixXd directly, without first converting it to a Ref in main():   Ref< MatrixXd > sub( mat );   incr( sub ); -- Are the two expressions   Ref< MatrixXd > sub = mat;   Ref< MatrixXd > sub( mat ); supposed to be equavalent?  I think that a compiler is allowed to interpret the first one as a default constructor followed by an assignment operator. Thank you, Norm On 09/21/2012 02:09 AM, Christoph Hertzberg wrote: On 19.09.2012 19:34, Norman Goldstein wrote: However, there is a software engineering issue that I have not been able to resolve: Sorry, if you don't get support re-inventing the wheel ... If you really have concerns against using the dev-branch (though I can't remember that something bad happened to me using that), you can also just copy the Ref-class from that branch. Christoph On 08/28/2012 01:01 AM, Gael Guennebaud wrote: With the devel branch you might try: void incr(Ref mat) { // no cast needed ... }

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