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

Array multiplication Perform the matrix product of the Array lhs by the transposed 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::ProductArray2DReturnType< Type, Lhs::structure_, Rhs::structure_ >::result_type result_type
 

Public Member Functions

 MultRightTransposeOp (ExprBase< Lhs > const &lhs, ExprBase< Rhs > const &rhs)
 
result_type operator() ()
 
template<typename Weights >
result_type operator() (ExprBase< Weights > const &weights)
 

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

Array multiplication Perform the matrix product of the Array lhs by the transposed Array rhs.

Definition at line 501 of file STK_Array2D_Functors.h.

Member Typedef Documentation

◆ param1_type

Definition at line 504 of file STK_Array2D_Functors.h.

◆ param2_type

Definition at line 505 of file STK_Array2D_Functors.h.

◆ result_type

template<typename Lhs , typename Rhs >
typedef hidden::ProductArray2DReturnType<Type,Lhs::structure_,Rhs::structure_>::result_type STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::result_type

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

Definition at line 506 of file STK_Array2D_Functors.h.

Member Enumeration Documentation

◆ anonymous enum

Enumerator
NbParam_ 

Definition at line 503 of file STK_Array2D_Functors.h.

Constructor & Destructor Documentation

◆ MultRightTransposeOp()

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

Definition at line 509 of file STK_Array2D_Functors.h.

510 : lhs_(lhs.asDerived()), rhs_(rhs.asDerived())
511 , rows_(lhs_.rows())
512 , cols_(rhs_.rows())
513 , res_()
514 {}

Member Function Documentation

◆ operator()() [1/2]

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

Definition at line 516 of file STK_Array2D_Functors.h.

517 {
518 res_.resize(rows_, cols_);
519 for (int j=res_.beginCols(); j<res_.endCols(); j++)
520 {
521 Integer const end = res_.rangeRowsInCol(j).end();
522 for (int i=res_.rangeRowsInCol(j).begin(); i<end; i++)
523 { res_(i, j) = dot(lhs_.row(i), rhs_.row(j));}
524 }
525 return res_;
526 }
Real dot(ExprBase< Container1D1 > const &x, ExprBase< Container1D2 > const &y)
Compute the dot product.
int Integer
STK fundamental type of integer values.

References STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::cols_, STK::dot(), STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::lhs_, STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::res_, STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::rhs_, and STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::rows_.

◆ operator()() [2/2]

template<typename Lhs , typename Rhs >
template<typename Weights >
result_type STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::operator() ( ExprBase< Weights > const weights)
inline

Definition at line 528 of file STK_Array2D_Functors.h.

529 {
530 res_.resize(rows_, cols_);
531 for (int j=res_.beginCols(); j<res_.endCols(); j++)
532 {
533 Integer const end = res_.rangeRowsInCol(j).end();
534 for (int i=res_.rangeRowsInCol(j).begin(); i<end; i++)
535 { res_(i, j) = weightedDot(lhs_.row(i), rhs_.row(j), weights);}
536 }
537 return res_;
538 }
Real weightedDot(ExprBase< Container1D1 > const &x, ExprBase< Container1D2 > const &y, ExprBase< Container1D3 > const &w)
Compute the dot product.

References STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::cols_, STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::lhs_, STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::res_, STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::rhs_, STK::Arrays::MultRightTransposeOp< Lhs, Rhs >::rows_, and STK::weightedDot().

Member Data Documentation

◆ cols_

◆ lhs_

◆ res_

◆ rhs_

◆ rows_


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