STK++ 0.9.13
STK::hidden::Copycat< Lhs, Rhs, Arrays::square_, Arrays::upper_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::upper_triangular_ >

Definition at line 549 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::upper_triangular_ >::runByCol ( Lhs lhs,
Rhs const rhs 
)
inlinestatic

Definition at line 552 of file STK_AssignSelector.h.

553 {
554 const int end = std::min(rhs.endRows(), rhs.endCols());
555 for (int j = rhs.beginCols(); j < end; ++j)
556 { int i = rhs.beginRows();
557 for (; i <= j; ++i) { lhs.setValue(i, j, rhs.elt(i, j));}
558 for (; i < rhs.endRows(); ++i) { lhs.setValue(i, j, Type(0));}
559 }
560 for (int j= end; j < rhs.endCols(); ++j)
561 for (int i = rhs.beginRows(); i < rhs.endRows(); ++i)
562 { lhs.setValue(i, j, rhs.elt(i, j));}
563 }

◆ runByRow()

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

Definition at line 564 of file STK_AssignSelector.h.

565 {
566 const int end = std::min(lhs.endRows(), lhs.endCols());
567 for (int i = rhs.beginRows(); i < end; ++i)
568 { int j = rhs.beginCols();
569 for (; j <i; ++j) { lhs.setValue(i, j, Type(0));}
570 for (; j < rhs.endCols(); ++j) { lhs.setValue(i, j, rhs.elt(i, j));}
571 }
572 for (int i= end; i < rhs.endRows(); ++i)
573 for (int j=rhs.beginCols(); j < rhs.endCols(); ++j)
574 { lhs.setValue(i, j, Type(0));}
575 }

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