public Matrix pow(double exp){
  Matrix X=new Matrix(m,n);
  double[][] C=X.getArray();
  for (int i=0; i < m; i++)   for (int j=0; j < n; j++)   C[i][j]=Math.pow(A[i][j],exp);
  return X;
}

public Matrix pow ( double exp ) { Matrix X = new Matrix ( m , n ) ; double [ ] [ ] C = X . getArray ( ) ; for ( int i = 0 ; i < m ; i ++ ) for ( int j = 0 ; j < n ; j ++ ) C [ i ] [ j ] = Math . pow ( A [ i ] [ j ] , exp ) ; return X ; }
x . powequals ( ) calculates the power of each element of the matrix .
