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:
@@ -32,13 +32,14 @@ RealScalar EIGEN_CAT(EIGEN_CAT(REAL_SCALAR_SUFFIX,SCALAR_SUFFIX),asum_)(int *n,
|
||||
|
||||
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)
|
||||
@@ -50,11 +51,11 @@ int EIGEN_BLAS_FUNC(dotcw)(int *n, RealScalar *px, int *incx, RealScalar *py, in
|
||||
Scalar* x = reinterpret_cast<Scalar*>(px);
|
||||
Scalar* y = reinterpret_cast<Scalar*>(py);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -72,11 +73,11 @@ int EIGEN_BLAS_FUNC(dotuw)(int *n, RealScalar *px, int *incx, RealScalar *py, in
|
||||
Scalar* x = reinterpret_cast<Scalar*>(px);
|
||||
Scalar* y = reinterpret_cast<Scalar*>(py);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -88,9 +89,9 @@ RealScalar EIGEN_CAT(EIGEN_CAT(REAL_SCALAR_SUFFIX,SCALAR_SUFFIX),nrm2_)(int *n,
|
||||
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)
|
||||
@@ -102,8 +103,8 @@ int EIGEN_CAT(EIGEN_CAT(SCALAR_SUFFIX,REAL_SCALAR_SUFFIX),rot_)(int *n, RealScal
|
||||
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);
|
||||
@@ -125,9 +126,8 @@ int EIGEN_CAT(EIGEN_CAT(SCALAR_SUFFIX,REAL_SCALAR_SUFFIX),scal_)(int *n, RealSca
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user