Add horizontal curly braces with text on top of a matrix

bracesmath-modematricesoverbracetikz-pgf

I am using tikz to make a flow diagram of a matrix appending rows. For the last matrix I want to add curly braces on the right and top of the matrix with texts. Below is my code which can add curly brace and text to the right:

\documentclass[12pt]{article}
\usepackage{multirow,graphics,graphicx,supertabular}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{matrix,decorations.pathreplacing,calc,positioning}

\begin{document}
\begin{figure}[h]
\centering
\begin{tikzpicture}
    \node (B) {
    $\begin{bmatrix}
        1 & 0 & \dots & 1 \\
        2 & 0 & \dots & 1 
     \end{bmatrix}$};
    \node[left=3.5cm of B] (A) {
    $\begin{bmatrix}
        1 & 0 & \dots & 1 
     \end{bmatrix}$};
    \node[right=3.5cm of B] (C){
    $\begin{rcases}\displaystyle
     \begin{bmatrix}
        1 & 0 & \dots & 1 \\
        2 & 0 & \dots & 1 \\
        3 & 1 & \dots & 4 
     \end{bmatrix}
     \end{rcases}
     \text{$N_{\mathrm{conf}}$}$};
    \draw[->] (A)--(B) node[midway, above,font=\small] {
    $+\begin{bmatrix}
        1 & 0 & \dots & 3
      \end{bmatrix}$};
    \draw[->] (B)--(C) node[midway, above,font=\small] {
    $+\begin{bmatrix} 
        1 & 0 & \dots & 3
      \end{bmatrix}$};
\end{tikzpicture}
\caption{Flow diagram of the matrix.}
\label{bootstrap_flowchart}
\end{figure}
\end{document}

But I am expecting to get something like this
enter image description here
I don't know how to add the curly brace and the text "Columns" on top of the matrix. Any suggestions?

Best Answer

--adding the code

\draw[decorate, ultra thick] ($(C.north west)+(2ex,0pt)$) -- 
   ($(C.north east)-(9ex,0pt)$) node[above=3pt,midway] {some text};

should produce the brace required

--in the preamble add calligraphy

  \usetikzlibrary{matrix,decorations.pathreplacing,calc,positioning,calligraphy}

enter image description here

\documentclass[12pt]{article}
\usepackage{multirow,graphics,graphicx,supertabular}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{matrix,decorations.pathreplacing,calc,positioning,calligraphy}

\begin{document}
\begin{figure}[h]
\centering
   \begin{tikzpicture}[decoration={calligraphic brace,amplitude=6pt}]
    \node (B) {
    $\begin{bmatrix}
        1 & 0 & \dots & 1 \\
        2 & 0 & \dots & 1 
     \end{bmatrix}$};
    \node[left=3.5cm of B] (A) {
    $\begin{bmatrix}
        1 & 0 & \dots & 1 
     \end{bmatrix}$};
    \node[right=3.5cm of B] (C){
    $\begin{rcases}\displaystyle
     \begin{bmatrix}
        1 & 0 & \dots & 1 \\
        2 & 0 & \dots & 1 \\
        3 & 1 & \dots & 4 
     \end{bmatrix}
     \end{rcases}
     \text{$N_{\mathrm{conf}}$}$};
    \draw[->] (A)--(B) node[midway, above,font=\small] {
    $+\begin{bmatrix}
        1 & 0 & \dots & 3
      \end{bmatrix}$};
    \draw[->] (B)--(C) node[midway, above,font=\small] {
    $+\begin{bmatrix} 
        1 & 0 & \dots & 3
      \end{bmatrix}$};
     \draw[decorate, ultra thick] ($(C.north west)+(2ex,0pt)$) -- ($(C.north east)-(9ex,0pt)$) node[above=3pt,midway] {some text};

\end{tikzpicture}
\caption{Flow diagram of the matrix.}
\label{bootstrap_flowchart}
\end{figure}
\end{document}