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 6894393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:46:37+00:00 2026-05-27T06:46:37+00:00

I have a large 2D multi_array that I need to reduce to a smaller

  • 0

I have a large 2D multi_array that I need to reduce to a smaller set of data (also 2D). At runtime I have a vector of the column indices that I want to select and put into the sub-array.

I know that you can create a sub-array from the original array using boost::multi_array_types::index_range, but all of the examples I’m seeing use hardcoded ranges. Is there a way to set the index_range at runtime using a vector of values, or is this just not possible in multi_array?

I’m looking to do something like

vector<int> columnIndex; // contains some values
boost::multi_array_types::index_range range;
for(int idx = 0; idx < columnIndex.size(); ++idx)
     range = columnIndex[idx];
  • 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-05-27T06:46:38+00:00Added an answer on May 27, 2026 at 6:46 am

    I looked into the boost code for boost::multi_array_types::index_range, and found that this is not possible. The class has only three members to store index values – start, finish, and stride. It can’t store a more complex set of values.

    Since the number of columns that I need is dynamic, I used a vector of sub-arrays (array_view),

    vector<boost::multi_array_ref<double, 2>::array_view<2>::type::const_reference
    

    and just added to the vector as needed.

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

Sidebar

Related Questions

Interpolating Large Datasets I have a large data set of about 0.5million records representing
I have a large (multi-GB) data file exported from an Oracle table. I want
I have got a multi-threaded app that process a very large data file. Works
I have a large list (expanding over time) of URLs that I need to
I have a large table with a multi-part index. I need to run several
I have large data sets (10 Hz data, so 864k points per 24 Hours)
I have large batches of XHTML files that are manually updated. During the review
I'm developing a website in PHP and I have large JS files that I
I have a large array in PHP. It contains strings that are split into
I have a class that I need to binary serialize. The class contains one

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.