mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Clang-format tests, examples, libraries, benchmarks, etc.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
3252ecc7a4
commit
46e9cdb7fe
@@ -8,10 +8,10 @@
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#define SCALAR double
|
||||
#define SCALAR double
|
||||
#define SCALAR_SUFFIX d
|
||||
#define SCALAR_SUFFIX_UP "D"
|
||||
#define ISCOMPLEX 0
|
||||
#define ISCOMPLEX 0
|
||||
|
||||
#include "level1_impl.h"
|
||||
#include "level1_real_impl.h"
|
||||
@@ -19,14 +19,25 @@
|
||||
#include "level2_real_impl.h"
|
||||
#include "level3_impl.h"
|
||||
|
||||
double EIGEN_BLAS_FUNC(sdot)(int* n, float* x, int* incx, float* y, int* incy)
|
||||
{
|
||||
if(*n<=0) return 0;
|
||||
double EIGEN_BLAS_FUNC(sdot)(int* n, float* x, int* incx, float* y, int* incy) {
|
||||
if (*n <= 0) return 0;
|
||||
|
||||
if(*incx==1 && *incy==1) return (make_vector(x,*n).cast<double>().cwiseProduct(make_vector(y,*n).cast<double>())).sum();
|
||||
else if(*incx>0 && *incy>0) return (make_vector(x,*n,*incx).cast<double>().cwiseProduct(make_vector(y,*n,*incy).cast<double>())).sum();
|
||||
else if(*incx<0 && *incy>0) return (make_vector(x,*n,-*incx).reverse().cast<double>().cwiseProduct(make_vector(y,*n,*incy).cast<double>())).sum();
|
||||
else if(*incx>0 && *incy<0) return (make_vector(x,*n,*incx).cast<double>().cwiseProduct(make_vector(y,*n,-*incy).reverse().cast<double>())).sum();
|
||||
else if(*incx<0 && *incy<0) return (make_vector(x,*n,-*incx).reverse().cast<double>().cwiseProduct(make_vector(y,*n,-*incy).reverse().cast<double>())).sum();
|
||||
else return 0;
|
||||
if (*incx == 1 && *incy == 1)
|
||||
return (make_vector(x, *n).cast<double>().cwiseProduct(make_vector(y, *n).cast<double>())).sum();
|
||||
else if (*incx > 0 && *incy > 0)
|
||||
return (make_vector(x, *n, *incx).cast<double>().cwiseProduct(make_vector(y, *n, *incy).cast<double>())).sum();
|
||||
else if (*incx < 0 && *incy > 0)
|
||||
return (make_vector(x, *n, -*incx).reverse().cast<double>().cwiseProduct(make_vector(y, *n, *incy).cast<double>()))
|
||||
.sum();
|
||||
else if (*incx > 0 && *incy < 0)
|
||||
return (make_vector(x, *n, *incx).cast<double>().cwiseProduct(make_vector(y, *n, -*incy).reverse().cast<double>()))
|
||||
.sum();
|
||||
else if (*incx < 0 && *incy < 0)
|
||||
return (make_vector(x, *n, -*incx)
|
||||
.reverse()
|
||||
.cast<double>()
|
||||
.cwiseProduct(make_vector(y, *n, -*incy).reverse().cast<double>()))
|
||||
.sum();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user