inline void Symm ( LeftOrRight side, UpperOrLower uplo, T alpha, const Matrix<T>& A, const Matrix<T>& B, T beta, Matrix<T>& C, bool conjugate=false ) { #ifndef RELEASE CallStackEntry entry("Symm"); #endif const char sideChar = LeftOrRightToChar( side ); const char uploChar = UpperOrLowerToChar( uplo ); if( conjugate ) { blas::Hemm ( sideChar, uploChar, C.Height(), C.Width(), alpha, A.LockedBuffer(), A.LDim(), B.LockedBuffer(), B.LDim(), beta, C.Buffer(), C.LDim() ); } else { blas::Symm ( sideChar, uploChar, C.Height(), C.Width(), alpha, A.LockedBuffer(), A.LDim(), B.LockedBuffer(), B.LDim(), beta, C.Buffer(), C.LDim() ); } }
inline void Trmm ( LeftOrRight side, UpperOrLower uplo, Orientation orientation, UnitOrNonUnit diag, T alpha, const Matrix<T>& A, Matrix<T>& B ) { #ifndef RELEASE CallStackEntry entry("Trmm"); if( A.Height() != A.Width() ) LogicError("Triangular matrix must be square"); if( side == LEFT ) { if( A.Height() != B.Height() ) LogicError("Nonconformal Trmm"); } else { if( A.Height() != B.Width() ) LogicError("Nonconformal Trmm"); } #endif const char sideChar = LeftOrRightToChar( side ); const char uploChar = UpperOrLowerToChar( uplo ); const char transChar = OrientationToChar( orientation ); const char diagChar = UnitOrNonUnitToChar( diag ); blas::Trmm ( sideChar, uploChar, transChar, diagChar, B.Height(), B.Width(), alpha, A.LockedBuffer(), A.LDim(), B.Buffer(), B.LDim() ); }
inline void Hemm ( LeftOrRight side, UpperOrLower uplo, T alpha, const Matrix<T>& A, const Matrix<T>& B, T beta, Matrix<T>& C ) { #ifndef RELEASE PushCallStack("Hemm"); #endif const char sideChar = LeftOrRightToChar( side ); const char uploChar = UpperOrLowerToChar( uplo ); blas::Hemm ( sideChar, uploChar, C.Height(), C.Width(), alpha, A.LockedBuffer(), A.LDim(), B.LockedBuffer(), B.LDim(), beta, C.Buffer(), C.LDim() ); #ifndef RELEASE PopCallStack(); #endif }
inline void Trsm ( LeftOrRight side, UpperOrLower uplo, Orientation orientation, UnitOrNonUnit diag, F alpha, const Matrix<F>& A, Matrix<F>& B, bool checkIfSingular ) { #ifndef RELEASE PushCallStack("Trsm"); if( A.Height() != A.Width() ) throw std::logic_error("Triangular matrix must be square"); if( side == LEFT ) { if( A.Height() != B.Height() ) throw std::logic_error("Nonconformal Trsm"); } else { if( A.Height() != B.Width() ) throw std::logic_error("Nonconformal Trsm"); } #endif const char sideChar = LeftOrRightToChar( side ); const char uploChar = UpperOrLowerToChar( uplo ); const char transChar = OrientationToChar( orientation ); const char diagChar = UnitOrNonUnitToChar( diag ); if( checkIfSingular && diag != UNIT ) { const int n = A.Height(); for( int j=0; j<n; ++j ) if( A.Get(j,j) == F(0) ) throw SingularMatrixException(); } blas::Trsm ( sideChar, uploChar, transChar, diagChar, B.Height(), B.Width(), alpha, A.LockedBuffer(), A.LDim(), B.Buffer(), B.LDim() ); #ifndef RELEASE PopCallStack(); #endif }