Squashed 'third_party/eigen/' changes from 61d72f6..cf794d3


Change-Id: I9b814151b01f49af6337a8605d0c42a3a1ed4c72
git-subtree-dir: third_party/eigen
git-subtree-split: cf794d3b741a6278df169e58461f8529f43bce5d
diff --git a/blas/level1_cplx_impl.h b/blas/level1_cplx_impl.h
index 283b9f8..719f5ba 100644
--- a/blas/level1_cplx_impl.h
+++ b/blas/level1_cplx_impl.h
@@ -32,45 +32,52 @@
 
   if(*n<=0) return 0;
 
-  if(*incx==1)  return vector(x,*n).unaryExpr<scalar_norm1_op>().sum();
-  else          return vector(x,*n,std::abs(*incx)).unaryExpr<scalar_norm1_op>().sum();
+  if(*incx==1)  return make_vector(x,*n).unaryExpr<scalar_norm1_op>().sum();
+  else          return make_vector(x,*n,std::abs(*incx)).unaryExpr<scalar_norm1_op>().sum();
 }
 
 // computes a dot product of a conjugated vector with another vector.
 int EIGEN_BLAS_FUNC(dotcw)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar* pres)
 {
 //   std::cerr << "_dotc " << *n << " " << *incx << " " << *incy << "\n";
+  Scalar* res = reinterpret_cast<Scalar*>(pres);
 
-  if(*n<=0) return 0;
+  if(*n<=0)
+  {
+    *res = Scalar(0);
+    return 0;
+  }
 
   Scalar* x = reinterpret_cast<Scalar*>(px);
   Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar* res = reinterpret_cast<Scalar*>(pres);
 
-  if(*incx==1 && *incy==1)    *res = (vector(x,*n).dot(vector(y,*n)));
-  else if(*incx>0 && *incy>0) *res = (vector(x,*n,*incx).dot(vector(y,*n,*incy)));
-  else if(*incx<0 && *incy>0) *res = (vector(x,*n,-*incx).reverse().dot(vector(y,*n,*incy)));
-  else if(*incx>0 && *incy<0) *res = (vector(x,*n,*incx).dot(vector(y,*n,-*incy).reverse()));
-  else if(*incx<0 && *incy<0) *res = (vector(x,*n,-*incx).reverse().dot(vector(y,*n,-*incy).reverse()));
+  if(*incx==1 && *incy==1)    *res = (make_vector(x,*n).dot(make_vector(y,*n)));
+  else if(*incx>0 && *incy>0) *res = (make_vector(x,*n,*incx).dot(make_vector(y,*n,*incy)));
+  else if(*incx<0 && *incy>0) *res = (make_vector(x,*n,-*incx).reverse().dot(make_vector(y,*n,*incy)));
+  else if(*incx>0 && *incy<0) *res = (make_vector(x,*n,*incx).dot(make_vector(y,*n,-*incy).reverse()));
+  else if(*incx<0 && *incy<0) *res = (make_vector(x,*n,-*incx).reverse().dot(make_vector(y,*n,-*incy).reverse()));
   return 0;
 }
 
 // computes a vector-vector dot product without complex conjugation.
 int EIGEN_BLAS_FUNC(dotuw)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar* pres)
 {
-//   std::cerr << "_dotu " << *n << " " << *incx << " " << *incy << "\n";
+  Scalar* res = reinterpret_cast<Scalar*>(pres);
 
-  if(*n<=0) return 0;
+  if(*n<=0)
+  {
+    *res = Scalar(0);
+    return 0;
+  }
 
   Scalar* x = reinterpret_cast<Scalar*>(px);
   Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar* res = reinterpret_cast<Scalar*>(pres);
 
-  if(*incx==1 && *incy==1)    *res = (vector(x,*n).cwiseProduct(vector(y,*n))).sum();
-  else if(*incx>0 && *incy>0) *res = (vector(x,*n,*incx).cwiseProduct(vector(y,*n,*incy))).sum();
-  else if(*incx<0 && *incy>0) *res = (vector(x,*n,-*incx).reverse().cwiseProduct(vector(y,*n,*incy))).sum();
-  else if(*incx>0 && *incy<0) *res = (vector(x,*n,*incx).cwiseProduct(vector(y,*n,-*incy).reverse())).sum();
-  else if(*incx<0 && *incy<0) *res = (vector(x,*n,-*incx).reverse().cwiseProduct(vector(y,*n,-*incy).reverse())).sum();
+  if(*incx==1 && *incy==1)    *res = (make_vector(x,*n).cwiseProduct(make_vector(y,*n))).sum();
+  else if(*incx>0 && *incy>0) *res = (make_vector(x,*n,*incx).cwiseProduct(make_vector(y,*n,*incy))).sum();
+  else if(*incx<0 && *incy>0) *res = (make_vector(x,*n,-*incx).reverse().cwiseProduct(make_vector(y,*n,*incy))).sum();
+  else if(*incx>0 && *incy<0) *res = (make_vector(x,*n,*incx).cwiseProduct(make_vector(y,*n,-*incy).reverse())).sum();
+  else if(*incx<0 && *incy<0) *res = (make_vector(x,*n,-*incx).reverse().cwiseProduct(make_vector(y,*n,-*incy).reverse())).sum();
   return 0;
 }
 
@@ -82,9 +89,9 @@
   Scalar* x = reinterpret_cast<Scalar*>(px);
 
   if(*incx==1)
-    return vector(x,*n).stableNorm();
+    return make_vector(x,*n).stableNorm();
 
-  return vector(x,*n,*incx).stableNorm();
+  return make_vector(x,*n,*incx).stableNorm();
 }
 
 int EIGEN_CAT(EIGEN_CAT(SCALAR_SUFFIX,REAL_SCALAR_SUFFIX),rot_)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pc, RealScalar *ps)
@@ -96,8 +103,8 @@
   RealScalar c = *pc;
   RealScalar s = *ps;
 
-  StridedVectorType vx(vector(x,*n,std::abs(*incx)));
-  StridedVectorType vy(vector(y,*n,std::abs(*incy)));
+  StridedVectorType vx(make_vector(x,*n,std::abs(*incx)));
+  StridedVectorType vy(make_vector(y,*n,std::abs(*incy)));
 
   Reverse<StridedVectorType> rvx(vx);
   Reverse<StridedVectorType> rvy(vy);
@@ -119,9 +126,8 @@
 
 //   std::cerr << "__scal " << *n << " " << alpha << " " << *incx << "\n";
 
-  if(*incx==1)  vector(x,*n) *= alpha;
-  else          vector(x,*n,std::abs(*incx)) *= alpha;
+  if(*incx==1)  make_vector(x,*n) *= alpha;
+  else          make_vector(x,*n,std::abs(*incx)) *= alpha;
 
   return 0;
 }
-