From 44861dcbfeee041223c4aac1ee075e92fa4daa01 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 18 Sep 2016 12:42:15 +0200 Subject: update --- eigen/blas/double.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 eigen/blas/double.cpp (limited to 'eigen/blas/double.cpp') diff --git a/eigen/blas/double.cpp b/eigen/blas/double.cpp new file mode 100644 index 0000000..8fd0709 --- /dev/null +++ b/eigen/blas/double.cpp @@ -0,0 +1,33 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Gael Guennebaud +// Copyright (C) 2012 Chen-Pang He +// +// This Source Code Form is subject to the terms of the Mozilla +// 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_SUFFIX d +#define SCALAR_SUFFIX_UP "D" +#define ISCOMPLEX 0 + +#include "level1_impl.h" +#include "level1_real_impl.h" +#include "level2_impl.h" +#include "level2_real_impl.h" +#include "level3_impl.h" + +double BLASFUNC(dsdot)(int* n, float* x, int* incx, float* y, int* incy) +{ + if(*n<=0) return 0; + + if(*incx==1 && *incy==1) return (vector(x,*n).cast().cwiseProduct(vector(y,*n).cast())).sum(); + else if(*incx>0 && *incy>0) return (vector(x,*n,*incx).cast().cwiseProduct(vector(y,*n,*incy).cast())).sum(); + else if(*incx<0 && *incy>0) return (vector(x,*n,-*incx).reverse().cast().cwiseProduct(vector(y,*n,*incy).cast())).sum(); + else if(*incx>0 && *incy<0) return (vector(x,*n,*incx).cast().cwiseProduct(vector(y,*n,-*incy).reverse().cast())).sum(); + else if(*incx<0 && *incy<0) return (vector(x,*n,-*incx).reverse().cast().cwiseProduct(vector(y,*n,-*incy).reverse().cast())).sum(); + else return 0; +} + -- cgit v1.2.3