本文整理汇总了C++中sp::Interaction::getLeftInteractionBlockForDSProjectOnConstraints方法的典型用法代码示例。如果您正苦于以下问题:C++ Interaction::getLeftInteractionBlockForDSProjectOnConstraints方法的具体用法?C++ Interaction::getLeftInteractionBlockForDSProjectOnConstraints怎么用?C++ Interaction::getLeftInteractionBlockForDSProjectOnConstraints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sp::Interaction
的用法示例。
在下文中一共展示了Interaction::getLeftInteractionBlockForDSProjectOnConstraints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeDiagonalInteractionBlock
//.........这里部分代码省略.........
prod(*leftInteractionBlock, *work, *currentInteractionBlock, false);
// gemm(CblasNoTrans,CblasNoTrans,1.0,*leftInteractionBlock,*work,1.0,*currentInteractionBlock);
}
else
{
prod(*leftInteractionBlock, *work, *currentInteractionBlock, false);
}
//*currentInteractionBlock *=h;
}
else if (Type::value(*ds) == Type::NewtonEulerDS)
{
if (inter->relation()->getType() != NewtonEuler)
{
RuntimeException::selfThrow("MLCPProjectOnConstraints::computeDiagonalInteractionBlock - relation is not from NewtonEulerR.");
}
SP::NewtonEulerDS neds = (std11::static_pointer_cast<NewtonEulerDS>(ds));
#ifdef MLCPPROJ_WITH_CT
unsigned int sizeDS = neds->getDim();
SP::SimpleMatrix T = neds->T();
SP::SimpleMatrix workT(new SimpleMatrix(*T));
workT->trans();
SP::SimpleMatrix workT2(new SimpleMatrix(6, 6));
prod(*workT, *T, *workT2, true);
leftInteractionBlock.reset(new SimpleMatrix(sizeY, sizeDS));
inter->getLeftInteractionBlockForDS(pos, leftInteractionBlock);
SP::SiconosMatrix work(new SimpleMatrix(*leftInteractionBlock));
std::cout << "LinearOSNS : leftUBlock\n";
work->display();
work->trans();
std::cout << "LinearOSNS::computeInteractionBlock workT2" <<std::endl;
workT2->display();
workT2->PLUForwardBackwardInPlace(*work);
prod(*leftInteractionBlock, *work, *currentInteractionBlock, false);
#else
if (0) //(std11::static_pointer_cast<NewtonEulerR> inter->relation())->_isConstact){
{
// unsigned int sizeDS = neds->getDim();
// SP::SimpleMatrix T = neds->T();
// SP::SimpleMatrix workT(new SimpleMatrix(*T));
// workT->trans();
// SP::SimpleMatrix workT2(new SimpleMatrix(6, 6));
// prod(*workT, *T, *workT2, true);
// leftInteractionBlock1.reset(new SimpleMatrix(sizeY, sizeDS));
// inter->getLeftInteractionBlockForDS(pos, leftInteractionBlock);
// leftInteractionBlock.reset(new SimpleMatrix(1, sizeDS));
// for (unsigned int ii = 0; ii < sizeDS; ii++)
// leftInteractionBlock->setValue(1, ii, leftInteractionBlock1->getValue(1, ii));
//
// SP::SiconosMatrix work(new SimpleMatrix(*leftInteractionBlock));
// //cout<<"LinearOSNS : leftUBlock\n";
// //work->display();
// work->trans();
// //cout<<"LinearOSNS::computeInteractionBlock workT2"<<endl;
// //workT2->display();
// workT2->PLUForwardBackwardInPlace(*work);
// prod(*leftInteractionBlock, *work, *currentInteractionBlock, false);
}
else
{
unsigned int sizeDS = (std11::static_pointer_cast<NewtonEulerDS>(ds))->getqDim();
leftInteractionBlock.reset(new SimpleMatrix(sizeY, sizeDS));
inter->getLeftInteractionBlockForDSProjectOnConstraints(pos, leftInteractionBlock);
// #ifdef MLCPPROJ_DEBUG
// std::cout << "MLCPProjectOnConstraints::computeDiagonalInteractionBlock - NewtonEuler case leftInteractionBlock : " << std::endl;
// leftInteractionBlock->display();
// #endif
SP::SiconosMatrix work(new SimpleMatrix(*leftInteractionBlock));
//cout<<"LinearOSNS sizeY="<<sizeY<<": leftUBlock\n";
//work->display();
work->trans();
prod(*leftInteractionBlock, *work, *currentInteractionBlock, false);
// #ifdef MLCPPROJ_DEBUG
// std::cout << "MLCPProjectOnConstraints::computeDiagonalInteractionBlock - NewtonEuler case currentInteractionBlock : "<< std::endl;
// currentInteractionBlock->display();
// #endif
}
}
else
RuntimeException::selfThrow("MLCPProjectOnConstraints::computeDiagonalInteractionBlock - ds is not from NewtonEulerDS neither a LagrangianDS.");
#endif
#ifdef MLCPPROJ_DEBUG
std::cout << "MLCPProjectOnConstraints::computeDiagonalInteractionBlock DiaginteractionBlock " << std::endl;
currentInteractionBlock->display();
#endif
// Set pos for next loop.
pos = pos2;
}
}