36,167 questions
-3
votes
0
answers
90
views
How to properly include other .cpp files into my main project? [duplicate]
I have this part of my code where I have an array and want to compare it with other constant arrays, to find a match. As I am working with Multi-dimensional arrays, I decided to store these constants ...
4
votes
3
answers
81
views
Excel array formula using if() with two rows from spilled array source
I have set of data that I am pulling from another sheet with filter() function, and then I'd like to use array formula if possible (with # operator) to have formula spill dynamically for as much rows ...
3
votes
1
answer
178
views
Boost multiarray, how to declare a class member and populate it at run time
I am attempting to move away from std::vector<std::vector<int>> types and use boost::multi_array in its place. I am struggling how to initialize such data members though.
I used to have a ...
Advice
0
votes
3
replies
97
views
Restrict keyword and pointers to pointers
I'm in C and I have an int ** (2 dimensional array, it's basically a matrix, it's actually set up a little bit complicated but there's no internal aliasing, so it's not relevant).
is this int** ...
3
votes
2
answers
131
views
How to properly constrain two-dimensional array types to be square in Ada?
I'm trying to create a package of generic adjacency matrices to define graphs, and the first goal is to define a static version based on two-dimensional array:
with Ada.Containers.Vectors;
generic
...
1
vote
2
answers
110
views
Get previous and next row of a matched row from a 2d array
I have the following code to sort the items based on a timestamp.
$arr = [];
foreach(glob('*.json') AS $item) {
$data = json_decode(file_get_contents($item), true);
$arr[] = [
'taken' =...
1
vote
1
answer
99
views
How to flatten multidimensional array in Azure Data Factory/Synapse
I want to extract "email" from JSON using ADF/Synapse.
Below is the JSON that I want to flatten and extract all "email" which is in an object in a multidimensional array:
{
"...
2
votes
1
answer
96
views
Convert ADODB RecordSet to a 2 dimensional array
I want to read an Excel file without openening the file and put the result in a two dim. array. For this I use the below code
Sub ReadExcelFileWithoutOpening()
Dim conn As Object
Dim rs As Object
Dim ...
-1
votes
1
answer
173
views
Use of 1D vs. 2D vectors in C++ implementation [closed]
After some extensive search I could not find a clear answer to the following issue. When one is to compare the 1D (vector<type>) vs 2D (<vector<vector<type>>>) vector ...
1
vote
2
answers
191
views
how to efficiently save a large image using stbi_write_png which is stored in a multidimensional array
In my initial question there was some confusion as to what I was really trying to do.
Specifically, when I edit large images i store them in an array of pixels where Pixel image[iwid][ihei] is my ...
1
vote
1
answer
110
views
Is it possible to expand/deduce a parameter pack to/from array dimensions?
I am using the following code for automatic vector/matrix template parameter deduction (I am particullarily interested in automatic deduction from passing initializer lists)
template<class T, ...
1
vote
2
answers
92
views
XML with attributes to array in PHP
I am trying to convert an XML string into multi-dimensioned PHP array. The difficulties are that XML comes with attributes and has nested values. My code works at parent level data but I am not sure ...
2
votes
3
answers
192
views
Is there a performance drawback when declaring 2D arrays using int** compared to int (*)[N] in C?
I have a question about the performance tradeoffs between different ways of storing 2D arrays in memory in C.
I know that if I declare a 2D matrix A with dimensions MxN by the following:
int (*A)[N] = ...
0
votes
0
answers
93
views
I am confused by mdspans' "layout policy", "layout mapping" and "layout mapping policy"
I'm looking at the newly-introduced std::mdspan class template (also described here on SO). One of the template parameters is, according to cppreference:
LayoutPolicy - specifies how to convert ...
0
votes
1
answer
91
views
how to create uniform nested lists and convert them in to multi dimensional arrays?
i would like to create a nested list of arbitrary depth (containing numerical values specifically) with uniform arbitrary lengths at each level and then compress it to a NumPy array of minimum ...