STK++ 0.9.13
STK::hidden::Copycat< Lhs, Rhs, Arrays::square_, Arrays::lower_triangular_ > Struct Template Reference

#include <STK_AssignSelector.h>

Public Types

typedef hidden::Traits< Lhs >::Type Type
 

Static Public Member Functions

static void runByCol (Lhs &lhs, Rhs const &rhs)
 
static void runByRow (Lhs &lhs, Rhs const &rhs)
 

Detailed Description

template<typename Lhs, typename Rhs>
struct STK::hidden::Copycat< Lhs, Rhs, Arrays::square_, Arrays::lower_triangular_ >

Definition at line 518 of file STK_AssignSelector.h.

Member Typedef Documentation

◆ Type

Member Function Documentation

◆ runByCol()

template<typename Lhs , typename Rhs >
static void STK::hidden::Copycat< Lhs, Rhs, Arrays::square_, Arrays::lower_triangular_ >::runByCol ( Lhs lhs,
Rhs const rhs 
)
inlinestatic

Definition at line 521 of file STK_AssignSelector.h.

522 {
523 const int end = std::min(rhs.endRows(), rhs.endCols());
524 for (int j = rhs.beginCols(); j < end; ++j)
525 { int i = rhs.beginRows();
526 for (; i < j; ++i) { lhs.setValue(i, j, Type(0));}
527 for (; i < rhs.endRows(); ++i) { lhs.setValue(i, j, rhs.elt(i, j));}
528 }
529 for (int j= end; j < rhs.endCols(); ++j)
530 for (int i = rhs.beginRows(); i < rhs.endRows(); ++i)
531 { lhs.setValue(i, j, Type(0));}
532 }

◆ runByRow()

template<typename Lhs , typename Rhs >
static void STK::hidden::Copycat< Lhs, Rhs, Arrays::square_, Arrays::lower_triangular_ >::runByRow ( Lhs lhs,
Rhs const rhs 
)
inlinestatic

Definition at line 533 of file STK_AssignSelector.h.

534 {
535 const int end = std::min(rhs.endRows(), rhs.endCols());
536 for (int i = rhs.beginRows(); i < end; ++i)
537 { int j = rhs.beginCols();
538 for (; j <=i; ++j) { lhs.setValue(i, j, rhs.elt(i, j));}
539 for (; j < rhs.endCols(); ++j) { lhs.setValue(i, j, Type(0));}
540 }
541 for (int i= end; i < rhs.endRows(); ++i)
542 for (int j=rhs.beginCols(); j < rhs.endCols(); ++j)
543 { lhs.setValue(i, j, rhs.elt(i, j));}
544 }

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