35#ifndef STK_PRODUCTOPERATORS_H
36#define STK_PRODUCTOPERATORS_H
41 template<
class Derived>
class ExprBase;
42 template<
typename Type,
int SizeRows_,
int SizeCols_,
bool Orient_>
class CAllocator;
45#define EGAL(arg1, arg2) ((arg1::structure_ == int(Arrays::arg2)))
61template<
typename Lhs,
typename Rhs>
class ArrayByDiagonalProduct;
75template<
typename Lhs,
typename Rhs>
class DiagonalByArrayProduct;
89template<
typename Lhs,
typename Rhs>
class VectorByPointProduct;
103template<
typename Lhs,
typename Rhs>
class PointByArrayProduct;
117template<
typename Lhs,
typename Rhs>
class ArrayByVectorProduct;
137template<
typename Lhs,
typename Rhs>
class ArrayByArrayProduct;
144template<
typename Lhs,
typename Rhs>
149 structure_ = Lhs::structure_,
150 sizeRows_ = Lhs::sizeRows_ ,
151 sizeCols_ = Rhs::sizeCols_,
152 orient_ = Lhs::orient_,
153 storage_ = Lhs::storage_
176template<
typename Lhs,
typename Rhs>
201 if (
lhs.cols() !=
rhs.rows())
232template<
typename Lhs,
typename Rhs>
237 structure_ = Rhs::structure_,
238 sizeRows_ = Lhs::sizeRows_,
239 sizeCols_ = Rhs::sizeCols_,
240 orient_ = Rhs::orient_,
241 storage_ = Rhs::storage_
267template<
typename Lhs,
typename Rhs>
292 if (
lhs.cols() !=
rhs.rows())
325template<
typename Lhs,
typename Rhs>
358template<
typename Lhs,
typename Rhs>
410template<
typename Lhs,
typename Rhs>
446template<
typename Lhs,
typename Rhs>
473 if (
lhs.range() !=
rhs.rows())
510template<
typename Lhs,
typename Rhs>
546template<
typename Lhs,
typename Rhs>
572 if (
lhs.cols() !=
rhs.range())
610template<
typename Lhs,
typename Rhs>
620 structure_ = Base::structure_,
621 sizeRows_ = Base::sizeRows_,
622 sizeCols_ = Base::sizeCols_,
623 orient_ = Base::orient_,
624 storage_ = Base::storage_,
625 useForRows_ = Base::useForRows_,
626 useForCols_ = Base::useForCols_
629 typedef typename Base::Type
Type;
651template<
typename Lhs,
typename Rhs>
722template<
typename Lhs,
typename Rhs>
724 :
Base(), lhs_(lhs), rhs_(rhs)
725 , result_(lhs.sizeRows(), rhs.sizeCols(),
Type(0))
728 if (
lhs.cols() !=
rhs.rows())
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
#define STKRUNTIME_ERROR_2ARG(Where, Arg1, Arg2, Error)
#define STK_STATIC_ASSERT_PRODUCT_OPERATOR_MISMATCH(COND)
Generic expression where a product operator is applied to two expressions.
Allocator const & result() const
hidden::BinaryRowsImpl< Lhs, Rhs, sizeRows_, useForRows_ > RowsImpl
ExprBase< ArrayByArrayProduct< Lhs, Rhs > > Base
hidden::BinaryColsImpl< Lhs, Rhs, sizeCols_, useForCols_ > ColsImpl
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
hidden::ProductDispatcher< Lhs, Rhs, Allocator, lhs_structure_, rhs_structure_ > Dispatcher
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
hidden::Traits< ArrayByArrayProduct >::TypeConst TypeConst
ColRange const & colsImpl() const
hidden::Traits< ArrayByArrayProduct >::Type Type
TypeConst elt2Impl(int i, int j) const
TypeConst elt0Impl() const
ArrayByArrayProduct(Lhs const &lhs, Rhs const &rhs)
Constructor.
hidden::Traits< ArrayByArrayProduct< Lhs, Rhs > >::Allocator Allocator
TypeConst elt1Impl(int i) const
RowRange const & rowsImpl() const
Generic expression where a product operator is applied to two expressions.
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
ArrayByDiagonalProduct(const Lhs &lhs, const Rhs &rhs)
hidden::Traits< ArrayByDiagonalProduct >::Type Type
RowRange const & rowsImpl() const
ExprBase< ArrayByDiagonalProduct< Lhs, Rhs > > Base
ColRange const & colsImpl() const
hidden::Traits< ArrayByDiagonalProduct >::TypeConst TypeConst
TypeConst elt2Impl(int i, int j) const
TypeConst elt1Impl(int i) const
Generic expression where a product operator is applied to two expressions.
ExprBase< ArrayByVectorProduct< Lhs, Rhs > > Base
ColRange const & colsImpl() const
hidden::Traits< ArrayByVectorProduct >::Allocator Allocator
hidden::Traits< ArrayByVectorProduct >::Type Type
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
TypeConst elt1Impl(int i) const
ArrayByVectorProduct(const Lhs &lhs, const Rhs &rhs)
Allocator const & result() const
RowRange const & rowsImpl() const
hidden::Traits< ArrayByVectorProduct >::TypeConst TypeConst
TypeConst elt2Impl(int i, int j) const
TypeConst elt0Impl() const
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
Generic expression where a product operator is applied to two expressions.
hidden::Traits< DiagonalByArrayProduct >::TypeConst TypeConst
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
hidden::Traits< DiagonalByArrayProduct >::Type Type
DiagonalByArrayProduct(const Lhs &lhs, const Rhs &rhs)
RowRange const & rowsImpl() const
TypeConst elt2Impl(int i, int j) const
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
TypeConst elt1Impl(int i) const
ColRange const & colsImpl() const
ExprBase< DiagonalByArrayProduct< Lhs, Rhs > > Base
base class for template evaluation expressions and visitors.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Generic expression where a product operator is applied to two expressions.
hidden::Traits< PointByArrayProduct >::Type Type
hidden::Traits< PointByArrayProduct >::Allocator Allocator
ColRange const & colsImpl() const
Allocator const & result() const
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
RowRange const & rowsImpl() const
PointByArrayProduct(const Lhs &lhs, const Rhs &rhs)
hidden::Traits< PointByArrayProduct >::TypeConst TypeConst
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
TypeConst elt0Impl() const
ExprBase< PointByArrayProduct< Lhs, Rhs > > Base
TypeConst elt1Impl(int i) const
TypeConst elt2Impl(int i, int j) const
Generic expression where a product operator is applied to two expressions.
RowRange const & rowsImpl() const
hidden::Traits< VectorByPointProduct >::Type Type
VectorByPointProduct(const Lhs &lhs, const Rhs &rhs)
constructor
hidden::Traits< VectorByPointProduct >::TypeConst TypeConst
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
ColRange const & colsImpl() const
TypeConst elt0Impl() const
TypeConst elt2Impl(int i, int j) const
ExprBase< VectorByPointProduct< Lhs, Rhs > > Base
@ sparse_
sparse matrix/vector/array/expression
@ dense_
dense matrix/vector/array/expression
@ array2D_
general matrix/array/expression
@ point_
row oriented vector/array/expression
@ vector_
column oriented vector/array/expression
@ by_col_
storage by column
The namespace STK is the main domain space of the Statistical ToolKit project.
Base class for all referencing containers.
implement the access to the columns of the BinaryOperator Possible cases are:
implement the access to the rows of the BinaryOperator Possible cases are:
Dispatcher allowing to choose th e way to multiply two expressions.
static void run(Lhs const &lhs, Rhs const &rhs, Result &res)
loop over the columns of rhs first
Base::TypeConst TypeConst
ProductTraits< Lhs, Rhs, Traits< Lhs >::structure_, Traits< Rhs >::structure_ > Base
Base::Allocator Allocator
RemoveConst< Type >::Type TypeConst
Promote< typenameLhs::Type, typenameRhs::Type >::result_type Type
hidden::Promote< typenameLhs::Type, typenameRhs::Type >::result_type Type
CAllocator< Type, sizeRows_, sizeCols_, orient_ > Allocator
RemoveConst< Type >::Type const & TypeConst
RemoveConst< Type >::Type TypeConst
Promote< typenameLhs::Type, typenameRhs::Type >::result_type Type
hidden::Promote< typenameLhs::Type, typenameRhs::Type >::result_type Type
CAllocator< Type, sizeRows_, sizeCols_, orient_ > Allocator
RemoveConst< Type >::Type const & TypeConst
Promote< typenameLhs::Type, typenameRhs::Type >::result_type Type
RemoveConst< Type >::Type TypeConst