41 template <
class TNum,
class TStateNm,
class TStateCf>
56 return this->
template sub<0>();
62 return this->
template sub<0>();
68 return this->
template sub<1>();
74 return this->
template sub<1>();
90 template <
class TNum,
template <
class,
class>
class TStateNm,
template <
class,
class>
class TStateCf>
93 template <
class TNum,
class TStateNmByOptVar,
class TStateCfByOptVar>
130 #ifdef USE_MAP_ALIGNMENT 131 new (&gradMatMap_) Eigen::Map<Eigen::Matrix<TNum, -1, -1, Eigen::RowMajor>, MapAlignment>(
133 this->
stateNm().sub(0).data().size());
135 new (&gradMatMap_) Eigen::Map<Eigen::Matrix<TNum, -1, -1, Eigen::RowMajor>>(
137 this->
stateNm().sub(0).data().size());
144 #ifdef USE_MAP_ALIGNMENT 145 Eigen::Map<Eigen::Matrix<TNum, -1, -1, Eigen::RowMajor>, MapAlignment> gradMatMap_;
147 Eigen::Map<Eigen::Matrix<TNum, -1, -1, Eigen::RowMajor>>
gradMatMap_;
151 template <
class TNum,
class TstateGrad>
172 TstateGrad::operator=(_rhs);
197 #ifdef USE_MAP_ALIGNMENT 198 new (&gradMatMap_) Eigen::Map<Eigen::Matrix<TNum, -1, -1, Eigen::RowMajor>, MapAlignment>(
201 new (&gradMatMap_) Eigen::Map<Eigen::Matrix<TNum, -1, -1, Eigen::RowMajor>>(
207 #ifdef USE_MAP_ALIGNMENT 208 Eigen::Map<Eigen::Matrix<TNum, -1, -1, Eigen::RowMajor>, MapAlignment> gradMatMap_;
210 Eigen::Map<Eigen::Matrix<TNum, -1, -1, Eigen::RowMajor>>
gradMatMap_;
216 template <
class TNum,
class TStateNm,
class TStateCf>
217 struct StateMapBaseTraits<StateMapBase<TNum, TStateNm, TStateCf>>
226 using NumType = TNum;
229 using StateCfType = TStateCf;
232 using StateNmType = TStateNm;
238 using StateNmNumType =
typename TStateNm::StateMapBaseCRTP::MatrixTypeCRTP;
241 using StateWithGradNmType = EmptyGradType;
244 using StateWithGradCfType = EmptyGradType;
247 using StateWithGradNmNumType = EmptyGradType;
249 template <
class TNum,
class TStateNm,
class TStateCf>
250 struct StateMapBaseTraits<StateGradMapBase<TNum, TStateNm, TStateCf>>
259 using NumType = TNum;
262 using StateCfType = TStateCf;
265 using StateNmType = TStateNm;
271 using StateNmNumType =
typename TStateNm::StateMapBaseCRTP::MatrixTypeCRTP;
274 using StateWithGradNmType = EmptyGradType;
277 using StateWithGradCfType = EmptyGradType;
280 using StateWithGradNmNumType = EmptyGradType;
282 template <
class TNum,
class TstateGrad>
283 struct StateMapBaseTraits<StateGradWithMatMap<TNum, TstateGrad>>
286 using StateType =
typename StateMapBaseTraits<TstateGrad>::StateType;
289 using StateForSimType =
typename StateMapBaseTraits<TstateGrad>::StateForSimType;
292 using NumType =
typename StateMapBaseTraits<TstateGrad>::NumType;
295 using StateCfType =
typename StateMapBaseTraits<TstateGrad>::StateCfType;
298 using StateNmType =
typename StateMapBaseTraits<TstateGrad>::StateNmType;
301 using StateVirtType =
typename StateMapBaseTraits<TstateGrad>::StateVirtType;
304 using StateNmNumType =
typename StateMapBaseTraits<TstateGrad>::StateNmNumType;
307 using StateWithGradNmType =
typename StateMapBaseTraits<TstateGrad>::StateWithGradNmType;
310 using StateWithGradCfType =
typename StateMapBaseTraits<TstateGrad>::StateWithGradCfType;
313 using StateWithGradNmNumType =
typename StateMapBaseTraits<TstateGrad>::StateWithGradNmNumType;
333 template <
class TStateWithGradMapType>
334 using StateMapTraits = StateMapBaseTraits<typename TStateWithGradMapType::StateMapBaseType>;
338 template <
class TNum,
class TState,
class TStateGrad>
347 return this->
template sub<0>();
353 return this->
template sub<0>();
359 return this->
template sub<1>();
365 return this->
template sub<1>();
369 template <
class TStateWithGradMapType>
372 typename StateMapTraits<TStateWithGradMapType>::NumType,
374 typename StateMapTraits<TStateWithGradMapType>::StateNmType,
375 typename StateMapTraits<TStateWithGradMapType>::StateNmGradType>,
376 StateWithGradMapSimBaseInternal<typename StateMapTraits<TStateWithGradMapType>::NumType,
377 typename StateMapTraits<TStateWithGradMapType>::StateCfType,
378 typename StateMapTraits<TStateWithGradMapType>::StateCfGradType>>
384 using NumType =
typename StateMapTraits<TStateWithGradMapType>::NumType;
389 StateWithGradMapSimBaseInternal<typename StateMapTraits<TStateWithGradMapType>::NumType,
390 typename StateMapTraits<TStateWithGradMapType>::StateNmType,
391 typename StateMapTraits<TStateWithGradMapType>::StateNmGradType>,
392 StateWithGradMapSimBaseInternal<typename StateMapTraits<TStateWithGradMapType>::NumType,
393 typename StateMapTraits<TStateWithGradMapType>::StateCfType,
394 typename StateMapTraits<TStateWithGradMapType>::StateCfGradType>>;
409 BaseClassType::operator=(_rhs);
422 return this->
template sub<0>();
428 return this->
template sub<0>();
434 return this->stateWithGradNm().template sub<0>();
440 return this->stateWithGradNm().template sub<0>();
446 return this->stateWithGradNm().template sub<1>();
452 return this->stateWithGradNm().template sub<1>();
458 return this->
template sub<1>();
464 return this->
template sub<1>();
470 return this->stateWithGradCf().template sub<0>();
476 return this->stateWithGradCf().template sub<0>();
482 return this->stateWithGradCf().template sub<1>();
488 return this->stateWithGradCf().template sub<1>();
492 template <
class TNum,
template <
class,
class>
class TStateNm,
template <
class,
class>
class TStateCf,
493 template <
class,
class>
class TOptVarStruct>
495 :
public StateMapTuple<TNum, StateMapBase<TNum, TStateNm<TNum, TNum>, TStateCf<TNum, TNum>>,
496 StateGradMapBase<TNum, StateGradWithMatMap<TNum, TStateNm<TNum, TOptVarStruct<TNum, TNum>>>,
497 StateGradWithMatMap<TNum, TStateCf<TNum, TOptVarStruct<TNum, TNum>>>>>
521 BaseClassType::operator=(_rhs);
534 return this->
state().template sub<0>();
540 return this->
state().template sub<0>();
546 return this->
state().template sub<1>();
552 return this->
state().template sub<1>();
558 return this->stateGrad().template sub<0>();
564 return this->stateGrad().template sub<0>();
570 return this->stateGrad().template sub<1>();
576 return this->stateGrad().template sub<1>();
582 return this->
template sub<0>();
588 return this->
template sub<0>();
594 return this->
template sub<1>();
600 return this->
template sub<1>();
604 template <
class TNum,
template <
class,
class>
class TStateNm,
template <
class,
class>
class TStateCf,
605 template <
class,
class>
class TOptVarStruct>
610 template <
class TNum,
template <
class,
class>
class TStateNm,
template <
class,
class>
class TStateCf,
611 template <
class,
class>
class TOptVarStruct>
612 struct StateMapBaseTraits<StateWithGradMapBase<TNum, TStateNm, TStateCf, TOptVarStruct>>
621 using NumType = TNum;
624 using StateCfType = TStateCf<TNum, TNum>;
627 using StateNmType = TStateNm<TNum, TNum>;
643 using StateNmNumType =
typename TStateNm<TNum, TNum>::StateMapBaseCRTP::MatrixTypeCRTP;
652 using StateWithGradNmNumType =
typename StateWithGradNmType::StateMapBaseCRTP::MatrixTypeCRTP;
657 template <
class TNumType>
661 #endif // STATE_SIM_HPP
StateMapTuple & operator=(const StateMapTuple &_rhs)
StateGradWithMatMap(const StateGradWithMatMap &_rhs)
Eigen::Map< Eigen::Matrix< TNum,-1,-1, Eigen::RowMajor > > gradMatMap_
const auto & stateCf() const
StateGradWithMatMap & operator=(const StateGradWithMatMap &_rhs)
Eigen::Map< Eigen::Matrix< TNum,-1,-1, Eigen::RowMajor > > gradMatMap_
StateWithGradMapSimBase(const StateWithGradMapSimBase &_rhs)
const auto & stateNm() const
StateGradMapBase(auto &&_a, auto &&_b)
StateWithGradMapSimBase()
NumericType *const memStartRef() const
typename StateMapTraits< TStateWithGradMapType >::StateType StateMapBaseType
const auto & stateWithGradNm() const
const auto & stateGrad() const
const auto & stateWithGradCf() const
const auto & stateGradCf() const
const auto & stateGrad() const
StateWithGradMapSimBase & operator=(const StateWithGradMapSimBase &_rhs)
const auto & state() const
StateGradWithMatMap(auto &&_a, auto &&_b)
const auto & stateGradCf() const
const auto & state() const
const auto & state() const
const auto & stateNm() const
const auto & stateCf() const
const auto & stateGradNm() const
StateWithGradMapBase & operator=(const StateWithGradMapBase &_rhs)
StateWithGradMapBase(const StateWithGradMapBase &_rhs)
typename StateMapTraits< TStateWithGradMapType >::NumType NumType
constexpr const size_t subSize() const
const auto & stateGradNm() const
const auto & stateCf() const
const auto & stateNm() const