示例#1
0
		void testCase11(){
			int arr1[] = { 0, 1, 3, 5, 9 }, arr2[] = { 2, 4, 6, 7, 8 };
			stdL<double> first1(std::begin(arr1), std::end(arr1)), second1(std::begin(arr2), std::end(arr2));
			tsL<double> first2(std::begin(arr1), std::end(arr1)), second2(std::begin(arr2), std::end(arr2));

			first1.merge(second1);
			first2.merge(second2);
			assert(TinySTL::Test::container_equal(first1, first2));
		}
示例#2
0
bool MOGA::dominates( const individual & i1, const individual & i2 ) const
{
	std::vector<double>::const_iterator first1( i1.obj.begin() ),
	                                    first2( i2.obj.begin() ),
	                                    last1( i1.obj.end() );

	bool result = false;
	for ( ; first1 != last1; ++first1, ++first2 )
	{
		if ( *first2 < *first1 ) return false;
		result = result || ( *first1 < *first2 );
	}
	return result;
}