Re: returning a ublas matrix from a function

oswin krause <[email protected]>
Newsgroups gmane.comp.lib.boost.ublas
Message-ID <[email protected]>
Hi,

the error lies in the fact that it has to be "BMT fun()" and not "BMT 
fun();" and is not an ublas error.

Regards,
Oswin

On 05.08.2014 10:05, sanann wrote:
> hello,
> I am trying to return a array of matrices from a function but when i use
> return there is always an error can you please help me.
>
>
> typedef boost::numeric::ublas::matrix<double> BMT;
>
>       BMT fun();
>         {
>         BMT mym;
>         mym.resize(3,3);
>         for(int i = 0; i<9;++i) mym(i/3,i%3)=i;
>         std::cout << mym << std::endl;
>         return mym;
>         }
> error: cannot convert 'BMT {aka boost::numeric::ublas::matrix<double>}' to
> 'int' in return
>          return mym;
>                 ^
>
> why do i get this error how do i overcome it.
>
>
>
> --
> View this message in context: http://boost.2283326.n4.nabble.com/returning-a-ublas-matrix-from-a-function-tp4666050.html
> Sent from the Boost - uBLAS mailing list archive at Nabble.com.
> _______________________________________________
> ublas mailing list
> [email protected]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: [email protected]
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.