📄 blas_2.cxx
字号:
Vector<float, Vect_Full, Allocator2>& Y) { cblas_sspmv(CblasRowMajor, Uplo, A.GetM(), alpha, A.GetData(), X.GetData(), 1, beta, Y.GetData(), 1); } template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void MltAdd(const double alpha, const enum CBLAS_UPLO Uplo, const Matrix<double, Prop0, RowSymPacked, Allocator0>& A, const Vector<double, Vect_Full, Allocator1>& X, const double beta, Vector<double, Vect_Full, Allocator2>& Y) { cblas_dspmv(CblasRowMajor, Uplo, A.GetM(), alpha, A.GetData(), X.GetData(), 1, beta, Y.GetData(), 1); } // MLTADD // //////////// ///////////////// // RANK1UPDATE // /*** ColMajor ***/ template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const float alpha, const Vector<float, Vect_Full, Allocator1>& X, const Vector<float, Vect_Full, Allocator2>& Y, Matrix<float, Prop0, ColMajor, Allocator0>& A) { cblas_sger(CblasColMajor, A.GetM(), A.GetN(), alpha, X.GetData(), 1, Y.GetData(), 1, A.GetData(), A.GetM()); } template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const double alpha, const Vector<double, Vect_Full, Allocator1>& X, const Vector<double, Vect_Full, Allocator2>& Y, Matrix<double, Prop0, ColMajor, Allocator0>& A) { cblas_dger(CblasColMajor, A.GetM(), A.GetN(), alpha, X.GetData(), 1, Y.GetData(), 1, A.GetData(), A.GetM()); } template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const complex<float> alpha, const Vector<complex<float>, Vect_Full, Allocator1>& X, const Vector<complex<float>, Vect_Full, Allocator2>& Y, Matrix<complex<float>, Prop0, ColMajor, Allocator0>& A) { cblas_cgeru(CblasColMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); } template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const complex<double> alpha, const Vector<complex<double>, Vect_Full, Allocator1>& X, const Vector<complex<double>, Vect_Full, Allocator2>& Y, Matrix<complex<double>, Prop0, ColMajor, Allocator0>& A) { cblas_zgeru(CblasColMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); } /*** ColMajor and ConjY ***/ template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const complex<float> alpha, const Vector<complex<float>, Vect_Full, Allocator1>& X, const SeldonConjugate& ConjY, const Vector<complex<float>, Vect_Full, Allocator2>& Y, Matrix<complex<float>, Prop0, ColMajor, Allocator0>& A) { if (ConjY.Conj()) cblas_cgerc(CblasColMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); else cblas_cgeru(CblasColMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); } template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const complex<double> alpha, const Vector<complex<double>, Vect_Full, Allocator1>& X, const SeldonConjugate& ConjY, const Vector<complex<double>, Vect_Full, Allocator2>& Y, Matrix<complex<double>, Prop0, ColMajor, Allocator0>& A) { if (ConjY.Conj()) cblas_zgerc(CblasColMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); else cblas_zgeru(CblasColMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); } /*** RowMajor ***/ template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const float alpha, const Vector<float, Vect_Full, Allocator1>& X, const Vector<float, Vect_Full, Allocator2>& Y, Matrix<float, Prop0, RowMajor, Allocator0>& A) { cblas_sger(CblasRowMajor, A.GetM(), A.GetN(), alpha, X.GetData(), 1, Y.GetData(), 1, A.GetData(), A.GetM()); } template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const double alpha, const Vector<double, Vect_Full, Allocator1>& X, const Vector<double, Vect_Full, Allocator2>& Y, Matrix<double, Prop0, RowMajor, Allocator0>& A) { cblas_dger(CblasRowMajor, A.GetM(), A.GetN(), alpha, X.GetData(), 1, Y.GetData(), 1, A.GetData(), A.GetM()); } template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const complex<float> alpha, const Vector<complex<float>, Vect_Full, Allocator1>& X, const Vector<complex<float>, Vect_Full, Allocator2>& Y, Matrix<complex<float>, Prop0, RowMajor, Allocator0>& A) { cblas_cgeru(CblasRowMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); } template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const complex<double> alpha, const Vector<complex<double>, Vect_Full, Allocator1>& X, const Vector<complex<double>, Vect_Full, Allocator2>& Y, Matrix<complex<double>, Prop0, RowMajor, Allocator0>& A) { cblas_zgeru(CblasRowMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); } /*** RowMajor and ConjY ***/ template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const complex<float> alpha, const Vector<complex<float>, Vect_Full, Allocator1>& X, const SeldonConjugate& ConjY, const Vector<complex<float>, Vect_Full, Allocator2>& Y, Matrix<complex<float>, Prop0, RowMajor, Allocator0>& A) { if (ConjY.Conj()) cblas_cgerc(CblasRowMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); else cblas_cgeru(CblasRowMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); } template <class Prop0, class Allocator0, class Allocator1, class Allocator2> void Rank1Update(const complex<double> alpha, const Vector<complex<double>, Vect_Full, Allocator1>& X, const SeldonConjugate& ConjY, const Vector<complex<double>, Vect_Full, Allocator2>& Y, Matrix<complex<double>, Prop0, RowMajor, Allocator0>& A) { if (ConjY.Conj()) cblas_zgerc(CblasRowMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); else cblas_zgeru(CblasRowMajor, A.GetM(), A.GetN(), reinterpret_cast<const void*>(&alpha), reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<const void*>(Y.GetData()), 1, reinterpret_cast<void*>(A.GetData()), A.GetM()); } /*** ColSymPacked and Upper ***/ template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const float alpha, const Vector<float, Vect_Full, Allocator0>& X, Matrix<float, Prop1, ColSymPacked, Allocator1>& A) { cblas_sspr(CblasColMajor, CblasUpper, A.GetM(), alpha, X.GetData(), 1, A.GetData()); } template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const double alpha, const Vector<double, Vect_Full, Allocator0>& X, Matrix<double, Prop1, ColSymPacked, Allocator1>& A) { cblas_dspr(CblasColMajor, CblasUpper, A.GetM(), alpha, X.GetData(), 1, A.GetData()); } // Warning: the matrix is assumed to be hermitian. template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const float alpha, const Vector<complex<float>, Vect_Full, Allocator0>& X, Matrix<complex<float>, Prop1, ColSymPacked, Allocator1>& A) { cblas_chpr(CblasColMajor, CblasUpper, A.GetM(), alpha, reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<void*>(A.GetData())); } // Warning: the matrix is assumed to be hermitian. template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const double alpha, const Vector<complex<double>, Vect_Full, Allocator0>& X, Matrix<complex<double>, Prop1, ColSymPacked, Allocator1>& A) { cblas_zhpr(CblasColMajor, CblasUpper, A.GetM(), alpha, reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<void*>(A.GetData())); } /*** ColSymPacked and Uplo ***/ template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const float alpha, const Vector<float, Vect_Full, Allocator0>& X, const enum CBLAS_UPLO Uplo, Matrix<float, Prop1, ColSymPacked, Allocator1>& A) { cblas_sspr(CblasColMajor, Uplo, A.GetM(), alpha, X.GetData(), 1, A.GetData()); } template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const double alpha, const Vector<double, Vect_Full, Allocator0>& X, const enum CBLAS_UPLO Uplo, Matrix<double, Prop1, ColSymPacked, Allocator1>& A) { cblas_dspr(CblasColMajor, Uplo, A.GetM(), alpha, X.GetData(), 1, A.GetData()); } // Warning: the matrix is assumed to be hermitian. template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const float alpha, const Vector<complex<float>, Vect_Full, Allocator0>& X, const enum CBLAS_UPLO Uplo, Matrix<complex<float>, Prop1, ColSymPacked, Allocator1>& A) { cblas_chpr(CblasColMajor, Uplo, A.GetM(), alpha, reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<void*>(A.GetData())); } // Warning: the matrix is assumed to be hermitian. template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const double alpha, const Vector<complex<double>, Vect_Full, Allocator0>& X, const enum CBLAS_UPLO Uplo, Matrix<complex<double>, Prop1, ColSymPacked, Allocator1>& A) { cblas_zhpr(CblasColMajor, Uplo, A.GetM(), alpha, reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<void*>(A.GetData())); } /*** RowSymPacked and Upper ***/ template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const float alpha, const Vector<float, Vect_Full, Allocator0>& X, Matrix<float, Prop1, RowSymPacked, Allocator1>& A) { cblas_sspr(CblasRowMajor, CblasUpper, A.GetM(), alpha, X.GetData(), 1, A.GetData()); } template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const double alpha, const Vector<double, Vect_Full, Allocator0>& X, Matrix<double, Prop1, RowSymPacked, Allocator1>& A) { cblas_dspr(CblasRowMajor, CblasUpper, A.GetM(), alpha, X.GetData(), 1, A.GetData()); } // Warning: the matrix is assumed to be hermitian. template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const float alpha, const Vector<complex<float>, Vect_Full, Allocator0>& X, Matrix<complex<float>, Prop1, RowSymPacked, Allocator1>& A) { cblas_chpr(CblasRowMajor, CblasUpper, A.GetM(), alpha, reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<void*>(A.GetData())); } // Warning: the matrix is assumed to be hermitian. template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const double alpha, const Vector<complex<double>, Vect_Full, Allocator0>& X, Matrix<complex<double>, Prop1, RowSymPacked, Allocator1>& A) { cblas_zhpr(CblasRowMajor, CblasUpper, A.GetM(), alpha, reinterpret_cast<const void*>(X.GetData()), 1, reinterpret_cast<void*>(A.GetData())); } /*** RowSymPacked and Uplo ***/ template <class Allocator0, class Prop1, class Allocator1> void Rank1Update(const float alpha, const Vector<float, Vect_Full, Allocator0>& X, const enum CBLAS_UPLO Uplo, Matrix<float, Prop1, RowSymPacked, Allocator1>& A) { cblas_sspr(CblasRowMajor, Uplo, A.GetM
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -