دنبال کننده ها

۱۳۹۶ شهریور ۱۰, جمعه

c++ - mapping 2 points with a 1D array

[ad_1]



I want to store random snapshots of a a 1D array arr using a mapping of 2 points say a,b. like say



P1 => (4,5) = [1,1,0,2,1]
P2 => (10,13) = [5,6,3,4,3]
P3 => (15,23) = [11,13,9,12,14]


so on.....
these points P(a,b) are not continuous,Later I need to add them to array A having also n elements like arr.
like say A = [1,1,1,1,1]



so now after P1 i have A as : [2,2,1,3,2] and so on till P ends.
I am not sure how to map these points P1,P2 ... in c+= with the !D array and then later sum it with array A.
I tried using a 3D array to store those points and then the array.But it seems bulky and not utilised in an efficient way.
Any help is appreciated.




[ad_2]

لینک منبع