mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Rename the vector() factories defined in blas/common.h into make_vector() to prevent a possible name conflict with std::vector.
This commit is contained in:
@@ -19,8 +19,8 @@ RealScalar EIGEN_BLAS_FUNC(asum)(int *n, RealScalar *px, int *incx)
|
||||
|
||||
if(*n<=0) return 0;
|
||||
|
||||
if(*incx==1) return vector(x,*n).cwiseAbs().sum();
|
||||
else return vector(x,*n,std::abs(*incx)).cwiseAbs().sum();
|
||||
if(*incx==1) return make_vector(x,*n).cwiseAbs().sum();
|
||||
else return make_vector(x,*n,std::abs(*incx)).cwiseAbs().sum();
|
||||
}
|
||||
|
||||
// computes a vector-vector dot product.
|
||||
@@ -33,11 +33,11 @@ Scalar EIGEN_BLAS_FUNC(dot)(int *n, RealScalar *px, int *incx, RealScalar *py, i
|
||||
Scalar* x = reinterpret_cast<Scalar*>(px);
|
||||
Scalar* y = reinterpret_cast<Scalar*>(py);
|
||||
|
||||
if(*incx==1 && *incy==1) return (vector(x,*n).cwiseProduct(vector(y,*n))).sum();
|
||||
else if(*incx>0 && *incy>0) return (vector(x,*n,*incx).cwiseProduct(vector(y,*n,*incy))).sum();
|
||||
else if(*incx<0 && *incy>0) return (vector(x,*n,-*incx).reverse().cwiseProduct(vector(y,*n,*incy))).sum();
|
||||
else if(*incx>0 && *incy<0) return (vector(x,*n,*incx).cwiseProduct(vector(y,*n,-*incy).reverse())).sum();
|
||||
else if(*incx<0 && *incy<0) return (vector(x,*n,-*incx).reverse().cwiseProduct(vector(y,*n,-*incy).reverse())).sum();
|
||||
if(*incx==1 && *incy==1) return (make_vector(x,*n).cwiseProduct(make_vector(y,*n))).sum();
|
||||
else if(*incx>0 && *incy>0) return (make_vector(x,*n,*incx).cwiseProduct(make_vector(y,*n,*incy))).sum();
|
||||
else if(*incx<0 && *incy>0) return (make_vector(x,*n,-*incx).reverse().cwiseProduct(make_vector(y,*n,*incy))).sum();
|
||||
else if(*incx>0 && *incy<0) return (make_vector(x,*n,*incx).cwiseProduct(make_vector(y,*n,-*incy).reverse())).sum();
|
||||
else if(*incx<0 && *incy<0) return (make_vector(x,*n,-*incx).reverse().cwiseProduct(make_vector(y,*n,-*incy).reverse())).sum();
|
||||
else return 0;
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ Scalar EIGEN_BLAS_FUNC(nrm2)(int *n, RealScalar *px, int *incx)
|
||||
|
||||
Scalar* x = reinterpret_cast<Scalar*>(px);
|
||||
|
||||
if(*incx==1) return vector(x,*n).stableNorm();
|
||||
else return vector(x,*n,std::abs(*incx)).stableNorm();
|
||||
if(*incx==1) return make_vector(x,*n).stableNorm();
|
||||
else return make_vector(x,*n,std::abs(*incx)).stableNorm();
|
||||
}
|
||||
|
||||
int EIGEN_BLAS_FUNC(rot)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pc, RealScalar *ps)
|
||||
@@ -64,8 +64,8 @@ int EIGEN_BLAS_FUNC(rot)(int *n, RealScalar *px, int *incx, RealScalar *py, int
|
||||
Scalar c = *reinterpret_cast<Scalar*>(pc);
|
||||
Scalar s = *reinterpret_cast<Scalar*>(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);
|
||||
|
||||
Reference in New Issue
Block a user