\hypertarget{ddss__dgemm_8c}{}\section{src/ddss\+\_\+dgemm.c File Reference}
\label{ddss__dgemm_8c}\index{src/ddss\+\_\+dgemm.\+c@{src/ddss\+\_\+dgemm.\+c}}


L\+A\+Ss-\/\+D\+D\+Ss ddss\+\_\+dgemm routine.  


{\ttfamily \#include \char`\"{}../include/lass.\+h\char`\"{}}\\*
Include dependency graph for ddss\+\_\+dgemm.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{ddss__dgemm_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{ddss__dgemm_8c_a05b6048b892d062d5656ff6e2f57fed9}{ddss\+\_\+dgemm} (enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS T\+R\+A\+N\+S\+\_\+A, enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS T\+R\+A\+N\+S\+\_\+B, int M, int N, int K, double A\+L\+P\+HA, double $\ast$A, int L\+DA, double $\ast$B, int L\+DB, double B\+E\+TA, double $\ast$C, int L\+DC)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
L\+A\+Ss-\/\+D\+D\+Ss ddss\+\_\+dgemm routine. 

L\+A\+Ss-\/\+D\+D\+Ss is a software package provided by\+: Barcelona Supercomputing Center -\/ Centro Nacional de Supercomputacion

\begin{DoxyAuthor}{Author}
Pedro Valero-\/\+Lara \href{mailto:pedro.valero@bsc.es}{\tt pedro.\+valero@bsc.\+es} 
\end{DoxyAuthor}
\begin{DoxyDate}{Date}
2017-\/01-\/02   
\end{DoxyDate}


\subsection{Function Documentation}
\index{ddss\+\_\+dgemm.\+c@{ddss\+\_\+dgemm.\+c}!ddss\+\_\+dgemm@{ddss\+\_\+dgemm}}
\index{ddss\+\_\+dgemm@{ddss\+\_\+dgemm}!ddss\+\_\+dgemm.\+c@{ddss\+\_\+dgemm.\+c}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dgemm(enum D\+D\+S\+S\+\_\+\+T\+R\+A\+N\+S T\+R\+A\+N\+S\+\_\+\+A, enum D\+D\+S\+S\+\_\+\+T\+R\+A\+N\+S T\+R\+A\+N\+S\+\_\+\+B, int M, int N, int K, double A\+L\+P\+H\+A, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B, double B\+E\+T\+A, double $\ast$\+C, int L\+D\+C)}{ddss_dgemm(enum DDSS_TRANS TRANS_A, enum DDSS_TRANS TRANS_B, int M, int N, int K, double ALPHA, double *A, int LDA, double *B, int LDB, double BETA, double *C, int LDC)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dgemm (
\begin{DoxyParamCaption}
\item[{enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS}]{T\+R\+A\+N\+S\+\_\+A, }
\item[{enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS}]{T\+R\+A\+N\+S\+\_\+B, }
\item[{int}]{M, }
\item[{int}]{N, }
\item[{int}]{K, }
\item[{double}]{A\+L\+P\+HA, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB, }
\item[{double}]{B\+E\+TA, }
\item[{double $\ast$}]{C, }
\item[{int}]{L\+DC}
\end{DoxyParamCaption}
)}\hypertarget{ddss__dgemm_8c_a05b6048b892d062d5656ff6e2f57fed9}{}\label{ddss__dgemm_8c_a05b6048b892d062d5656ff6e2f57fed9}
Performs the matrix-\/matrix operation\+: \begin{DoxyVerb}C = ALPHA * op( A ) * op( B ) + BETA * C
\end{DoxyVerb}


where op( X ) is one of\+: \begin{DoxyVerb}op( X ) = X      or
op( X ) = X**T 
\end{DoxyVerb}


A\+L\+P\+HA and B\+E\+TA are scalars, and A, B and C are matrices, with op( A ) an M by K matrix, op( B ) a K by N matrix and C an M by N matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em T\+R\+A\+N\+S\+\_\+A} & enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS. T\+R\+A\+N\+S\+\_\+A specifies the form of op( A ) to be used in the matrix multiplication as follows\+:
\begin{DoxyItemize}
\item No\+Trans\+: op( A ) = A.
\item Trans\+: op( A ) = A$\ast$$\ast$T.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em T\+R\+A\+N\+S\+\_\+B} & enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS. T\+R\+A\+N\+S\+\_\+B specifies the form of op( B ) to be used in the matrix multiplication as follows\+:
\begin{DoxyItemize}
\item No\+Trans\+: op( B ) = B.
\item Trans\+: op( B ) = B$\ast$$\ast$T.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the matrix A and the number of rows of the matrix C. M must be greater than zero.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the matrix B and the number of columns of the matrix C. N must be greater than zero.\\
\hline
\mbox{\tt in}  & {\em K} & int. K specifies the number of columns of the matrix A and the number of rows of the matrix B. K must be greater than zero.\\
\hline
\mbox{\tt in}  & {\em A\+L\+P\+HA} & double.\\
\hline
\mbox{\tt in}  & {\em A} & double $\ast$. A is a pointer to a matrix of dimension Ma ( rows ) by Ka ( columns ), where Ma is M and Ka is K when T\+R\+A\+N\+S\+\_\+A = No\+Trans, and Ma is K and Ka is M otherwise.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). When T\+R\+A\+N\+S\+\_\+A = No\+Trans then L\+DA must be at least max( 1, K ), otherwise L\+DA must be at least max( 1, M ).\\
\hline
\mbox{\tt in}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension Kb ( rows ) by Nb ( columns ), where Kb is K and Nb is N when T\+R\+A\+N\+S\+\_\+B = No\+Trans, and Kb is N and Nb is K otherwise.\\
\hline
\mbox{\tt in}  & {\em L\+DB} & int. L\+DB specifies the number of columns of B ( row-\/major order ). When T\+R\+A\+N\+S\+\_\+B = No\+Trans then L\+DB must be at least max( 1, N ), otherwise L\+DB must be at least max( 1, K ).\\
\hline
\mbox{\tt in}  & {\em B\+E\+TA} & double.\\
\hline
\mbox{\tt in,out}  & {\em C} & double $\ast$. C is a pointer to a matrix of dimension M by N. On exit, C is overwritten by the M by N matrix ( A\+L\+P\+H\+A$\ast$op( A )$\ast$op( B ) + B\+E\+T\+A$\ast$C ).\\
\hline
\mbox{\tt in}  & {\em L\+DC} & int. L\+DC specifies the number of columns of C ( row-\/major order ). L\+DC must be at least max( 1, N ).\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em Success} & successful exit \\
\hline
{\em No\+Success} & unsuccessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a1b27a37a58ea181d1e5f7eb91c6e0b58}{kdgemm} 
\end{DoxySeeAlso}


Definition at line 128 of file ddss\+\_\+dgemm.\+c.



References kdgemm().


\begin{DoxyCode}
133 \{
134     
135     \textcolor{comment}{// Local variables}
136     \textcolor{keywordtype}{int} An, Bn;  
137     
138     \textcolor{comment}{// Argument checking}
139     \textcolor{keywordflow}{if} ( ( TRANS\_A != NoTrans ) && ( TRANS\_A != Trans ) )
140     \{
141         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of TRANS\_A, in ddss\_dgemm code\(\backslash\)n"} );
142         \textcolor{keywordflow}{return} NoSuccess;
143     \}
144 
145     \textcolor{keywordflow}{if} ( ( TRANS\_B != NoTrans ) && ( TRANS\_B != Trans ) )
146     \{
147         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of TRANS\_B, in ddss\_dgemm code\(\backslash\)n"} );
148         \textcolor{keywordflow}{return} NoSuccess;
149     \}
150 
151     \textcolor{keywordflow}{if} ( M < 0 )
152     \{
153         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of M, in ddss\_dgemm code\(\backslash\)n"} );
154         \textcolor{keywordflow}{return} NoSuccess;
155     \}
156     
157     \textcolor{keywordflow}{if} ( N < 0 )
158     \{
159         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dgemm code\(\backslash\)n"} );
160         \textcolor{keywordflow}{return} NoSuccess;
161     \}
162     
163     \textcolor{keywordflow}{if} ( K < 0 )
164     \{
165         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of K, in ddss\_dgemm code\(\backslash\)n"} );
166         \textcolor{keywordflow}{return} NoSuccess;
167     \}
168     
169     \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
170     \{
171         An = K;
172     \}   
173     \textcolor{keywordflow}{else}
174     \{
175         An = M;
176     \}
177 
178     \textcolor{keywordflow}{if} ( LDA < MAX( 1, An ) )
179     \{
180         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dgemm code\(\backslash\)n"} );    
181         \textcolor{keywordflow}{return} NoSuccess;
182     \}
183 
184     \textcolor{keywordflow}{if} ( TRANS\_B == NoTrans )
185     \{
186         Bn = N;
187     \}   
188     \textcolor{keywordflow}{else}
189     \{
190         Bn = K;
191     \}
192 
193     \textcolor{keywordflow}{if} ( LDB < MAX( 1, Bn ) )
194     \{
195         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDB, in ddss\_dgemm code\(\backslash\)n"} );    
196         \textcolor{keywordflow}{return} NoSuccess;
197     \}
198 
199     \textcolor{keywordflow}{if} ( LDC < MAX( 1, N ) )
200     \{
201         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDC, in ddss\_dgemm code\(\backslash\)n"} );    
202         \textcolor{keywordflow}{return} NoSuccess;
203     \}
204 
205     \textcolor{comment}{// Quick return}
206     \textcolor{keywordflow}{if} ( M == 0 || N == 0 || ( ( ALPHA == 0.0 || K == 0 ) && BETA == 1.0 ) )
207     \{
208         \textcolor{keywordflow}{return} Success;
209     \}   
210 
211     \textcolor{keywordflow}{return} \hyperlink{kdgemm_8c_a1b27a37a58ea181d1e5f7eb91c6e0b58}{kdgemm}( TRANS\_A, TRANS\_B, M, N, K, 
212                     (\textcolor{keyword}{const} \textcolor{keywordtype}{double}) ALPHA, A, LDA, 
213                                           B, LDB, 
214                     (\textcolor{keyword}{const} \textcolor{keywordtype}{double})  BETA, C, LDC );
215     
216 \}
\end{DoxyCode}
