本文整理汇总了C++中TimeRange::isValid方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeRange::isValid方法的具体用法?C++ TimeRange::isValid怎么用?C++ TimeRange::isValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeRange
的用法示例。
在下文中一共展示了TimeRange::isValid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TEUCHOS_UNIT_TEST( Rythmos_TimeRange, copyAndScaleInvalid ) {
TimeRange<double> tr;
TimeRange<double> newTr = tr.copyAndScale(5.0);
TEST_EQUALITY_CONST( newTr.isValid(), false );
TEST_EQUALITY( newTr.lower(), tr.lower() );
TEST_EQUALITY( newTr.upper(), tr.upper() );
TEST_EQUALITY( newTr.length(), tr.length() );
}
示例2: tr
TEUCHOS_UNIT_TEST( Rythmos_TimeRange, copyAndScale ) {
TimeRange<double> tr(1.0,2.0);
TimeRange<double> newTr = tr.copyAndScale(5.0);
TEST_EQUALITY_CONST( newTr.isValid(), true );
TEST_EQUALITY_CONST( newTr.lower(), 5.0 );
TEST_EQUALITY_CONST( newTr.upper(), 10.0 );
TEST_EQUALITY_CONST( newTr.length(), 5.0 );
}
示例3: ostab
void ImplicitBDFStepperRampingStepControl<Scalar>::initialize(
const StepperBase<Scalar>& stepper)
{
// Initialize can be called from the stepper when setInitialCondition
// is called.
using Teuchos::as;
typedef Teuchos::ScalarTraits<Scalar> ST;
using Thyra::createMember;
// Set initial time:
TimeRange<Scalar> stepperRange = stepper.getTimeRange();
TEUCHOS_TEST_FOR_EXCEPTION(
!stepperRange.isValid(),
std::logic_error,
"Error, Stepper does not have valid time range for initialization "
"of ImplicitBDFStepperRampingStepControl!\n");
if (is_null(parameterList_)) {
RCP<Teuchos::ParameterList> emptyParameterList =
Teuchos::rcp(new Teuchos::ParameterList);
this->setParameterList(emptyParameterList);
}
if (is_null(errWtVecCalc_)) {
RCP<ImplicitBDFStepperErrWtVecCalc<Scalar> > IBDFErrWtVecCalc =
rcp(new ImplicitBDFStepperErrWtVecCalc<Scalar>());
errWtVecCalc_ = IBDFErrWtVecCalc;
}
stepControlState_ = UNINITIALIZED;
requestedStepSize_ = Scalar(-1.0);
currentStepSize_ = initialStepSize_;
currentOrder_ = 1;
nextStepSize_ = initialStepSize_;
nextOrder_ = 1;
numberOfSteps_ = 0;
totalNumberOfFailedSteps_ = 0;
countOfConstantStepsAfterFailure_ = 0;
if (is_null(delta_)) {
delta_ = createMember(stepper.get_x_space());
}
if (is_null(errWtVec_)) {
errWtVec_ = createMember(stepper.get_x_space());
}
V_S(delta_.ptr(),ST::zero());
if ( doOutput_(Teuchos::VERB_HIGH) ) {
RCP<Teuchos::FancyOStream> out = this->getOStream();
Teuchos::OSTab ostab(out,1,"initialize");
*out << "currentOrder_ = " << currentOrder_ << std::endl;
*out << "numberOfSteps_ = " << numberOfSteps_ << std::endl;
}
setStepControlState_(BEFORE_FIRST_STEP);
}
示例4: timeRange
TEUCHOS_UNIT_TEST( Rythmos_TimeRange, nonMemberConstructor ) {
TimeRange<double> tr = timeRange(1.25,3.45);
TEST_EQUALITY_CONST( tr.isValid(), true );
TEST_EQUALITY_CONST( tr.lower(), 1.25 );
TEST_EQUALITY_CONST( tr.upper(), 3.45 );
}