|
MOAB
4.9.3pre
|
#include <SparseLU_kernel_bmod.h>
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. | |
Definition at line 17 of file SparseLU_kernel_bmod.h.
| 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.
| segsize | Size of the segment (and blocks ) to use for updates | |
| [in,out] | dense | Packed values of the original matrix |
| tempv | temporary vector to use for updates | |
| lusup | array containing the supernodes | |
| lda | Leading dimension in the supernode | |
| nrow | Number of rows in the rectangular part of the supernode | |
| lsub | compressed row subscripts of supernodes | |
| lptr | pointer to the first column of the current supernode in lsub | |
| no_zeros | Number 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);
}
}