[Tex/LaTex] Descriptive row and overbrace, underbrace, spanning multiple columns in a matrix

bracesmath-modematrices

I would like to have a matrix with round brackets, a descriptive row which is not included in the surrounding brackets and overbraces and underbraces as can be seen in this picture:

desired matrix

I've tried to adapt this \bordermatrix code but did not come far:

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\[
\phantom{(17') \rightarrow\hspace{\arraycolsep}}
\underbrace{
  \bordermatrix{
    \hspace{-\arraycolsep} & 
    \overbrace{}^{label2}  &
                           & 
    \overbrace{}^{label3} \cr
     & 1 & 1 & 1 \cr
     & 1 & 1 & 1
    }
  }_{\text{label1}}
\]

\end{document}

enter image description here

Best Answer

enter image description here

Well, I draw this matrix as tikzpicture:

Edit: slightly improved code and matrix looks:

\documentclass[tikz,
               border=3mm,
               ]{standalone}
\usetikzlibrary{decorations.pathreplacing,
                matrix,
                positioning,
                }

\begin{document}
\begin{tikzpicture}[auto,
               node distance = 0mm,
         every matrix/.style = {matrix of math nodes,
                                nodes={minimum width=2em},
                                left  delimiter={(},
                                right delimiter={)},
                                },
                    B/.style = {decorate,
            decoration={brace, amplitude=2pt,
            pre=moveto,pre length=1pt,post=moveto,post length=1pt,
            raise=1mm,
                        },
            },  
                    ]
\matrix (m)
{
1   &   1   &   1   \\
1   &   1   &   1   \\
};
\foreach \i in {1,2,3}
    \node (a\i) [above=of m-1-\i] {$d_{\i}$};
\draw[B]    (a1.north west) -- node[above=2mm] {label1} (a2.north east);
\draw[B]    (a3.north west) -- node[above=2mm] {label2} (a3.north east);
\draw[B] (m-2-1.south east) -- node[below=2mm] {label3} (m-2-1.south west);
\end{tikzpicture}
\end{document}