I have the following code
int Number_Decision_Variables=State_Vector.nextInt();
int max=0;
int[] Num_Alt_Decision_variable=new int[Number_Decision_Variables];
for(int Num=0;Num<Number_Decision_Variables;Num++){
System.out.println("Enter the number of Alternatives for Decision Variable"+Num+1);
Num_Alt_Decision_variable[Num]=State_Vector.nextInt();
if(Num_Alt_Decision_variable[Num]>max)max=Num_Alt_Decision_variable[Num];
}
double[][] c=new double[Number_Decision_Variables][max];
I defined matrix c to have a number of columns equal to the maximum number in the "Num_Alt_Decision_variable" array. But I don't think this is a good practice because the cells in the "Num_Alt_Decision_variable" array ranges from 1 to 20 therefore I need to define a separate 1-d array for each "Number_Decision_Variables" with size equal to the value of in each cell in the "Num_Alt_Decision_variable" for example if Num_Alt_Decision_variable[1]=1 then the first array should have size of one, also if Num_Alt_Decision_variable[2]=10 then the second array should have size of ten any suggestion?