|
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 #ifndef VECTOR_IN_FUNC_H 00030 #define VECTOR_IN_FUNC_H 00031 00032 #include "DenseLinAlgPack_IOBasic.hpp" 00033 00034 namespace DenseLinAlgPack { 00035 00036 /* * @name DVector/DVectorSlice input stream functions. 00037 * 00038 * These are functions that are used to read a DVector 00039 * or DVectorSlice object from a formated input stream. 00040 * 00041 * The input format is diferent depending on the on whether the 00042 * bit #LinAlgPackIO::ignore_dim_bit# is set. If #exta_flags & LinAlgPackIO::ignore_dim_bit != 0# 00043 * then the input format is: 00044 * 00045 * Case 1\\ 00046 * #n#\\ 00047 * #v(1) v(2) v(3) ... v(n)#\\ 00048 * 00049 * If #exta_flags & LinAlgPackIO::ignore_dim_bit == 0# then the input format is: 00050 * 00051 * Case 2\\ 00052 * #v(1) v(2) v(3) ... v(v.size())#\\ 00053 * 00054 * The numbers of the input must be seperated by white space and be valid 00055 * C numeric constants. For example, the input format for the vector {1.1, 2.2, 3.3} 00056 * for case 1 is: 00057 * 00058 * #3#\\ 00059 * #1.1 2.2 3.3#\\ 00060 * 00061 * And for case 2 is: 00062 * 00063 * #1.1 2.2 3.3#\\ 00064 * 00065 * It is permisible for the dimension #n# in case 1 to be 0. In this case there will be 00066 * no elements. So to input an empty vector you would use: 00067 * 00068 * #0#\\ 00069 * 00070 * If any of the input operations fails then a LinAlgPackIO::InputException exception 00071 * is thrown. In other words if #is.fail()# or #is.eof()# is true 00072 * before all of the elements have been read in then the exception is thrown. 00073 * Also if the stream becomes corrupted (#is.bad() == true#) then a #std::ios_base::failure# 00074 * exception is thrown. 00075 */ 00076 // @{ 00077 00079 /* * DVector input stream function. 00080 * 00081 * Inputs a DVector object from an input stream. If #exta_flags & LinAlgPackIO::ignore_dim_bit != 0# 00082 * then #v# is resized to #n# given in the file. If #exta_flags & LinAlgPackIO::ignore_dim_bit == 0# 00083 * then the number of elements read in depends on the current size of #v#. 00084 * 00085 */ 00086 std::istream& input(std::istream& is, DVector* v, LinAlgPackIO::fmtflags extra_flags); 00087 00089 /* * DVectorSlice input stream function. 00090 * 00091 * Inputs a DVectorSlice object from an input stream. If #exta_flags & LinAlgPackIO::ignore_dim_bit != 0# 00092 * then the size (!= 0) of #vs# is compared to the #n# given in the file and if they are not equal 00093 * then a #LinAlgPackIO::InputException# is thrown. If #vs# is unsized then it is resized to #n#. 00094 * If #exta_flags & LinAlgPackIO::ignore_dim_bit == 0# then the number of elements read in depends 00095 * on the current size of #vs#. 00096 */ 00097 std::istream& input(std::istream& is, DVectorSlice* vs, LinAlgPackIO::fmtflags extra_flags); 00098 00099 // @} 00100 00101 } // end namespace DenseLinAlgPack 00102 00103 #endif // VECTOR_IN_FUNC_H
1.7.4