列表中的C#Complex-a大

列表中的C#Complex-a大,c#,arrays,list,aforge,C#,Arrays,List,Aforge,我正试着用数学来做这个 我想要一个列表,然后在一个复杂的列表中。。。 例如,列表[1,2]内部有一个由5个数字组成的复杂列表,对于其他位置也是如此: List<int>[,] Alist = new List<int>[20,20]; AForge.Math.Complex[] input = new AForge.Math.Complex[5]; for(int a=1; a<=5; a++){ for(int b=1; b<=2

我正试着用数学来做这个 我想要一个列表,然后在一个复杂的列表中。。。 例如,列表[1,2]内部有一个由5个数字组成的复杂列表,对于其他位置也是如此:

  List<int>[,] Alist = new List<int>[20,20];
  AForge.Math.Complex[] input = new AForge.Math.Complex[5];
  for(int a=1; a<=5; a++){
        for(int b=1; b<=20; b++){
              for(int c=1; c<=20; c++){ //all 'for's must be in this order
                    input[a].Re = a * b; //for example
                    input[a].I = 0.0;
                    Alist[b,c] = input; //ERROR
              }
        }
  }
List[,]Alist=新列表[20,20];
AForge.Math.Complex[]输入=新的AForge.Math.Complex[5];

对于(inta=1;a注释代码

  List<int>[,] Alist = new List<int>[20,20];
//好的,输入是一个1D数组的一个forme.Math.Complex

  for(int a=1; a<=5; a++){
        for(int b=1; b<=20; b++){
              for(int c=1; c<=20; c++){ //all 'for's must be in this order
                    input[a].Re = a * b; //for example
                    input[a].I = 0.0;
                    Alist[b,c] = input; //ERROR

我真的不知道你想做什么,但我希望你明白什么现在不起作用了。

哦,好的,我明白了,谢谢!但是现在,我怎么才能创建一个包含1D复数的2D列表呢?list[,]Alist=new-AForge.Math.complex[20,20];这是不可能的:实际上,你为什么要它来定义一个列表[,]?整数从何而来?为什么不是一个forge.Math.Complex的2D数组?你把数组和列表混淆了。你不需要列表。你需要:AForge.Math.Complex[,]Alist=new-AForge.Math.Complex[20,20],但我怎么做呢?我需要位置信息[for(int b=1;bI真的看不出来为什么不需要?你需要什么额外的数据?
  for(int a=1; a<=5; a++){
        for(int b=1; b<=20; b++){
              for(int c=1; c<=20; c++){ //all 'for's must be in this order
                    input[a].Re = a * b; //for example
                    input[a].I = 0.0;
                    Alist[b,c] = input; //ERROR
              }
        }
  }