public static Matrix createDiagonalMatrix(List<Double> values){
  Matrix m=new Matrix(values.size(),values.size(),0);
  for (int i=0; i < values.size(); i++) {
    m.set(i,i,values.get(i));
  }
  return m;
}

public static Matrix createDiagonalMatrix ( List < Double > values ) { Matrix m = new Matrix ( values . size ( ) , values . size ( ) , 0 ) ; for ( int i = 0 ; i < values . size ( ) ; i ++ ) { m . set ( i , i , values . get ( i ) ) ; } return m ; }
construct a diagonal matrix from the given list of doubles
