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

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

Definition at line 339 of file STK_AssignSelector.h.

340 {
341 const int end = std::min(rhs.endRows(), rhs.endCols());
342 for (int j = rhs.beginCols(); j < end; ++j)
343 { int i = rhs.beginRows();
344 for (; i <= j; ++i) { lhs.setValue(i, j, rhs.elt(i, j));}
345 for (; i < rhs.endRows(); ++i) { lhs.setValue(i, j, Type(0));}
346 }
347 for (int j= end; j < rhs.endCols(); ++j)
348 for (int i = rhs.beginRows(); i < rhs.endRows(); ++i)
349 { lhs.setValue(i, j, rhs.elt(i, j));}
350 }

◆ runByRow()

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

Definition at line 351 of file STK_AssignSelector.h.

352 {
353 const int end = std::min(lhs.endRows(), lhs.endCols());
354 for (int i = rhs.beginRows(); i < end; ++i)
355 { int j = rhs.beginCols();
356 for (; j <i; ++j) { lhs.setValue(i, j, Type(0));}
357 for (; j < rhs.endCols(); ++j) { lhs.setValue(i, j, rhs.elt(i, j));}
358 }
359 for (int i= end; i < rhs.endRows(); ++i)
360 for (int j=rhs.beginCols(); j < rhs.endCols(); ++j)
361 { lhs.setValue(i, j, Type(0));}
362 }

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