static public void Ax(double[] result, double[][] A, double[] x) {
    for (int i = 0; i < result.length; i++) {
      result[i] = 0.0;
      for (int j = 0; j < result.length; j++) {
        result[i] += (A[i][j] * x[j]);
      }
    }
  }
static public void Ax ( double [ ] result , double [ ] [ ] A , double [ ] x ) { for ( int i = 0 ; i < result . length ; i ++ ) { result [ i ] = 0.0 ; for ( int j = 0 ; j < result . length ; j ++ ) { result [ i ] += ( A [ i ] [ j ] * x [ j ] ) ; } } }
(DxD) matrix * (Dx1) column vector = (Dx1) column vector