MOAB  4.9.3pre
Eigen::internal::LU_kernel_bmod< SegSizeAtCompileTime > Struct Template Reference

#include <SparseLU_kernel_bmod.h>

List of all members.

Static Public Member Functions

template<typename BlockScalarVector , typename ScalarVector , typename IndexVector >
static EIGEN_DONT_INLINE void run (const Index segsize, BlockScalarVector &dense, ScalarVector &tempv, ScalarVector &lusup, Index &luptr, const Index lda, const Index nrow, IndexVector &lsub, const Index lptr, const Index no_zeros)
 Performs numeric block updates from a given supernode to a single column.

Detailed Description

template<int SegSizeAtCompileTime>
struct Eigen::internal::LU_kernel_bmod< SegSizeAtCompileTime >

Definition at line 17 of file SparseLU_kernel_bmod.h.


Member Function Documentation

template<int SegSizeAtCompileTime>
template<typename BlockScalarVector , typename ScalarVector , typename IndexVector >
EIGEN_DONT_INLINE void Eigen::internal::LU_kernel_bmod< SegSizeAtCompileTime >::run ( const Index  segsize,
BlockScalarVector &  dense,
ScalarVector &  tempv,
ScalarVector &  lusup,
Index luptr,
const Index  lda,
const Index  nrow,
IndexVector &  lsub,
const Index  lptr,
const Index  no_zeros 
) [static]

Performs numeric block updates from a given supernode to a single column.

Parameters:
segsizeSize of the segment (and blocks ) to use for updates
[in,out]densePacked values of the original matrix
tempvtemporary vector to use for updates
lusuparray containing the supernodes
ldaLeading dimension in the supernode
nrowNumber of rows in the rectangular part of the supernode
lsubcompressed row subscripts of supernodes
lptrpointer to the first column of the current supernode in lsub
no_zerosNumber of nonzeros elements before the diagonal part of the supernode

Definition at line 39 of file SparseLU_kernel_bmod.h.

{
  typedef typename ScalarVector::Scalar Scalar;
  // First, copy U[*,j] segment from dense(*) to tempv(*)
  // The result of triangular solve is in tempv[*]; 
    // The result of matric-vector update is in dense[*]
  Index isub = lptr + no_zeros; 
  Index i;
  Index irow;
  for (i = 0; i < ((SegSizeAtCompileTime==Dynamic)?segsize:SegSizeAtCompileTime); i++)
  {
    irow = lsub(isub); 
    tempv(i) = dense(irow); 
    ++isub; 
  }
  // Dense triangular solve -- start effective triangle
  luptr += lda * no_zeros + no_zeros; 
  // Form Eigen matrix and vector 
  Map<Matrix<Scalar,SegSizeAtCompileTime,SegSizeAtCompileTime, ColMajor>, 0, OuterStride<> > A( &(lusup.data()[luptr]), segsize, segsize, OuterStride<>(lda) );
  Map<Matrix<Scalar,SegSizeAtCompileTime,1> > u(tempv.data(), segsize);
  
  u = A.template triangularView<UnitLower>().solve(u); 
  
  // Dense matrix-vector product y <-- B*x 
  luptr += segsize;
  const Index PacketSize = internal::packet_traits<Scalar>::size;
  Index ldl = internal::first_multiple(nrow, PacketSize);
  Map<Matrix<Scalar,Dynamic,SegSizeAtCompileTime, ColMajor>, 0, OuterStride<> > B( &(lusup.data()[luptr]), nrow, segsize, OuterStride<>(lda) );
  Index aligned_offset = internal::first_default_aligned(tempv.data()+segsize, PacketSize);
  Index aligned_with_B_offset = (PacketSize-internal::first_default_aligned(B.data(), PacketSize))%PacketSize;
  Map<Matrix<Scalar,Dynamic,1>, 0, OuterStride<> > l(tempv.data()+segsize+aligned_offset+aligned_with_B_offset, nrow, OuterStride<>(ldl) );
  
  l.setZero();
  internal::sparselu_gemm<Scalar>(l.rows(), l.cols(), B.cols(), B.data(), B.outerStride(), u.data(), u.outerStride(), l.data(), l.outerStride());
  
  // Scatter tempv[] into SPA dense[] as a temporary storage 
  isub = lptr + no_zeros;
  for (i = 0; i < ((SegSizeAtCompileTime==Dynamic)?segsize:SegSizeAtCompileTime); i++)
  {
    irow = lsub(isub++); 
    dense(irow) = tempv(i);
  }
  
  // Scatter l into SPA dense[]
  for (i = 0; i < nrow; i++)
  {
    irow = lsub(isub++); 
    dense(irow) -= l(i);
  } 
}

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines