• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision2e2bb6e1c5d6d899c15ec5ebd68312bdcb1acdd1 (tree)
l'heure2014-01-17 17:17:18
AuteurKatsuhiko Nishimra <ktns.87@gmai...>
CommiterKatsuhiko Nishimra

Message de Log

Add wrapper functions of BLAS dnrm2 routine. #30379

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1653 1136aad2-a195-0410-b898-f5ea1d11b9d8

Change Summary

Modification

--- a/src/wrappers/Blas.cpp
+++ b/src/wrappers/Blas.cpp
@@ -132,6 +132,25 @@ double Blas::Ddot(molds_blas_int n,
132132 return cblas_ddot(n, x, incrementX, y, incrementY);
133133 }
134134
135+// returns sqrt(sum(Xi^2))
136+// vectorX: n-vector
137+double Blas::Dnrm2(molds_blas_int n,
138+ double const* vectorX) const{
139+ molds_blas_int incrementX = 1;
140+ return this->Dnrm2(n,vectorX,incrementX);
141+}
142+// returns sqrt(sum(Xi^2))
143+// vectorX: n-vector
144+double Blas::Dnrm2(molds_blas_int n,
145+ double const* vectorX,
146+ molds_blas_int incrementX) const{
147+ if(n<=0 || vectorX == NULL || incrementX <= 0){
148+ return 0.0;
149+ }
150+ double* x=const_cast<double*>(vectorX);
151+ return cblas_dnrm2(n,x,incrementX);
152+}
153+
135154 // returns max(abs(vectorX[i]))
136155 // vectorX: n-vector
137156 double Blas::Damax(molds_blas_int n,
--- a/src/wrappers/Blas.h
+++ b/src/wrappers/Blas.h
@@ -45,6 +45,11 @@ public:
4545 double Ddot(molds_blas_int n,
4646 double const* vectorX, molds_blas_int incrementX,
4747 double const* vectorY, molds_blas_int incrementY)const;
48+ double Dnrm2(molds_blas_int n,
49+ double const* vectorX) const;
50+ double Dnrm2(molds_blas_int n,
51+ double const* vectorX,
52+ molds_blas_int incrementX) const;
4853 double Damax(molds_blas_int n,
4954 double const* vectorX) const;
5055 double Damax(molds_blas_int n,