[Tex/LaTex] Problems using `\left\{` in array environment

arrayserrorsformatting

I am trying to define a matrix in segments by enclosing the entries of the matrix in boxes, and also using the open and closed braces to label those segments. So far I have developed the following code to do this.

\documentclass[a4,12pt]{report}

\usepackage{multirow}

\begin{document}

\[
  A =
    \left(
      \begin{array}{rrrrrl}
          \cline{2-4} \cline{5-5}
        \multirow{2}{*}{$B \{$} &
          \multicolumn{1}{|r}{1} & 2 & \multicolumn{1}{r|}{-4} & \multicolumn{1}{|r|}{1} & \multirow{2}{*}{$\} \hat{\mathbf{b}}^{T}$} \\
          & \multicolumn{1}{|r}{2} & -5 & \multicolumn{1}{r|}{-3} & \multicolumn{1}{|r|}{-3} & \\
          \cline{2-4} \cline{5-5}
        \hat{\mathbf{c}} \{  & \multicolumn{1}{|r}{-6} & -3 & \multicolumn{1}{r|}{0} & \multicolumn{1}{|r|}{5} & \} a_{n-1,n} \\
          \cline{2-4} \cline{5-5}
        \hat{\mathbf{d}} \{ & \multicolumn{1}{|r}{-6} &  7 & \multicolumn{1}{r|}{0} & \multicolumn{1}{|r|}{-8} & \} a_{n,n} \\
          \cline{2-4} \cline{5-5}
      \end{array}
    \right)
\]


\end{document}

This produces the following output:

enter image description here

What I want to do is expand the left and right brace in the first and last columns to line up with the rows that have been segmented. One way of doing this is to use the \left\{ and \right\} LaTeX commands. The problem is that when I do this, I get the following LaTeX error:

! Missing \right.  inserted.
<inserted text>
                \right .
l.12         \multirow{2}{*}{$B \left\{$}
                                          &
?

Also, what I would like to do is separate the segments using individual boxes, rather than adjoining boxes as above. Any ideas on how to do this would be very much appreciated.

Best Answer

I took @mico's answer and added hhline

enter image description here

\documentclass[a4paper,12pt]{report}
\usepackage{multirow,hhline}
\begin{document}
  \[
  A =
  \left(
  \begin{array}{r|rrr||r|l}
    \hhline{~|---||-|~}
    \multirow{2}{*}{$B \bigg\{$} 
    & 1 & 2 & -4 & 1 & 
    \multirow{2}{*}{$\bigg\} \hat{\mathbf{b}}^{T}$} \\
    & 2 & -5 & -3 & -3 & \\
    \hhline{~:===::=:~}
    \hat{\mathbf{c}} \{  & -6 & -3 & 0 & 5 & \} a_{n-1,n} \\
    \hhline{~:===::=:~}
    \hat{\mathbf{d}} \{ & -6 &  7 & 0 & -8 & \} a_{n,n} \\
    \hhline{~|---||-|~}
  \end{array}
  \right)
  \]
\end{document}
Related Question