@Override
    public String toString() {
        StringBuilder buf = new StringBuilder();

        buf.append("%%MatrixMarket matrix ");

        if (isSparse())
            buf.append("coordinate ");
        else
            buf.append("array ");

        if (isReal())
            buf.append("real ");
        else if (isComplex())
            buf.append("complex ");
        else if (isPattern())
            buf.append("pattern ");
        else if (isInteger())
            buf.append("integer ");
        else
            // This should never happen
            throw new IllegalArgumentException("Unknown field specification");

        if (isGeneral())
            buf.append("general\n");
        else if (isSymmetric())
            buf.append("symmetric\n");
        else if (isSkewSymmetric())
            buf.append("skew-symmetric\n");
        else if (isHermitian())
            buf.append("Hermitian\n");
        else
            // This should never happen
            throw new IllegalArgumentException("Unknown symmetry specification");

        return buf.toString();
    }