00001 /*************************************************************************** 00002 minus.h - description 00003 ------------------- 00004 begin : Fri May 12 2000 00005 copyright : (C) 2000 by Michael Peeters 00006 email : Michael.Peeters@vub.ac.be 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef MINUS_H 00019 #define MINUS_H 00020 00021 #include "vectorfunction.h" 00022 #include "newtonroot.h" 00023 #include <vector> 00024 00025 namespace MODEL { 00030 // Prev: template <integer dims, class NT = NumericTraits<number,dims> > 00031 template<integer dims, typename nelem=number, class NT = NumericTraits<nelem,dims> > 00032 class Minus : public VectorFunction<dims,nelem,NT> 00033 { 00034 public: 00036 Minus(vf& func,bool own=false) 00037 : f((own)?func.clone():&func), owned(own) {} 00038 00040 Minus(const Minus& vfb) : f(vfb.f), owned(false){} 00042 const Minus& operator=(const Minus& vfb) 00043 { if (this!=&vfb){f=vfb.f;owned=false;} return *this;} 00044 00046 virtual Minus* clone () const {return new Minus(*this);} 00047 00052 virtual const vect& function(vect& fu,const vect& u) 00053 { 00054 f->function(fu,u); 00055 fu*=-1.; 00056 return fu; 00057 } 00058 00059 private: 00060 vf* f; 00061 bool owned; 00062 }; 00063 00064 } // end namespace 00065 #endif 00066 00067 /********************************************************************* 00068 $Id: minus.h,v 1.1 2001/05/22 10:54:55 mpeeters Exp $ 00069 ********************************************************************** 00070 00071 $Log: minus.h,v $ 00072 Revision 1.1 2001/05/22 10:54:55 mpeeters 00073 Moved sources and headers for libModel to model/ subdirectory, in an attempt to rationalize the source tree. This should make things "netter". 00074 00075 Revision 1.2 2000/09/15 10:26:31 mpeeters 00076 Cleaned out header and added CVS tails to files, removed superfuous 00077 @author comments, inserted dates 00078 00079 *********************************************************************/
More Info? Michael Peeters. Also, check our research website: www.alna.vub.ac.be
Last update: June 2002.