========================== LU-Zerlegung: Vorbereitung [TOC] ========================== Wir werden zunächst die ungeblockte LU-Zerlegung _hpc::ulmlapack::getf2_ implementieren. Dazu sind zunächst weitere BLAS Bausteine notwendig: - _hpc::ulmblas::ger_ für die Rang-1 Operation $A \leftarrow A + \alpha x\,y^T$. - _hpc::ulmblas::scal_ für die Vektorskalierung $x \leftarrow \alpha x$. - _hpc::ulmblas::iamax_ für die Bestimmung eines Index $i$ mit $|\,x_i| = \max\limits_{j} |\,x_j|$ - _hpc::ulmblas::swap_ für die Vertauschung $x \leftrightarrow y$ zweier Vektoren. Das Vorlesungsprojekt soll um diese Bausteine erweitert werden. Dazu sollen zunächst die Signaturen vorgegeben werden. hpc::ulmblas::ger ================= ---- CODE (type=cc) ------------------------------------------------------------ #ifndef HPC_ULMBLAS_GER_H #define HPC_ULMBLAS_GER_H 1 #include namespace hpc { namespace ulmblas { template void ger(Index m, Index n, const Alpha &alpha, const TX *x, Index incX, const TY *y, Index incY, TA *A, Index incRowA, Index incColA) { /* ... */ } } } // namespace ulmblas, hpc #endif // HPC_ULMBLAS_GER_H -------------------------------------------------------------------------------- hpc::ulmblas::scal ================== ---- CODE (type=cc) ------------------------------------------------------------ #ifndef HPC_ULMBLAS_SCAL_H #define HPC_ULMBLAS_SCAL_H 1 namespace hpc { namespace ulmblas { template void scal(Index n, const Alpha &alpha, TX *x, Index incX) { /* ... */ } } } // namespace ulmblas, hpc #endif // HPC_ULMBLAS_SCAL_H -------------------------------------------------------------------------------- hpc::ulmblas::iamax =================== ---- CODE (type=cc) ------------------------------------------------------------ #ifndef HPC_ULMBLAS_IAMAX_H #define HPC_ULMBLAS_IAMAX_H 1 #include namespace hpc { namespace ulmblas { template Index iamax(Index n, const TX *x, Index incX) { /* ... */ } } } // namespace ulmblas, hpc #endif // HPC_ULMBLAS_IAMAX_H -------------------------------------------------------------------------------- hpc::ulmblas::swap ================== ---- CODE (type=cc) ------------------------------------------------------------ #ifndef HPC_ULMBLAS_SWAP_H #define HPC_ULMBLAS_SWAP_H 1 #include namespace hpc { namespace ulmblas { template void swap(Index n, TX *x, Index incX, TY *y, Index incY) { /* ... */ } } } // namespace ulmblas, hpc #endif // HPC_ULMBLAS_SWAP_H -------------------------------------------------------------------------------- Aufgaben ======== Implementiert diese Funktionen. Als Test wird die ungeblockte LU-Zerlegung auf der nächsten Seite dienen. :navigate: up -> doc:index next -> doc:session17/page02