Boost logo

Ublas :

Subject: Re: [ublas] Converting Fortran 90 array access to use Matrix?
From: Hartley, Bob (Bob.Hartley_at_[hidden])
Date: 2014-01-09 12:48:40


Does subrange not do what you want? <snippet... it should be mostly readable...> (...input matrix a of size nxn ) int n = a.size2(); int size = 2*n; boost::numeric::ublas::matrix<double>p(size,size); boost::numeric::ublas::subrange(p, 0,n, 0,n) = -trans(a); boost::numeric::ublas::subrange(p, 0,n, n,size) = ublas::zero_matrix<double>(n,n); boost::numeric::ublas::subrange(p, n,size, 0,n) = temp * dt; boost::numeric::ublas::subrange(p, n,size, n,size) = a; Bob the amateur. ________________________________________ What is the most efficient way to convert Fortran's column array access like shown below to C++? a(i,:) = 0 ! set entire column to zero I suspect best solution might use matrix proxies like matrix_row? Can this be done on one line without the for loop? Can you help me fix the syntax on the commented out code that attempted to use iterators?