Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
123 views

It is very easy to delete the last rows or columns in a boost::multi_array, for example, using the following minimal example: #include "boost/multi_array.hpp" #include <iostream> ...
TMueller83's user avatar
2 votes
1 answer
91 views

I have this apparently simple code, but boost complains about a dimension mismatch: #include <iostream> #include <fstream> #include "boost/multi_array.hpp" struct t_struct { ...
user3131020's user avatar
2 votes
2 answers
225 views

I am running a simple benchmarking exercise of 2d array access of reading and writing. I have const int XDim = 1000; and const int YDim = 1000; and create a 1000 x 1000 matrix. In C-style, I ...
Tryer's user avatar
  • 4,198
3 votes
2 answers
94 views

I'm trying to use boost::multi_array_ref to use a block of contiguous data in my code. But I worry about if I use the code like below, the 1d C array won't be confirmed to save: #include <iostream&...
Learning Lin's user avatar
1 vote
1 answer
182 views

I receive a matrix with elements of type unsigned char from another function and I am trying to find its max value. boost::multi_array<unsigned char, 2> matrix; All elements are integers and so ...
jelc's user avatar
  • 45
1 vote
1 answer
75 views

When I run the following with warning flags I get a type conversion warning. #include <boost/multi_array.hpp> void function (boost::multi_array<unsigned char, 2> matrix) { int nrows = ...
jelc's user avatar
  • 45
1 vote
1 answer
299 views

I'm struggling to access the values and store them in boost multi_array container. I've tried to access the elements using the indexing methods ([] and .at()), but throws error: no matching function ...
Mahesh's user avatar
  • 1,146
2 votes
2 answers
152 views

In my program I use boost::multi_array and sometimes it is important to convert a pointer to an element inside the container into its indices, for example, to check that the element is not on the ...
Fedor's user avatar
  • 24.8k
1 vote
1 answer
349 views

Is there a reason to prefere the usage of boost::multi_array_ref over boost::multi_array&? Why is the adapter class boost::multi_array_ref provided by boost at all?
UweJ's user avatar
  • 489
2 votes
2 answers
310 views

How can I execute a mathematical operation between two boost::multi_arrays? Example of adding two arrays with value type double: auto array1 = boost::multi_array<double, 2>(boost::extents[10][10]...
UweJ's user avatar
  • 489
1 vote
1 answer
116 views

How can I copy (deep-copy) a selcted range (view) from a boost::multi_array to another array?
UweJ's user avatar
  • 489
2 votes
1 answer
184 views

I need to send reference to a subarray of 2d of Boost.MultiArray with Boost.MPI. Now I have the following code: matrix_type::array_view<2>::type current_process_batch = ...
Denys Ivanenko's user avatar
2 votes
1 answer
455 views

I am working on a program where I need to use 2d Boost.MultiArray. I managed to initialize it and fill it with data. But I don't understand how to take subarray of size i,j if multiarray is of size m,...
Denys Ivanenko's user avatar
1 vote
2 answers
82 views

I want to add two boost multi-arrays in C++. The first challenge is the alignment of the two arrays. One of these arrays is vertically aligned and the other is horizontally aligned as shown in the ...
UweJ's user avatar
  • 489
1 vote
2 answers
217 views

I have a function called DataView that performs the "slicing" (creation of the array_view) as follows: template <class T> typename Boost<T>::Array2D::template array_view<2>::type ...
B.Plant's user avatar
  • 23
1 vote
1 answer
139 views

I have several large arrays of 64-bit integers whose values are expensive to calculate, so I presently have generator codes in my build system that calculate the constants and generate the .cpp files ...
ppyvabw's user avatar
  • 141
2 votes
1 answer
93 views

std::vector<T> foo(100) initialises every element with the default value for T. Does boost::multi_array<T, 2> foo(boost::extents[10][10]) do the same?
Timmmm's user avatar
  • 99.3k
1 vote
0 answers
172 views

I programmed a piece of code where I have a huge 3D matrix in C++ using boost::multi_array. For every matrix element I want to sum up the neighborhood in a certain distance dist. Every element is ...
Ella's user avatar
  • 11
4 votes
1 answer
104 views

I'm using a two-dimensional boost::multi_array to store objects of a custom struct. The problem is that I have a huge amount of these objects so that the index of the array I would need exceeds the ...
maria2703's user avatar
3 votes
1 answer
743 views

I got this error in C++. I am trying to implement Strassen matrix multiplication with multi_array. I assign one array to another which they same dimension. Like that A11[i][j][k] = A[i][j][k]. I ...
helios_'s user avatar
  • 31
6 votes
3 answers
1k views

Say I have #include <boost/multi_array.hpp> using intArray3D = boost::multi_array<int, 3>; and I want to create a bunch of intArray3Ds with the same shape: auto my_shape = boost::...
rayhem's user avatar
  • 771
1 vote
1 answer
52 views

I have a probably stupid question, but I am trying to define a 8x3 array (each row is an array of 3 xyz-indices of a cell, there are 8 cells in total) using boost::multi_array. My question is, is ...
Minh N's user avatar
  • 61
2 votes
1 answer
282 views

Suppose i need a five-dimensional array as class member and want to use it in different functions. For this puropose I use boost::multi_array e.g.: class myClass { typedef boost::multiarray<...
knallfrosch's user avatar
3 votes
1 answer
253 views

I am writing a class that acts as a go-between for c++ classes and legacy c code. I have been using boost multi_array's to simplify a lot of the code. This mult_array is declared as such: using Array ...
CodeSmith's user avatar
  • 123
7 votes
1 answer
552 views

It doesn't appear that multi_array has a move constructor - is this correct? Is there a reason for this or was it just never implemented since the class seems to have been written before move ...
David Doria's user avatar
  • 10.4k
5 votes
2 answers
1k views

I'd like to initialize a boost::multi_array inline in some code. But I don't think the boost::multi_array supports initialization from an initializer list. Here's what I have so far: // First create ...
Christopher Bruns's user avatar
0 votes
0 answers
51 views

I m quite new to c++ but working hard. I m using the boost::multi_array library in a project but I got problem with typedef. //in main.h #include "boost/multi_array.hpp" #DEFINE D #include "...
Cocco Nat's user avatar
2 votes
1 answer
40 views

I am trying to build a function to write multidimensional arrays to the file system. In order to keep it compact I would like to just create one function for different sized multi_arrays. typedef ...
coJetty's user avatar
  • 57
3 votes
2 answers
125 views

I`m writing a code for which I'm using a 3 dimensional boost multiarray to save coordinates. But I always get a segmentation fault at some point. How are boost multiarray sizes limited and how can I ...
Myrkjartan's user avatar
3 votes
1 answer
161 views

Is the arrow operator missing from boost multiarray iterators? Am I wrong to expect this to work? #include <vector> #include <boost/multi_array.hpp> struct foo { int n; }; int main()...
cambunctious's user avatar
  • 9,861
2 votes
1 answer
470 views

How can I reassign a boost multi_array_view to point to a different part of a multi_array? I don't want a deep copy. boost::multi_array<int, 2> a(...); array_view b = a[indices[index_range(0, 5)...
cambunctious's user avatar
  • 9,861
2 votes
2 answers
77 views

A multi_array view has many of the same methods as a multi_array. Do they have a common base that I can use by reference? void count(Type a) { // ^^^^ what should I use here? cout <<...
cambunctious's user avatar
  • 9,861
2 votes
1 answer
101 views

My plan is to store hundreds (or even thousands) of (interpolation) functions in the multidimensional array multi_array from the boost library. I need to store them, since I need to call them at ...
USC's user avatar
  • 47
2 votes
0 answers
188 views

I want to plot a multi-array I have created with the Boost library. I keep getting stuck inside my gnuplot-third party library (added in order to plot). Im having trouble sending the correct ...
Trygve's user avatar
  • 21
3 votes
1 answer
121 views

I am using a boost::multi_array to store some data. I do all my work on the data using views, because I need to work with slices of the data in different dimensions. My question is, how is the memory ...
Peter A's user avatar
  • 237
2 votes
1 answer
144 views

In the following code, the ExtractSubArray function is totally generic, while the ExtractSubArrayCornerAndExtent requires knowledge of the dimensionality at the time the code is written (to construct ...
David Doria's user avatar
  • 10.4k
3 votes
1 answer
311 views

I work on big data and program in c++. For example, I need to create 4-dimensional arrays of size [7 x 128^3 x 5 x 5] etc. I will have to create many more arrays as intermediate data structures for ...
Jackson's user avatar
  • 33
0 votes
2 answers
1k views

I want to understand how to use the view functionality provided by boost::multi_array. Specifically, I want to be able to iterate within a single loop over all elements of a view that represents a ...
burnedWood's user avatar
0 votes
1 answer
446 views

I am trying to extract a sub-array from a multi_array. For this demo, let's assume that there are no collapsed dimensions (i.e. the dimensionality of the sub-array is the same as the original array). ...
David Doria's user avatar
  • 10.4k
1 vote
0 answers
123 views

This discussion has let to another question. It seems that index_gen in multi_array (a.k.a. boost::multi_array::index_gen) is set to boost::detail::multi_array::index_gen<0,0>, where I would ...
David Doria's user avatar
  • 10.4k
2 votes
0 answers
133 views

I am trying to store a boost::indices in a variable. From what I can gather, this produces an index_gen type. However, index_gen seems to be templated in boost::detail, but the template parameters are ...
David Doria's user avatar
  • 10.4k
0 votes
1 answer
268 views

I am writing a program to test a feature. However, I get an error when I declare a boost::multi_array that has a certain size. I get the following error: terminate called after throwing an instance ...
Rene's user avatar
  • 41
4 votes
1 answer
951 views

I'm looking for clean syntactic sugar to initialize a boost::multi_array from explicit values. The best I could come up with was double g[5][5] = { {-0.0009 , 0.003799 , 0.00666 , 0.00374 ...
Mark Lakata's user avatar
  • 21.1k
2 votes
1 answer
282 views

Working on a Kubuntu 14.04 system with gcc 4.8.4 I ran into the following problem: Using std:vector, I can assign between vector elements via an iterator: std::vector<float> v ; v.push_back(0....
Kay F. Jahnke's user avatar
3 votes
2 answers
1k views

I need to resize one multi_array to the size of another. In Blitz++ I could just do arr1.resize(arr2.shape()); Is there a multi_array solution of similar length? Because arr1.resize(boost::...
Cory's user avatar
  • 161
2 votes
1 answer
810 views

Related questions have been asked here before, but I still haven't found a satisfactory answer, so I will try to explain my problem and hope someone can enlighten me. I am currently writing some code ...
Aleksandra Glesaaen's user avatar
5 votes
2 answers
5k views

I have been surprised to find that boost::multi_array seems to allocate its initial elements differently from, say, std::vector. It does not seem to fill each element with a unique element (using its ...
Corey's user avatar
  • 1,880
3 votes
1 answer
346 views

I have a boost::multi_array of 3 dimensions boost::multi_array<Struct, 3>* newArr = new boost::multi_array<Struct, 3>(boost::extents[x][y][z], boost::fortran_storage_order()) Is there ...
Bersaelor's user avatar
  • 2,577
2 votes
1 answer
161 views

What i need is to create a class that can hold boost::multi_array of same type but with different dimentions assume there are one or more such arrays of Double boost::multi_array<double, 2> ...
Indika Herath's user avatar
1 vote
1 answer
1k views

pros, I need some performance-opinions with the following: 1st Question: I want to store objects in a 3D-Grid-Structure, overall it will be ~33% filled, i.e. 2 out of 3 gridpoints will be empty. ...
Bersaelor's user avatar
  • 2,577