Questions tagged [structure-of-arrays]

8 questions
4
votes
0 answers

vectorisation, AoSoA and gather?

I've been trying to get up to speed on where we are taking advantage of vectorisation. Of course the answer to optimisation is always to profile, make a change and profile again but you don't necessarily know what CPU will be used when your…
Bruce Adams
  • 4,953
  • 4
  • 48
  • 111
3
votes
2 answers

How to create a tuple of vectors of type deduced from a variadic template in C++17?

I have implemented a collection class that converts a vector of tuples to a tuple of vectors (it is essentially an AOS to SOA conversion). This code works for this example of two template classes. I was trying to make it more generic by using…
motam79
  • 3,542
  • 5
  • 34
  • 60
2
votes
1 answer

Generalizing your operation for a specific declared type in Fortran

I have a Structure of arrays using the declared type in Fortran e.g. type t_data integer :: N real, allocatable :: x(:) real, allocatable :: z(:) real, allocatable :: y(:) contains procedure :: copy procedure…
ATK
  • 1,296
  • 10
  • 26
1
vote
0 answers

Elegence and terseness with structure-of-arrays as opposed to array-of-structs

Suppos I need to hold some data consisting of n Foo's, n Bars and n Bazs. The elements of corresponding indices are related, so you can also think of this data as n triplets of Foo, Bar andBaz`. The first description of the data is a "structure of…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
0
votes
0 answers

filter multiple vectors in a Struct of Arrays with rayon

I have a Struct of Vectors that I'm trying to filter based off precomputed indices of out-of-scope particles for a particle-in-cell program. each index will be filtered as a group, so each resulting array will be exactly the same length…
0
votes
2 answers

Why does this array of structures overwrite char * but not int?

I have written a program which makes use of array of structures in order to maintain a sort of "database" program with different options that can be used to manipulate the "database". The program has 4 modes of operation, if the user enters: 'i'…
-1
votes
3 answers

Reading from text file into a structure of array

I'm trying to read a text file into an array of structure. I haven't figured out a way to input it into an array of structure yet but the problem with my code is that the output keeps looping. I'm new to C++ as this is the first programming course I…
-2
votes
1 answer

To read from a text file and input into structure of array then displaying the data read C++

I have some trouble displaying the file I've read into an array of structure. This is my struct: struct Employee { char staffId[5]; char fullName[30]; char phoneNum[15]; char address[40]; char email[30]; }; This is my text…