You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(71) |
Mar
(296) |
Apr
(77) |
May
(71) |
Jun
(128) |
Jul
(32) |
Aug
(69) |
Sep
(101) |
Oct
(31) |
Nov
(34) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(19) |
Feb
(52) |
Mar
(39) |
Apr
(61) |
May
(114) |
Jun
(57) |
Jul
(127) |
Aug
(134) |
Sep
(33) |
Oct
(51) |
Nov
(15) |
Dec
(21) |
| 2005 |
Jan
(24) |
Feb
(7) |
Mar
(16) |
Apr
(5) |
May
(50) |
Jun
(2) |
Jul
(8) |
Aug
(1) |
Sep
(4) |
Oct
(6) |
Nov
(43) |
Dec
(16) |
| 2006 |
Jan
|
Feb
(8) |
Mar
(7) |
Apr
(7) |
May
(26) |
Jun
(14) |
Jul
(3) |
Aug
(2) |
Sep
(1) |
Oct
(5) |
Nov
(24) |
Dec
(2) |
| 2007 |
Jan
|
Feb
(2) |
Mar
(3) |
Apr
(36) |
May
(51) |
Jun
(100) |
Jul
(29) |
Aug
(4) |
Sep
(22) |
Oct
(4) |
Nov
(10) |
Dec
(52) |
| 2008 |
Jan
(68) |
Feb
(49) |
Mar
(35) |
Apr
(12) |
May
(2) |
Jun
(18) |
Jul
|
Aug
(8) |
Sep
|
Oct
(136) |
Nov
(24) |
Dec
(45) |
| 2009 |
Jan
(19) |
Feb
(58) |
Mar
(22) |
Apr
(24) |
May
|
Jun
(28) |
Jul
(25) |
Aug
(49) |
Sep
(10) |
Oct
(6) |
Nov
(22) |
Dec
(30) |
| 2010 |
Jan
(138) |
Feb
(53) |
Mar
(1) |
Apr
(7) |
May
(4) |
Jun
(5) |
Jul
(7) |
Aug
(3) |
Sep
(15) |
Oct
|
Nov
(7) |
Dec
(7) |
| 2011 |
Jan
(11) |
Feb
(4) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <mor...@us...> - 2010-11-11 16:06:52
|
Revision: 3873
http://ecell.svn.sourceforge.net/ecell/?rev=3873&view=rev
Author: moriyoshi
Date: 2010-11-11 16:06:45 +0000 (Thu, 11 Nov 2010)
Log Message:
-----------
* Completely overhaul Polymorph. It was too buggy! :(
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/Polymorph.hpp
ecell3/trunk/ecell/libecs/tests/Polymorph_test.cpp
Modified: ecell3/trunk/ecell/libecs/Polymorph.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/Polymorph.hpp 2010-11-10 09:30:14 UTC (rev 3872)
+++ ecell3/trunk/ecell/libecs/Polymorph.hpp 2010-11-11 16:06:45 UTC (rev 3873)
@@ -116,26 +116,29 @@
return theNumberOfItems;
}
- bool operator==( Tuple const& rhs ) const;
+ template<typename Trange>
+ bool operator==( Trange const& rhs ) const;
- template< typename T_ >
- bool operator!=( Tuple const& rhs ) const
+ template< typename Trange >
+ bool operator!=( Trange const& rhs ) const
{
return !operator==( rhs );
}
- bool operator<( Tuple const& rhs ) const;
+ template< typename Trange >
+ bool operator<( Trange const& rhs ) const;
- template< typename T_ >
- bool operator>=( Tuple const& rhs ) const
+ template< typename Trange >
+ bool operator>=( Trange const& rhs ) const
{
return !operator<( rhs );
}
- bool operator>( Tuple const& rhs ) const;
+ template< typename Trange >
+ bool operator>( Trange const& rhs ) const;
- template< typename T_ >
- bool operator<=( Tuple const& rhs ) const
+ template< typename Trange >
+ bool operator<=( Trange const& rhs ) const
{
return !operator<( rhs );
}
@@ -186,16 +189,25 @@
bool operator<( RawString const& rhs ) const
{
- size_type l( std::min( theLength, rhs.theLength ) );
- int c( memcmp( ptr, rhs.ptr, sizeof( value_type ) * l ) );
- return c < 0 || ( c == 0 && l == theLength );
+ size_type const l( std::min( theLength, rhs.theLength ) );
+ std::pair< value_type const*, value_type const* > c(
+ std::mismatch( ptr, ptr + l, rhs.ptr ) );
+ return ( c.first == ptr + theLength &&
+ c.second != rhs.ptr + rhs.theLength)
+ || ( c.first != ptr + theLength &&
+ c.second != rhs.ptr + rhs.theLength &&
+ *c.first < *c.second );
}
bool operator<( const char* rhs ) const
{
- size_type l( std::min( theLength, std::strlen( rhs ) ) );
- int c( memcmp( ptr, rhs, sizeof( value_type ) * l ) );
- return c < 0 || ( c == 0 && l == theLength );
+ size_type const rl( std::strlen( rhs ) );
+ size_type const l( std::min( theLength, rl ) );
+ std::pair< value_type const*, value_type const* > c(
+ std::mismatch( ptr, ptr + l, rhs ) );
+ return ( c.first == ptr + theLength && c.second != rhs + rl )
+ || ( c.first != ptr + theLength &&
+ c.second != rhs + rl && *c.first < *c.second );
}
bool operator<( String const& rhs ) const
@@ -211,16 +223,25 @@
bool operator>( RawString const& rhs ) const
{
- size_type l( std::min( theLength, rhs.theLength ) );
- int c( memcmp( ptr, rhs.ptr, sizeof( value_type ) * l ) );
- return c < 0 || (c == 0 && l == theLength );
+ size_type const l( std::min( theLength, rhs.theLength ) );
+ std::pair< value_type const*, value_type const* > c(
+ std::mismatch( ptr, ptr + l, rhs.ptr ) );
+ return ( c.first != ptr + theLength &&
+ c.second == rhs.ptr + rhs.theLength )
+ || ( c.first != ptr + theLength &&
+ c.second != rhs.ptr + rhs.theLength &&
+ *c.first > *c.second );
}
bool operator>( const char* rhs ) const
{
- size_type l( std::min( theLength, std::strlen( rhs ) ) );
- int c( memcmp( ptr, rhs, sizeof( value_type ) * l ) );
- return c < 0 || (c == 0 && l == theLength );
+ size_type const rl( std::strlen( rhs ) );
+ size_type const l( std::min( theLength, rl ) );
+ std::pair< value_type const*, value_type const* > c(
+ std::mismatch( ptr, ptr + l, rhs ) );
+ return ( c.first != ptr + theLength && c.second == rhs + rl )
+ || ( c.first != ptr + theLength &&
+ c.second != rhs + rl && *c.first > *c.second );
}
bool operator>( String const& rhs ) const
@@ -246,7 +267,7 @@
private:
size_type theLength;
- char ptr[1];
+ value_type ptr[1];
};
public:
@@ -1150,39 +1171,44 @@
namespace libecs
{
-inline bool PolymorphValue::Tuple::operator==( PolymorphValue::Tuple const& rhs ) const
+template< typename Trange >
+inline bool PolymorphValue::Tuple::operator==( Trange const& rhs ) const
{
- if ( theNumberOfItems != rhs.theNumberOfItems )
+ if ( theNumberOfItems != rhs.size() )
return false;
- return std::equal( reinterpret_cast< Polymorph const* >( ptr ),
- reinterpret_cast< Polymorph const* >( ptr ) + theNumberOfItems,
- reinterpret_cast< Polymorph const* >( rhs.ptr ) );
+ return std::equal( boost::begin( *this ), boost::end( *this ),
+ boost::begin( rhs ) );
}
-
-inline bool PolymorphValue::Tuple::operator<( PolymorphValue::Tuple const& rhs ) const
+template< typename Trange >
+inline bool PolymorphValue::Tuple::operator<( Trange const& rhs ) const
{
- size_type l( std::min( theNumberOfItems, rhs.theNumberOfItems ) );
- std::pair< Polymorph const*, Polymorph const* > c(
- std::mismatch( reinterpret_cast< Polymorph const* >( ptr ),
- reinterpret_cast< Polymorph const* >( ptr ) + l,
- reinterpret_cast< Polymorph const* >( rhs.ptr ) ) );
- return *c.first < *c.second
- || ( theNumberOfItems < l &&
- c.first == reinterpret_cast< Polymorph const * >( ptr ) + l );
+ std::pair< Polymorph const*,
+ typename boost::range_const_iterator< Trange >::type > c(
+ std::mismatch( boost::begin( *this ),
+ boost::begin( *this )
+ + std::min( theNumberOfItems, rhs.size() ),
+ boost::begin( rhs ) ) );
+ return ( c.first == boost::end( *this ) && c.second != boost::end( rhs ) )
+ || ( c.first != boost::end( *this ) &&
+ c.second != boost::end( rhs ) &&
+ *c.first < *c.second );
}
-inline bool PolymorphValue::Tuple::operator>( PolymorphValue::Tuple const& rhs ) const
+template< typename Trange >
+inline bool PolymorphValue::Tuple::operator>( Trange const& rhs ) const
{
- size_type l( std::min( theNumberOfItems, rhs.theNumberOfItems ) );
- std::pair< Polymorph const*, Polymorph const* > c(
- std::mismatch( reinterpret_cast< Polymorph const* >( ptr ),
- reinterpret_cast< Polymorph const* >( ptr ) + l,
- reinterpret_cast< Polymorph const* >( rhs.ptr ) ) );
- return *c.first > *c.second
- || ( theNumberOfItems > l &&
- c.second == reinterpret_cast< Polymorph const * >( rhs.ptr ) + l );
+ std::pair< Polymorph const*,
+ typename boost::range_const_iterator< Trange >::type > c(
+ std::mismatch( boost::begin( *this ),
+ boost::begin( *this )
+ + std::min( theNumberOfItems, rhs.size() ),
+ boost::begin( rhs ) ) );
+ return ( c.first != boost::end( *this ) && c.second == boost::end( rhs ) )
+ || ( c.first != boost::end( *this ) &&
+ c.second != boost::end( rhs ) &&
+ *c.first > *c.second );
}
inline PolymorphValue::Tuple::operator Polymorph*()
@@ -1451,8 +1477,10 @@
return false;
case TUPLE:
return theTupleValue == rhs;
+ case REAL:
+ return rhs.size() == 1 && theRealValue == rhs[ 0 ];
default:
- return rhs.size() == 1 && theRealValue == rhs[ 0 ];
+ return false;
}
NEVER_GET_HERE;
}
@@ -1514,6 +1542,26 @@
NEVER_GET_HERE;
}
+inline bool PolymorphValue::operator==( PolymorphVector const& rhs ) const
+{
+ switch ( theType )
+ {
+ case NONE:
+ return false;
+ case TUPLE:
+ return theTupleValue == rhs;
+ case REAL:
+ return rhs.size() == 1 && theRealValue == rhs[ 0 ];
+ case INTEGER:
+ return rhs.size() == 1 && theIntegerValue == rhs[ 0 ];
+ case STRING:
+ return rhs.size() == 1 && theStringValue == rhs[ 0 ];
+ default:
+ return false;
+ }
+ NEVER_GET_HERE;
+}
+
inline bool PolymorphValue::operator<( Real const& rhs ) const
{
switch ( theType )
@@ -1527,7 +1575,9 @@
case STRING:
return false;
case TUPLE:
- return theTupleValue.size() < 1 || static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) < rhs;
+ return theTupleValue.size() == 0
+ || ( theTupleValue.size() == 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) < rhs);
}
NEVER_GET_HERE;
}
@@ -1545,8 +1595,9 @@
case STRING:
return false;
case TUPLE:
- return theTupleValue.size() < 1 ||
- static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) < rhs;
+ return theTupleValue.size() == 0
+ || ( theTupleValue.size() == 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) < rhs);
}
NEVER_GET_HERE;
}
@@ -1564,7 +1615,9 @@
case STRING:
return theStringValue < rhs;
case TUPLE:
- return theTupleValue.size() < 1 || static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) < rhs;
+ return theTupleValue.size() == 0
+ || ( theTupleValue.size() == 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) < rhs);
}
NEVER_GET_HERE;
}
@@ -1576,11 +1629,14 @@
case NONE:
return true;
case REAL:
- return rhs.size() < 1 && theRealValue < static_cast< PolymorphValue const& >( rhs[ 0 ] );
+ return ( rhs.size() == 1 && theRealValue < static_cast< PolymorphValue const& >( rhs[ 0 ] ) )
+ || ( rhs.size() > 1 && theRealValue <= static_cast< PolymorphValue const& >( rhs[ 0 ] ) );
case INTEGER:
- return rhs.size() < 1 && theIntegerValue < static_cast< PolymorphValue const& >( rhs[ 0 ] );
+ return ( rhs.size() == 1 && theIntegerValue < static_cast< PolymorphValue const& >( rhs[ 0 ] ) )
+ || ( rhs.size() > 1 && theIntegerValue <= static_cast< PolymorphValue const& >( rhs[ 0 ] ) );
case STRING:
- return rhs.size() < 1 && theStringValue < static_cast< PolymorphValue const& >( rhs[ 0 ] );
+ return ( rhs.size() == 1 && theStringValue < static_cast< PolymorphValue const& >( rhs[ 0 ] ) )
+ || ( rhs.size() > 1 && theStringValue <= static_cast< PolymorphValue const& >( rhs[ 0 ] ) );
case TUPLE:
return theTupleValue < rhs;
}
@@ -1600,7 +1656,9 @@
case STRING:
return theStringValue < rhs;
case TUPLE:
- return theTupleValue.size() < 1 || static_cast< PolymorphValue const& >( theTupleValue[ 0 ] )< rhs;
+ return theTupleValue.size() == 0
+ || ( theTupleValue.size() == 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) < rhs);
}
NEVER_GET_HERE;
}
@@ -1618,11 +1676,34 @@
case STRING:
return theStringValue < rhs;
case TUPLE:
- return theTupleValue.size() < 1 || static_cast< PolymorphValue const& >( theTupleValue[ 0 ] )< rhs;
+ return theTupleValue.size() == 0
+ || ( theTupleValue.size() == 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) < rhs);
}
NEVER_GET_HERE;
}
+inline bool PolymorphValue::operator<( PolymorphVector const& rhs ) const
+{
+ switch ( theType )
+ {
+ case NONE:
+ return true;
+ case REAL:
+ return ( rhs.size() == 1 && theRealValue < static_cast< PolymorphValue const& >( rhs[ 0 ] ) )
+ || ( rhs.size() > 1 && theRealValue <= static_cast< PolymorphValue const& >( rhs[ 0 ] ) );
+ case INTEGER:
+ return ( rhs.size() == 1 && theIntegerValue < static_cast< PolymorphValue const& >( rhs[ 0 ] ) )
+ || ( rhs.size() > 1 && theIntegerValue <= static_cast< PolymorphValue const& >( rhs[ 0 ] ) );
+ case STRING:
+ return ( rhs.size() == 1 && theStringValue < static_cast< PolymorphValue const& >( rhs[ 0 ] ) )
+ || ( rhs.size() > 1 && theStringValue <= static_cast< PolymorphValue const& >( rhs[ 0 ] ) );
+ case TUPLE:
+ return theTupleValue < rhs;
+ }
+ NEVER_GET_HERE;
+}
+
inline bool PolymorphValue::operator<( PolymorphValue const& rhs ) const
{
switch ( theType )
@@ -1654,8 +1735,10 @@
case STRING:
return true;
case TUPLE:
- return theTupleValue.size() >= 1 &&
- static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) > rhs;
+ return ( theTupleValue.size() == 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) > rhs )
+ || ( theTupleValue.size() > 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) >= rhs);
}
NEVER_GET_HERE;
}
@@ -1673,8 +1756,10 @@
case STRING:
return true;
case TUPLE:
- return theTupleValue.size() >= 1 &&
- static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) > rhs;
+ return ( theTupleValue.size() == 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) > rhs )
+ || ( theTupleValue.size() > 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) >= rhs);
}
NEVER_GET_HERE;
}
@@ -1692,7 +1777,10 @@
case STRING:
return theStringValue > rhs;
case TUPLE:
- return theTupleValue.size() >= 1 && static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) > rhs;
+ return ( theTupleValue.size() == 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) > rhs )
+ || ( theTupleValue.size() > 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) >= rhs);
}
NEVER_GET_HERE;
}
@@ -1705,13 +1793,13 @@
return false;
case REAL:
return rhs.size() == 0
- || ( rhs.size() == 1 && static_cast< PolymorphValue const& >( rhs[ 0 ] ) < theRealValue );
+ || ( rhs.size() == 1 && static_cast< PolymorphValue const& >( rhs[ 0 ] ) <= theRealValue );
case INTEGER:
return rhs.size() == 0
- || ( rhs.size() == 1 && static_cast< PolymorphValue const& >( rhs[ 0 ] ) < theIntegerValue );
+ || ( rhs.size() >= 1 && static_cast< PolymorphValue const& >( rhs[ 0 ] ) <= theIntegerValue );
case STRING:
return rhs.size() == 0
- || ( rhs.size() == 1 && static_cast< PolymorphValue const& >( rhs[ 0 ] )< theStringValue );
+ || ( rhs.size() >= 1 && static_cast< PolymorphValue const& >( rhs[ 0 ] ) <= theStringValue );
case TUPLE:
return theTupleValue > rhs;
}
@@ -1731,7 +1819,10 @@
case STRING:
return theStringValue > rhs;
case TUPLE:
- return theTupleValue.size() >= 1 && static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) > rhs;
+ return ( theTupleValue.size() == 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) > rhs )
+ || ( theTupleValue.size() > 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) >= rhs);
}
NEVER_GET_HERE;
}
@@ -1749,11 +1840,35 @@
case STRING:
return theStringValue > rhs;
case TUPLE:
- return theTupleValue.size() >= 1 && static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) > rhs;
+ return ( theTupleValue.size() == 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) > rhs )
+ || ( theTupleValue.size() > 1 &&
+ static_cast< PolymorphValue const& >( theTupleValue[ 0 ] ) >= rhs);
}
NEVER_GET_HERE;
}
+inline bool PolymorphValue::operator>( PolymorphVector const& rhs ) const
+{
+ switch ( theType )
+ {
+ case NONE:
+ return false;
+ case REAL:
+ return rhs.size() == 0
+ || ( rhs.size() == 1 && static_cast< PolymorphValue const& >( rhs[ 0 ] ) <= theRealValue );
+ case INTEGER:
+ return rhs.size() == 0
+ || ( rhs.size() >= 1 && static_cast< PolymorphValue const& >( rhs[ 0 ] ) <= theIntegerValue );
+ case STRING:
+ return rhs.size() == 0
+ || ( rhs.size() >= 1 && static_cast< PolymorphValue const& >( rhs[ 0 ] ) <= theStringValue );
+ case TUPLE:
+ return theTupleValue > rhs;
+ }
+ NEVER_GET_HERE;
+}
+
inline bool PolymorphValue::operator>( PolymorphValue const& rhs ) const
{
switch ( rhs.getType() )
Modified: ecell3/trunk/ecell/libecs/tests/Polymorph_test.cpp
===================================================================
--- ecell3/trunk/ecell/libecs/tests/Polymorph_test.cpp 2010-11-10 09:30:14 UTC (rev 3872)
+++ ecell3/trunk/ecell/libecs/tests/Polymorph_test.cpp 2010-11-11 16:06:45 UTC (rev 3873)
@@ -80,3 +80,66 @@
BOOST_CHECK_EQUAL( "1.0", Polymorph( "1.0" ) );
BOOST_CHECK_EQUAL( Polymorph( "1.0" ), "1.0" );
}
+
+BOOST_AUTO_TEST_CASE(testStringComparison)
+{
+ BOOST_CHECK( Polymorph( "1" ) == Polymorph( "1" ) );
+ BOOST_CHECK( Polymorph( "1" ) >= Polymorph( "1" ) );
+ BOOST_CHECK( Polymorph( "1" ) != Polymorph( "" ) );
+ BOOST_CHECK( !( Polymorph( "1" ) == Polymorph( "" ) ) );
+ BOOST_CHECK( Polymorph( "" ) != Polymorph( "1" ) );
+ BOOST_CHECK( !( Polymorph( "" ) == Polymorph( "1" ) ) );
+ BOOST_CHECK( Polymorph( "" ) < Polymorph( "1" ) );
+ BOOST_CHECK( !( Polymorph( "" ) >= Polymorph( "1" ) ) );
+ BOOST_CHECK( !( Polymorph( "" ) > Polymorph( "1" ) ) );
+ BOOST_CHECK( Polymorph( "2" ) > Polymorph( "1" ) );
+ BOOST_CHECK( !( Polymorph( "2" ) < Polymorph( "1" ) ) );
+ BOOST_CHECK( !( Polymorph( "2" ) <= Polymorph( "1" ) ) );
+ BOOST_CHECK( Polymorph( "1" ) < Polymorph( "2" ) );
+ BOOST_CHECK( !( Polymorph( "1" ) > Polymorph( "2" ) ) );
+ BOOST_CHECK( !( Polymorph( "1" ) >= Polymorph( "2" ) ) );
+ BOOST_CHECK( Polymorph( "1" ) > Polymorph( "" ) );
+ BOOST_CHECK( !( Polymorph( "1" ) < Polymorph( "" ) ) );
+ BOOST_CHECK( !( Polymorph( "1" ) <= Polymorph( "" ) ) );
+ BOOST_CHECK( Polymorph( "12" ) > Polymorph( "1" ) );
+ BOOST_CHECK( !( Polymorph( "12" ) < Polymorph( "1" ) ) );
+ BOOST_CHECK( !( Polymorph( "12" ) <= Polymorph( "1" ) ) );
+ BOOST_CHECK( Polymorph( "1" ) < Polymorph( "12" ) );
+ BOOST_CHECK( !( Polymorph( "1" ) > Polymorph( "12" ) ) );
+ BOOST_CHECK( !( Polymorph( "1" ) >= Polymorph( "12" ) ) );
+}
+
+BOOST_AUTO_TEST_CASE(testTupleComparison)
+{
+ BOOST_CHECK( Polymorph( "1" ) == Polymorph( boost::make_tuple( "1" ) ) );
+ BOOST_CHECK( Polymorph( 1l ) == Polymorph( boost::make_tuple( 1l ) ) );
+ BOOST_CHECK( Polymorph( 1.0 ) == Polymorph( boost::make_tuple( 1.0 ) ) );
+ BOOST_CHECK( Polymorph( boost::make_tuple() ) == Polymorph( boost::make_tuple() ) );
+ BOOST_CHECK( Polymorph( boost::make_tuple( 1.0 ) ) == Polymorph( boost::make_tuple( 1.0 ) ) );
+
+ BOOST_CHECK( Polymorph( "1" ) != Polymorph( boost::make_tuple() ) );
+ BOOST_CHECK( Polymorph( "1" ) != Polymorph( boost::make_tuple( "2" ) ) );
+ BOOST_CHECK( Polymorph( 1l ) != Polymorph( boost::make_tuple() ) );
+ BOOST_CHECK( Polymorph( 1l ) != Polymorph( boost::make_tuple( 2l ) ) );
+ BOOST_CHECK( Polymorph( 1.0 ) != Polymorph( boost::make_tuple() ) );
+ BOOST_CHECK( Polymorph( 1.0 ) != Polymorph( boost::make_tuple( 2.0 ) ) );
+ BOOST_CHECK( Polymorph( boost::make_tuple() ) != Polymorph( boost::make_tuple( 1.0 ) ) );
+ BOOST_CHECK( Polymorph( boost::make_tuple( 2.0 ) ) != Polymorph( boost::make_tuple( 1.0 ) ) );
+ BOOST_CHECK( Polymorph( boost::make_tuple( 1.0 ) ) != Polymorph( boost::make_tuple( 1.0, 2.0 ) ) );
+
+ BOOST_CHECK( Polymorph( "1" ) < Polymorph( boost::make_tuple( "2" ) ) );
+ BOOST_CHECK( Polymorph( "1" ) < Polymorph( boost::make_tuple( "1", "2" ) ) );
+ BOOST_CHECK( Polymorph( 1l ) < Polymorph( boost::make_tuple( 2l ) ) );
+ BOOST_CHECK( Polymorph( 1l ) < Polymorph( boost::make_tuple( 1l, 2l ) ) );
+ BOOST_CHECK( Polymorph( 1.0 ) < Polymorph( boost::make_tuple( 2.0 ) ) );
+ BOOST_CHECK( Polymorph( 1.0 ) < Polymorph( boost::make_tuple( 1.0, 2.0 ) ) );
+ BOOST_CHECK( Polymorph( boost::make_tuple() ) < Polymorph( boost::make_tuple( 0.0 ) ) );
+ BOOST_CHECK( Polymorph( boost::make_tuple( 1.0 ) ) < Polymorph( boost::make_tuple( 1.0, 2.0 ) ) );
+
+ BOOST_CHECK( Polymorph( "2" ) > Polymorph( boost::make_tuple( "1" ) ) );
+ BOOST_CHECK( Polymorph( boost::make_tuple( "1", "2" ) ) > Polymorph( "1" ) );
+ BOOST_CHECK( Polymorph( 2.0 ) > Polymorph( boost::make_tuple( 1.0 ) ) );
+ BOOST_CHECK( Polymorph( boost::make_tuple( 1.0, 2.0 ) ) > Polymorph( boost::make_tuple( 1.0 ) ) );
+ BOOST_CHECK( Polymorph( 2l ) > Polymorph( boost::make_tuple( 1l ) ) );
+ BOOST_CHECK( Polymorph( boost::make_tuple( 1l, 2l ) ) > Polymorph( boost::make_tuple( 1l ) ) );
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-11-10 09:30:20
|
Revision: 3872
http://ecell.svn.sourceforge.net/ecell/?rev=3872&view=rev
Author: moriyoshi
Date: 2010-11-10 09:30:14 +0000 (Wed, 10 Nov 2010)
Log Message:
-----------
* Ensure ExpressionAssignmentProcess has at least one non-zero variable reference. It would segfault before the fix.
Modified Paths:
--------------
ecell3/trunk/ecell/dm/ExpressionAssignmentProcess.cpp
Modified: ecell3/trunk/ecell/dm/ExpressionAssignmentProcess.cpp
===================================================================
--- ecell3/trunk/ecell/dm/ExpressionAssignmentProcess.cpp 2010-11-05 11:27:19 UTC (rev 3871)
+++ ecell3/trunk/ecell/dm/ExpressionAssignmentProcess.cpp 2010-11-10 09:30:14 UTC (rev 3872)
@@ -101,9 +101,11 @@
{
if( i->getCoefficient() != 0 )
{
- theVariableReference = *i;
+ theVariableReference = *i;
+ return;
}
}
+ THROW_EXCEPTION_INSIDE(InitializationFailed, "No variable references with non-zero coefficients exist");
}
virtual void fire()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-11-05 11:27:25
|
Revision: 3871
http://ecell.svn.sourceforge.net/ecell/?rev=3871&view=rev
Author: moriyoshi
Date: 2010-11-05 11:27:19 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
* Update testcases.
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/tests/ExpressionCompiler_test.cpp
ecell3/trunk/ecell/libecs/tests/VirtualMachine_test.cpp
Modified: ecell3/trunk/ecell/libecs/tests/ExpressionCompiler_test.cpp
===================================================================
--- ecell3/trunk/ecell/libecs/tests/ExpressionCompiler_test.cpp 2010-11-05 11:26:20 UTC (rev 3870)
+++ ecell3/trunk/ecell/libecs/tests/ExpressionCompiler_test.cpp 2010-11-05 11:27:19 UTC (rev 3871)
@@ -87,7 +87,7 @@
BOOST_REQUIRE_EQUAL( op, reinterpret_cast< const scripting::InstructionHead* >(pc)->getOpcode() ); \
if ( isReal( oper ) ) \
{ \
- BOOST_CHECK_CLOSE_FRACTION( toReal( oper ), toReal( reinterpret_cast< const scripting::Instruction< op >* >( pc )->getOperand() ), 50 ); \
+ BOOST_CHECK_CLOSE_FRACTION( toReal( oper ), toReal( reinterpret_cast< const scripting::Instruction< op >* >( pc )->getOperand() ), .1 ); \
} \
else \
{ \
Modified: ecell3/trunk/ecell/libecs/tests/VirtualMachine_test.cpp
===================================================================
--- ecell3/trunk/ecell/libecs/tests/VirtualMachine_test.cpp 2010-11-05 11:26:20 UTC (rev 3870)
+++ ecell3/trunk/ecell/libecs/tests/VirtualMachine_test.cpp 2010-11-05 11:27:19 UTC (rev 3871)
@@ -67,7 +67,7 @@
scripting::Instruction< scripting::PUSH_REAL >( i ) );
a.appendInstruction( scripting::Instruction< scripting::ADD >() );
a.appendInstruction( scripting::Instruction< scripting::RET >() );
- BOOST_CHECK_CLOSE_FRACTION( i * 2, vm.execute( *code ), 50 );
+ BOOST_CHECK_CLOSE( i * 2, vm.execute( *code ), .1 );
}
for ( Real i = 0; i < 100; i += 0.8 ) {
@@ -83,7 +83,84 @@
scripting::Instruction< scripting::PUSH_REAL >( i ) );
a.appendInstruction( scripting::Instruction< scripting::ADD >() );
a.appendInstruction( scripting::Instruction< scripting::RET >() );
- BOOST_CHECK_CLOSE_FRACTION( i * 3, vm.execute( *code ), 50 );
+ BOOST_CHECK_CLOSE( i * 3, vm.execute( *code ), .1 );
}
}
+struct Test
+{
+ Real getValue() const
+ {
+ return 4;
+ }
+};
+
+BOOST_AUTO_TEST_CASE(testFunctionCall)
+{
+ {
+ std::auto_ptr<scripting::Code> code(new scripting::Code());
+ scripting::VirtualMachine vm;
+ scripting::Assembler a( code.get() );
+ Test t;
+ a.appendInstruction(
+ scripting::Instruction< scripting::OBJECT_METHOD_REAL >(
+ scripting::RealObjectMethodProxy::createConst<
+ Test, &Test::getValue >( &t ) ) );
+ a.appendInstruction(
+ scripting::Instruction< scripting::CALL_FUNC1 >( &std::sqrt ) );
+ a.appendInstruction(
+ scripting::Instruction< scripting::PUSH_REAL >( 1 ) );
+ a.appendInstruction( scripting::Instruction< scripting::ADD >() );
+ a.appendInstruction( scripting::Instruction< scripting::RET >() );
+ BOOST_CHECK_CLOSE( 3, vm.execute( *code ), .1 );
+ }
+
+ {
+ std::auto_ptr<scripting::Code> code(new scripting::Code());
+ scripting::VirtualMachine vm;
+ scripting::Assembler a( code.get() );
+ a.appendInstruction(
+ scripting::Instruction< scripting::PUSH_REAL >( 4 ) );
+ a.appendInstruction(
+ scripting::Instruction< scripting::CALL_FUNC1 >( &std::sqrt ) );
+ a.appendInstruction(
+ scripting::Instruction< scripting::PUSH_REAL >( 1 ) );
+ a.appendInstruction( scripting::Instruction< scripting::ADD >() );
+ a.appendInstruction( scripting::Instruction< scripting::RET >() );
+ BOOST_CHECK_CLOSE( 3, vm.execute( *code ), .1 );
+ }
+
+ {
+ std::auto_ptr<scripting::Code> code(new scripting::Code());
+ scripting::VirtualMachine vm;
+ scripting::Assembler a( code.get() );
+ Test t;
+ a.appendInstruction(
+ scripting::Instruction< scripting::PUSH_REAL >( 1 ) );
+ a.appendInstruction(
+ scripting::Instruction< scripting::OBJECT_METHOD_REAL >(
+ scripting::RealObjectMethodProxy::createConst<
+ Test, &Test::getValue >( &t ) ) );
+ a.appendInstruction(
+ scripting::Instruction< scripting::CALL_FUNC1 >( &std::sqrt ) );
+ a.appendInstruction( scripting::Instruction< scripting::ADD >() );
+ a.appendInstruction( scripting::Instruction< scripting::RET >() );
+ BOOST_CHECK_CLOSE( 3, vm.execute( *code ), .1 );
+ }
+
+ {
+ std::auto_ptr<scripting::Code> code(new scripting::Code());
+ scripting::VirtualMachine vm;
+ scripting::Assembler a( code.get() );
+ a.appendInstruction(
+ scripting::Instruction< scripting::PUSH_REAL >( 1 ) );
+ a.appendInstruction(
+ scripting::Instruction< scripting::PUSH_REAL >( 4 ) );
+ a.appendInstruction(
+ scripting::Instruction< scripting::CALL_FUNC1 >( &std::sqrt ) );
+ a.appendInstruction( scripting::Instruction< scripting::ADD >() );
+ a.appendInstruction( scripting::Instruction< scripting::RET >() );
+ BOOST_CHECK_CLOSE( 3, vm.execute( *code ), .1 );
+ }
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-11-05 11:26:26
|
Revision: 3870
http://ecell.svn.sourceforge.net/ecell/?rev=3870&view=rev
Author: moriyoshi
Date: 2010-11-05 11:26:20 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
* Fixed the bug that some expressions wouldn't be evaluated correctly.
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/scripting/VirtualMachine.cpp
Modified: ecell3/trunk/ecell/libecs/scripting/VirtualMachine.cpp
===================================================================
--- ecell3/trunk/ecell/libecs/scripting/VirtualMachine.cpp 2010-11-05 10:48:20 UTC (rev 3869)
+++ ecell3/trunk/ecell/libecs/scripting/VirtualMachine.cpp 2010-11-05 11:26:20 UTC (rev 3870)
@@ -96,13 +96,12 @@
void push_back(const Telem_& elem)
{
*(++ptr_) = elem;
- last = elem;
}
Telem_& pop()
{
- last = *(ptr_ - 1);
- return *(ptr_--);
+ Telem_& retval(*(ptr_--));
+ return retval;
}
size_type size()
@@ -118,20 +117,23 @@
template<size_type bkidx>
Telem_& peek()
{
- if ( bkidx == 0 )
- return last;
return *( ptr_ - bkidx );
}
+ template<size_type bkidx>
+ Telem_ const& peek() const
+ {
+ return *( ptr_ - bkidx );
+ }
+
void pop_back()
{
- last = *(--ptr_);
+ --ptr_;
}
private:
Telem_ elems_[ maxdepth_ + 1 ];
Telem_* ptr_;
- Telem_ last;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-11-05 10:48:27
|
Revision: 3869
http://ecell.svn.sourceforge.net/ecell/?rev=3869&view=rev
Author: moriyoshi
Date: 2010-11-05 10:48:20 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
* Fix test case.
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/tests/ExpressionCompiler_test.cpp
Modified: ecell3/trunk/ecell/libecs/tests/ExpressionCompiler_test.cpp
===================================================================
--- ecell3/trunk/ecell/libecs/tests/ExpressionCompiler_test.cpp 2010-09-27 07:46:09 UTC (rev 3868)
+++ ecell3/trunk/ecell/libecs/tests/ExpressionCompiler_test.cpp 2010-11-05 10:48:20 UTC (rev 3869)
@@ -394,7 +394,7 @@
CHECK_INSTRUCTION( pc, scripting::LOAD_REAL, &aPropertyAccess.a );
CHECK_INSTRUCTION( pc, scripting::ADD, scripting::NoOperand() );
CHECK_INSTRUCTION( pc, scripting::OBJECT_METHOD_REAL, (
- scripting::RealObjectMethodProxy::create<
+ scripting::RealObjectMethodProxy::createConst<
Variable, &Variable::getValue >( 0 ) ) );
CHECK_INSTRUCTION( pc, scripting::ADD, scripting::NoOperand() );
CHECK_INSTRUCTION( pc, scripting::RET, scripting::NoOperand() );
@@ -410,4 +410,83 @@
}
}
+BOOST_AUTO_TEST_CASE(testFunctionCall)
+{
+ class ErrorReporter: public scripting::ErrorReporter {
+ public:
+ ErrorReporter() {}
+ virtual void error( const String& type, const String& msg ) const {
+ throw type;
+ }
+ } anErrorReporter;
+
+ class PropertyAccess: public scripting::PropertyAccess {
+ public:
+ PropertyAccess()
+ : a(0), b(0), c(0)
+ {
+ }
+
+ virtual Real* get( const String& name ) {
+ if (name == "a") {
+ return &a;
+ } else if (name == "b") {
+ return &b;
+ } else if (name == "c") {
+ return &c;
+ }
+ return 0;
+ }
+ public:
+ Real a, b, c;
+ } aPropertyAccess;
+
+ class VariableReferenceResolver: public scripting::VariableReferenceResolver {
+ public:
+ virtual const VariableReference* get(
+ const String& name ) const
+ {
+ if (name == "A") {
+ return &a;
+ } else if (name == "B") {
+ return &b;
+ } else if (name == "C") {
+ return &c;
+ }
+ return 0;
+ }
+ public:
+ VariableReference a, b, c;
+ } aVarRefResolver;
+
+
+ class EntityResolver: public scripting::EntityResolver {
+ public:
+ virtual Entity* get( const String& name )
+ {
+ return 0;
+ }
+ } anEntityResolver;
+
+ scripting::ExpressionCompiler ec(
+ anErrorReporter, aPropertyAccess,
+ anEntityResolver, aVarRefResolver );
+
+ {
+ std::auto_ptr<const scripting::Code> code(
+ ec.compileExpression("sqrt( A.Value ) + 1.0") );
+
+ const unsigned char* pc = code->data();
+ const unsigned char* eoc = &*code->end();
+ CHECK_INSTRUCTION( pc, scripting::OBJECT_METHOD_REAL, (
+ scripting::RealObjectMethodProxy::createConst<
+ Variable, &Variable::getValue >( 0 ) ) );
+ CHECK_INSTRUCTION( pc, scripting::CALL_FUNC1,
+ static_cast< double(*)( double ) >( &std::sqrt ) );
+ CHECK_INSTRUCTION( pc, scripting::PUSH_REAL, 1 );
+ CHECK_INSTRUCTION( pc, scripting::ADD, scripting::NoOperand() );
+ CHECK_INSTRUCTION( pc, scripting::RET, scripting::NoOperand() );
+ BOOST_CHECK_EQUAL(eoc, pc);
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-27 07:46:15
|
Revision: 3868
http://ecell.svn.sourceforge.net/ecell/?rev=3868&view=rev
Author: moriyoshi
Date: 2010-09-27 07:46:09 +0000 (Mon, 27 Sep 2010)
Log Message:
-----------
* Fix install rule so it fits to docbook to html converters that generate
nested directories under the output directory.
Modified Paths:
--------------
ecell3/trunk/doc/users-manual/Makefile.am
Modified: ecell3/trunk/doc/users-manual/Makefile.am
===================================================================
--- ecell3/trunk/doc/users-manual/Makefile.am 2010-09-22 17:06:13 UTC (rev 3867)
+++ ecell3/trunk/doc/users-manual/Makefile.am 2010-09-27 07:46:09 UTC (rev 3868)
@@ -3,9 +3,6 @@
DOC_pdf = users-manual.pdf
DOC_dvi = users-manual.dvi
-_htmldir = $(htmldir)/$(DOC_html)
-_html_DATA = $(DOC_html)/*
-
if BUILD_USERS_MANUAL_html
$(DOC_html)/*: users-manual.xml
$(DB2HTML) -o $(DOC_html) $<
@@ -56,6 +53,20 @@
EXTRA_DIST += $(DOC_html)
endif
+if BUILD_USERS_MANUAL_html
+install-data-local:
+ (cd "$(DOC_html)" && \
+ find . -type d | while read path; do $(INSTALL) -d "$(DESTDIR)$(htmldir)/$(DOC_html)/$$path"; done && \
+ find . -type f | while read path; do $(INSTALL) -m 644 $$path "$(DESTDIR)$(htmldir)/$(DOC_html)/$$path"; done)
+
+uninstall-local:
+ ( cd "$(DESTDIR)$(htmldir)" && rm -rf "$(DOC_html)" )
+else
+install-data-local:
+
+uninstall-local:
+endif
+
clean-local:
$(RM) -f $(DOC_ps) $(DOC_pdf) $(DOC_dvi)
$(RM) -rf *.junk *.tex
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-22 17:06:19
|
Revision: 3867
http://ecell.svn.sourceforge.net/ecell/?rev=3867&view=rev
Author: moriyoshi
Date: 2010-09-22 17:06:13 +0000 (Wed, 22 Sep 2010)
Log Message:
-----------
* Give a go for .2.1.
Modified Paths:
--------------
ecell3/trunk/NEWS
Modified: ecell3/trunk/NEWS
===================================================================
--- ecell3/trunk/NEWS 2010-09-22 17:05:28 UTC (rev 3866)
+++ ecell3/trunk/NEWS 2010-09-22 17:06:13 UTC (rev 3867)
@@ -1,4 +1,4 @@
-ecell-3.2.1: ?-Jul-2010
+ecell-3.2.1: 23-Sep-2010
* Fix segmentation fault in PythonProcess and PythonFluxProcess.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-22 17:05:38
|
Revision: 3866
http://ecell.svn.sourceforge.net/ecell/?rev=3866&view=rev
Author: moriyoshi
Date: 2010-09-22 17:05:28 +0000 (Wed, 22 Sep 2010)
Log Message:
-----------
* Workaround for the bug in GCC 4.4
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/MethodProxy.hpp
Modified: ecell3/trunk/ecell/libecs/MethodProxy.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/MethodProxy.hpp 2010-09-22 13:43:35 UTC (rev 3865)
+++ ecell3/trunk/ecell/libecs/MethodProxy.hpp 2010-09-22 17:05:28 UTC (rev 3866)
@@ -65,7 +65,7 @@
template< RET (CLASS::*METHOD)() const >
static MethodProxy createConst()
{
- return MethodProxy( reinterpret_cast< Invoker >( &invokeConst<METHOD> ) );
+ return MethodProxy( &invokeConst<METHOD> );
}
inline bool operator==( MethodProxy const& that ) const
@@ -93,7 +93,7 @@
}
template< RET (CLASS::*METHOD)() const >
- inline static RET invokeConst( CLASS const* anObject )
+ inline static RET invokeConst( CLASS* anObject )
{
return ( anObject->*METHOD )();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-22 13:43:41
|
Revision: 3865
http://ecell.svn.sourceforge.net/ecell/?rev=3865&view=rev
Author: moriyoshi
Date: 2010-09-22 13:43:35 +0000 (Wed, 22 Sep 2010)
Log Message:
-----------
* Update.
Modified Paths:
--------------
ecell-build/trunk/pkg/rpm/ecell-3.2.1-ply-2.3-compat.patch
ecell-build/trunk/pkg/rpm/ecell3.spec
Modified: ecell-build/trunk/pkg/rpm/ecell-3.2.1-ply-2.3-compat.patch
===================================================================
--- ecell-build/trunk/pkg/rpm/ecell-3.2.1-ply-2.3-compat.patch 2010-09-17 04:54:53 UTC (rev 3864)
+++ ecell-build/trunk/pkg/rpm/ecell-3.2.1-ply-2.3-compat.patch 2010-09-22 13:43:35 UTC (rev 3865)
@@ -8,7 +8,7 @@
- lex.lex( lextab=lextabmod[-1], optimize=1, outputdir=os.path.join( outputdir,*lextabmod[:-1] ) )
- yacc.yacc( tabmodule=parsertabmod[-1], outputdir=os.path.join( outputdir, *parsertabmod[:-1] ) )
+ lex.lex( lextab=lextabmod[-1], optimize=1 )
-+ os.rename( lextabmod[-1] + ".py", os.path.join( outputdir, *lextabmod ) )
++ os.rename( lextabmod[-1] + ".py", os.path.join( outputdir, *lextabmod ) + ".py" )
+ yacc.yacc( tabmodule=parsertabmod[-1], optimize=1, outputdir=os.path.join( outputdir, *parsertabmod[:-1] ) )
def convertEm2Eml( anEmFileObject, debug=0 ):
@@ -23,7 +23,7 @@
- lex.lex( lextab=lextabmod[-1], optimize=1, outputdir=os.path.join( outputdir,*lextabmod[:-1] ) )
- yacc.yacc( tabmodule=parsertabmod[-1], outputdir=os.path.join( outputdir, *parsertabmod[:-1] ) )
+ lex.lex( lextab=lextabmod[-1], optimize=1 )
-+ os.rename( lextabmod[-1] + ".py", os.path.join( outputdir, *lextabmod ) )
++ os.rename( lextabmod[-1] + ".py", os.path.join( outputdir, *lextabmod ) + ".py" )
+ yacc.yacc( tabmodule=parsertabmod[-1], optimize=1, outputdir=os.path.join( outputdir, *parsertabmod[:-1] ) )
Modified: ecell-build/trunk/pkg/rpm/ecell3.spec
===================================================================
--- ecell-build/trunk/pkg/rpm/ecell3.spec 2010-09-17 04:54:53 UTC (rev 3864)
+++ ecell-build/trunk/pkg/rpm/ecell3.spec 2010-09-22 13:43:35 UTC (rev 3865)
@@ -20,6 +20,7 @@
Requires: python-ply >= 2.3
Requires: glibc
BuildRequires: make
+BuildRequires: numpy >= 1.0.3
BuildRequires: python-devel
BuildRequires: pygtk2 >= 2.4
BuildRequires: python-ply >= 2.3
@@ -112,12 +113,13 @@
infodir=%{_infodir} \
docdir=%{_datadir}/doc/ecell3 \
install
-rm -rf ${RPM_BUILD_ROOT}/usr/lib/python*
+# rm -rf ${RPM_BUILD_ROOT}/usr/lib/python*
mv ${RPM_BUILD_ROOT}%{_datadir}/doc/ecell3/users-manual .
mv ${RPM_BUILD_ROOT}%{_datadir}/doc/ecell3/api .
mv ${RPM_BUILD_ROOT}%{_datadir}/doc/ecell3/model-editor .
mv ${RPM_BUILD_ROOT}%{_datadir}/doc/ecell3/samples .
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/doc/ecell3
+find ${RPM_BUILD_ROOT}%{_libdir} -name "*.out" -a -type f | xargs rm -f
%clean
rm -rf ${RPM_BUILD_ROOT}
@@ -135,10 +137,13 @@
%{_libdir}/libecs.so.*
%{_libdir}/libemc.so.*
%{_libdir}/ecell-3.2/dms
-%{_libdir}/python*
-%ifarch x86_64 ppc64 sparc64
-%{python_sitelib}/*
-%endif
+%{_libdir}/python*/site-packages/ecell/*.so
+%{_libdir}/python*/site-packages/ecell/*.py
+%{_libdir}/python*/site-packages/ecell/*.pyc
+%{_libdir}/python*/site-packages/ecell/analysis
+%{_libdir}/python*/site-packages/ecell/session_manager
+%{python_sitelib}/ecell/ui/__init__.py
+%{python_sitelib}/ecell/ui/__init__.pyc
%files devel
%defattr(-,root,root)
@@ -160,6 +165,7 @@
%{_bindir}/ecell3-session-monitor
%{_libdir}/ecell-3.2/session-monitor
%{_datadir}/ecell-3.2/session-monitor
+%{python_sitelib}/ecell/ui/osogo
%files model-editor
%defattr(-,root,root)
@@ -168,6 +174,7 @@
%{_bindir}/ecell3-model-editor
%{_libdir}/ecell-3.2/model-editor
%{_datadir}/ecell-3.2/model-editor
+%{python_sitelib}/ecell/ui/model_editor
%changelog
* Wed Jun 30 2010 Moriyoshi Koizumi <mo...@ri...>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-09-17 04:55:00
|
Revision: 3864
http://ecell.svn.sourceforge.net/ecell/?rev=3864&view=rev
Author: kaizu
Date: 2010-09-17 04:54:53 +0000 (Fri, 17 Sep 2010)
Log Message:
-----------
os.chdir was removed
Modified Paths:
--------------
ecell3/trunk/ecell/pyecell/ecell/analysis/emlsupport.py
Modified: ecell3/trunk/ecell/pyecell/ecell/analysis/emlsupport.py
===================================================================
--- ecell3/trunk/ecell/pyecell/ecell/analysis/emlsupport.py 2010-09-14 10:14:39 UTC (rev 3863)
+++ ecell3/trunk/ecell/pyecell/ecell/analysis/emlsupport.py 2010-09-17 04:54:53 UTC (rev 3864)
@@ -131,7 +131,6 @@
if type( fileName ) == str:
self.__theEmlFileName = os.path.abspath( fileName )
- os.chdir( os.path.dirname( self.getEmlFileName() ) )
else:
raise TypeError, ' The type of fileName must be string (file name) '
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-14 10:14:45
|
Revision: 3863
http://ecell.svn.sourceforge.net/ecell/?rev=3863&view=rev
Author: moriyoshi
Date: 2010-09-14 10:14:39 +0000 (Tue, 14 Sep 2010)
Log Message:
-----------
* Fix weird bug caused by gcc's wrong function resolution.
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/MethodProxy.hpp
Modified: ecell3/trunk/ecell/libecs/MethodProxy.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/MethodProxy.hpp 2010-09-14 10:13:42 UTC (rev 3862)
+++ ecell3/trunk/ecell/libecs/MethodProxy.hpp 2010-09-14 10:14:39 UTC (rev 3863)
@@ -43,7 +43,7 @@
class MethodProxy<CLASS, RET>
{
private:
- typedef RET (* Invoker )( CLASS* );
+ typedef RET ( *Invoker )( CLASS* );
public:
RET operator()( CLASS* anObject ) const
@@ -110,7 +110,7 @@
class ObjectMethodProxy<RET>
{
private:
- typedef RET (* Invoker )( void* );
+ typedef RET ( *Invoker )( void* );
public:
RET operator()() const
@@ -121,13 +121,13 @@
template < typename T, RET (T::*TMethod)() >
static ObjectMethodProxy create( T* anObject )
{
- return ObjectMethodProxy( reinterpret_cast< Invoker >( &invoke< T, TMethod > ), anObject );
+ return ObjectMethodProxy( &invoke< T, TMethod >, anObject );
}
template < typename T, RET (T::*TMethod)() const >
static ObjectMethodProxy createConst( T const* anObject )
{
- return ObjectMethodProxy( reinterpret_cast< Invoker >( &invokeConst< T, TMethod > ), const_cast< T* >( anObject ) );
+ return ObjectMethodProxy( &invokeConst< T, TMethod >, const_cast< T* >( anObject ) );
}
inline bool operator==( ObjectMethodProxy const& that ) const
@@ -151,15 +151,15 @@
}
template < class T, RET (T::*TMethod)() >
- static RET invoke( T* anObject )
+ static RET invoke( void* anObject )
{
- return ( anObject->*TMethod )();
+ return ( reinterpret_cast< T* >( anObject )->*TMethod )();
}
template < class T, RET (T::*TMethod)() const >
- static RET invokeConst( T const* anObject )
+ static RET invokeConst( void* anObject )
{
- return ( anObject->*TMethod )();
+ return ( reinterpret_cast< T const* >( anObject )->*TMethod )();
}
private:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-14 10:13:48
|
Revision: 3862
http://ecell.svn.sourceforge.net/ecell/?rev=3862&view=rev
Author: moriyoshi
Date: 2010-09-14 10:13:42 +0000 (Tue, 14 Sep 2010)
Log Message:
-----------
* Remove redundant typename ;)
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/System.hpp
Modified: ecell3/trunk/ecell/libecs/System.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/System.hpp 2010-09-09 02:47:22 UTC (rev 3861)
+++ ecell3/trunk/ecell/libecs/System.hpp 2010-09-14 10:13:42 UTC (rev 3862)
@@ -295,19 +295,19 @@
template <>
-inline typename System::Variables System::getEntities< Variable >() const
+inline System::Variables System::getEntities< Variable >() const
{
return getVariables();
}
template <>
-inline typename System::Processes System::getEntities< Process >() const
+inline System::Processes System::getEntities< Process >() const
{
return getProcesses();
}
template <>
-inline typename System::Systems System::getEntities< System >() const
+inline System::Systems System::getEntities< System >() const
{
return getSystems();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-09 02:47:28
|
Revision: 3861
http://ecell.svn.sourceforge.net/ecell/?rev=3861&view=rev
Author: moriyoshi
Date: 2010-09-09 02:47:22 +0000 (Thu, 09 Sep 2010)
Log Message:
-----------
* Add missing DM_IF
Modified Paths:
--------------
ecell3/trunk/ecell/dm/ESSYNSProcessInterface.hpp
ecell3/trunk/ecell/dm/GillespieProcessInterface.hpp
Modified: ecell3/trunk/ecell/dm/ESSYNSProcessInterface.hpp
===================================================================
--- ecell3/trunk/ecell/dm/ESSYNSProcessInterface.hpp 2010-09-09 02:46:22 UTC (rev 3860)
+++ ecell3/trunk/ecell/dm/ESSYNSProcessInterface.hpp 2010-09-09 02:47:22 UTC (rev 3861)
@@ -31,7 +31,7 @@
#include <libecs/libecs.hpp>
-struct ESSYNSProcessInterface
+struct DM_IF ESSYNSProcessInterface
{
virtual const boost::multi_array< libecs::Real, 2 >& getESSYNSMatrix() = 0;
Modified: ecell3/trunk/ecell/dm/GillespieProcessInterface.hpp
===================================================================
--- ecell3/trunk/ecell/dm/GillespieProcessInterface.hpp 2010-09-09 02:46:22 UTC (rev 3860)
+++ ecell3/trunk/ecell/dm/GillespieProcessInterface.hpp 2010-09-09 02:47:22 UTC (rev 3861)
@@ -30,7 +30,7 @@
#include <libecs/libecs.hpp>
-struct GillespieProcessInterface
+struct DM_IF GillespieProcessInterface
{
virtual GET_METHOD( libecs::Real, Propensity ) = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-09 02:46:28
|
Revision: 3860
http://ecell.svn.sourceforge.net/ecell/?rev=3860&view=rev
Author: moriyoshi
Date: 2010-09-09 02:46:22 +0000 (Thu, 09 Sep 2010)
Log Message:
-----------
* MSVC fix.
Modified Paths:
--------------
ecell3/trunk/ecell/dm/GillespieProcess.cpp
Modified: ecell3/trunk/ecell/dm/GillespieProcess.cpp
===================================================================
--- ecell3/trunk/ecell/dm/GillespieProcess.cpp 2010-09-09 02:45:46 UTC (rev 3859)
+++ ecell3/trunk/ecell/dm/GillespieProcess.cpp 2010-09-09 02:46:22 UTC (rev 3860)
@@ -33,10 +33,10 @@
: theOrder( 0 ),
c( 0.0 ),
theGetPropensityMethodPtr(
- RealMethodProxy::create<
+ RealMethodProxy::createConst<
&GillespieProcess::getZero>() ),
theGetMinValueMethodPtr(
- RealMethodProxy::create<
+ RealMethodProxy::createConst<
&GillespieProcess::getZero>() ),
theGetPDMethodPtr( &GillespieProcess::getPD_Zero )
{
@@ -310,35 +310,35 @@
if( theOrder == 0 ) // no substrate
{
theGetPropensityMethodPtr =
- RealMethodProxy::create<&GillespieProcess::getZero>();
+ RealMethodProxy::createConst<&GillespieProcess::getZero>();
theGetMinValueMethodPtr =
- RealMethodProxy::create<&GillespieProcess::getZero>();
+ RealMethodProxy::createConst<&GillespieProcess::getZero>();
theGetPDMethodPtr = &GillespieProcess::getPD_Zero;
}
else if( theOrder == 1 ) // one substrate, first order.
{
theGetPropensityMethodPtr =
- RealMethodProxy::create<&GillespieProcess::getPropensity_FirstOrder>();
+ RealMethodProxy::createConst<&GillespieProcess::getPropensity_FirstOrder>();
theGetMinValueMethodPtr =
- RealMethodProxy::create<&GillespieProcess::getMinValue_FirstOrder>();
+ RealMethodProxy::createConst<&GillespieProcess::getMinValue_FirstOrder>();
theGetPDMethodPtr = &GillespieProcess::getPD_FirstOrder;
}
else if( theOrder == 2 )
{
if( getZeroVariableReferenceOffset() == 2 ) // 2 substrates, 2nd order
{
- theGetPropensityMethodPtr = RealMethodProxy::create<
+ theGetPropensityMethodPtr = RealMethodProxy::createConst<
&GillespieProcess::getPropensity_SecondOrder_TwoSubstrates > ();
- theGetMinValueMethodPtr = RealMethodProxy::create<
+ theGetMinValueMethodPtr = RealMethodProxy::createConst<
&GillespieProcess::getMinValue_SecondOrder_TwoSubstrates >();
theGetPDMethodPtr =
&GillespieProcess::getPD_SecondOrder_TwoSubstrates;
}
else // one substrate, second order (coeff == -2)
{
- theGetPropensityMethodPtr = RealMethodProxy::create<
+ theGetPropensityMethodPtr = RealMethodProxy::createConst<
&GillespieProcess::getPropensity_SecondOrder_OneSubstrate>();
- theGetMinValueMethodPtr = RealMethodProxy::create<
+ theGetMinValueMethodPtr = RealMethodProxy::createConst<
&GillespieProcess::getMinValue_SecondOrder_OneSubstrate>();
theGetPDMethodPtr =
&GillespieProcess::getPD_SecondOrder_OneSubstrate;
@@ -347,9 +347,9 @@
else
{
//FIXME: generic functions should come here.
- theGetPropensityMethodPtr = RealMethodProxy::create<
+ theGetPropensityMethodPtr = RealMethodProxy::createConst<
&GillespieProcess::getZero>();
- theGetPropensityMethodPtr = RealMethodProxy::create<
+ theGetPropensityMethodPtr = RealMethodProxy::createConst<
&GillespieProcess::getZero>();
theGetPDMethodPtr = &GillespieProcess::getPD_Zero;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-09 02:45:52
|
Revision: 3859
http://ecell.svn.sourceforge.net/ecell/?rev=3859&view=rev
Author: moriyoshi
Date: 2010-09-09 02:45:46 +0000 (Thu, 09 Sep 2010)
Log Message:
-----------
* More MSVC fixes...
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/MethodProxy.hpp
Modified: ecell3/trunk/ecell/libecs/MethodProxy.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/MethodProxy.hpp 2010-09-09 02:44:56 UTC (rev 3858)
+++ ecell3/trunk/ecell/libecs/MethodProxy.hpp 2010-09-09 02:45:46 UTC (rev 3859)
@@ -63,9 +63,9 @@
}
template< RET (CLASS::*METHOD)() const >
- static MethodProxy create()
+ static MethodProxy createConst()
{
- return MethodProxy( &invoke<METHOD> );
+ return MethodProxy( reinterpret_cast< Invoker >( &invokeConst<METHOD> ) );
}
inline bool operator==( MethodProxy const& that ) const
@@ -93,7 +93,7 @@
}
template< RET (CLASS::*METHOD)() const >
- inline static RET invoke( CLASS* anObject )
+ inline static RET invokeConst( CLASS const* anObject )
{
return ( anObject->*METHOD )();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-09 02:45:02
|
Revision: 3858
http://ecell.svn.sourceforge.net/ecell/?rev=3858&view=rev
Author: moriyoshi
Date: 2010-09-09 02:44:56 +0000 (Thu, 09 Sep 2010)
Log Message:
-----------
* Remove unwanted consts.
Modified Paths:
--------------
ecell3/trunk/ecell/libemc/SimulatorImplementation.hpp
Modified: ecell3/trunk/ecell/libemc/SimulatorImplementation.hpp
===================================================================
--- ecell3/trunk/ecell/libemc/SimulatorImplementation.hpp 2010-09-08 13:39:18 UTC (rev 3857)
+++ ecell3/trunk/ecell/libemc/SimulatorImplementation.hpp 2010-09-09 02:44:56 UTC (rev 3858)
@@ -169,13 +169,13 @@
virtual libecs::Polymorph getNextEvent() const = 0;
- virtual void step( const libecs::Integer aNumSteps ) = 0;
+ virtual void step( libecs::Integer aNumSteps ) = 0;
virtual libecs::Real getCurrentTime() const = 0;
virtual void run() = 0;
- virtual void run( const libecs::Real aDuration ) = 0;
+ virtual void run( libecs::Real aDuration ) = 0;
virtual void stop() = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-08 13:39:24
|
Revision: 3857
http://ecell.svn.sourceforge.net/ecell/?rev=3857&view=rev
Author: moriyoshi
Date: 2010-09-08 13:39:18 +0000 (Wed, 08 Sep 2010)
Log Message:
-----------
* Remove usage of DECLARE_MAP()
* Add missing typenames to dependent names.
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/System.hpp
Modified: ecell3/trunk/ecell/libecs/System.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/System.hpp 2010-09-08 13:38:16 UTC (rev 3856)
+++ ecell3/trunk/ecell/libecs/System.hpp 2010-09-08 13:39:18 UTC (rev 3857)
@@ -48,9 +48,9 @@
{
public:
// Maps used for entry lists
- typedef std::map<String, Variable*, std::less<String> > VariableMap;
- typedef std::map<String, Process*, std::less<String> > ProcessMap;
- typedef std::map<String, System*, std::less<String> > SystemMap;
+ typedef std::map< String, Variable*, std::less< String > > VariableMap;
+ typedef std::map< String, Process*, std::less< String > > ProcessMap;
+ typedef std::map< String, System*, std::less< String > > SystemMap;
typedef boost::iterator_range< VariableMap::iterator > Variables;
typedef boost::iterator_range< ProcessMap::iterator > Processes;
@@ -121,7 +121,7 @@
}
template <class T_>
- boost::iterator_range< typename std::map< const String, T_*, std::less<const String> >::iterator > getEntities() const;
+ boost::iterator_range< typename std::map< String, T_*, std::less< String > >::iterator > getEntities() const;
Variables getVariables() const
{
@@ -295,19 +295,19 @@
template <>
-inline System::Variables System::getEntities< Variable >() const
+inline typename System::Variables System::getEntities< Variable >() const
{
return getVariables();
}
template <>
-inline System::Processes System::getEntities< Process >() const
+inline typename System::Processes System::getEntities< Process >() const
{
return getProcesses();
}
template <>
-inline System::Systems System::getEntities< System >() const
+inline typename System::Systems System::getEntities< System >() const
{
return getSystems();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-08 13:38:25
|
Revision: 3856
http://ecell.svn.sourceforge.net/ecell/?rev=3856&view=rev
Author: moriyoshi
Date: 2010-09-08 13:38:16 +0000 (Wed, 08 Sep 2010)
Log Message:
-----------
* MSVC cannot gracefully handle template overloaded functions with a function pointer as its template argument.
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/MethodProxy.hpp
ecell3/trunk/ecell/libecs/scripting/Assembler.cpp
Modified: ecell3/trunk/ecell/libecs/MethodProxy.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/MethodProxy.hpp 2010-09-08 10:47:26 UTC (rev 3855)
+++ ecell3/trunk/ecell/libecs/MethodProxy.hpp 2010-09-08 13:38:16 UTC (rev 3856)
@@ -118,19 +118,19 @@
return theInvoker( theObject );
}
- template < class T, RET (T::*TMethod)() >
+ template < typename T, RET (T::*TMethod)() >
static ObjectMethodProxy create( T* anObject )
{
- return ObjectMethodProxy( &invoke<T,TMethod>, anObject );
+ return ObjectMethodProxy( reinterpret_cast< Invoker >( &invoke< T, TMethod > ), anObject );
}
- template < class T, RET (T::*TMethod)() const >
- static ObjectMethodProxy create( T* anObject )
+ template < typename T, RET (T::*TMethod)() const >
+ static ObjectMethodProxy createConst( T const* anObject )
{
- return ObjectMethodProxy( &invoke<T,TMethod>, anObject );
+ return ObjectMethodProxy( reinterpret_cast< Invoker >( &invokeConst< T, TMethod > ), const_cast< T* >( anObject ) );
}
- inline bool operator==( ObjectMethodProxy const& that ) const
+ inline bool operator==( ObjectMethodProxy const& that ) const
{
return that.theInvoker == theInvoker;
}
@@ -151,15 +151,15 @@
}
template < class T, RET (T::*TMethod)() >
- static RET invoke( void* anObject )
+ static RET invoke( T* anObject )
{
- return ( static_cast<T*>(anObject)->*TMethod )();
+ return ( anObject->*TMethod )();
}
template < class T, RET (T::*TMethod)() const >
- static RET invoke( void* anObject )
+ static RET invokeConst( T const* anObject )
{
- return ( static_cast<T const*>(anObject)->*TMethod )();
+ return ( anObject->*TMethod )();
}
private:
Modified: ecell3/trunk/ecell/libecs/scripting/Assembler.cpp
===================================================================
--- ecell3/trunk/ecell/libecs/scripting/Assembler.cpp 2010-09-08 10:47:26 UTC (rev 3855)
+++ ecell3/trunk/ecell/libecs/scripting/Assembler.cpp 2010-09-08 13:38:16 UTC (rev 3856)
@@ -41,14 +41,14 @@
appendInstruction\
( Instruction<OBJECT_METHOD_REAL>\
( RealObjectMethodProxy::\
- create< CLASSNAME, & CLASSNAME::METHODNAME >\
+ createConst< CLASSNAME, & CLASSNAME::METHODNAME >\
( OBJECT ) ) ) // \
#define APPEND_OBJECT_METHOD_INTEGER( OBJECT, CLASSNAME, METHODNAME )\
appendInstruction\
( Instruction<OBJECT_METHOD_INTEGER>\
( IntegerObjectMethodProxy::\
- create< CLASSNAME, & CLASSNAME::METHODNAME >\
+ createConst< CLASSNAME, & CLASSNAME::METHODNAME >\
( OBJECT ) ) ) // \
void
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-08 10:47:32
|
Revision: 3855
http://ecell.svn.sourceforge.net/ecell/?rev=3855&view=rev
Author: moriyoshi
Date: 2010-09-08 10:47:26 +0000 (Wed, 08 Sep 2010)
Log Message:
-----------
* Fix Stepper so that setStepInterval() can be overridden in the subclass.
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/DifferentialStepper.cpp
ecell3/trunk/ecell/libecs/DifferentialStepper.hpp
ecell3/trunk/ecell/libecs/Stepper.cpp
ecell3/trunk/ecell/libecs/Stepper.hpp
Modified: ecell3/trunk/ecell/libecs/DifferentialStepper.cpp
===================================================================
--- ecell3/trunk/ecell/libecs/DifferentialStepper.cpp 2010-09-08 08:56:43 UTC (rev 3854)
+++ ecell3/trunk/ecell/libecs/DifferentialStepper.cpp 2010-09-08 10:47:26 UTC (rev 3855)
@@ -407,5 +407,11 @@
return new DifferentialStepper::Interpolant( aVariable, this );
}
+SET_METHOD_DEF( Real, StepInterval, DifferentialStepper )
+{
+ Stepper::setStepInterval( value );
+ setTolerableStepInterval( value );
+ setNextStepInterval( value );
+}
} // namespace libecs
Modified: ecell3/trunk/ecell/libecs/DifferentialStepper.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/DifferentialStepper.hpp 2010-09-08 08:56:43 UTC (rev 3854)
+++ ecell3/trunk/ecell/libecs/DifferentialStepper.hpp 2010-09-08 10:47:26 UTC (rev 3855)
@@ -36,6 +36,7 @@
#include "libecs/Stepper.hpp"
#include <boost/multi_array.hpp>
+#include <iostream>
namespace libecs
{
@@ -114,12 +115,7 @@
return theTolerableStepInterval;
}
- virtual void setStepInterval( Real aStepInterval )
- {
- Stepper::setStepInterval( aStepInterval );
- setTolerableStepInterval( aStepInterval );
- setNextStepInterval( aStepInterval );
- }
+ virtual SET_METHOD( Real, StepInterval );
void resetAll();
Modified: ecell3/trunk/ecell/libecs/Stepper.cpp
===================================================================
--- ecell3/trunk/ecell/libecs/Stepper.cpp 2010-09-08 08:56:43 UTC (rev 3854)
+++ ecell3/trunk/ecell/libecs/Stepper.cpp 2010-09-08 10:47:26 UTC (rev 3855)
@@ -572,6 +572,10 @@
}
}
+SET_METHOD_DEF( Real, StepInterval, Stepper )
+{
+ setNextTime( getCurrentTime() + value );
+}
SET_METHOD_DEF( String, RngSeed, Stepper )
{
Modified: ecell3/trunk/ecell/libecs/Stepper.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/Stepper.hpp 2010-09-08 08:56:43 UTC (rev 3854)
+++ ecell3/trunk/ecell/libecs/Stepper.hpp 2010-09-08 10:47:26 UTC (rev 3855)
@@ -146,7 +146,7 @@
@return the step interval of this Stepper
*/
- virtual GET_METHOD( Real, StepInterval )
+ GET_METHOD( Real, StepInterval )
{
const Real aNextTime( getNextTime() );
const Real aCurrentTime( getCurrentTime() );
@@ -157,10 +157,7 @@
return aNextTime - aCurrentTime;
}
- SET_METHOD( Real, StepInterval )
- {
- setNextTime( getCurrentTime() + value );
- }
+ virtual SET_METHOD( Real, StepInterval );
/**
This may be overridden in dynamically scheduled steppers.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-09-08 08:56:50
|
Revision: 3854
http://ecell.svn.sourceforge.net/ecell/?rev=3854&view=rev
Author: moriyoshi
Date: 2010-09-08 08:56:43 +0000 (Wed, 08 Sep 2010)
Log Message:
-----------
* Change Stepper wrapper so any non-predefined property can be assigned to.
* Throw AttributeError instead of RuntimeError when the property access fails.
Modified Paths:
--------------
ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp
Modified: ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp
===================================================================
--- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2010-08-30 11:46:06 UTC (rev 3853)
+++ ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2010-09-08 08:56:43 UTC (rev 3854)
@@ -2688,7 +2688,9 @@
return py::object( VariableReferences( self ) );
}
-static Polymorph Entity___getattr__( Entity* self, std::string key )
+template< typename TecsObject_ >
+static Polymorph EcsObject___getattr__( TecsObject_* self, std::string key )
+try
{
if ( key == "__members__" || key == "__methods__" )
{
@@ -2698,26 +2700,39 @@
return self->getProperty( key );
}
+catch ( NoSlot const& anException )
+{
+ PyErr_SetString( PyExc_AttributeError, anException.what() );
+ py::throw_error_already_set();
+ return Polymorph();
+}
-static void Entity___setattr__( py::object aSelf, py::object key, py::object value )
+template< typename TecsObject_ >
+static void EcsObject___setattr__( py::back_reference< TecsObject_* > aSelf, py::object key, py::object value )
+try
{
- py::handle<> aDescr( py::allow_null( PyObject_GetAttr( reinterpret_cast< PyObject* >( aSelf.ptr()->ob_type ), key.ptr() ) ) );
+ py::handle<> aDescr( py::allow_null( PyObject_GetAttr( reinterpret_cast< PyObject* >( aSelf.source().ptr()->ob_type ), key.ptr() ) ) );
if ( !aDescr || !( aDescr->ob_type->tp_flags & Py_TPFLAGS_HAVE_CLASS ) || !aDescr.get()->ob_type->tp_descr_set )
{
PyErr_Clear();
- Entity* self = py::extract< Entity* >( aSelf );
+ EcsObject* self = aSelf.get();
std::string keyStr = py::extract< std::string >( key );
self->setProperty( keyStr, py::extract< Polymorph >( value ) );
}
else
{
- aDescr.get()->ob_type->tp_descr_set( aDescr.get(), aSelf.ptr(), value.ptr() );
+ aDescr.get()->ob_type->tp_descr_set( aDescr.get(), aSelf.source().ptr(), value.ptr() );
if (PyErr_Occurred())
{
py::throw_error_already_set();
}
}
}
+catch ( NoSlot const& anException )
+{
+ PyErr_SetString( PyExc_AttributeError, anException.what() );
+ py::throw_error_already_set();
+}
template< typename T_ >
static PyObject* writeOnly( T_* )
@@ -2926,6 +2941,8 @@
&Stepper::getMinStepInterval,
&Stepper::setMinStepInterval )
.add_property( "RngSeed", &writeOnly<Stepper>, &Stepper::setRngSeed )
+ .def( "__setattr__", &EcsObject___setattr__< Stepper > )
+ .def( "__getattr__", &EcsObject___getattr__< Stepper > )
;
py::class_< Entity, py::bases<>, Entity, boost::noncopyable >
@@ -2937,8 +2954,8 @@
.add_property( "ID", &Entity::getID, &Entity::setID )
.add_property( "FullID", &Entity::getFullID )
.add_property( "Name", &Entity::getName )
- .def( "__setattr__", &Entity___setattr__ )
- .def( "__getattr__", &Entity___getattr__ )
+ .def( "__setattr__", &EcsObject___setattr__< Entity > )
+ .def( "__getattr__", &EcsObject___getattr__< Entity > )
;
py::class_< System, py::bases< Entity >, System, boost::noncopyable>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-08-30 11:46:12
|
Revision: 3853
http://ecell.svn.sourceforge.net/ecell/?rev=3853&view=rev
Author: moriyoshi
Date: 2010-08-30 11:46:06 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
* Do not implicitly chdir to the directory where the session script is placed.
Modified Paths:
--------------
ecell3/trunk/ecell/pyecell/ecell3-session.in
Modified: ecell3/trunk/ecell/pyecell/ecell3-session.in
===================================================================
--- ecell3/trunk/ecell/pyecell/ecell3-session.in 2010-08-30 11:30:15 UTC (rev 3852)
+++ ecell3/trunk/ecell/pyecell/ecell3-session.in 2010-08-30 11:46:06 UTC (rev 3853)
@@ -49,11 +49,8 @@
# Session methods
def loadScript( self, ecs, parameters={} ):
- ( ecsDir, ecsFile ) = os.path.split( ecs )
- if ecsDir != '':
- os.chdir( ecsDir )
aContext = self.__createScriptContext( parameters )
- execfile( ecsFile, aContext )
+ execfile( ecs, aContext )
def interact( self, parameters = {} ):
aContext = self.__createScriptContext( parameters )
@@ -83,6 +80,8 @@
Options:
+ -C : change to the directory where
+ the script (.ess) file is placed.
-e or --exec=[.ess file] : load script (.ess) file
-f or --file=[.eml file] : load model (.eml) file
@@ -115,6 +114,7 @@
# -------------------------------------
anEmlFile = None
anEssFile = None
+ chdirToEssFile = False
anEmlFlag = 0
aParameters = {}
@@ -139,7 +139,7 @@
# -------------------------------------
try:
opts, args = getopt.gnu_getopt(
- sys.argv[ 1: ] , 'he:f:D:',
+ sys.argv[ 1: ] , 'he:f:D:C',
[ "parameters=", "help", "exec=", "file=" ] )
except:
usage()
@@ -171,6 +171,10 @@
sys.exit( -1 )
anEmlFile = anArg
+ # change directory where ESS file is placed.
+ if anOption == "-C":
+ chdirToEssFile = True
+
# set session parameters
if anOption == "-D":
aSplitArgList = anArg.split( '=' )
@@ -226,6 +230,9 @@
aSession.loadModel( anEmlFile )
if anEssFile:
+ if chdirToEssFile:
+ anEssDirectory, anEssFile = os.path.split( anEssFile )
+ os.chdir( anEssDirectory )
aConsole.loadScript( anEssFile, aParameters )
else:
aConsole.interact( aParameters )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-08-30 11:30:23
|
Revision: 3852
http://ecell.svn.sourceforge.net/ecell/?rev=3852&view=rev
Author: moriyoshi
Date: 2010-08-30 11:30:15 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
Fix typo ;)
Modified Paths:
--------------
ecell3/trunk/ecell/pyecell/ecell/session_manager/SessionManager.py
Modified: ecell3/trunk/ecell/pyecell/ecell/session_manager/SessionManager.py
===================================================================
--- ecell3/trunk/ecell/pyecell/ecell/session_manager/SessionManager.py 2010-08-16 05:32:34 UTC (rev 3851)
+++ ecell3/trunk/ecell/pyecell/ecell/session_manager/SessionManager.py 2010-08-30 11:30:15 UTC (rev 3852)
@@ -796,7 +796,7 @@
return int : job id
'''
# creates AbstractSessionProxy
- jva.suob = self.__theSystemProxy.createSessionProxy()
+ job = self.__theSystemProxy.createSessionProxy()
job.setScriptFileName( scriptfile )
job.setInterpreter( interpreter )
if arguments != None:
@@ -853,7 +853,7 @@
self.__theSystemProxy.getSessionProxy( jobid ).clear()
def clearAllSessionProxies( self ):
- for job in self.getSessionProxies():
+ for job in list(self.getSessionProxies()):
job.clear()
def clearRunningSessionProxies( self ):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-08-16 05:32:41
|
Revision: 3851
http://ecell.svn.sourceforge.net/ecell/?rev=3851&view=rev
Author: moriyoshi
Date: 2010-08-16 05:32:34 +0000 (Mon, 16 Aug 2010)
Log Message:
-----------
* DifferentialStepper::setStepInterval() isn't the same as Stepper::setStepInterval().
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/DifferentialStepper.cpp
Modified: ecell3/trunk/ecell/libecs/DifferentialStepper.cpp
===================================================================
--- ecell3/trunk/ecell/libecs/DifferentialStepper.cpp 2010-07-09 11:52:24 UTC (rev 3850)
+++ ecell3/trunk/ecell/libecs/DifferentialStepper.cpp 2010-08-16 05:32:34 UTC (rev 3851)
@@ -277,7 +277,7 @@
void DifferentialStepper::updateInternalState( Real aStepInterval )
{
- setStepInterval( aStepInterval );
+ Stepper::setStepInterval( aStepInterval );
// check if the step interval was changed, by epsilon
if ( std::fabs( getTolerableStepInterval() - aStepInterval )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-07-09 11:52:30
|
Revision: 3850
http://ecell.svn.sourceforge.net/ecell/?rev=3850&view=rev
Author: moriyoshi
Date: 2010-07-09 11:52:24 +0000 (Fri, 09 Jul 2010)
Log Message:
-----------
* Update NEWS.
Modified Paths:
--------------
ecell3/trunk/NEWS
Modified: ecell3/trunk/NEWS
===================================================================
--- ecell3/trunk/NEWS 2010-07-09 11:50:12 UTC (rev 3849)
+++ ecell3/trunk/NEWS 2010-07-09 11:52:24 UTC (rev 3850)
@@ -1,5 +1,7 @@
-ecell-3.2.1: 7-Jul-2010
+ecell-3.2.1: ?-Jul-2010
+ * Fix segmentation fault in PythonProcess and PythonFluxProcess.
+
* Removed DifferentialStepper::initializeStepInterval() in favor of
virtualized Stepper::setStepInterval().
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mor...@us...> - 2010-07-09 11:50:20
|
Revision: 3849
http://ecell.svn.sourceforge.net/ecell/?rev=3849&view=rev
Author: moriyoshi
Date: 2010-07-09 11:50:12 +0000 (Fri, 09 Jul 2010)
Log Message:
-----------
* Fix segmentation fault
Modified Paths:
--------------
ecell3/trunk/ecell/dm/PythonProcessBase.hpp
Modified: ecell3/trunk/ecell/dm/PythonProcessBase.hpp
===================================================================
--- ecell3/trunk/ecell/dm/PythonProcessBase.hpp 2010-07-09 11:49:40 UTC (rev 3848)
+++ ecell3/trunk/ecell/dm/PythonProcessBase.hpp 2010-07-09 11:50:12 UTC (rev 3849)
@@ -67,7 +67,7 @@
}
}
- ~PythonProcessBase()
+ virtual ~PythonProcessBase()
{
// ; do nothing
}
@@ -155,7 +155,7 @@
// extract 'this' Process's methods and attributes
boost::python::object aPySelfProcess(
- boost::python::ptr( reinterpret_cast< libecs::Process* >( this ) ) );
+ boost::python::ptr( dynamic_cast< libecs::Process* const >( this ) ) );
theGlobalNamespace[ "self" ] = aPySelfProcess;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|