本文整理汇总了C++中GmatBase::HasDynamicParameterSTM方法的典型用法代码示例。如果您正苦于以下问题:C++ GmatBase::HasDynamicParameterSTM方法的具体用法?C++ GmatBase::HasDynamicParameterSTM怎么用?C++ GmatBase::HasDynamicParameterSTM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GmatBase
的用法示例。
在下文中一共展示了GmatBase::HasDynamicParameterSTM方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MapObjectsToSTM
//------------------------------------------------------------------------------
bool EstimationStateManager::MapObjectsToSTM()
{
bool retval = true;
// Fill in the STM based on the objects that comprise the state vector
GmatBase* obj;
Integer elementId; //, elementLength;
for (UnsignedInt h = 0; h < stateMap.size(); ++h)
{
obj = stateMap[h]->object;
if (stateMap[h]->subelement == 1)
{
elementId = stateMap[h]->parameterID;
// elementLength = stateMap[h]->length;
bool hasDstm = obj->HasDynamicParameterSTM(elementId);
#ifdef DEBUG_STM_MAPPING
MessageInterface::ShowMessage("Prepping for STM; element %s for "
"object %s has ID %d and length %d, and %s a dynamic STM "
"contribution\n", stateMap[h]->elementName.c_str(),
obj->GetName().c_str(), elementId, elementLength,
(hasDstm ? "has" : "does not have"));
#endif
if (hasDstm)
{
const Rmatrix* dstm = obj->GetParameterSTM(elementId);
Integer stmSize = dstm->GetNumRows();
// Fill in the master stm with the current data
for (Integer i = 0; i < stmSize; ++i)
for (Integer j = 0; j < stmSize; ++j)
stm(h+i, h+j) = (*dstm)(i,j);
}
}
}
#ifdef DEBUG_STM_MAPPING
MessageInterface::ShowMessage("Loaded object STM's; esm STM now contains\n");
for (Integer i = 0; i < stateSize; ++i)
{
for (Integer j = 0; j < stateSize; ++j)
MessageInterface::ShowMessage(" %.12lf", stm(i,j));
MessageInterface::ShowMessage("\n");
}
MessageInterface::ShowMessage("\n");
#endif
return retval;
}
示例2: MapSTMToObjects
//------------------------------------------------------------------------------
bool EstimationStateManager::MapSTMToObjects()
{
bool retval = true;
#ifdef DEBUG_STM_MAPPING
MessageInterface::ShowMessage("Setting object STM's to\n");
for (Integer i = 0; i < stateSize; ++i)
{
for (Integer j = 0; j < stateSize; ++j)
MessageInterface::ShowMessage(" %.12lf", stm(i,j));
MessageInterface::ShowMessage("\n");
}
MessageInterface::ShowMessage("\n");
#endif
// Fill in the STM based on the objects that comprise the state vector
GmatBase* obj;
Integer elementId; //, elementLength;
for (UnsignedInt h = 0; h < stateMap.size(); ++h)
{
obj = stateMap[h]->object;
if (stateMap[h]->subelement == 1)
{
elementId = stateMap[h]->parameterID;
// elementLength = stateMap[h]->length;
bool hasDstm = obj->HasDynamicParameterSTM(elementId);
if (hasDstm)
{
Rmatrix* dstm = obj->GetParameterSTM(elementId);
Integer stmSize = dstm->GetNumRows();
// Fill in the object stm's from the master stm
for (Integer i = 0; i < stmSize; ++i)
for (Integer j = 0; j < stmSize; ++j)
(*dstm)(i,j) = stm(h+i, h+j);
}
}
}
return retval;
}