Re: Converting Fortran 90 array access to use Matrix?

"Hartley, Bob" <[email protected]>
Newsgroups gmane.comp.lib.boost.ublas
Message-ID <59847A1E3A518A4BA8852607D105A6235C9A9164@HSV-MB002.huntsville.ads.sparta.com>
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?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.