Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:15:17+00:00 2026-06-14T18:15:17+00:00

Hi I have a few boost::multi_array defined as below: typedef boost::multi_array<double, 3> region_prior_integral_image I

  • 0

Hi I have a few boost::multi_array defined as below:

typedef boost::multi_array<double, 3> region_prior_integral_image

I am trying to create an array of region_prior_integral_image like the following:

unordered_map<string, int> filename_to_hash_key_map = get_filename_to_hash_key_map();

unordered_map<string, region_prior_integral_image> filename_to_region_prior_map = get_region_prior_integral_images();

region_prior_integral_image* image_cache = new region_prior_integral_image[5];
for(unordered_map<string, int>::iterator it = filename_to_hash_key_map.begin(); it != filename_to_hash_key_map.end(); it++){
    image_cache[it->second] = filename_to_region_prior_map[it->first];
}

However the program is terminating with the following: SemanticTextonForest: /home/aly/libs/boost_1_51_0/stage/include/boost/multi_array/multi_array_ref.hpp:488: boost::multi_array_ref<T, NumDims>& boost::multi_array_ref<T, NumDims>::operator=(const ConstMultiArray&) [with ConstMultiArray = boost::multi_array<double, 3ul>, T = double, long unsigned int NumDims = 3ul, boost::multi_array_ref<T, NumDims> = boost::multi_array_ref<double, 3ul>]: Assertionstd::equal(other.shape(),other.shape()+this->num_dimensions(), this->shape())’ failed.`

And I have no idea why?

I know I could just use a vector, but for arguments sake lets say I wanted to have an array of region_prior_integral_images

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:15:18+00:00Added an answer on June 14, 2026 at 6:15 pm

    Let’s say we have two region_prior_integral_image instances: A and B. If you want to assign B to A, like A = B;, the shapes of A and B must be equal. The error message is saying that, in your code image_cache[it->second] = filename_to_region_prior_map[it->first];, the two arrays are of different shapes.

    How do you created the arrays in filename_to_region_prior_map? I guess you used this constructor to specify the shapes: multi_array<double,3> B(boost::extents[i][j][k]). Hence their shape is [i][j][k]. But when you create the image_cache, the default constructor is invoked. So the two shapes mismatch.

    My opinion is to store pointers of region_prior_integral_image in your code, which will save a lot of copy as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class which contains a few boost::numeric::ublas::matrix's within it. I would like
I have a few questions about boost::regex: I tried an example below. 1) What
I have a few projects that use boost::shared_ptr or std::shared_ptr extensively (I can convert
I have a few static unordered_maps in my application that I would like to
i have code like below. Base is the base class and D1, D2, D3
I have a few classes: Array, Shape, Point. A point is a type of
I'm currently working on a C++ project that needs to have as few external
in my code i would like boost::shared_ptr not to call delete but call ptr->deleteMe()
I have a ini file which contains some sample values like: [Section1] Value1 =
Im trying to create a PNG sequencer class that will allow me to change

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.