示例#1
0
 public GradientContainer(GradientContainer other)
 {
     arr = new double[other.arr.Length][];
     for (int i = 0; i < other.arr.Length; i++) {
         arr[i] = (double[]) other.arr[i].Clone();
     }
 }
示例#2
0
 public void EqualSum(double alpha, double beta, GradientContainer other)
 {
     var arr2 = arr;
     for (int i = 0; i < arr.Length; i++) {
         for (int j = 0; j < arr[i].Length; j++) {
             arr2[i][j] += alpha*arr[i][j] + beta*other.arr[i][j];
         }
     }
 }