vecalg.cpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002     
00003     vecalg.cpp -- See vecalh.hpp.
00004 
00005     This file is a part of Arageli library.
00006 
00007     Copyright (C) Nikolai Yu. Zolotykh, 1999--2006
00008     Copyright (C) Sergey S. Lyalin, 2005--2006
00009     University of Nizhni Novgorod, Russia
00010 
00011 *****************************************************************************/
00012 
00013 #include "config.hpp"
00014 
00015 #if !defined(ARAGELI_INCLUDE_CPP_WITH_EXPORT_TEMPLATE) || \
00016     defined(ARAGELI_INCLUDE_CPP_WITH_EXPORT_TEMPLATE_VECALG)
00017 
00018 #include "vecalg.hpp"
00019 
00020 
00021 namespace Arageli
00022 {
00023 
00024 
00025 template <typename Out, typename Vec>
00026 Out& vec_output_list
00027 (
00028     Out& out,
00029     const Vec& x,
00030     const char* first_bracket,
00031     const char* second_bracket,
00032     const char* separator
00033 )
00034 {
00035     out << first_bracket;
00036     
00037     if(!x.is_empty())
00038     {
00039         out << x[0];
00040         
00041         typedef typename Vec::size_type size_type;
00042         for(size_type i = 1; i < x.size(); ++i)
00043             out << separator << x[i];
00044     }
00045     
00046     out << second_bracket;
00047     return out;
00048 }
00049 
00050 
00051 }
00052 
00053 #else
00054 
00055 #include "vecalg.hpp"
00056 
00057 
00058 namespace Arageli
00059 {
00060 
00061 const char* vector_output_list_first_bracket_default = "(";
00062 const char* vector_output_list_second_bracket_default = ")";
00063 const char* vector_output_list_separator_default = ", ";
00064 const char* vector_input_list_first_bracket_default = "(";
00065 const char* vector_input_list_second_bracket_default = ")";
00066 const char* vector_input_list_separator_default = ",";
00067 const char* vector_input_list_range_default = ":";
00068 const char* vector_output_aligned_left_col_default = "||";
00069 const char* vector_output_aligned_right_col_default = "||";
00070 
00071 }
00072 
00073 
00074 #endif // #ifndef ARAGELI_INCLUDE_CPP_WITH_EXPORT_TEMPLATE

Generated on Thu Aug 31 17:38:12 2006 for Arageli by  doxygen 1.4.7