PrVec.h

00001 //===========================================================================
00002 // GoTools - SINTEF Geometry Tools version 1.1
00003 //
00004 // GoTools module: parametrization
00005 //
00006 // Copyright (C) 2000-2005 SINTEF ICT, Applied Mathematics, Norway.
00007 //
00008 // This program is free software; you can redistribute it and/or          
00009 // modify it under the terms of the GNU General Public License            
00010 // as published by the Free Software Foundation version 2 of the License. 
00011 //
00012 // This program is distributed in the hope that it will be useful,        
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of         
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          
00015 // GNU General Public License for more details.                           
00016 //
00017 // You should have received a copy of the GNU General Public License      
00018 // along with this program; if not, write to the Free Software            
00019 // Foundation, Inc.,                                                      
00020 // 59 Temple Place - Suite 330,                                           
00021 // Boston, MA  02111-1307, USA.                                           
00022 //
00023 // Contact information: E-mail: tor.dokken@sintef.no                      
00024 // SINTEF ICT, Department of Applied Mathematics,                         
00025 // P.O. Box 124 Blindern,                                                 
00026 // 0314 Oslo, Norway.                                                     
00027 //
00028 // Other licenses are also available for this software, notably licenses
00029 // for:
00030 // - Building commercial software.                                        
00031 // - Building software whose source code you wish to keep private.        
00032 //===========================================================================
00033 #ifndef PRVEC_H
00034 #define PRVEC_H
00035 
00036 #include <vector>
00037 #include <iostream>
00038 
00039 /*<PrVec-syntax: */
00040 
00044 class PrVec
00045 {
00046 protected:
00047 
00048     std::vector<double> a_;
00049 
00050 public:
00052     PrVec()
00053     {}
00056     PrVec(int n, double fill_with = 0.0)
00057         : a_(n, fill_with)
00058     {}
00059 
00062     template <typename InputIterator>
00063     PrVec(InputIterator begin, InputIterator end)
00064         : a_(begin, end)
00065     {}
00066 
00068     void redim(int n, double fill_with = 0.0);
00069 
00071     int size() const {return a_.size();}
00072 
00074           double& operator () (int i) {return a_[i];}
00076     const double& operator () (int i) const {return a_[i];}
00078           double& operator [] (int i) {return a_[i];}
00080     const double& operator [] (int i) const {return a_[i];}
00081 
00083     double inner(const PrVec& x);
00084 
00086     void read(std::istream& is);
00087 
00089     void print(std::ostream& os);
00090 };
00091 
00092 
00093 /*>PrVec-syntax: */
00094 
00095 /*Class:PrVec
00096 
00097 Name:              PrVec
00098 Syntax:            @PrVec-syntax
00099 Keywords:
00100 Description:       
00101 Member functions:
00102                    
00103 Constructors:
00104 Files:
00105 Example:
00106 
00107 See also:
00108 Developed by:      SINTEF Applied Mathematics, Oslo, Norway
00109 Author:            Michael Floater, SINTEF
00110 Date:              Dec. 98
00111 */
00112 
00113 #endif // PRVEC_H
00114 
00115 
00116 
00117 
00118 

Generated on Tue Jun 12 11:05:05 2007 for GoTools Parametrization Library by  doxygen 1.5.1