// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #if defined(_MSC_VER) // Turn off compiler warning about long names # pragma warning(disable:4786) #endif #ifdef NDEBUG #undef NDEBUG // checkClean and checkClear not define #define NO_CHECK_CL #endif #include #include "CoinFinite.hpp" #include "CoinIndexedVector.hpp" #include "CoinShallowPackedVector.hpp" //-------------------------------------------------------------------------- void CoinIndexedVectorUnitTest() { int i; // Test default constructor { CoinIndexedVector r; assert( r.indices_==NULL ); assert( r.elements_==NULL ); assert( r.getNumElements()==0 ); assert( r.capacity_==0); } // Test set and get methods const int ne = 4; int inx[ne] = { 1, 3, 4, 7 }; double el[ne] = { 1.2, 3.4, 5.6, 7.8 }; { CoinIndexedVector r; assert( r.getNumElements()==0 ); // Test setting/getting elements with int* & float* vectors r.setVector( ne, inx, el ); assert( r.getNumElements()==ne ); for ( i=0; i