// 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). #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CoinFinite.hpp" #include "CoinFloatEqual.hpp" #include "CoinShallowPackedVector.hpp" #include "CoinPackedVector.hpp" void CoinShallowPackedVectorUnitTest() { CoinRelFltEq eq; int i; // Test default constructor { CoinShallowPackedVector r; assert( r.indices_==NULL ); assert( r.elements_==NULL ); assert( r.nElements_==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 }; { CoinShallowPackedVector r; assert( r.getNumElements()==0 ); // Test setting/getting elements with int* & double* vectors r.setVector( ne, inx, el ); assert( r.getNumElements()==ne ); for ( i=0; i