MOOCHO (Single Doxygen Collection) Version of the Day
DenseLinAlgPack_TestVectorClass.cpp
Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00005 //                  Copyright (2003) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00038 // 
00039 // ***********************************************************************
00040 // @HEADER
00041 
00042 #include <iomanip>
00043 #include <ostream>
00044 #include <vector>
00045 #include <typeinfo>
00046 
00047 #include "DenseLinAlgPack_TestDenseLinAlgPack.hpp"
00048 #include "DenseLinAlgPack_DVectorClass.hpp"
00049 #include "DenseLinAlgPack_DVectorOut.hpp"
00050 #include "DenseLinAlgPack_MatVecCompare.hpp"
00051 #include "TestingHelperPack_update_success.hpp"
00052 
00053 namespace {
00054 
00055 // This template function checks that iterator and subscriping access all
00056 // give the same results.
00057 template<class V, class I>
00058 void test_access( V* _v, I begin, I end, std::ostream*out, bool* success ) {
00059   using std::setw;
00060   using TestingHelperPack::update_success;
00061 
00062   V &v = *_v;
00063   bool result;
00064 
00065   if(out)
00066     *out  << "\nbegin + i == v[i] == v(i+1), for i = 0,1,...,v.dim()\n";
00067 
00068   I itr;
00069   int i;
00070   if(out)
00071     *out  << "\n i,  *(begin + i)  ==  v[i]  ==  v(i+1)  ==    ?  "
00072         << "\n--,  ------------     ------     ------     ------\n";
00073   for( itr = begin, i = 0; itr != end; ++itr, ++i ) {
00074     result = update_success( *itr == v[i] && v[i] == v(i+1), success );
00075     if(out)
00076       *out  << setw(2)  << i << ','
00077           << setw(14) << *itr
00078           << setw(11) << v[i]
00079           << setw(11) << v(i+1)
00080           << setw(11) << std::right << result << std::endl << std::left;
00081   }
00082   if(out) *out << std::endl;
00083 }
00084 
00085 // This template function checks that a subregion creates the expected view.
00086 // Here rng must be rng.full_range() == true.
00087 template<class V, class VS>
00088 void test_subregion_access( V* _v, VS* _vs, const DenseLinAlgPack::Range1D& rng
00089   , std::ostream* out, bool* success )
00090 {
00091   using std::setw;
00092   using TestingHelperPack::update_success;
00093 
00094   bool result;
00095   V &v = *_v;
00096   VS &vs = *_vs;
00097 
00098   if(out)
00099     *out  << "\nv.begin() + i1 == vs.begin() + i2 == vs[i2] == vs(i2+1)"
00100         << ", for i1 = lb-1,..,ub-1, for i2 = 0,..,rng.size()-1\n";
00101 
00102   typename V::const_iterator itr1;
00103   typename VS::const_iterator itr2;
00104   int i1, i2;
00105   if(out)
00106     *out  << "\ni1, i2, *(v.begin() + i1)  ==  *(vs.begin() + i2)  ==  vs[i2]  ==  vs(i2+1)  ==    ?  "
00107         << "\n--, --, -----------------      ------------------      ------      --------      ------\n";
00108   for(  i1 = rng.lbound()-1, itr1 = v.begin() + i1, i2 = 0, itr2 = vs.begin();
00109       i2 < rng.size();
00110       ++i1, ++itr1, ++i2, ++itr2                        )
00111   {
00112     result = update_success( *itr1 == *itr2 && *itr2 == vs[i2] && *itr2 == vs(i2+1), success );
00113     if(out)
00114       *out  << setw(2)  << i1 << ','
00115           << setw(3)  << i2 << ','
00116           << setw(18) << *itr1
00117           << setw(24) << *itr2
00118           << setw(12) << vs[i2]
00119           << setw(14) << vs(i2+1)
00120           << setw(12) << std::right << result << std::endl << std::left;
00121   }
00122   if(out) *out << std::endl;
00123 }
00124 
00125 // Print out a string for overlap
00126 const char* overlap_str( DenseLinAlgPack::EOverLap overlap ) {
00127   switch(overlap) {
00128     case DenseLinAlgPack::NO_OVERLAP:
00129       return "NO_OVERLAP";
00130     case DenseLinAlgPack::SOME_OVERLAP:
00131       return "SOME_OVERLAP";
00132     case DenseLinAlgPack::SAME_MEM:
00133       return "SAME_MEM";
00134   }
00135   return "Invalid value for EOverLap";
00136 }
00137 
00138 } // end namespace
00139 
00140 bool DenseLinAlgPack::TestingPack::TestVectorClass(std::ostream* out)
00141 {
00142   using DenseLinAlgPack::comp;
00143   using DenseLinAlgPack::sqrt_eps;
00144   using TestingHelperPack::update_success;
00145 
00146   bool success = true;
00147   bool result, result1, result2;
00148 
00149   if(out)
00150     *out  << "\n**********************************************"
00151         << "\n*** Testing DVector and DVectorSlice classes ***"
00152         << "\n**********************************************\n"
00153         << std::boolalpha;
00154 
00155   try {
00156 
00157   if(out)
00158     *out  << "\nLet vvz[i-1] = i + 0.1*i, for i = 1...,n\n";
00159 
00160   // std::vector<> which is starndard for comparisons
00161   const DVector::size_type n = 6;
00162   std::vector<DVector::value_type> vvz(6);
00163   {for(int i = 1; i <= n; ++i)
00164     vvz[i-1] = i + 0.1 * i;
00165   }
00166 
00167   if(out) *out << "\nLet alpha1 = 22.5\n";
00168   const value_type alpha1 = 22.5; 
00169 
00170   // ///////////////////////
00171   // Test Constructors
00172 
00173   if(out)
00174     *out  << "\n***\n*** Testing constructors\n***\n";
00175 
00176   // DVectorSlice Constructors
00177 
00178   if(out) *out << "\nVectorSlice vs1\n";
00179   DVectorSlice  vs1;
00180   if(out) *out << "vs1 =\n" << vs1;
00181 
00182   if(out) *out << "\nVectorSlice vs2(vvz.begin(),n)\n";
00183   DVectorSlice  vs2(&vvz[0],n);
00184   if(out) *out << "vs2 =\n" << vs2;
00185 
00186   if(out) *out << "\nVectorSlice vs3(vvz.begin(),n,Range1D())\n";
00187   DVectorSlice  vs3(&vvz[0],n,Range1D());
00188   if(out) *out << "vs3 =\n" << vs3;
00189 
00190   if(out) *out << "\nVectorSlice vs4(vs3,Range1D())\n";
00191   DVectorSlice  vs4(vs3,Range1D());
00192   if(out) *out << "vs4 =\n" << vs4;
00193 
00194   // DVector Constructors
00195 
00196   if(out) *out << "\nVector v1\n";
00197   DVector v1;
00198   if(out) *out << "v1 =\n" << v1;
00199 
00200   if(out) *out << "\nVector v2(alpha1,n)\n";
00201   DVector v2(alpha1,n);
00202   if(out) *out << "v2 =\n" << v2;
00203 
00204   if(out) *out << "\nVector v3(vvz.begin(),n)\n";
00205   DVector v3(&vvz[0],n);
00206   if(out) *out << "v3 =\n" << v3;
00207 
00208   if(out) *out << "\nVector v4(vs4)\n";
00209   DVector v4(vs4);
00210   if(out) *out << "v4 =\n" << v4;
00211 
00212   // //////////////////////////////////////
00213   // Test Binding Views (DVectorSlice)
00214 
00215   if(out)
00216     *out  << "\n***\n*** Testing DVectorSlice binding and "
00217           "conversion from DVector -> DVectorSlice\n***\n"
00218         << "\nvs1.bind(v2());\n";
00219   vs1.bind(v2());
00220   if(out) *out << "vs1 =\n" << vs1;
00221 
00222   // ///////////////////////
00223   // Test DVector Resizing
00224 
00225   if(out)
00226     *out  << "\n***\n*** Testing DVector resizing\n***\n"
00227         << "\nv2.free();\n";
00228   v2.free();
00229   if(out) *out << "v2.dim() == 0 : " << update_success( v2.dim() == 0, &success ) << std::endl;
00230 
00231   if(out)
00232     *out  << "\nv2.resize(n,2*alpha1);\n";
00233   v2.resize(n,2*alpha1);
00234   result1 = update_success( v2.dim() == n, &success );
00235   result2 = update_success( comp(v2,2*alpha1), &success );
00236   if(out)
00237     *out  << "( (v2.dim() -> " << v2.dim() << ") == n && "
00238         << "(comp(v2,2*alpha1) -> " << result2 << ") ) : " << (result1 && result2) << std::endl
00239         << "v2 =\n" << v2;
00240 
00241   // //////////////////////////////////////////////////////////
00242   // Test Iterator Access, Subscriping and Reverse VectorSlices
00243 
00244   if(out) *out << "\n***\n*** Testing Iterator Access, Subscriping and Reverse VectorSlices\n***\n";
00245 
00246   if(out)
00247     *out  << "\nLet v == v3, begin = v.begin()";
00248   test_access(&v3,v3.begin(),v3.end(),out,&success);
00249 
00250   if(out)
00251     *out  << "\nLet v == const_cast<const DVector&>(v3), begin = v.begin()";
00252   test_access(&const_cast<const DVector&>(v3),const_cast<const DVector&>(v3).begin()
00253     ,const_cast<const DVector&>(v3).end(),out,&success);
00254 
00255   if(out)
00256     *out  << "\nLet v == vs3, begin = v.begin()";
00257   test_access(&vs3,vs3.begin(),vs3.end(),out,&success);
00258 
00259   if(out)
00260     *out  << "\nLet v == const_cast<const DVectorSlice&>(vs3), begin = v.begin()";
00261   test_access(&const_cast<const DVectorSlice&>(vs3),const_cast<const DVectorSlice&>(vs3).begin()
00262     ,const_cast<const DVectorSlice&>(vs3).end(),out,&success);
00263 
00264   if(out)
00265     *out  << "\nLet v == v3.rev(), begin = v3.rbegin()";
00266   test_access(&v3.rev(),v3.rbegin(),v3.rend(),out,&success);
00267 
00268   if(out)
00269     *out  << "\nLet v == const_cast<const DVector&>(v3).rev(), begin = const_cast<const DVector&>(v3).rbegin()";
00270   test_access(&const_cast<const DVector&>(v3).rev(),const_cast<const DVector&>(v3).rbegin()
00271     ,const_cast<const DVector&>(v3).rend(),out,&success);
00272 
00273   if(out)
00274     *out  << "\nLet v == vs3.rev(), begin = vs3.rbegin()";
00275   test_access(&vs3.rev(),vs3.rbegin(),vs3.rend(),out,&success);
00276 
00277   if(out)
00278     *out  << "\nLet v == const_cast<const DVectorSlice&>(vs3).rev()"
00279           ", begin = const_cast<const DVectorSlice&>(vs3).rbegin()";
00280   test_access(&const_cast<const DVectorSlice&>(vs3).rev(),const_cast<const DVectorSlice&>(vs3).rbegin()
00281     ,const_cast<const DVectorSlice&>(vs3).rend(),out,&success);
00282 
00283 #ifdef LINALGPACK_CHECK_RANGE
00284 
00285   if(out) *out << "\n*** Test subscriping out of bounds\n";
00286 
00287   if(out) *out << "\nv3(0); (should throw std::out_of_range)\n";
00288   try{
00289     v3(0);
00290     result = false; 
00291   }
00292   catch(const std::out_of_range&) {
00293     result = true;
00294   }
00295   if(out) *out << "v3(0) threw std::out_of_range : " << result << std::endl;
00296   update_success( result, &success );
00297   
00298   if(out) *out << "\nv3(n+1); (should throw std::out_of_range)\n";
00299   try{
00300     v3(n+1);
00301     result = false; 
00302   }
00303   catch(const std::out_of_range&) {
00304     result = true;
00305   }
00306   if(out) *out << "v3(n+1) threw std::out_of_range : " << result << std::endl;
00307   update_success( result, &success );
00308 
00309   if(out) *out << "\nvs3(0); (should throw std::out_of_range)\n";
00310   try{
00311     vs3(0);
00312     result = false; 
00313   }
00314   catch(const std::out_of_range &) {
00315     result = true;
00316   }
00317   if(out) *out << "vs3(0) threw std::out_of_range : " << result << std::endl;
00318   update_success( result, &success );
00319   
00320   if(out) *out << "\nvs3(n+1); (should throw std::out_of_range)\n";
00321   try{
00322     vs3(n+1);
00323     result = false; 
00324   }
00325   catch(const std::out_of_range&) {
00326     result = true;
00327   }
00328   if(out) *out << "vs3(n+1) threw std::out_of_range : " << result << std::endl;
00329   update_success( result, &success );
00330 
00331 #endif
00332 
00333   // ////////////////////////////////
00334   // Test Subregion Access
00335 
00336   if(out) *out << "\n***\n*** Testing Subregion Access\n***\n";
00337 
00338   // DVector Subregions
00339   Range1D rng;
00340 
00341   if(out) *out << "\nv = v3, rng = [1,n/2], vs = v(rng)";
00342   rng = Range1D(1,n/2);
00343   test_subregion_access( &v3, &v3(rng), rng, out, &success );
00344 
00345   if(out) *out << "\nv = v3, rng = [n/3,2*n/3], vs = v(rng)";
00346   rng = Range1D(n/3,2*n/3);
00347   test_subregion_access( &v3, &v3(rng), rng, out, &success );
00348   
00349   if(out) *out << "\nv = v3, rng = [n/2,n], vs = v(rng)";
00350   rng = Range1D(n/2,n);
00351   test_subregion_access( &v3, &v3(rng), rng, out, &success );
00352 
00353   if(out) *out << "\nv = const_cast<const DVector&>(v3), rng = [n/2,n], vs = v(rng)";
00354   rng = Range1D(n/2,n);
00355   test_subregion_access( &v3, &const_cast<const DVector&>(v3)(rng), rng, out, &success );
00356 
00357   if(out) *out << "\nv = v3, rng = [1,n/2], vs = v(1,n/2)";
00358   rng = Range1D(1,n/2);
00359   test_subregion_access( &v3, &v3(1,n/2), rng, out, &success );
00360 
00361   if(out) *out << "\nv = const_cast<const DVector&>(v3), rng = [n/2,n], vs = v(n/2,n)";
00362   rng = Range1D(n/2,n);
00363   test_subregion_access( &v3, &const_cast<const DVector&>(v3)(n/2,n), rng, out, &success );
00364 
00365   // DVectorSlice Subregions
00366 
00367   if(out) *out << "\nv = vs3, rng = [1,n/2], vs = v(rng)";
00368   rng = Range1D(1,n/2);
00369   test_subregion_access( &vs3, &vs3(rng), rng, out, &success );
00370 
00371   if(out) *out << "\nv = vs3, rng = [n/3,2*n/3], vs = v(rng)";
00372   rng = Range1D(n/3,2*n/3);
00373   test_subregion_access( &vs3, &vs3(rng), rng, out, &success );
00374   
00375   if(out) *out << "\nv = vs3, rng = [n/2,n], vs = v(rng)";
00376   rng = Range1D(n/2,n);
00377   test_subregion_access( &vs3, &vs3(rng), rng, out, &success );
00378 
00379   if(out) *out << "\nv = const_cast<const DVectorSlice&>(vs3), rng = [n/2,n], vs = v(rng)";
00380   rng = Range1D(n/2,n);
00381   test_subregion_access( &vs3, &const_cast<const DVectorSlice&>(vs3)(rng), rng, out, &success );
00382 
00383   if(out) *out << "\nv = vs3, rng = [1,n/2], vs = v(1,n/2)";
00384   rng = Range1D(1,n/2);
00385   test_subregion_access( &vs3, &vs3(1,n/2), rng, out, &success );
00386 
00387   if(out) *out << "\nv = const_cast<const DVectorSlice&>(vs3), rng = [n/2,n], vs = v(n/2,n)";
00388   rng = Range1D(n/2,n);
00389   test_subregion_access( &vs3, &const_cast<const DVectorSlice&>(vs3)(n/2,n), rng, out, &success );
00390 
00391   // ///////////////////////
00392   // Test Assignment
00393 
00394   if(out) *out << "\n***\n*** Testing assignment operators\n***\n";
00395 
00396   // DVector Assignment
00397 
00398   if(out) *out << "\nv1.resize(n); v1 = 0.0;\n";
00399   v1.resize(n);
00400   v1 = 0.0;
00401   result = update_success( comp( v1, 0.0 ), &success );
00402   if(out)
00403     *out  << "v1 =\n" << v1
00404         << "v1 == 0.0 : " << result << std::endl;
00405   
00406   if(out) *out << "\nv1 = 0.0; v1 = vs3;\n";
00407   v1 = 0.0;
00408   v1 = vs3;
00409   result = update_success( comp( v1, vs3 ), &success );
00410   if(out)
00411     *out  << "v1 =\n" << v1
00412         << "v1 == vs3 : " << result << std::endl;
00413 
00414   if(out) *out << "\nv1 = 0.0; v1 = v3;\n";
00415   v1 = 0.0;
00416   v1 = v3;
00417   result = update_success( comp( v1, v3 ), &success );
00418   if(out)
00419     *out  << "v1 =\n" << v1
00420         << "v1 == v3 : " << result << std::endl;
00421 
00422   // DVectorSlice Assignment
00423 
00424   if(out) *out << "\nv1.resize(n); v1 = 0.0; vs1.bind(v1());\n";
00425   v1.resize(n);
00426   v1 = 0.0;
00427   vs1.bind(v1());
00428 
00429   if(out) *out << "\nvs1 = alpha1;\n";
00430   vs1 = alpha1;
00431   result = update_success( comp( vs1, alpha1 ), &success );
00432   if(out)
00433     *out  << "vs1 =\n" << v1
00434         << "vs1 == alpha1 : " << result << std::endl;
00435   
00436   if(out) *out << "\nvs1 = 0.0; vs1 = vs3;\n";
00437   vs1 = 0.0;
00438   vs1 = vs3;
00439   result = update_success( comp( vs1, vs3 ), &success );
00440   if(out)
00441     *out  << "vs1 =\n" << vs1
00442         << "vs1 == vs3 : " << result << std::endl;
00443 
00444   // ////////////////////////
00445   // Test overlap()
00446 
00447   if(out) *out << "\n***\n*** Testing overlap\n***\n";
00448 
00449   EOverLap ovlap;
00450 
00451   // DVector overlap
00452 
00453   if(out) *out << "\n*** DVector overlap\n";
00454 
00455   if(out) *out << "(v1.overlap(v3) -> ";
00456   ovlap = v1.overlap(v3);
00457   result = update_success( ovlap == NO_OVERLAP, &success );
00458   if(out) *out  << overlap_str(ovlap) << ") == NO_OVERLAP : " << result << std::endl;
00459   
00460   if(out) *out << "(v3.overlap(v3) -> ";
00461   ovlap = v3.overlap(v3);
00462   result = update_success( ovlap == SAME_MEM, &success );
00463   if(out) *out  << overlap_str(ovlap) << ") == SAME_MEM : " << result << std::endl;
00464 
00465   if(out) *out << "(v3.overlap(v3(1,n-1)) -> ";
00466   ovlap = v3.overlap(v3(1,n-1));
00467   result = update_success( ovlap == SOME_OVERLAP, &success );
00468   if(out) *out  << overlap_str(ovlap) << ") == SOME_OVERLAP : " << result << std::endl;
00469 
00470   if(out) *out << "(v3.overlap(v3(2,n-1)) -> ";
00471   ovlap = v3.overlap(v3(2,n-1));
00472   result = update_success( ovlap == SOME_OVERLAP, &success );
00473   if(out) *out  << overlap_str(ovlap) << ") == SOME_OVERLAP : " << result << std::endl;
00474 
00475   // DVectorSlice overlap
00476 
00477   if(out) *out << "\n*** DVectorSlice overlap\n"
00478           << "vs1.bind(v3());\n";
00479 
00480   vs1.bind(v3());
00481 
00482   if(out) *out << "(vs1.overlap(v2) -> ";
00483   ovlap = vs1.overlap(v2);
00484   result = update_success( ovlap == NO_OVERLAP, &success );
00485   if(out) *out  << overlap_str(ovlap) << ") == NO_OVERLAP : " << result << std::endl;
00486 
00487   if(out) *out << "(vs1.overlap(vs1) -> ";
00488   ovlap = vs1.overlap(vs1);
00489   result = update_success( ovlap == SAME_MEM, &success );
00490   if(out) *out  << overlap_str(ovlap) << ") == SAME_MEM : " << result << std::endl;
00491 
00492   if(out) *out << "(vs1(1,n/2).overlap(vs1(n/2+1,n)) -> ";
00493   ovlap = vs1(1,n/2).overlap(vs1(n/2+1,n));
00494   result = update_success( ovlap == NO_OVERLAP, &success );
00495   if(out) *out  << overlap_str(ovlap) << ") == NO_OVERLAP : " << result << std::endl;
00496 
00497   if(out) *out << "(vs1(1,n/2).overlap(vs1(n/3,2*n/3)) -> ";
00498   ovlap = vs1(1,n/2).overlap(vs1(n/3,2*n/3));
00499   result = update_success( ovlap == SOME_OVERLAP, &success );
00500   if(out) *out  << overlap_str(ovlap) << ") == SOME_OVERLAP : " << result << std::endl;
00501 
00502   if(out) *out << "(vs1(n/3,2*n/3).overlap(vs1(n/2+1,n)) -> ";
00503   ovlap = vs1(n/3,2*n/3).overlap(vs1(n/2+1,n));
00504   result = update_success( ovlap == SOME_OVERLAP, &success );
00505   if(out) *out  << overlap_str(ovlap) << ") == SOME_OVERLAP : " << result << std::endl;
00506 
00507   if(out) *out << "(vs1(n/3,2*n/3).overlap(vs1(n/3,2*n/3)) -> ";
00508   ovlap = vs1(n/3,2*n/3).overlap(vs1(n/3,2*n/3));
00509   result = update_success( ovlap == SAME_MEM, &success );
00510   if(out) *out  << overlap_str(ovlap) << ") == SAME_MEM : " << result << std::endl;
00511 
00512   } // end try
00513   catch( const std::exception& excpt ) {
00514     success = false;
00515     if(out)
00516       (*out)  << "\nError, a standard exception was thrown: "
00517           << typeName(excpt) << ": "
00518           << excpt.what() << std::endl; 
00519   }
00520   catch(...) {
00521     success = false;
00522     if(out)
00523       (*out)  << "\nError, an unknown exception was thrown\n";
00524   }
00525 
00526   if(out) {
00527     if(success)
00528       (*out)
00529         << "\n*** Congradulations, DVector and DVectorSlice seem to check out. ***\n";
00530     else
00531       (*out)
00532         << "\n*** Oops, all of the tests for DVector and DVectorSlice "
00533           "where not successful. ***\n";
00534   }
00535 
00536   return success;
00537 }
00538 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines