|
Ublas : |
Subject: Re: [ublas] returning a ublas matrix from a function
From: PB (newbarker_at_[hidden])
Date: 2014-08-05 04:45:21
You've declared main() as returning int but you're trying to return a type
that isn't an int. What do you expect to happen? The compiler error is
pretty clear here IMO.
On Tue, Aug 5, 2014 at 9:27 AM, sanann <padalasaisandeep_at_[hidden]> wrote:
> Thank you very much for that.
>
> but on the other hand i tried the same with another part of my code but i
> still get the same error. could you kindly help me through this too.
>
> int main(int argc, char *argv[])
> {
> QApplication a(argc, argv);
> const size_t arraySize = 3;
> boost::numeric::ublas::matrix<double> M[arraySize] =
> {
> boost::numeric::ublas::scalar_matrix<double>(2, 2),
> boost::numeric::ublas::scalar_matrix<double>(3, 3),
> boost::numeric::ublas::scalar_matrix<double>(4, 4)
> };
>
>
> for (int i=0;i<4;i++)
> {
> std::cout << M[i]<< std::endl;
> }
> return M;
> }
>
> I end up with the same error.
> error: invalid conversion from 'boost::numeric::ublas::matrix<double>*' to
> 'int' [-fpermissive]
> return M;
> ^
>
>
>
> --
> View this message in context:
> http://boost.2283326.n4.nabble.com/returning-a-ublas-matrix-from-a-function-tp4666050p4666054.html
> Sent from the Boost - uBLAS mailing list archive at Nabble.com.
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: newbarker_at_[hidden]
>