本文整理汇总了C++中Interaction::getSizeOfY方法的典型用法代码示例。如果您正苦于以下问题:C++ Interaction::getSizeOfY方法的具体用法?C++ Interaction::getSizeOfY怎么用?C++ Interaction::getSizeOfY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interaction
的用法示例。
在下文中一共展示了Interaction::getSizeOfY方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SiconosVector
void FirstOrderType1R::initComponents(Interaction& inter, VectorOfBlockVectors& DSlink, VectorOfVectors& workV, VectorOfSMatrices& workM)
{
// Check if an Interaction is connected to the Relation.
unsigned int sizeY = inter.getSizeOfY();
unsigned int sizeDS = inter.getSizeOfDS();
unsigned int sizeZ = DSlink[FirstOrderR::z]->size();
workV.resize(FirstOrderR::workVecSize);
workV[FirstOrderR::vec_z].reset(new SiconosVector(sizeZ));
workV[FirstOrderR::vec_x].reset(new SiconosVector(sizeDS));
workV[FirstOrderR::vec_r].reset(new SiconosVector(sizeDS));
workM.resize(FirstOrderR::mat_workMatSize);
if (!_C)
workM[FirstOrderR::mat_C].reset(new SimpleMatrix(sizeY, sizeDS));
if (!_D)
workM[FirstOrderR::mat_D].reset(new SimpleMatrix(sizeY, sizeY));
if (!_F)
workM[FirstOrderR::mat_F].reset(new SimpleMatrix(sizeY, sizeZ));
if (!_B)
workM[FirstOrderR::mat_B].reset(new SimpleMatrix(sizeDS, sizeY));
}
示例2: initComponents
void LagrangianRheonomousR::initComponents(Interaction& inter, VectorOfBlockVectors& DSlink, VectorOfVectors& workV, VectorOfSMatrices& workM)
{
LagrangianR::initComponents(inter, DSlink, workV, workM);
unsigned int sizeY = inter.getSizeOfY();
// hDot
if (!_hDot)
_hDot.reset(new SiconosVector(sizeY));
else
_hDot->resize(sizeY);
if (_pluginJachq->fPtr && !_jachq)
{
unsigned int sizeY = inter.getSizeOfY();
unsigned int sizeQ = DSlink[LagrangianR::q0]->size();
_jachq.reset(new SimpleMatrix(sizeY, sizeQ));
}
}
示例3: initComponents
void LagrangianCompliantR::initComponents(Interaction& inter, VectorOfBlockVectors& DSlink, VectorOfVectors& workV, VectorOfSMatrices& workM)
{
LagrangianR::initComponents(inter, DSlink, workV, workM);
unsigned int sizeY = inter.getSizeOfY();
if (! _jachlambda)
_jachlambda.reset(new SimpleMatrix(sizeY, sizeY));
else
_jachlambda->resize(sizeY, sizeY);
}
示例4: initComponents
void KneeJointR::initComponents(Interaction& inter, VectorOfBlockVectors& DSlink, VectorOfVectors& workV, VectorOfSMatrices& workM)
{
NewtonEulerR::initComponents(inter, DSlink, workV, workM);
if (!_dotjachq)
{
unsigned int sizeY = inter.getSizeOfY();
unsigned int xSize = inter.getSizeOfDS();
unsigned int qSize = 7 * (xSize / 6);
_dotjachq.reset(new SimpleMatrix(sizeY, qSize));
}
}
示例5: initComponents
void LagrangianLinearTIR::initComponents(Interaction& inter, VectorOfBlockVectors& DSlink, VectorOfVectors& workV, VectorOfSMatrices& workM)
{
unsigned int sizeY = inter.getSizeOfY();
if (!(_jachq) || _jachq->size(1) != inter.getSizeOfDS() || _jachq->size(0) != sizeY)
RuntimeException::selfThrow("LagrangianLinearTIR::initComponents inconsistent sizes between H matrix and the interaction.");
if ((_jachlambda) && (_jachlambda->size(0) != sizeY || _jachlambda->size(1) != sizeY))
RuntimeException::selfThrow("LagrangianLinearTIR::initComponents inconsistent sizes between D matrix and the interaction.");
if ((_e) && _e->size() != sizeY)
RuntimeException::selfThrow("LagrangianLinearTIR::initComponents inconsistent sizes between e vector and the dimension of the interaction.");
unsigned int sizeZ = DSlink[LagrangianR::z]->size();
if ((_F) && (
_F->size(0) != sizeZ || _F->size(1) != sizeZ))
RuntimeException::selfThrow("LagrangianLinearTIR::initComponents inconsistent sizes between F matrix and the interaction.");
}
示例6: initComponents
void FirstOrderLinearR::initComponents(Interaction& inter, VectorOfBlockVectors& DSlink, VectorOfVectors& workV, VectorOfSMatrices& workM)
{
// Note: do not call FirstOrderR::initialize to avoid jacobianH and jacobianG allocation.
// get interesting size
unsigned int sizeY = inter.getSizeOfY();
unsigned int sizeX = inter.getSizeOfDS();
unsigned int sizeZ = DSlink[FirstOrderR::z]->size();
// Update workV (copy of DS variables)
workV.resize(FirstOrderR::workVecSize);
workV[FirstOrderR::vec_z].reset(new SiconosVector(sizeZ));
workM.resize(FirstOrderR::mat_workMatSize);
if (!_C && _pluginJachx->fPtr)
workM[FirstOrderR::mat_C].reset(new SimpleMatrix(sizeY, sizeX));
if (!_D && _pluginJachlambda->fPtr)
workM[FirstOrderR::mat_D].reset(new SimpleMatrix(sizeY, sizeY));
if (!_B && _pluginJacglambda->fPtr)
workM[FirstOrderR::mat_B].reset(new SimpleMatrix(sizeX, sizeY));
if (!_F && _pluginf->fPtr)
{
workM[FirstOrderR::mat_F].reset(new SimpleMatrix(sizeY, sizeZ));
}
if (!_e && _plugine->fPtr)
{
workV[FirstOrderR::e].reset(new SiconosVector(sizeY));
}
// Check if various operators sizes are consistent.
// Reference: interaction.
if (_C)
{
if (_C->size(0) == 0)
_C->resize(sizeX, sizeY);
else
assert((_C->size(0) == sizeY && _C->size(1) == sizeX) && "FirstOrderLinearR::initialize , inconsistent size between C and Interaction.");
}
if (_B)
{
if (_B->size(0) == 0)
_B->resize(sizeY, sizeX);
else
assert((_B->size(1) == sizeY && _B->size(0) == sizeX) && "FirstOrderLinearR::initialize , inconsistent size between B and interaction.");
}
// C and B are the minimum inputs. The others may remain null.
if (_D)
{
if (_D->size(0) == 0)
_D->resize(sizeY, sizeY);
else
assert((_D->size(0) == sizeY || _D->size(1) == sizeY) && "FirstOrderLinearR::initialize , inconsistent size between C and D.");
}
if (_F)
{
if (_F->size(0) == 0)
_F->resize(sizeY, sizeZ);
else
assert(((_F->size(0) == sizeY) && (_F->size(1) == sizeZ)) && "FirstOrderLinearR::initialize , inconsistent size between C and F.");
}
if (_e)
{
if (_e->size() == 0)
_e->resize(sizeY);
else
assert(_e->size() == sizeY && "FirstOrderLinearR::initialize , inconsistent size between C and e.");
}
}