# Having Difficulty with bbordermatrix problem in Beamer

I have the following code:

\documentclass{beamer}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{etoolbox}

\let\bbordermatrix\bordermatrix
\patchcmd{\bbordermatrix}{8.75}{4.75}{}{}
\patchcmd{\bbordermatrix}{\left(}{\left[}{}{}
\patchcmd{\bbordermatrix}{\right)}{\right]}{}{}
\patchcmd{\bbordermatrix}{\begingroup}{\begingroup\openup1\jot}{}{}
\makeatletter
\patchcmd{\bbordermatrix}
{\vcenter{\kern-\ht\@ne\unvbox\z@\kern-\baselineskip}}
{\vcenter{\kern-\ht\@ne\unvbox\z@\kern-\baselineskip\kern2pt}}
{}{}
\makeatother

\title{Linear Algebra Models in Information Retrieval}
\date{December 12th, 2016}

\begin{document}

\begin{frame}
\tiny
$\bbordermatrix{ & d_{1} & d_{2} & d_{3} & d_{4} & d_{5} & \ldots & d_{1,000,000}\cr \\ t_{1} & m_{1,1} & m_{1,2} & m_{1,3} & m_{1,4} & m_{1,5} & & m_{1,1,000,000} \cr \\ t_{2} & m_{2,1} & m_{2,2} & m_{2,3} & m_{2,4} & m_{2,5} & & m_{2,1,000,000} \cr \\ t_{3} & m_{3,1} & m_{3,2} & m_{3,3} & m_{3,4} & m_{3,5} & \ldots & m_{3,1,000,000} \cr \\ t_{4}& m_{4,1} & m_{4,2} & m_{4,3} & m_{4,4} & m_{4,5} & & m_{4,1,000,000} \cr \\ t_{5}& m_{5,1} & m_{5,2} & m_{5,3} & m_{5,4} & m_{5,5} & & m_{5,1,000,000} \cr \\ \vdots & & & &\vdots & & & \cr \\ t_{300,000} & m_{300,000,1} & m_{300,000,2} & m_{300,000,3} & m_{300,000,4} & m_{300,000,5} & & m_{300,000, 1,000,000}}$\normalsize
\end{frame}

\end{document}


But I am getting the following error:

./bordermatrixerror.tex:46: LaTeX Error: There's no line here to end.

The file is working in my paper but not in Beamer. Can someone provide a suggestion?

Since \bbordermatrix functions similar to \bordermatrix, it relies on the same line-breaking requirements. Remove all the \\ in \bbordermatrix and only use \cr.