STK++ 0.9.13
STK::Arrays::Product< Lhs, Rhs > Struct Template Reference

Array product (by coefficient) Perform the matrix product coefficient by coefficient of the Array lhs by the Array rhs. More...

#include <STK_Array2D_Functors.h>

Public Types

enum  { NbParam_ = 2 }
 
typedef Lhs param1_type
 
typedef Rhs param2_type
 
typedef hidden::Promote< typenamehidden::Traits< Lhs >::Type, typenamehidden::Traits< Rhs >::Type >::result_type Type
 
typedef hidden::BinaryReturnArray2DType< typenamehidden::Promote< typenamehidden::Traits< Lhs >::Type, typenamehidden::Traits< Rhs >::Type >::result_type, hidden::Traits< Lhs >::structure_, hidden::Traits< Rhs >::structure_ >::result_type result_type
 

Public Member Functions

 Product (ExprBase< Lhs > const &lhs, ExprBase< Rhs > const &rhs)
 
result_type operator() ()
 

Protected Attributes

param1_type constlhs_
 
param2_type constrhs_
 
Range rows_
 
Range cols_
 
result_type res_
 

Detailed Description

template<typename Lhs, typename Rhs>
struct STK::Arrays::Product< Lhs, Rhs >

Array product (by coefficient) Perform the matrix product coefficient by coefficient of the Array lhs by the Array rhs.

Definition at line 317 of file STK_Array2D_Functors.h.

Member Typedef Documentation

◆ param1_type

template<typename Lhs , typename Rhs >
typedef Lhs STK::Arrays::Product< Lhs, Rhs >::param1_type

Definition at line 320 of file STK_Array2D_Functors.h.

◆ param2_type

template<typename Lhs , typename Rhs >
typedef Rhs STK::Arrays::Product< Lhs, Rhs >::param2_type

Definition at line 321 of file STK_Array2D_Functors.h.

◆ result_type

template<typename Lhs , typename Rhs >
typedef hidden::BinaryReturnArray2DType<typenamehidden::Promote<typenamehidden::Traits<Lhs>::Type,typenamehidden::Traits<Rhs>::Type>::result_type,hidden::Traits<Lhs>::structure_,hidden::Traits<Rhs>::structure_>::result_type STK::Arrays::Product< Lhs, Rhs >::result_type

Definition at line 323 of file STK_Array2D_Functors.h.

◆ Type

template<typename Lhs , typename Rhs >
typedef hidden::Promote<typenamehidden::Traits<Lhs>::Type,typenamehidden::Traits<Rhs>::Type>::result_type STK::Arrays::Product< Lhs, Rhs >::Type

Definition at line 322 of file STK_Array2D_Functors.h.

Member Enumeration Documentation

◆ anonymous enum

Enumerator
NbParam_ 

Definition at line 319 of file STK_Array2D_Functors.h.

Constructor & Destructor Documentation

◆ Product()

template<typename Lhs , typename Rhs >
STK::Arrays::Product< Lhs, Rhs >::Product ( ExprBase< Lhs > const lhs,
ExprBase< Rhs > const rhs 
)
inline

Definition at line 325 of file STK_Array2D_Functors.h.

326 : lhs_(lhs.asDerived()), rhs_(rhs.asDerived())
327 , rows_(inf(lhs_.rows(), rhs_.rows()))
328 , cols_(inf(lhs_.cols(), rhs_.cols()))
329 , res_()
330 {}
Range inf(TRange< SizeI_ > const &I, TRange< SizeJ_ > const &J)
compute inf(I,J).
Definition STK_Range.h:477
param1_type const & lhs_
param2_type const & rhs_

Member Function Documentation

◆ operator()()

template<typename Lhs , typename Rhs >
result_type STK::Arrays::Product< Lhs, Rhs >::operator() ( )
inline

Definition at line 331 of file STK_Array2D_Functors.h.

332 {
333 res_.resize(rows_, cols_); res_ = Type();
334 for (int j= cols_.begin(); j< cols_.end(); ++j)
335 {
336 Range rows = inf(lhs_.rangeRowsInCol(j), rhs_.rangeRowsInCol(j));
337 for (int i= rows.begin(); i< rows.end(); ++i)
338 { res_(i,j) = lhs_(i,j) * rhs_(i,j);}
339 }
340 return res_;
341 }
int begin() const
get the first index of the TRange.
Definition STK_Range.h:93
int end() const
get the ending index of the TRange.
Definition STK_Range.h:299
TRange< UnknownSize > Range
Definition STK_Range.h:59
hidden::Promote< typenamehidden::Traits< Lhs >::Type, typenamehidden::Traits< Rhs >::Type >::result_type Type

References STK::RangeBase< Derived >::begin(), STK::Arrays::Product< Lhs, Rhs >::cols_, STK::TRange< UnknownSize >::end(), STK::inf(), STK::Arrays::Product< Lhs, Rhs >::lhs_, STK::Arrays::Product< Lhs, Rhs >::res_, STK::Arrays::Product< Lhs, Rhs >::rhs_, and STK::Arrays::Product< Lhs, Rhs >::rows_.

Member Data Documentation

◆ cols_

template<typename Lhs , typename Rhs >
Range STK::Arrays::Product< Lhs, Rhs >::cols_
protected

◆ lhs_

template<typename Lhs , typename Rhs >
param1_type const& STK::Arrays::Product< Lhs, Rhs >::lhs_
protected

◆ res_

template<typename Lhs , typename Rhs >
result_type STK::Arrays::Product< Lhs, Rhs >::res_
protected

◆ rhs_

template<typename Lhs , typename Rhs >
param2_type const& STK::Arrays::Product< Lhs, Rhs >::rhs_
protected

◆ rows_

template<typename Lhs , typename Rhs >
Range STK::Arrays::Product< Lhs, Rhs >::rows_
protected

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