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


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


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


\subsection{Detailed Description}
L\+A\+Ss-\/\+D\+D\+Ss ddss\+\_\+dtrsm 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}
2017-\/12-\/14   
\end{DoxyDate}


\subsection{Function Documentation}
\index{ddss\+\_\+dtrsm.\+c@{ddss\+\_\+dtrsm.\+c}!ddss\+\_\+dtrsm@{ddss\+\_\+dtrsm}}
\index{ddss\+\_\+dtrsm@{ddss\+\_\+dtrsm}!ddss\+\_\+dtrsm.\+c@{ddss\+\_\+dtrsm.\+c}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dtrsm(enum D\+D\+S\+S\+\_\+\+S\+I\+D\+E S\+I\+D\+E, 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\+\_\+\+A, enum D\+D\+S\+S\+\_\+\+D\+I\+A\+G D\+I\+A\+G, int M, int N, const double A\+L\+P\+H\+A, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B)}{ddss_dtrsm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG, int M, int N, const double ALPHA, double *A, int LDA, double *B, int LDB)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dtrsm (
\begin{DoxyParamCaption}
\item[{enum D\+D\+S\+S\+\_\+\+S\+I\+DE}]{S\+I\+DE, }
\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\+N\+S\+\_\+A, }
\item[{enum D\+D\+S\+S\+\_\+\+D\+I\+AG}]{D\+I\+AG, }
\item[{int}]{M, }
\item[{int}]{N, }
\item[{const double}]{A\+L\+P\+HA, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB}
\end{DoxyParamCaption}
)}\hypertarget{ddss__dtrsm_8c_a0f0421e7581b000ae1833415b7e0efc5}{}\label{ddss__dtrsm_8c_a0f0421e7581b000ae1833415b7e0efc5}
Solves one of the matrix equations\+: \begin{DoxyVerb}op( A ) * X = ALPHA * B, or X * op( A ) = ALPHA * B
\end{DoxyVerb}


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


A\+L\+P\+HA is a scalar, X and B are M by N matrices, A is a unit, or non-\/unit, upper or lower triangular matrix. The matrix X is overwritten on B


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em S\+I\+DE} & enum D\+D\+S\+S\+\_\+\+S\+I\+DE. S\+I\+DE specifies the position of the triangular A matrix in the operations\+:
\begin{DoxyItemize}
\item Left\+: op( A ) $\ast$ X = A\+L\+P\+HA $\ast$ B.
\item Right\+: X $\ast$ op( A ) = A\+L\+P\+HA $\ast$ B.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em U\+P\+LO} & enum D\+D\+S\+S\+\_\+\+U\+P\+LO. U\+P\+LO specifies the form of A is stored\+:
\begin{DoxyItemize}
\item Lower\+: Lower triangle of A is stored. The upper traingular part is not referenced.
\item Upper\+: Upper triangle of A is stored. The lower triangular part is not referenced.
\end{DoxyItemize}\\
\hline
\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\+:
\begin{DoxyItemize}
\item No\+Trans\+: op( A ) = A.
\item Trans\+: op( A ) = A$\ast$$\ast$T.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em D\+I\+AG} & enum D\+D\+S\+S\+\_\+\+D\+I\+AG. D\+I\+AG specifies whether or not A is unit triangular as follows\+:
\begin{DoxyItemize}
\item Unit\+: A is assumed to be unit triangular.
\item Non\+Unit\+: A is not assumed to be unit triangular.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of B. M must be at least zero.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of B. N 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 K by K, where K is M when S\+I\+DE = Left and is N otherwise. When U\+P\+LO = Uppper the strictly lower triangular part of A is not referenced and when U\+P\+LO = Lower the strictly upper triangular part of A is not referenced. Note that when D\+I\+AG = Unit, the diagonal elements of A are not referenced either, but are assumed to be unity.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). When S\+I\+DE = Left then L\+DA must be at least max( 1, M ), otherwise L\+DA must be at least max( 1, N ).\\
\hline
\mbox{\tt in,out}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension M by N. On exit the matrix B is overwritten by the solution matrix X.\\
\hline
\mbox{\tt in}  & {\em L\+DB} & int. L\+DB specifies the number of columns of B ( row-\/major order ). L\+DB must be at least max( 1, N ).\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_addfda795c19230c16da674648de83a5c}{kdtrsm} 
\end{DoxySeeAlso}


Definition at line 113 of file ddss\+\_\+dtrsm.\+c.



References kdtrsm().


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