Example #1
0
Stream& Product::print( Stream &stream ) const{

	if ( ( acadoIsFinite( argument1->getValue() ) == BT_FALSE ) ||
		 ( acadoIsFinite( argument2->getValue() ) == BT_FALSE ) )
	{
		return  (((((stream << "(") << *argument1) << "*") << *argument2) << ")");
	}
	else
	{
		return stream << "((real_t)(" << ((argument1->getValue()) * (argument2->getValue())) << "))";
	}
}
Example #2
0
BEGIN_NAMESPACE_ACADO



BooleanType Interval::isCompact() const{
 
	BooleanType result = BT_TRUE;
	
	if( acadoIsNaN   ( _l ) == BT_TRUE  ) result = BT_FALSE;
	if( acadoIsFinite( _l ) == BT_FALSE ) result = BT_FALSE;
	if( acadoIsNaN   ( _u ) == BT_TRUE  ) result = BT_FALSE;
	if( acadoIsFinite( _u ) == BT_FALSE ) result = BT_FALSE;
	
	return result;
}
Example #3
0
returnValue CondensingExport::setStateBounds(	const VariablesGrid& _xBounds
												)
{
	BooleanType isFinite = BT_FALSE;
	Vector lbTmp = _xBounds.getLowerBounds(0);
	Vector ubTmp = _xBounds.getUpperBounds(0);
	
	if ( xBoundsIdx != 0 )
		delete[] xBoundsIdx;
	xBoundsIdx = new int[_xBounds.getDim()+1];

	for( uint j=0; j<lbTmp.getDim(); ++j )
	{
		if ( acadoIsGreater( ubTmp(j),lbTmp(j) ) == BT_FALSE )
			return ACADOERROR( RET_INVALID_ARGUMENTS );
			
		if ( ( acadoIsFinite( ubTmp(j) ) == BT_TRUE ) || ( acadoIsFinite( lbTmp(j) ) == BT_TRUE ) )
			isFinite = BT_TRUE;
	}

	for( uint i=1; i<_xBounds.getNumPoints(); ++i )
	{
		lbTmp = _xBounds.getLowerBounds(i);
		ubTmp = _xBounds.getUpperBounds(i);

		for( uint j=0; j<lbTmp.getDim(); ++j )
		{
			if ( acadoIsGreater( ubTmp(j),lbTmp(j) ) == BT_FALSE )
				return ACADOERROR( RET_INVALID_ARGUMENTS );
			
			if ( ( acadoIsFinite( ubTmp(j) ) == BT_TRUE ) || ( acadoIsFinite( lbTmp(j) ) == BT_TRUE ) )
			{
				xBoundsIdx[nxBounds] = i*lbTmp.getDim()+j;
				++nxBounds;
				isFinite = BT_TRUE;
			}
		}
	}

	xBoundsIdx[nxBounds] = -1;

	if ( isFinite == BT_TRUE )
		xBounds = _xBounds;
	else
		xBounds.init();

	return SUCCESSFUL_RETURN;
}
Example #4
0
BooleanType isFinite( const T& _value )
{
	for (unsigned el = 0; el < _value.size(); ++el)
		if ( acadoIsFinite( _value[ el ] ) == BT_TRUE )
            return BT_TRUE;
	return BT_FALSE;
}