LASs - Linear Algebra Routines on OmpSs  1.0.0
LASs
Functions
ddss_dtrmm.c File Reference

LASs-DDSs ddss_dtrmm routine. More...

#include "../include/lass.h"
Include dependency graph for ddss_dtrmm.c:

Go to the source code of this file.

Functions

int ddss_dtrmm (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)
 

Detailed Description

LASs-DDSs ddss_dtrmm routine.

LASs-DDSs is a software package provided by: Barcelona Supercomputing Center - Centro Nacional de Supercomputacion

Author
Pedro Valero-Lara pedro.nosp@m..val.nosp@m.ero@b.nosp@m.sc.e.nosp@m.s
Boro Sofranac boro..nosp@m.sofr.nosp@m.anac@.nosp@m.bsc..nosp@m.es
Date
2018-03-19

Definition in file ddss_dtrmm.c.

Function Documentation

int ddss_dtrmm ( 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 
)

Performs one of the matrix-matrix operations:

B = ALPHA * op( A ) * B, or B = ALPHA * B * op( A )

where op( A ) is one of:

op( A ) = A      or
op( A ) = A**T 

ALPHA is a scalar, B is a M by N matrix and A is a unit, or non-unit, upper or lower triangular matrix.

Parameters
[in]SIDEenum DDSS_SIDE. SIDE specifies the position of the triangular A matrix in the operations:
  • Left: B = ALPHA * op( A ) * B.
  • Right: B = ALPHA * B * op( A ).
[in]UPLOenum DDSS_UPLO. UPLO specifies the form in which A is stored:
  • Lower: Lower triangle of A is stored. The upper traingular part is not referenced.
  • Upper: Upper triangle of A is stored. The lower triangular part is not referenced.
[in]TRANS_Aenum DDSS_TRANS. TRANS_A specifies the form of op( A ) to be used:
  • NoTrans: op( A ) = A.
  • Trans: op( A ) = A**T.
[in]DIAGenum DDSS_DIAG. DIAG specifies whether or not A is unit triangular as follows:
  • Unit: A is assumed to be unit triangular.
  • NonUnit: A is not assumed to be unit triangular.
[in]Mint. M specifies the number of rows of B. M must be at least zero.
[in]Nint. N specifies the number of columns of B. N must be at least zero.
[in]ALPHAdouble. ALPHA specifies the scalar alpha.
[in]Adouble *. A is a pointer to a matrix of dimension K by K, where K is M when SIDE = Left and is N otherwise. When UPLO = Uppper the strictly lower triangular part of A is not referenced and when UPLO = Lower the strictly upper triangular part of A is not referenced. Note that when DIAG = Unit, the diagonal elements of A are not referenced either, but are assumed to be unity.
[in]LDAint. LDA specifies the number of columns of A ( row-major order ). When SIDE = Left then LDA must be at least max( 1, M ), otherwise LDA must be at least max( 1, N ).
[in,out]Bdouble *. B is a pointer to a matrix of dimension M by N. On exit the matrix B is overwritten by the transformed matrix.
[in]LDBint. LDB specifies the number of columns of B ( row-major order ). LDB must be at least max( 1, N ).
See also
kdtrmm

Definition at line 113 of file ddss_dtrmm.c.

References kdtrmm().

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