2009-07-22 11:54:58 +02:00
|
|
|
// This file is part of Eigen, a lightweight C++ template library
|
|
|
|
|
// for linear algebra.
|
|
|
|
|
//
|
2010-06-24 23:21:58 +02:00
|
|
|
// Copyright (C) 2009-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
|
2009-07-22 11:54:58 +02:00
|
|
|
//
|
2012-07-13 14:42:47 -04:00
|
|
|
// 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/.
|
2009-07-22 11:54:58 +02:00
|
|
|
|
|
|
|
|
#ifndef EIGEN_BLASUTIL_H
|
|
|
|
|
#define EIGEN_BLASUTIL_H
|
|
|
|
|
|
|
|
|
|
// This file contains many lightweight helper classes used to
|
|
|
|
|
// implement and control fast level 2 and level 3 BLAS-like routines.
|
|
|
|
|
|
2021-09-10 19:12:26 +00:00
|
|
|
#include "../InternalHeaderCheck.h"
|
|
|
|
|
|
2012-04-15 11:06:28 +01:00
|
|
|
namespace Eigen {
|
|
|
|
|
|
2010-10-25 10:15:22 -04:00
|
|
|
namespace internal {
|
|
|
|
|
|
2009-07-22 11:54:58 +02:00
|
|
|
// forward declarations
|
2014-10-02 16:51:57 -07:00
|
|
|
template<typename LhsScalar, typename RhsScalar, typename Index, typename DataMapper, int mr, int nr, bool ConjugateLhs=false, bool ConjugateRhs=false>
|
2010-10-25 10:15:22 -04:00
|
|
|
struct gebp_kernel;
|
2009-07-22 11:54:58 +02:00
|
|
|
|
2014-10-02 16:51:57 -07:00
|
|
|
template<typename Scalar, typename Index, typename DataMapper, int nr, int StorageOrder, bool Conjugate = false, bool PanelMode=false>
|
2010-10-25 10:15:22 -04:00
|
|
|
struct gemm_pack_rhs;
|
2009-07-22 11:54:58 +02:00
|
|
|
|
2018-09-20 17:01:24 +02:00
|
|
|
template<typename Scalar, typename Index, typename DataMapper, int Pack1, int Pack2, typename Packet, int StorageOrder, bool Conjugate = false, bool PanelMode = false>
|
2010-10-25 10:15:22 -04:00
|
|
|
struct gemm_pack_lhs;
|
2009-07-22 11:54:58 +02:00
|
|
|
|
|
|
|
|
template<
|
2010-07-07 19:49:09 +02:00
|
|
|
typename Index,
|
|
|
|
|
typename LhsScalar, int LhsStorageOrder, bool ConjugateLhs,
|
|
|
|
|
typename RhsScalar, int RhsStorageOrder, bool ConjugateRhs,
|
2019-09-10 16:25:24 +02:00
|
|
|
int ResStorageOrder, int ResInnerStride>
|
2010-10-25 10:15:22 -04:00
|
|
|
struct general_matrix_matrix_product;
|
2009-07-22 11:54:58 +02:00
|
|
|
|
2014-10-31 16:33:51 -07:00
|
|
|
template<typename Index,
|
|
|
|
|
typename LhsScalar, typename LhsMapper, int LhsStorageOrder, bool ConjugateLhs,
|
|
|
|
|
typename RhsScalar, typename RhsMapper, bool ConjugateRhs, int Version=Specialized>
|
2010-10-25 10:15:22 -04:00
|
|
|
struct general_matrix_vector_product;
|
2009-07-22 11:54:58 +02:00
|
|
|
|
2010-10-25 10:15:22 -04:00
|
|
|
template<typename From,typename To> struct get_factor {
|
2016-07-18 12:02:20 +02:00
|
|
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE To run(const From& x) { return To(x); }
|
2010-07-11 23:57:23 +02:00
|
|
|
};
|
|
|
|
|
|
2010-10-25 10:15:22 -04:00
|
|
|
template<typename Scalar> struct get_factor<Scalar,typename NumTraits<Scalar>::Real> {
|
2013-07-17 13:21:35 +02:00
|
|
|
EIGEN_DEVICE_FUNC
|
2013-06-10 23:40:56 +02:00
|
|
|
static EIGEN_STRONG_INLINE typename NumTraits<Scalar>::Real run(const Scalar& x) { return numext::real(x); }
|
2010-07-11 23:57:23 +02:00
|
|
|
};
|
2010-07-07 19:49:09 +02:00
|
|
|
|
2014-10-02 16:51:57 -07:00
|
|
|
|
2014-10-31 16:33:51 -07:00
|
|
|
template<typename Scalar, typename Index>
|
|
|
|
|
class BlasVectorMapper {
|
|
|
|
|
public:
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE BlasVectorMapper(Scalar *data) : m_data(data) {}
|
2014-10-31 16:33:51 -07:00
|
|
|
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar operator()(Index i) const {
|
2014-10-31 16:33:51 -07:00
|
|
|
return m_data[i];
|
|
|
|
|
}
|
|
|
|
|
template <typename Packet, int AlignmentType>
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet load(Index i) const {
|
2014-10-31 16:33:51 -07:00
|
|
|
return ploadt<Packet, AlignmentType>(m_data + i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename Packet>
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC bool aligned(Index i) const {
|
2016-05-26 10:52:12 +02:00
|
|
|
return (UIntPtr(m_data+i)%sizeof(Packet))==0;
|
2014-10-31 16:33:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
Scalar* m_data;
|
|
|
|
|
};
|
|
|
|
|
|
2019-09-10 16:25:24 +02:00
|
|
|
template<typename Scalar, typename Index, int AlignmentType, int Incr=1>
|
|
|
|
|
class BlasLinearMapper;
|
|
|
|
|
|
2014-10-02 16:51:57 -07:00
|
|
|
template<typename Scalar, typename Index, int AlignmentType>
|
2019-09-10 16:25:24 +02:00
|
|
|
class BlasLinearMapper<Scalar,Index,AlignmentType>
|
2018-09-20 17:01:24 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2019-09-10 16:25:24 +02:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE BlasLinearMapper(Scalar *data, Index incr=1)
|
|
|
|
|
: m_data(data)
|
|
|
|
|
{
|
|
|
|
|
EIGEN_ONLY_USED_FOR_DEBUG(incr);
|
|
|
|
|
eigen_assert(incr==1);
|
|
|
|
|
}
|
2014-10-02 16:51:57 -07:00
|
|
|
|
2022-01-13 13:23:18 +00:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void prefetch(Index i) const {
|
2014-10-02 16:51:57 -07:00
|
|
|
internal::prefetch(&operator()(i));
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar& operator()(Index i) const {
|
2014-10-02 16:51:57 -07:00
|
|
|
return m_data[i];
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-20 17:01:24 +02:00
|
|
|
template<typename PacketType>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketType loadPacket(Index i) const {
|
|
|
|
|
return ploadt<PacketType, AlignmentType>(m_data + i);
|
2014-10-02 16:51:57 -07:00
|
|
|
}
|
|
|
|
|
|
2022-01-13 13:23:18 +00:00
|
|
|
template<typename PacketType, int AlignmentT>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketType load(Index i) const {
|
|
|
|
|
return ploadt<PacketType, AlignmentT>(m_data + i);
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-20 17:01:24 +02:00
|
|
|
template<typename PacketType>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void storePacket(Index i, const PacketType &p) const {
|
|
|
|
|
pstoret<Scalar, PacketType, AlignmentType>(m_data + i, p);
|
2014-10-02 16:51:57 -07:00
|
|
|
}
|
|
|
|
|
|
2018-09-20 17:01:24 +02:00
|
|
|
protected:
|
2014-10-02 16:51:57 -07:00
|
|
|
Scalar *m_data;
|
|
|
|
|
};
|
|
|
|
|
|
2009-07-28 14:02:12 +02:00
|
|
|
// Lightweight helper class to access matrix coefficients.
|
2019-09-10 16:25:24 +02:00
|
|
|
template<typename Scalar, typename Index, int StorageOrder, int AlignmentType = Unaligned, int Incr = 1>
|
|
|
|
|
class blas_data_mapper;
|
|
|
|
|
|
2020-05-19 19:24:11 +00:00
|
|
|
// TMP to help PacketBlock store implementation.
|
|
|
|
|
// There's currently no known use case for PacketBlock load.
|
|
|
|
|
// The default implementation assumes ColMajor order.
|
|
|
|
|
// It always store each packet sequentially one `stride` apart.
|
|
|
|
|
template<typename Index, typename Scalar, typename Packet, int n, int idx, int StorageOrder>
|
|
|
|
|
struct PacketBlockManagement
|
|
|
|
|
{
|
|
|
|
|
PacketBlockManagement<Index, Scalar, Packet, n, idx - 1, StorageOrder> pbm;
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(Scalar *to, const Index stride, Index i, Index j, const PacketBlock<Packet, n> &block) const {
|
|
|
|
|
pbm.store(to, stride, i, j, block);
|
|
|
|
|
pstoreu<Scalar>(to + i + (j + idx)*stride, block.packet[idx]);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// PacketBlockManagement specialization to take care of RowMajor order without ifs.
|
|
|
|
|
template<typename Index, typename Scalar, typename Packet, int n, int idx>
|
|
|
|
|
struct PacketBlockManagement<Index, Scalar, Packet, n, idx, RowMajor>
|
|
|
|
|
{
|
|
|
|
|
PacketBlockManagement<Index, Scalar, Packet, n, idx - 1, RowMajor> pbm;
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(Scalar *to, const Index stride, Index i, Index j, const PacketBlock<Packet, n> &block) const {
|
|
|
|
|
pbm.store(to, stride, i, j, block);
|
|
|
|
|
pstoreu<Scalar>(to + j + (i + idx)*stride, block.packet[idx]);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<typename Index, typename Scalar, typename Packet, int n, int StorageOrder>
|
|
|
|
|
struct PacketBlockManagement<Index, Scalar, Packet, n, -1, StorageOrder>
|
|
|
|
|
{
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(Scalar *to, const Index stride, Index i, Index j, const PacketBlock<Packet, n> &block) const {
|
|
|
|
|
EIGEN_UNUSED_VARIABLE(to);
|
|
|
|
|
EIGEN_UNUSED_VARIABLE(stride);
|
|
|
|
|
EIGEN_UNUSED_VARIABLE(i);
|
|
|
|
|
EIGEN_UNUSED_VARIABLE(j);
|
|
|
|
|
EIGEN_UNUSED_VARIABLE(block);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<typename Index, typename Scalar, typename Packet, int n>
|
|
|
|
|
struct PacketBlockManagement<Index, Scalar, Packet, n, -1, RowMajor>
|
|
|
|
|
{
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(Scalar *to, const Index stride, Index i, Index j, const PacketBlock<Packet, n> &block) const {
|
|
|
|
|
EIGEN_UNUSED_VARIABLE(to);
|
|
|
|
|
EIGEN_UNUSED_VARIABLE(stride);
|
|
|
|
|
EIGEN_UNUSED_VARIABLE(i);
|
|
|
|
|
EIGEN_UNUSED_VARIABLE(j);
|
|
|
|
|
EIGEN_UNUSED_VARIABLE(block);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2019-09-10 16:25:24 +02:00
|
|
|
template<typename Scalar, typename Index, int StorageOrder, int AlignmentType>
|
|
|
|
|
class blas_data_mapper<Scalar,Index,StorageOrder,AlignmentType,1>
|
2018-09-20 17:01:24 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2014-10-31 16:33:51 -07:00
|
|
|
typedef BlasLinearMapper<Scalar, Index, AlignmentType> LinearMapper;
|
|
|
|
|
typedef BlasVectorMapper<Scalar, Index> VectorMapper;
|
2014-10-02 16:51:57 -07:00
|
|
|
|
2019-09-10 16:25:24 +02:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE blas_data_mapper(Scalar* data, Index stride, Index incr=1)
|
|
|
|
|
: m_data(data), m_stride(stride)
|
|
|
|
|
{
|
|
|
|
|
EIGEN_ONLY_USED_FOR_DEBUG(incr);
|
|
|
|
|
eigen_assert(incr==1);
|
|
|
|
|
}
|
2014-10-02 16:51:57 -07:00
|
|
|
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType>
|
2014-10-02 16:51:57 -07:00
|
|
|
getSubMapper(Index i, Index j) const {
|
|
|
|
|
return blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType>(&operator()(i, j), m_stride);
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE LinearMapper getLinearMapper(Index i, Index j) const {
|
2014-10-02 16:51:57 -07:00
|
|
|
return LinearMapper(&operator()(i, j));
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE VectorMapper getVectorMapper(Index i, Index j) const {
|
2014-10-31 16:33:51 -07:00
|
|
|
return VectorMapper(&operator()(i, j));
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-13 13:23:18 +00:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void prefetch(Index i, Index j) const {
|
|
|
|
|
internal::prefetch(&operator()(i, j));
|
|
|
|
|
}
|
2014-10-31 16:33:51 -07:00
|
|
|
|
2014-10-02 16:51:57 -07:00
|
|
|
EIGEN_DEVICE_FUNC
|
|
|
|
|
EIGEN_ALWAYS_INLINE Scalar& operator()(Index i, Index j) const {
|
|
|
|
|
return m_data[StorageOrder==RowMajor ? j + i*m_stride : i + j*m_stride];
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-20 17:01:24 +02:00
|
|
|
template<typename PacketType>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketType loadPacket(Index i, Index j) const {
|
|
|
|
|
return ploadt<PacketType, AlignmentType>(&operator()(i, j));
|
2014-10-02 16:51:57 -07:00
|
|
|
}
|
|
|
|
|
|
2016-12-03 21:14:14 +01:00
|
|
|
template <typename PacketT, int AlignmentT>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketT load(Index i, Index j) const {
|
2016-12-05 12:59:32 +01:00
|
|
|
return ploadt<PacketT, AlignmentT>(&operator()(i, j));
|
2016-12-03 21:14:14 +01:00
|
|
|
}
|
|
|
|
|
|
2014-10-02 16:51:57 -07:00
|
|
|
template<typename SubPacket>
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void scatterPacket(Index i, Index j, const SubPacket &p) const {
|
2014-10-02 16:51:57 -07:00
|
|
|
pscatter<Scalar, SubPacket>(&operator()(i, j), p, m_stride);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename SubPacket>
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE SubPacket gatherPacket(Index i, Index j) const {
|
2014-10-02 16:51:57 -07:00
|
|
|
return pgather<Scalar, SubPacket>(&operator()(i, j), m_stride);
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC const Index stride() const { return m_stride; }
|
|
|
|
|
EIGEN_DEVICE_FUNC const Scalar* data() const { return m_data; }
|
2014-10-31 16:33:51 -07:00
|
|
|
|
2016-01-11 17:26:56 -08:00
|
|
|
EIGEN_DEVICE_FUNC Index firstAligned(Index size) const {
|
2016-05-26 10:52:12 +02:00
|
|
|
if (UIntPtr(m_data)%sizeof(Scalar)) {
|
2014-10-31 16:33:51 -07:00
|
|
|
return -1;
|
|
|
|
|
}
|
2015-08-06 17:52:01 +02:00
|
|
|
return internal::first_default_aligned(m_data, size);
|
2014-10-31 16:33:51 -07:00
|
|
|
}
|
|
|
|
|
|
2020-05-19 19:24:11 +00:00
|
|
|
template<typename SubPacket, int n>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void storePacketBlock(Index i, Index j, const PacketBlock<SubPacket, n> &block) const {
|
|
|
|
|
PacketBlockManagement<Index, Scalar, SubPacket, n, n-1, StorageOrder> pbm;
|
|
|
|
|
pbm.store(m_data, m_stride, i, j, block);
|
|
|
|
|
}
|
2018-09-20 17:01:24 +02:00
|
|
|
protected:
|
2014-10-02 16:51:57 -07:00
|
|
|
Scalar* EIGEN_RESTRICT m_data;
|
|
|
|
|
const Index m_stride;
|
2009-07-22 11:54:58 +02:00
|
|
|
};
|
|
|
|
|
|
2019-09-10 16:25:24 +02:00
|
|
|
// Implementation of non-natural increment (i.e. inner-stride != 1)
|
|
|
|
|
// The exposed API is not complete yet compared to the Incr==1 case
|
|
|
|
|
// because some features makes less sense in this case.
|
|
|
|
|
template<typename Scalar, typename Index, int AlignmentType, int Incr>
|
|
|
|
|
class BlasLinearMapper
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE BlasLinearMapper(Scalar *data,Index incr) : m_data(data), m_incr(incr) {}
|
|
|
|
|
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void prefetch(int i) const {
|
|
|
|
|
internal::prefetch(&operator()(i));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar& operator()(Index i) const {
|
|
|
|
|
return m_data[i*m_incr.value()];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename PacketType>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketType loadPacket(Index i) const {
|
|
|
|
|
return pgather<Scalar,PacketType>(m_data + i*m_incr.value(), m_incr.value());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename PacketType>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void storePacket(Index i, const PacketType &p) const {
|
|
|
|
|
pscatter<Scalar, PacketType>(m_data + i*m_incr.value(), p, m_incr.value());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
Scalar *m_data;
|
|
|
|
|
const internal::variable_if_dynamic<Index,Incr> m_incr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<typename Scalar, typename Index, int StorageOrder, int AlignmentType,int Incr>
|
|
|
|
|
class blas_data_mapper
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
typedef BlasLinearMapper<Scalar, Index, AlignmentType,Incr> LinearMapper;
|
|
|
|
|
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE blas_data_mapper(Scalar* data, Index stride, Index incr) : m_data(data), m_stride(stride), m_incr(incr) {}
|
|
|
|
|
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE blas_data_mapper
|
|
|
|
|
getSubMapper(Index i, Index j) const {
|
|
|
|
|
return blas_data_mapper(&operator()(i, j), m_stride, m_incr.value());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE LinearMapper getLinearMapper(Index i, Index j) const {
|
|
|
|
|
return LinearMapper(&operator()(i, j), m_incr.value());
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-13 13:23:18 +00:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void prefetch(Index i, Index j) const {
|
|
|
|
|
internal::prefetch(&operator()(i, j));
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-10 16:25:24 +02:00
|
|
|
EIGEN_DEVICE_FUNC
|
|
|
|
|
EIGEN_ALWAYS_INLINE Scalar& operator()(Index i, Index j) const {
|
|
|
|
|
return m_data[StorageOrder==RowMajor ? j*m_incr.value() + i*m_stride : i*m_incr.value() + j*m_stride];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename PacketType>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketType loadPacket(Index i, Index j) const {
|
|
|
|
|
return pgather<Scalar,PacketType>(&operator()(i, j),m_incr.value());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename PacketT, int AlignmentT>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketT load(Index i, Index j) const {
|
|
|
|
|
return pgather<Scalar,PacketT>(&operator()(i, j),m_incr.value());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename SubPacket>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void scatterPacket(Index i, Index j, const SubPacket &p) const {
|
|
|
|
|
pscatter<Scalar, SubPacket>(&operator()(i, j), p, m_stride);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename SubPacket>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE SubPacket gatherPacket(Index i, Index j) const {
|
|
|
|
|
return pgather<Scalar, SubPacket>(&operator()(i, j), m_stride);
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-20 14:01:02 -03:00
|
|
|
// storePacketBlock_helper defines a way to access values inside the PacketBlock, this is essentially required by the Complex types.
|
2021-08-04 22:41:52 +00:00
|
|
|
template<typename SubPacket, typename Scalar_, int n, int idx>
|
2020-05-20 14:01:02 -03:00
|
|
|
struct storePacketBlock_helper
|
|
|
|
|
{
|
2021-08-04 22:41:52 +00:00
|
|
|
storePacketBlock_helper<SubPacket, Scalar_, n, idx-1> spbh;
|
2020-05-20 14:01:02 -03:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, Incr>* sup, Index i, Index j, const PacketBlock<SubPacket, n>& block) const {
|
|
|
|
|
spbh.store(sup, i,j,block);
|
|
|
|
|
for(int l = 0; l < unpacket_traits<SubPacket>::size; l++)
|
|
|
|
|
{
|
2021-08-04 22:41:52 +00:00
|
|
|
Scalar_ *v = &sup->operator()(i+l, j+idx);
|
2020-05-20 14:01:02 -03:00
|
|
|
*v = block.packet[idx][l];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<typename SubPacket, int n, int idx>
|
|
|
|
|
struct storePacketBlock_helper<SubPacket, std::complex<float>, n, idx>
|
|
|
|
|
{
|
|
|
|
|
storePacketBlock_helper<SubPacket, std::complex<float>, n, idx-1> spbh;
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, Incr>* sup, Index i, Index j, const PacketBlock<SubPacket, n>& block) const {
|
|
|
|
|
spbh.store(sup,i,j,block);
|
|
|
|
|
for(int l = 0; l < unpacket_traits<SubPacket>::size; l++)
|
|
|
|
|
{
|
|
|
|
|
std::complex<float> *v = &sup->operator()(i+l, j+idx);
|
|
|
|
|
v->real(block.packet[idx].v[2*l+0]);
|
|
|
|
|
v->imag(block.packet[idx].v[2*l+1]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<typename SubPacket, int n, int idx>
|
|
|
|
|
struct storePacketBlock_helper<SubPacket, std::complex<double>, n, idx>
|
|
|
|
|
{
|
|
|
|
|
storePacketBlock_helper<SubPacket, std::complex<double>, n, idx-1> spbh;
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, Incr>* sup, Index i, Index j, const PacketBlock<SubPacket, n>& block) const {
|
|
|
|
|
spbh.store(sup,i,j,block);
|
|
|
|
|
for(int l = 0; l < unpacket_traits<SubPacket>::size; l++)
|
|
|
|
|
{
|
|
|
|
|
std::complex<double> *v = &sup->operator()(i+l, j+idx);
|
|
|
|
|
v->real(block.packet[idx].v[2*l+0]);
|
|
|
|
|
v->imag(block.packet[idx].v[2*l+1]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2021-08-04 22:41:52 +00:00
|
|
|
template<typename SubPacket, typename Scalar_, int n>
|
|
|
|
|
struct storePacketBlock_helper<SubPacket, Scalar_, n, -1>
|
2020-05-20 14:01:02 -03:00
|
|
|
{
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, Incr>*, Index, Index, const PacketBlock<SubPacket, n>& ) const {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<typename SubPacket, int n>
|
|
|
|
|
struct storePacketBlock_helper<SubPacket, std::complex<float>, n, -1>
|
|
|
|
|
{
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, Incr>*, Index, Index, const PacketBlock<SubPacket, n>& ) const {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<typename SubPacket, int n>
|
|
|
|
|
struct storePacketBlock_helper<SubPacket, std::complex<double>, n, -1>
|
|
|
|
|
{
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, Incr>*, Index, Index, const PacketBlock<SubPacket, n>& ) const {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
// This function stores a PacketBlock on m_data, this approach is really quite slow compare to Incr=1 and should be avoided when possible.
|
|
|
|
|
template<typename SubPacket, int n>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void storePacketBlock(Index i, Index j, const PacketBlock<SubPacket, n>&block) const {
|
|
|
|
|
storePacketBlock_helper<SubPacket, Scalar, n, n-1> spb;
|
|
|
|
|
spb.store(this, i,j,block);
|
|
|
|
|
}
|
2019-09-10 16:25:24 +02:00
|
|
|
protected:
|
|
|
|
|
Scalar* EIGEN_RESTRICT m_data;
|
|
|
|
|
const Index m_stride;
|
|
|
|
|
const internal::variable_if_dynamic<Index,Incr> m_incr;
|
|
|
|
|
};
|
|
|
|
|
|
2009-07-22 11:54:58 +02:00
|
|
|
// lightweight helper class to access matrix coefficients (const version)
|
2010-05-30 16:00:58 -04:00
|
|
|
template<typename Scalar, typename Index, int StorageOrder>
|
2014-10-02 16:51:57 -07:00
|
|
|
class const_blas_data_mapper : public blas_data_mapper<const Scalar, Index, StorageOrder> {
|
2009-07-22 11:54:58 +02:00
|
|
|
public:
|
2014-10-02 16:51:57 -07:00
|
|
|
EIGEN_ALWAYS_INLINE const_blas_data_mapper(const Scalar *data, Index stride) : blas_data_mapper<const Scalar, Index, StorageOrder>(data, stride) {}
|
|
|
|
|
|
|
|
|
|
EIGEN_ALWAYS_INLINE const_blas_data_mapper<Scalar, Index, StorageOrder> getSubMapper(Index i, Index j) const {
|
|
|
|
|
return const_blas_data_mapper<Scalar, Index, StorageOrder>(&(this->operator()(i, j)), this->m_stride);
|
|
|
|
|
}
|
2009-07-22 11:54:58 +02:00
|
|
|
};
|
|
|
|
|
|
2010-07-05 16:18:09 +02:00
|
|
|
|
2009-07-22 18:04:16 +02:00
|
|
|
/* Helper class to analyze the factors of a Product expression.
|
|
|
|
|
* In particular it allows to pop out operator-, scalar multiples,
|
|
|
|
|
* and conjugate */
|
2010-10-25 10:15:22 -04:00
|
|
|
template<typename XprType> struct blas_traits
|
2009-07-22 18:04:16 +02:00
|
|
|
{
|
2010-10-25 10:15:22 -04:00
|
|
|
typedef typename traits<XprType>::Scalar Scalar;
|
2009-07-28 14:02:12 +02:00
|
|
|
typedef const XprType& ExtractType;
|
2022-01-10 20:53:29 +00:00
|
|
|
typedef XprType ExtractType_;
|
2009-07-22 18:04:16 +02:00
|
|
|
enum {
|
|
|
|
|
IsComplex = NumTraits<Scalar>::IsComplex,
|
2009-12-16 11:41:16 +01:00
|
|
|
IsTransposed = false,
|
2009-07-22 18:04:16 +02:00
|
|
|
NeedToConjugate = false,
|
2010-04-23 11:36:22 -04:00
|
|
|
HasUsableDirectAccess = ( (int(XprType::Flags)&DirectAccessBit)
|
2011-01-30 08:17:46 +01:00
|
|
|
&& ( bool(XprType::IsVectorAtCompileTime)
|
|
|
|
|
|| int(inner_stride_at_compile_time<XprType>::ret) == 1)
|
2019-02-18 11:47:54 +01:00
|
|
|
) ? 1 : 0,
|
|
|
|
|
HasScalarFactor = false
|
2009-07-22 18:04:16 +02:00
|
|
|
};
|
2010-10-25 22:13:49 +02:00
|
|
|
typedef typename conditional<bool(HasUsableDirectAccess),
|
2009-07-28 14:02:12 +02:00
|
|
|
ExtractType,
|
2022-01-10 20:53:29 +00:00
|
|
|
typename ExtractType_::PlainObject
|
2010-10-25 22:13:49 +02:00
|
|
|
>::type DirectLinearAccessType;
|
2018-06-11 18:33:24 +02:00
|
|
|
static inline EIGEN_DEVICE_FUNC ExtractType extract(const XprType& x) { return x; }
|
|
|
|
|
static inline EIGEN_DEVICE_FUNC const Scalar extractScalarFactor(const XprType&) { return Scalar(1); }
|
2009-07-22 18:04:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// pop conjugate
|
2009-07-28 14:02:12 +02:00
|
|
|
template<typename Scalar, typename NestedXpr>
|
2010-10-25 10:15:22 -04:00
|
|
|
struct blas_traits<CwiseUnaryOp<scalar_conjugate_op<Scalar>, NestedXpr> >
|
|
|
|
|
: blas_traits<NestedXpr>
|
2009-07-22 18:04:16 +02:00
|
|
|
{
|
2010-10-25 10:15:22 -04:00
|
|
|
typedef blas_traits<NestedXpr> Base;
|
|
|
|
|
typedef CwiseUnaryOp<scalar_conjugate_op<Scalar>, NestedXpr> XprType;
|
2009-07-28 14:02:12 +02:00
|
|
|
typedef typename Base::ExtractType ExtractType;
|
2009-07-22 18:04:16 +02:00
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
IsComplex = NumTraits<Scalar>::IsComplex,
|
2009-08-17 17:41:01 +02:00
|
|
|
NeedToConjugate = Base::NeedToConjugate ? 0 : IsComplex
|
2009-07-22 18:04:16 +02:00
|
|
|
};
|
2012-02-03 23:18:26 +01:00
|
|
|
static inline ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
|
2010-10-25 10:15:22 -04:00
|
|
|
static inline Scalar extractScalarFactor(const XprType& x) { return conj(Base::extractScalarFactor(x.nestedExpression())); }
|
2009-07-22 18:04:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// pop scalar multiple
|
2016-06-14 11:26:57 +02:00
|
|
|
template<typename Scalar, typename NestedXpr, typename Plain>
|
|
|
|
|
struct blas_traits<CwiseBinaryOp<scalar_product_op<Scalar>, const CwiseNullaryOp<scalar_constant_op<Scalar>,Plain>, NestedXpr> >
|
|
|
|
|
: blas_traits<NestedXpr>
|
|
|
|
|
{
|
2019-02-18 11:47:54 +01:00
|
|
|
enum {
|
|
|
|
|
HasScalarFactor = true
|
|
|
|
|
};
|
2016-06-14 11:26:57 +02:00
|
|
|
typedef blas_traits<NestedXpr> Base;
|
|
|
|
|
typedef CwiseBinaryOp<scalar_product_op<Scalar>, const CwiseNullaryOp<scalar_constant_op<Scalar>,Plain>, NestedXpr> XprType;
|
|
|
|
|
typedef typename Base::ExtractType ExtractType;
|
2018-06-11 18:33:24 +02:00
|
|
|
static inline EIGEN_DEVICE_FUNC ExtractType extract(const XprType& x) { return Base::extract(x.rhs()); }
|
|
|
|
|
static inline EIGEN_DEVICE_FUNC Scalar extractScalarFactor(const XprType& x)
|
2016-06-14 11:26:57 +02:00
|
|
|
{ return x.lhs().functor().m_other * Base::extractScalarFactor(x.rhs()); }
|
|
|
|
|
};
|
|
|
|
|
template<typename Scalar, typename NestedXpr, typename Plain>
|
|
|
|
|
struct blas_traits<CwiseBinaryOp<scalar_product_op<Scalar>, NestedXpr, const CwiseNullaryOp<scalar_constant_op<Scalar>,Plain> > >
|
|
|
|
|
: blas_traits<NestedXpr>
|
|
|
|
|
{
|
2019-02-18 11:47:54 +01:00
|
|
|
enum {
|
|
|
|
|
HasScalarFactor = true
|
|
|
|
|
};
|
2016-06-14 11:26:57 +02:00
|
|
|
typedef blas_traits<NestedXpr> Base;
|
|
|
|
|
typedef CwiseBinaryOp<scalar_product_op<Scalar>, NestedXpr, const CwiseNullaryOp<scalar_constant_op<Scalar>,Plain> > XprType;
|
|
|
|
|
typedef typename Base::ExtractType ExtractType;
|
|
|
|
|
static inline ExtractType extract(const XprType& x) { return Base::extract(x.lhs()); }
|
|
|
|
|
static inline Scalar extractScalarFactor(const XprType& x)
|
|
|
|
|
{ return Base::extractScalarFactor(x.lhs()) * x.rhs().functor().m_other; }
|
|
|
|
|
};
|
2016-08-23 16:19:10 +02:00
|
|
|
template<typename Scalar, typename Plain1, typename Plain2>
|
|
|
|
|
struct blas_traits<CwiseBinaryOp<scalar_product_op<Scalar>, const CwiseNullaryOp<scalar_constant_op<Scalar>,Plain1>,
|
|
|
|
|
const CwiseNullaryOp<scalar_constant_op<Scalar>,Plain2> > >
|
|
|
|
|
: blas_traits<CwiseNullaryOp<scalar_constant_op<Scalar>,Plain1> >
|
|
|
|
|
{};
|
2016-06-14 11:26:57 +02:00
|
|
|
|
2009-07-22 18:04:16 +02:00
|
|
|
// pop opposite
|
2009-07-28 14:02:12 +02:00
|
|
|
template<typename Scalar, typename NestedXpr>
|
2010-10-25 10:15:22 -04:00
|
|
|
struct blas_traits<CwiseUnaryOp<scalar_opposite_op<Scalar>, NestedXpr> >
|
|
|
|
|
: blas_traits<NestedXpr>
|
2009-07-22 18:04:16 +02:00
|
|
|
{
|
2019-02-18 11:47:54 +01:00
|
|
|
enum {
|
|
|
|
|
HasScalarFactor = true
|
|
|
|
|
};
|
2010-10-25 10:15:22 -04:00
|
|
|
typedef blas_traits<NestedXpr> Base;
|
|
|
|
|
typedef CwiseUnaryOp<scalar_opposite_op<Scalar>, NestedXpr> XprType;
|
2009-07-28 14:02:12 +02:00
|
|
|
typedef typename Base::ExtractType ExtractType;
|
2012-02-03 23:18:26 +01:00
|
|
|
static inline ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
|
2009-07-22 18:04:16 +02:00
|
|
|
static inline Scalar extractScalarFactor(const XprType& x)
|
2010-01-22 10:15:41 +01:00
|
|
|
{ return - Base::extractScalarFactor(x.nestedExpression()); }
|
2009-07-22 18:04:16 +02:00
|
|
|
};
|
|
|
|
|
|
2009-07-28 14:02:12 +02:00
|
|
|
// pop/push transpose
|
|
|
|
|
template<typename NestedXpr>
|
2010-10-25 10:15:22 -04:00
|
|
|
struct blas_traits<Transpose<NestedXpr> >
|
|
|
|
|
: blas_traits<NestedXpr>
|
2009-07-28 14:02:12 +02:00
|
|
|
{
|
|
|
|
|
typedef typename NestedXpr::Scalar Scalar;
|
2010-10-25 10:15:22 -04:00
|
|
|
typedef blas_traits<NestedXpr> Base;
|
2009-07-28 14:02:12 +02:00
|
|
|
typedef Transpose<NestedXpr> XprType;
|
2022-01-10 20:53:29 +00:00
|
|
|
typedef Transpose<const typename Base::ExtractType_> ExtractType; // const to get rid of a compile error; anyway blas traits are only used on the RHS
|
|
|
|
|
typedef Transpose<const typename Base::ExtractType_> ExtractType_;
|
2010-10-25 22:13:49 +02:00
|
|
|
typedef typename conditional<bool(Base::HasUsableDirectAccess),
|
2009-07-28 14:02:12 +02:00
|
|
|
ExtractType,
|
2010-02-20 15:53:57 +01:00
|
|
|
typename ExtractType::PlainObject
|
2010-10-25 22:13:49 +02:00
|
|
|
>::type DirectLinearAccessType;
|
2009-12-16 11:41:16 +01:00
|
|
|
enum {
|
2019-02-19 14:32:25 +01:00
|
|
|
IsTransposed = Base::IsTransposed ? 0 : 1
|
2009-12-16 11:41:16 +01:00
|
|
|
};
|
2014-09-23 14:28:23 +02:00
|
|
|
static inline ExtractType extract(const XprType& x) { return ExtractType(Base::extract(x.nestedExpression())); }
|
2010-01-22 10:15:41 +01:00
|
|
|
static inline Scalar extractScalarFactor(const XprType& x) { return Base::extractScalarFactor(x.nestedExpression()); }
|
2009-07-28 14:02:12 +02:00
|
|
|
};
|
|
|
|
|
|
2010-12-22 17:45:37 -05:00
|
|
|
template<typename T>
|
|
|
|
|
struct blas_traits<const T>
|
|
|
|
|
: blas_traits<T>
|
|
|
|
|
{};
|
|
|
|
|
|
2010-10-25 10:15:22 -04:00
|
|
|
template<typename T, bool HasUsableDirectAccess=blas_traits<T>::HasUsableDirectAccess>
|
|
|
|
|
struct extract_data_selector {
|
2021-07-09 14:58:07 +00:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static const typename T::Scalar* run(const T& m)
|
2010-02-25 16:30:58 +01:00
|
|
|
{
|
2012-02-03 23:18:26 +01:00
|
|
|
return blas_traits<T>::extract(m).data();
|
2010-02-25 16:30:58 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
2010-10-25 10:15:22 -04:00
|
|
|
struct extract_data_selector<T,false> {
|
2010-02-25 16:30:58 +01:00
|
|
|
static typename T::Scalar* run(const T&) { return 0; }
|
|
|
|
|
};
|
|
|
|
|
|
2021-07-09 14:58:07 +00:00
|
|
|
template<typename T>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const typename T::Scalar* extract_data(const T& m)
|
2010-02-25 16:30:58 +01:00
|
|
|
{
|
2010-10-25 10:15:22 -04:00
|
|
|
return extract_data_selector<T>::run(m);
|
2010-02-25 16:30:58 +01:00
|
|
|
}
|
|
|
|
|
|
2021-01-01 20:54:45 +01:00
|
|
|
/**
|
|
|
|
|
* \c combine_scalar_factors extracts and multiplies factors from GEMM and GEMV products.
|
|
|
|
|
* There is a specialization for booleans
|
|
|
|
|
*/
|
|
|
|
|
template<typename ResScalar, typename Lhs, typename Rhs>
|
|
|
|
|
struct combine_scalar_factors_impl
|
|
|
|
|
{
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static ResScalar run(const Lhs& lhs, const Rhs& rhs)
|
|
|
|
|
{
|
|
|
|
|
return blas_traits<Lhs>::extractScalarFactor(lhs) * blas_traits<Rhs>::extractScalarFactor(rhs);
|
|
|
|
|
}
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static ResScalar run(const ResScalar& alpha, const Lhs& lhs, const Rhs& rhs)
|
|
|
|
|
{
|
|
|
|
|
return alpha * blas_traits<Lhs>::extractScalarFactor(lhs) * blas_traits<Rhs>::extractScalarFactor(rhs);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
template<typename Lhs, typename Rhs>
|
|
|
|
|
struct combine_scalar_factors_impl<bool, Lhs, Rhs>
|
|
|
|
|
{
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static bool run(const Lhs& lhs, const Rhs& rhs)
|
|
|
|
|
{
|
|
|
|
|
return blas_traits<Lhs>::extractScalarFactor(lhs) && blas_traits<Rhs>::extractScalarFactor(rhs);
|
|
|
|
|
}
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static bool run(const bool& alpha, const Lhs& lhs, const Rhs& rhs)
|
|
|
|
|
{
|
|
|
|
|
return alpha && blas_traits<Lhs>::extractScalarFactor(lhs) && blas_traits<Rhs>::extractScalarFactor(rhs);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<typename ResScalar, typename Lhs, typename Rhs>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE ResScalar combine_scalar_factors(const ResScalar& alpha, const Lhs& lhs, const Rhs& rhs)
|
|
|
|
|
{
|
|
|
|
|
return combine_scalar_factors_impl<ResScalar,Lhs,Rhs>::run(alpha, lhs, rhs);
|
|
|
|
|
}
|
|
|
|
|
template<typename ResScalar, typename Lhs, typename Rhs>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE ResScalar combine_scalar_factors(const Lhs& lhs, const Rhs& rhs)
|
|
|
|
|
{
|
|
|
|
|
return combine_scalar_factors_impl<ResScalar,Lhs,Rhs>::run(lhs, rhs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2010-10-25 10:15:22 -04:00
|
|
|
} // end namespace internal
|
|
|
|
|
|
2012-04-15 11:06:28 +01:00
|
|
|
} // end namespace Eigen
|
|
|
|
|
|
2009-07-22 11:54:58 +02:00
|
|
|
#endif // EIGEN_BLASUTIL_H
|