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

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

Public Member Functions

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

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

Definition at line 449 of file STK_Array2D_Functors.h.

Member Typedef Documentation

◆ param1_type

Definition at line 452 of file STK_Array2D_Functors.h.

◆ param2_type

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

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

Definition at line 454 of file STK_Array2D_Functors.h.

Member Enumeration Documentation

◆ anonymous enum

Enumerator
NbParam_ 

Definition at line 451 of file STK_Array2D_Functors.h.

Constructor & Destructor Documentation

◆ MultLeftTransposeOp()

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

Definition at line 457 of file STK_Array2D_Functors.h.

458 : lhs_(lhs.asDerived()), rhs_(rhs.asDerived())
459 , rows_(lhs_.cols())
460 , cols_(rhs_.cols())
461 , res_()
462 {}

Member Function Documentation

◆ operator()() [1/2]

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

Definition at line 464 of file STK_Array2D_Functors.h.

465 {
466 res_.resize(rows_, cols_);
467 for (int j=res_.beginCols(); j<res_.endCols(); j++)
468 {
469 Integer const end = res_.rangeRowsInCol(j).end();
470 for (int i=res_.rangeRowsInCol(j).begin(); i<end; i++)
471 { res_(i, j) = dot(lhs_.col(i), rhs_.col(j));}
472 }
473 return res_;
474 }
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::MultLeftTransposeOp< Lhs, Rhs >::cols_, STK::dot(), STK::Arrays::MultLeftTransposeOp< Lhs, Rhs >::lhs_, STK::Arrays::MultLeftTransposeOp< Lhs, Rhs >::res_, STK::Arrays::MultLeftTransposeOp< Lhs, Rhs >::rhs_, and STK::Arrays::MultLeftTransposeOp< Lhs, Rhs >::rows_.

◆ operator()() [2/2]

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

Definition at line 476 of file STK_Array2D_Functors.h.

477 {
478 res_.resize(rows_, cols_);
479 for (int j=rhs_.beginCols(); j<rhs_.endCols(); j++)
480 {
481 Integer const end = res_.rangeRowsInCol(j).end();
482 for (int i=res_.rangeRowsInCol(j).begin(); i<end; i++)
483 { res_(i, j) = weightedDot(lhs_.col(i), rhs_.col(j), weights);}
484 }
485 return res_;
486 }
Real weightedDot(ExprBase< Container1D1 > const &x, ExprBase< Container1D2 > const &y, ExprBase< Container1D3 > const &w)
Compute the dot product.

References STK::Arrays::MultLeftTransposeOp< Lhs, Rhs >::cols_, STK::Arrays::MultLeftTransposeOp< Lhs, Rhs >::lhs_, STK::Arrays::MultLeftTransposeOp< Lhs, Rhs >::res_, STK::Arrays::MultLeftTransposeOp< Lhs, Rhs >::rhs_, STK::Arrays::MultLeftTransposeOp< 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: