00001 //$Header: /home/ben/Mapper/include/RCS/vector_constraint.h,v 6.3 2002/06/10 22:16:17 ben Exp $
00002 #ifndef VECTOR_CONSTRAINT_H
00003 #define VECTOR_CONSTRAINT_H
00004 // Copyright Benedict Adamson 2002.
00005 // This file is part of Mapper.
00006
00007 // Mapper is free software; you can redistribute it and/or modify
00008 // it under the terms of the GNU General Public License as published by
00009 // the Free Software Foundation; either version 2 of the License, or
00010 // (at your option) any later version.
00011
00012 // Mapper 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 Mapper; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00020
00031 #include "assoc.h"
00032 #include "constraint.h"
00033
00034
00035
00039 class vector_constraint
00040 :public constraint
00041 {
00042 public: //Constructors and destructors.
00043
00059 vector_constraint(
00060 const double u,
00061 const double x1,
00062 const double y1
00063 );
00064
00065 virtual ~vector_constraint(void);
00066
00067 public: //Attributes
00068
00099 virtual void energy(
00100 const double tol,
00101 const vector< vector2 > &p,
00102 double &e, //output
00103 vector< vector2 > &dedp //output
00104 ) const;
00105
00110 double x;
00111
00116 double y;
00117
00118 private: //State
00119
00120 friend void assoc(
00121 vector_constraint &c,
00122 vector2 &p0,
00123 vector2 &p1
00124 );
00125
00126 friend void unassoc(
00127 vector_constraint &c
00128 );
00129
00130 };
00131
00132
00133
00134 #endif