source/inc/tool/global.hxx

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  The Contents of this file are made available subject to
00004  *  the terms of GNU Lesser General Public License Version 2.1.
00005  *
00006  *
00007  *    GNU Lesser General Public License Version 2.1
00008  *    =============================================
00009  *    Copyright 2005 by Kohei Yoshida.
00010  *    1039 Kingsway Dr., Apex, NC 27502, USA
00011  *
00012  *    This library is free software; you can redistribute it and/or
00013  *    modify it under the terms of the GNU Lesser General Public
00014  *    License version 2.1, as published by the Free Software Foundation.
00015  *
00016  *    This library is distributed in the hope that it will be useful,
00017  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  *    Lesser General Public License for more details.
00020  *
00021  *    You should have received a copy of the GNU Lesser General Public
00022  *    License along with this library; if not, write to the Free Software
00023  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00024  *    MA  02111-1307  USA
00025  *
00026  ************************************************************************/
00027 
00028 #ifndef _GLOBAL_HXX_
00029 #define _GLOBAL_HXX_
00030 
00031 #include <string>
00032 #include <iterator>
00033 #include <iostream>
00034 #include <vector>
00035 
00036 #define SCSOLVER_DEBUG 0
00037 
00038 #define REWRITE_FOR_SUN_STUDIO_COMPILER 1
00039 
00040 #if defined(SCSOLVER_UNO_COMPONENT) || defined(SCSOLVER_UNITTEST)
00041 
00042 #ifndef OSL_ASSERT
00043 #define OSL_ASSERT assert
00044 #endif
00045 
00046 #else
00047 #include <osl/diagnose.h>
00048 #endif
00049 
00050 namespace scsolver { namespace numeric {
00051     class Matrix;
00052 }}
00053 
00054 namespace {
00055 
00056 //---------------------------------------------------------------------------
00057 // Function templates (need to be implemented in header)
00058 
00059 template<typename Container>
00060 void printElements( const Container& cn, const char* sep = " " )
00061 {
00062         using namespace ::std;
00063         copy( cn.begin(), cn.end(), ostream_iterator<typename Container::value_type>( cout, sep ) );
00064         cout << endl;
00065 }
00066 
00067 }
00068 
00069 namespace scsolver {
00070 
00076 void Debug( const char* s );
00077 std::string repeatString( const char*, unsigned long );
00078 
00079 void vectorToMatrix(const ::std::vector<double>& vec, ::scsolver::numeric::Matrix& mx, bool rowMatrix = true);
00080 void matrixToVector(const ::scsolver::numeric::Matrix& mx, ::std::vector<double>& vec);
00081 
00082 }
00083 
00084 #endif

Generated on Mon Jul 28 09:13:20 2008 for scsolver by  doxygen 1.5.3