-
March 1st, 2011, 07:30 AM
#1
Boost multy_array gives an runtime error
Hi guys, i am a beginer in C++, i am developing a Managed C++ wrapper for an existing native C++ dll. The native C++ dll uses std:: pair<unsigned long, boost::multi_array<double,2>> as input.I tried creating a multiarray object and got the error when i tried assigining it to "second" property of pair object. Please help. I have put the code below.
"Assertion Failed!"
multi_array_ref.hpp:487:
`std::equal(other.shape(),other.shape()+this->num_dimensions(),
this->shape())'
std:: pair<unsigned long, boost::multi_array<double,2>> dataPointNative;
dataPointNative.first = 100;
KWExtrinsicModuleStructures::Matrix^ rMatrix = dpt->Value;
boost::multi_array<double,2> rachetmatrix(boost::extents[3][3]);
for(int i=0;i<rMatrix->Rows;i++)
{
for(int j=0;j<rMatrix->Columns;j++)
{
rachetmatrix[i][j] = 3.1417;
}
}
dataPointNative.second = rachetmatrix; //Line where i get the error.
Thanks in Advance.
Naresh
-
March 1st, 2011, 07:47 AM
#2
Re: Boost multy_array gives an runtime error
I think you get the error because dataPointNative.second isnt the same dimension as [3][3].
try
Code:
dataPointNative.second.resize(boost::extents[3][3]);
dataPointNative.second = rachetmatrix;
-
March 1st, 2011, 08:14 AM
#3
Re: Boost multy_array gives an runtime error
Bingo! Thank you very much.That was the issue. Saved my day.
Naresh
-
March 1st, 2011, 09:31 AM
#4
Re: Boost multy_array gives an runtime error
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|