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

LASs-DDSs ddss_dsyr2k routine. More...

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

Go to the source code of this file.

Functions

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

Detailed Description

LASs-DDSs ddss_dsyr2k 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-02-21

Definition in file ddss_dsyr2k.c.

Function Documentation

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

Performs one of the symmetric rank 2k operations:

C = ALPHA * A * B**T + ALPHA * B * A**T + BETA * C or
C = ALPHA * A**T * B + ALPHA * B**T * A + BETA * C

ALPHA and BETA 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.

Parameters
[in]UPLOenum DDSS_UPLO. UPLO specifies the form in which C is stored:
  • Lower: Lower triangular part of C is stored. The upper traingular part is not referenced.
  • Upper: Upper triangular part of C is stored. The lower triangular part is not referenced.
[in]TRANSenum DDSS_TRANS. TRANS specifies the operation to be performed as follows:
  • NoTrans: C = ALPHA * A * B**T + ALPHA * B * A**T + BETA * C
  • Trans: C = ALPHA * A**T * B + ALPHA * B**T * A + BETA * C
[in]Nint. N specifies the order of matrix C. N must be at least zero.
[in]Kint. With TRANS = NoTrans, K specifies the number of columns of the matrices A and B, and with TRANS = Trans, K specifies the number of rows of the matrices A and B. K must be at least zero.
[in]ALPHAdouble. ALPHA specifies the scalar alpha.
[in]Adouble *. A is a pointer to a matrix of dimension Na ( rows ) by Ka ( columns ), where Na is N and Ka is K when TRANS = NoTrans, and Na is K and Ka is N otherwise.
[in]LDAint. LDA specifies the number of columns of A ( row-major order ). When TRANS = NoTrans then LDA must be at least max( 1, K ), otherwise LDA must be at least max( 1, N ).
[in]Bdouble *. B is a pointer to a matrix of dimension Nb ( rows ) by Kb ( columns ), where Nb is N and Kb is K when TRANS = NoTrans, and Nb is K and Kb is N otherwise.
[in]LDBint. LDB specifies the number of columns of B ( row-major order ). When TRANS = NoTrans then LDB must be at least max( 1, K ), otherwise LDB must be at least max( 1, N ).
[in]BETAdouble. BETA specifies the scalar beta.
[in,out]Cdouble *. C is a pointer to a matrix of dimension N by N. When UPLO = 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 UPLO = 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.
[in]LDCint. LDC specifies the number of columns of C ( row-major order ). LDC must be at least max( 1, N ).
See also
kdsyr2k

Definition at line 114 of file ddss_dsyr2k.c.

References kdsyr2k().

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