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

Matricial Division. 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

 DivOp (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::DivOp< Lhs, Rhs >

Matricial Division.

Perform the matrix division coefficient by coefficient of the Array lhs by the Array rhs

Definition at line 357 of file STK_Array2D_Functors.h.

Member Typedef Documentation

◆ param1_type

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

Definition at line 360 of file STK_Array2D_Functors.h.

◆ param2_type

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

Definition at line 361 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::DivOp< Lhs, Rhs >::result_type

Definition at line 363 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::DivOp< Lhs, Rhs >::Type

Definition at line 362 of file STK_Array2D_Functors.h.

Member Enumeration Documentation

◆ anonymous enum

Enumerator
NbParam_ 

Definition at line 359 of file STK_Array2D_Functors.h.

Constructor & Destructor Documentation

◆ DivOp()

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

Definition at line 365 of file STK_Array2D_Functors.h.

366 : lhs_(lhs.asDerived()), rhs_(rhs.asDerived())
367 , rows_(inf(lhs_.rows(), rhs_.rows()))
368 , cols_(inf(lhs_.cols(), rhs_.cols()))
369 , res_()
370 {}
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::DivOp< Lhs, Rhs >::operator() ( )
inline

Definition at line 371 of file STK_Array2D_Functors.h.

372 {
373 res_.resize(rows_, cols_); res_ = Type();
374 for (int j= cols_.begin(); j< cols_.end(); ++j)
375 {
376 Range rows = inf(lhs_.rangeRowsInCol(j), rhs_.rangeRowsInCol(j));
377 for (int i= rows.begin(); i< rows.end(); ++i)
378 { res_(i,j) = lhs_(i,j) / rhs_(i,j);}
379 }
380 return res_;
381 }
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::DivOp< Lhs, Rhs >::cols_, STK::TRange< UnknownSize >::end(), STK::inf(), STK::Arrays::DivOp< Lhs, Rhs >::lhs_, STK::Arrays::DivOp< Lhs, Rhs >::res_, STK::Arrays::DivOp< Lhs, Rhs >::rhs_, and STK::Arrays::DivOp< Lhs, Rhs >::rows_.

Member Data Documentation

◆ cols_

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

Definition at line 386 of file STK_Array2D_Functors.h.

Referenced by STK::Arrays::DivOp< Lhs, Rhs >::operator()().

◆ lhs_

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

Definition at line 383 of file STK_Array2D_Functors.h.

Referenced by STK::Arrays::DivOp< Lhs, Rhs >::operator()().

◆ res_

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

Definition at line 387 of file STK_Array2D_Functors.h.

Referenced by STK::Arrays::DivOp< Lhs, Rhs >::operator()().

◆ rhs_

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

Definition at line 384 of file STK_Array2D_Functors.h.

Referenced by STK::Arrays::DivOp< Lhs, Rhs >::operator()().

◆ rows_

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

Definition at line 385 of file STK_Array2D_Functors.h.

Referenced by STK::Arrays::DivOp< Lhs, Rhs >::operator()().


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