|
DenseLinAlgPack: Concreate C++ Classes for Dense Blas-Compatible Linear Algebra Version of the Day
|
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 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 00025 // 00026 // *********************************************************************** 00027 // @HEADER 00028 // 00029 00030 #ifndef LINALGPACK_IO_NAME_LOOKUPS_H 00031 #define LINALGPACK_IO_NAME_LOOKUPS_H 00032 00033 #ifdef _WINDOWS 00034 00035 // MS VC++ 5.0 is not performing function look for these templated operator 00036 // functions as it should so I will do it for the compiler. These 00037 // inline functions are injected into the local namespace. These should 00038 // be removed once a standards conforming compiler is available. 00039 00040 namespace { 00041 00042 // Define some boiler plate macros 00043 00044 #define OPEATOR_FUNCTION(OPERATOR,STREAM_TYPE,FORMAT_TYPE,OBJECT_TYPE) \ 00045 inline STREAM_TYPE & OPERATOR ( STREAM_TYPE & s \ 00046 , DenseLinAlgPack::LinAlgPackIO:: ## FORMAT_TYPE ## <DenseLinAlgPack:: ## OBJECT_TYPE ## >& bf) \ 00047 { \ 00048 return DenseLinAlgPack:: ## OPERATOR ## (s,bf); \ 00049 } 00050 00051 #define INPUT_OPEATOR_FUNCTION(FORMAT_TYPE,OBJECT_TYPE) \ 00052 OPEATOR_FUNCTION( operator>> , std::istream , FORMAT_TYPE , OBJECT_TYPE ) \ 00053 00054 #define OUTPUT_OPEATOR_FUNCTION(FORMAT_TYPE,OBJECT_TYPE) \ 00055 OPEATOR_FUNCTION( operator<< , std::ostream , FORMAT_TYPE , OBJECT_TYPE ) \ 00056 00057 00058 INPUT_OPEATOR_FUNCTION( bound_format , DVector ) 00059 OUTPUT_OPEATOR_FUNCTION( bound_format , DVector ) 00060 OUTPUT_OPEATOR_FUNCTION( const_bound_format , DVector ) 00061 00062 INPUT_OPEATOR_FUNCTION( bound_format , DVectorSlice ) 00063 OUTPUT_OPEATOR_FUNCTION( bound_format , DVectorSlice ) 00064 OUTPUT_OPEATOR_FUNCTION( const_bound_format , DVectorSlice ) 00065 00066 INPUT_OPEATOR_FUNCTION( bound_format , DMatrix ) 00067 OUTPUT_OPEATOR_FUNCTION( bound_format , DMatrix ) 00068 OUTPUT_OPEATOR_FUNCTION( const_bound_format , DMatrix ) 00069 00070 INPUT_OPEATOR_FUNCTION( bound_format , DMatrixSlice ) 00071 OUTPUT_OPEATOR_FUNCTION( bound_format , DMatrixSlice ) 00072 OUTPUT_OPEATOR_FUNCTION( const_bound_format , DMatrixSlice ) 00073 00074 #undef OPEATOR_FUNCTION 00075 #undef INPUT_OPEATOR_FUNCTION 00076 #undef OUTPUT_OPEATOR_FUNCTION 00077 00078 } // end namespace 00079 00080 #endif 00081 00082 #endif // LINALGPACK_IO_NAME_LOOKUPS_H
1.7.4