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


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


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


\subsection{Detailed Description}
L\+A\+Ss-\/\+D\+D\+Ss ddss\+\_\+dsyr2k 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} 

Boro Sofranac \href{mailto:boro.sofranac@bsc.es}{\tt boro.\+sofranac@bsc.\+es} 
\end{DoxyAuthor}
\begin{DoxyDate}{Date}
2018-\/02-\/21   
\end{DoxyDate}


\subsection{Function Documentation}
\index{ddss\+\_\+dsyr2k.\+c@{ddss\+\_\+dsyr2k.\+c}!ddss\+\_\+dsyr2k@{ddss\+\_\+dsyr2k}}
\index{ddss\+\_\+dsyr2k@{ddss\+\_\+dsyr2k}!ddss\+\_\+dsyr2k.\+c@{ddss\+\_\+dsyr2k.\+c}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dsyr2k(enum D\+D\+S\+S\+\_\+\+U\+P\+L\+O U\+P\+L\+O, enum D\+D\+S\+S\+\_\+\+T\+R\+A\+N\+S T\+R\+A\+N\+S, int N, int K, const double A\+L\+P\+H\+A, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B, const double B\+E\+T\+A, double $\ast$\+C, int L\+D\+C)}{ddss_dsyr2k(enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS, int N, int K, const double ALPHA, double *A, int LDA, double *B, int LDB, const double BETA, double *C, int LDC)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dsyr2k (
\begin{DoxyParamCaption}
\item[{enum D\+D\+S\+S\+\_\+\+U\+P\+LO}]{U\+P\+LO, }
\item[{enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS}]{T\+R\+A\+NS, }
\item[{int}]{N, }
\item[{int}]{K, }
\item[{const double}]{A\+L\+P\+HA, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB, }
\item[{const double}]{B\+E\+TA, }
\item[{double $\ast$}]{C, }
\item[{int}]{L\+DC}
\end{DoxyParamCaption}
)}\hypertarget{ddss__dsyr2k_8c_a0bd18e3495c9d8ab6ae463389a2b00bf}{}\label{ddss__dsyr2k_8c_a0bd18e3495c9d8ab6ae463389a2b00bf}
Performs one of the symmetric rank 2k operations\+: \begin{DoxyVerb}C = ALPHA * A * B**T + ALPHA * B * A**T + BETA * C or
C = ALPHA * A**T * B + ALPHA * B**T * A + BETA * C
\end{DoxyVerb}


A\+L\+P\+HA and B\+E\+TA are scalars, C is an N by N symmetric matrix and A and B are N by K matrices in the first case and K by N matrices in the second case. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em U\+P\+LO} & enum D\+D\+S\+S\+\_\+\+U\+P\+LO. U\+P\+LO specifies the form in which C is stored\+:
\begin{DoxyItemize}
\item Lower\+: Lower triangular part of C is stored. The upper traingular part is not referenced.
\item Upper\+: Upper triangular part of C is stored. The lower triangular part is not referenced.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em T\+R\+A\+NS} & enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS. T\+R\+A\+NS specifies the operation to be performed as follows\+:
\begin{DoxyItemize}
\item No\+Trans\+: C = A\+L\+P\+HA $\ast$ A $\ast$ B$\ast$$\ast$T + A\+L\+P\+HA $\ast$ B $\ast$ A$\ast$$\ast$T + B\+E\+TA $\ast$ C
\item Trans\+: C = A\+L\+P\+HA $\ast$ A$\ast$$\ast$T $\ast$ B + A\+L\+P\+HA $\ast$ B$\ast$$\ast$T $\ast$ A + B\+E\+TA $\ast$ C
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the order of matrix C. N must be at least zero.\\
\hline
\mbox{\tt in}  & {\em K} & int. With T\+R\+A\+NS = No\+Trans, K specifies the number of columns of the matrices A and B, and with T\+R\+A\+NS = Trans, K specifies the number of rows of the matrices A and B. K must be at least zero.\\
\hline
\mbox{\tt in}  & {\em A\+L\+P\+HA} & double. A\+L\+P\+HA specifies the scalar alpha.\\
\hline
\mbox{\tt in}  & {\em A} & double $\ast$. A is a pointer to a matrix of dimension Na ( rows ) by Ka ( columns ), where Na is N and Ka is K when T\+R\+A\+NS = No\+Trans, and Na is K and Ka is N 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\+NS = No\+Trans then L\+DA must be at least max( 1, K ), otherwise L\+DA must be at least max( 1, N ).\\
\hline
\mbox{\tt in}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension Nb ( rows ) by Kb ( columns ), where Nb is N and Kb is K when T\+R\+A\+NS = No\+Trans, and Nb is K and Kb is N 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\+NS = No\+Trans then L\+DB must be at least max( 1, K ), otherwise L\+DB must be at least max( 1, N ).\\
\hline
\mbox{\tt in}  & {\em B\+E\+TA} & double. B\+E\+TA specifies the scalar beta.\\
\hline
\mbox{\tt in,out}  & {\em C} & double $\ast$. C is a pointer to a matrix of dimension N by N. When U\+P\+LO = Uppper the strictly lower triangular part of C is not referenced. On exit, the upper triangular part of C is overwritten by the upper triangular part of the updated solution matrix C. When U\+P\+LO = Lower the strictly upper triangular part of C is not referenced. On exit, the lower triangular part of C is overwritten by the lower triangular part of the updated solution matrix 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{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a2ef29953763cd105a69a3c8db2adc1b3}{kdsyr2k} 
\end{DoxySeeAlso}


Definition at line 114 of file ddss\+\_\+dsyr2k.\+c.



References kdsyr2k().


\begin{DoxyCode}
119 \{
120     \textcolor{comment}{// Local variables}
121     \textcolor{keywordtype}{int} nA, nB;
122     
123     \textcolor{comment}{// Argument checking}
124     \textcolor{keywordflow}{if} ( ( UPLO != Upper ) && ( UPLO != Lower ) ) 
125     \{
126         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of UPLO, in ddss\_dsyr2k code\(\backslash\)n"} );
127         \textcolor{keywordflow}{return} NoSuccess;
128     \}
129     
130     \textcolor{keywordflow}{if} ( ( TRANS != NoTrans ) && ( TRANS != Trans ) )
131     \{
132         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of TRANS, in ddss\_dsyr2k code\(\backslash\)n"} );
133         \textcolor{keywordflow}{return} NoSuccess;
134     \}
135     
136     \textcolor{keywordflow}{if} ( N < 0 )
137     \{
138         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dsyr2k code\(\backslash\)n"} );
139         \textcolor{keywordflow}{return} NoSuccess;
140     \}
141         
142     \textcolor{keywordflow}{if} ( K < 0 )
143     \{
144         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of K, in ddss\_dsyr2k code\(\backslash\)n"} );
145         \textcolor{keywordflow}{return} NoSuccess;
146     \}
147     
148     \textcolor{keywordflow}{if} ( TRANS == NoTrans ) 
149     \{
150         nA = nB = K;
151     \} 
152     \textcolor{keywordflow}{else} 
153     \{
154         nA = nB = N;
155     \}
156 
157     \textcolor{keywordflow}{if} ( LDA < MAX( 1, nA ) ) 
158     \{
159         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dsyr2k code\(\backslash\)n"} );
160         \textcolor{keywordflow}{return} NoSuccess;
161     \}
162     
163     \textcolor{keywordflow}{if} ( LDB < MAX( 1, nB ) ) 
164     \{
165         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDB, in ddss\_dsyr2k code\(\backslash\)n"} );
166         \textcolor{keywordflow}{return} NoSuccess;
167     \}
168 
169     \textcolor{keywordflow}{if} ( LDC < MAX( 1, N ) ) 
170     \{
171         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDC, in ddss\_dsyr2k code\(\backslash\)n"} );
172         \textcolor{keywordflow}{return} NoSuccess;
173     \}
174     
175     \textcolor{comment}{// Quick return}
176      \textcolor{keywordflow}{if} ( N == 0 || ( ( ALPHA == 0.0 || K == 0 ) && BETA == 1.0 ) )
177      \{
178          \textcolor{keywordflow}{return} Success;
179      \}
180     
181     \textcolor{keywordflow}{return} \hyperlink{kdsyr2k_8c_a2ef29953763cd105a69a3c8db2adc1b3}{kdsyr2k}( UPLO, TRANS,
182                     N, K,
183                     ALPHA, A, LDA,
184                            B, LDB,
185                     BETA,  C, LDC );
186 
187 \}
\end{DoxyCode}
