STK++ 0.9.13
STK::hidden::ProductDispatcher< Lhs, Rhs, Result, lhsStructure_, RhsStructure_ > Struct Template Reference

Dispatcher allowing to choose th e way to multiply two expressions. More...

#include <STK_ProductDispatcher.h>

Public Types

enum  { sizeRows_ = Traits<Result>::sizeRows_ , sizeCols_ = Traits<Result>::sizeCols_ , orient_ = Traits<Result>::orient_ , storage_ = Traits<Result>::storage_ }
 
typedef MultCoefImpl< Lhs, Rhs, Result > MultCoeff
 

Static Public Member Functions

static void run (Lhs const &lhs, Rhs const &rhs, Result &res)
 loop over the columns of rhs first
 

Detailed Description

template<class Lhs, class Rhs, class Result, int lhsStructure_ = hidden::Traits<Lhs>::structure_, int RhsStructure_ = hidden::Traits<Rhs>::structure_>
struct STK::hidden::ProductDispatcher< Lhs, Rhs, Result, lhsStructure_, RhsStructure_ >

Dispatcher allowing to choose th e way to multiply two expressions.

Note
In the some cases, e.g. when some of the structures are triangular for examples, we use the usual matrix multiplication formula. This can be enhanced in future versions.

Definition at line 396 of file STK_ProductDispatcher.h.

Member Typedef Documentation

◆ MultCoeff

template<class Lhs , class Rhs , class Result , int lhsStructure_ = hidden::Traits<Lhs>::structure_, int RhsStructure_ = hidden::Traits<Rhs>::structure_>
typedef MultCoefImpl<Lhs, Rhs, Result> STK::hidden::ProductDispatcher< Lhs, Rhs, Result, lhsStructure_, RhsStructure_ >::MultCoeff

Definition at line 406 of file STK_ProductDispatcher.h.

Member Enumeration Documentation

◆ anonymous enum

template<class Lhs , class Rhs , class Result , int lhsStructure_ = hidden::Traits<Lhs>::structure_, int RhsStructure_ = hidden::Traits<Rhs>::structure_>
anonymous enum
Enumerator
sizeRows_ 
sizeCols_ 
orient_ 
storage_ 

Definition at line 398 of file STK_ProductDispatcher.h.

399 {
400 // structure_ = Traits<Result>::structure_,
401 sizeRows_ = Traits<Result>::sizeRows_,
402 sizeCols_ = Traits<Result>::sizeCols_,
403 orient_ = Traits<Result>::orient_,
404 storage_ = Traits<Result>::storage_
405 };

Member Function Documentation

◆ run()

template<class Lhs , class Rhs , class Result , int lhsStructure_ = hidden::Traits<Lhs>::structure_, int RhsStructure_ = hidden::Traits<Rhs>::structure_>
static void STK::hidden::ProductDispatcher< Lhs, Rhs, Result, lhsStructure_, RhsStructure_ >::run ( Lhs const lhs,
Rhs const rhs,
Result &  res 
)
inlinestatic

loop over the columns of rhs first

Definition at line 409 of file STK_ProductDispatcher.h.

410 {
411 if (lhs.sizeRows()<rhs.sizeCols())
412 {
413 for (int j=rhs.beginCols(); j< rhs.endCols(); j++)
414 {
415 Range const r = res.rangeRowsInCol(j);
416// int const begin = res.rangeRowsInCol(j).begin(), end = res.rangeRowsInCol(j).end();
417 for (int i=r.begin(); i< r.end(); i++)
418 { MultCoeff::dot(lhs, rhs, res, i, j);}
419 }
420 }
421 else
422 {
423 for (int i=lhs.beginRows(); i< lhs.endRows(); i++)
424 {
425 Range const r = res.rangeColsInRow(i);
426 for (int j=r.begin(); j< r.end(); j++)
427 { MultCoeff::dot(lhs, rhs, res, i, j);}
428 // stk_cout << "(begin,end)=("<<begin<<","<<end<<")\n";
429 }
430 // stk_cout << "product done\n";
431 }
432 }
TRange< UnknownSize > Range
Definition STK_Range.h:59

References STK::RangeBase< Derived >::begin(), and STK::TRange< UnknownSize >::end().

Referenced by STK::ArrayByArrayProduct< Lhs, Rhs >::ArrayByArrayProduct(), STK::ArrayByVectorProduct< Lhs, Rhs >::ArrayByVectorProduct(), and STK::PointByArrayProduct< Lhs, Rhs >::PointByArrayProduct().


The documentation for this struct was generated from the following file: