docs: public static Matrix diag(Vec a)
      {
          DenseMatrix A = new DenseMatrix(a.length(), a.length());
          for(Iterator<IndexValue> iter = a.getNonZeroIterator(); iter.hasNext();)
          {
              IndexValue iv = iter.next();
              A.set(iv.getIndex(), iv.getIndex(), iv.getValue());
          }
              
          return A;
      }