Originally posted by: SystemAdmin
I need to write a code which update 3D array like below,
X,Y,Z p q r and d are given, each element should be integer.
int O{i in 1..p}{j in 1..q}{k in 1..r}={{{X,X/(1+d)^1,X/(1+d)^2,....,X/(1+d)^r}},{{ Y,Y/(1+d)^1,Y/(1+d)^2,....,Y/(1+d)^r}},{{ Z,Z/(1+d)^1,Z/(1+d)^2,....,Z/(1+d)^r}}},
Actually final one would be like this,we know
O{1}{1}{1}=X;
O{1}{1}{k}=X/(1+d)^k
Also
O{2}{1}{1}=Y;
O{2}{1}{k}=Y/(1+d)^k
Similarly
O{1}{2}{1}=Z;
O{1}{2}{k}=Z/(1+d)^k;
Which means each time O{1}{1}{1},O{1}{2}{1},O{1}{3}{1},....,O{1}{q}{1} and O{2}{1}{1},O{2}{2}{1},...O{p}{q}{1} given
Which means O{m}{n}{k}=O{m}{n}{0}/(1+d)^k
For all m and n;
0{m}{n}{0} are given. I need do update other elements like above, other elements change as a function of k.
#DecisionOptimization#MathematicalProgramming-General