blas/double.cpp
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
5 // Copyright (C) 2012 Chen-Pang He <jdh8@ms63.hinet.net>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #define SCALAR double
12 #define SCALAR_SUFFIX d
13 #define SCALAR_SUFFIX_UP "D"
14 #define ISCOMPLEX 0
15 
16 #include "level1_impl.h"
17 #include "level1_real_impl.h"
18 #include "level2_impl.h"
19 #include "level2_real_impl.h"
20 #include "level3_impl.h"
21 
22 double BLASFUNC(dsdot)(int* n, float* x, int* incx, float* y, int* incy)
23 {
24  if(*n<=0) return 0;
25 
26  if(*incx==1 && *incy==1) return (make_vector(x,*n).cast<double>().cwiseProduct(make_vector(y,*n).cast<double>())).sum();
27  else if(*incx>0 && *incy>0) return (make_vector(x,*n,*incx).cast<double>().cwiseProduct(make_vector(y,*n,*incy).cast<double>())).sum();
28  else if(*incx<0 && *incy>0) return (make_vector(x,*n,-*incx).reverse().cast<double>().cwiseProduct(make_vector(y,*n,*incy).cast<double>())).sum();
29  else if(*incx>0 && *incy<0) return (make_vector(x,*n,*incx).cast<double>().cwiseProduct(make_vector(y,*n,-*incy).reverse().cast<double>())).sum();
30  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();
31  else return 0;
32 }
Scalar * y
#define BLASFUNC(FUNC)
RealScalar RealScalar int * incx
int n
const mpreal sum(const mpreal tab[], const unsigned long int n, int &status, mp_rnd_t mode=mpreal::get_default_rnd())
Definition: mpreal.h:2381
Map< Matrix< T, Dynamic, 1 >, 0, InnerStride< Dynamic > > make_vector(T *data, int size, int incr)
double BLASFUNC() dsdot(int *n, float *x, int *incx, float *y, int *incy)
Definition: blas/double.cpp:22
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
int RealScalar int RealScalar int * incy


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:41:59