\section{Constraint\-Manager  Class Reference}
\label{class_ConstraintManager}\index{ConstraintManager@{Constraint\-Manager}}
{\tt \#include $<$constraint\_\-manager.h$>$}

Collaboration diagram for Constraint\-Manager:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=164pt]{class_ConstraintManager_coll_graph}
\end{center}
\end{figure}
\subsection*{Public Methods}
\begin{CompactItemize}
\item 
{\bf Constraint\-Manager} (const {\bf Molecule} \&mol)
\item 
virtual {\bf $\sim$Constraint\-Manager} ()
\item 
int {\bf Number} () const
\item 
int {\bf num\-Atoms} () const
\item 
int {\bf num\-Atoms\-ON} () const
\item 
int {\bf num\-Constraints} () const
\item 
const {\bf Molecule}\& {\bf get\-Molecule} () const
\item 
const {\bf Atom}\& {\bf get\-Atom} (int i) const
\item 
const {\bf j\-Vector}\& {\bf get\-Position} (int i) const
\item 
{\bf j\-Vector} {\bf molecule\_\-center} (void) const
\item 
double {\bf get\-Radius} (int i) const
\item 
{\bf Envelope\-Constraint}$\ast$ {\bf get\-Envelope} () const
\item 
void {\bf Invalidate\-Envelope} (void) const
\item 
void {\bf Turn\-Envelope\-On} (void) const
\item 
void {\bf Invalidate\-Atoms} (void) const
\item 
const {\bf Atom}\& {\bf operator[$\,$]} (int i) const
\item 
const {\bf j\-Vector}\& {\bf operator()} (int i) const
\item 
{\bf DLList}$<$int$>$ {\bf approx\_\-neighbor\_\-i} (const {\bf j\-Vector} \&p, double distance) const
\item 
{\bf DLList}$<$int$>$ {\bf neighbor\_\-i} (const {\bf j\-Vector} \&p, double distance) const
\item 
bool {\bf constraint\-ON} (int i) const
\item 
{\bf DLList}$<${\bf Constraint}$\ast$$>$ {\bf get\-Parents} (int Id) const
\item 
{\bf DLList}$<${\bf Constraint}$\ast$$>$ {\bf get\-Assoc\-Atoms} (int Id) const
\begin{CompactList}\small\item\em Returns the list of atoms that are involved in some constraint with the atom.\item\end{CompactList}\item 
{\bf Constraint}$\ast$ {\bf get\-Constraint} (int id) const
\begin{CompactList}\small\item\em Returns the pointer to the constraint with id id'.\item\end{CompactList}\item 
ostream\& {\bf Print\-Graph} (ostream \&os)
\begin{CompactList}\small\item\em output a graphical version of the constraint graph for examination.\item\end{CompactList}\item 
virtual double {\bf get\-Weight} (int id) const
\item 
void {\bf set\-Molecule} (const {\bf Molecule} \&mol)
\item 
void {\bf read\-New\-Molecule\-Xmol} (ifstream \&is)
\item 
void {\bf set\-Position} (int i, const {\bf j\-Vector} \&v)
\item 
void {\bf set\-Atom} (int i, const {\bf Atom} \&a)
\item 
void {\bf register\-Envelope} ({\bf Envelope\-Constraint} $\ast$EC\_\-in)
\item 
void {\bf Turn\-Atoms\-Off} () const
\begin{CompactList}\small\item\em Turn all atoms constratins off.\item\end{CompactList}\item 
void {\bf Turn\-Atom\-On} (int i) const
\begin{CompactList}\small\item\em Turn single atom on.\item\end{CompactList}\item 
void {\bf Turn\-Constraint\-On} (int i) const
\item 
void {\bf Translate\-Model} ({\bf j\-Vector} dir)
\begin{CompactList}\small\item\em Moves all atoms in model dir.\item\end{CompactList}\item 
void {\bf Random\-Perturb} (double dist)
\begin{CompactList}\small\item\em Perturbs all atoms +/- dist in each direction.\item\end{CompactList}\item 
void {\bf reset\-Moved} (void)
\begin{CompactList}\small\item\em set all atoms in molecule to 'not moved yet'.\item\end{CompactList}\item 
virtual void {\bf set\-Weight} (int id)
\item 
virtual double {\bf Combine\-Stress} (const {\bf Int\-Vec} \&Id\-List, const {\bf j\-Vector} \&stress\-List) const
\item 
double {\bf stress} (int atom)
\begin{CompactList}\small\item\em Return stress total stress for an atom.\item\end{CompactList}\item 
double {\bf stress} (int atom, const {\bf j\-Vector} \&position) const
\begin{CompactList}\small\item\em Return total stress for an atom as if it were in a new posistion.\item\end{CompactList}\item 
double {\bf stress} ()
\begin{CompactList}\small\item\em Return sum of stress over all aloms in the molecule.\item\end{CompactList}\item 
{\bf j\-Vector} {\bf get\-Stress\-List} ()
\begin{CompactList}\small\item\em Returns a {\bf j\-Vector} {\rm (p.\,\pageref{class_jVector})} of the stress values; one for each atom.\item\end{CompactList}\item 
{\bf j\-Vector} {\bf d\-Stress} (int atom) const
\begin{CompactList}\small\item\em Returns the gradient and hessian of stress for an atom.\item\end{CompactList}\item 
{\bf j\-Vector} {\bf d\-Stress} (int atom, const {\bf j\-Vector} \&position) const
\begin{CompactList}\small\item\em Returns the gradient and hessian of stress for an atom for a new position.\item\end{CompactList}\item 
void {\bf Abs\-Dist\-Residuals} (double \&max, double \&ave) const
\begin{CompactList}\small\item\em Summary Functions.\item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Types}
\begin{CompactItemize}
\item 
typedef {\bf dd\-Graph}$<${\bf Constraint}$\ast$$>$ {\bf dynamic\-Graph}
\item 
typedef {\bf sd\-Graph}$<${\bf Constraint}$\ast$$>$ {\bf static\-Graph}
\end{CompactItemize}
\subsection*{Protected Methods}
\begin{CompactItemize}
\item 
bool {\bf is\-Dynamic} () const
\item 
bool {\bf make\-Static} ()
\item 
bool {\bf make\-Dynamic} ()
\item 
void {\bf remove} ({\bf Constraint} \&c)
\item 
int {\bf add} ({\bf Constraint} \&c)
\item 
void {\bf clear\-Constraints} ()
\begin{CompactList}\small\item\em Erases all the constraints that are not atoms.\item\end{CompactList}\item 
void {\bf clear\-All\-Constraints} ()
\begin{CompactList}\small\item\em Erases all the constraints, even atoms.\item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf Envelope\-Constraint}$\ast$ {\bf EC}
\item 
{\bf dynamic\-Graph}$\ast$ {\bf d\-G}
\begin{CompactList}\small\item\em The dynamic constraint graph.\item\end{CompactList}\item 
{\bf static\-Graph}$\ast$ {\bf s\-G}
\begin{CompactList}\small\item\em The static constraint graph.\item\end{CompactList}\item 
{\bf Atom\-Constraint}$\ast$ {\bf Atom\-Constraints}
\begin{CompactList}\small\item\em Array of dummy constraints, each holding one atom in the graph.\item\end{CompactList}\item 
{\bf Molecule} {\bf M}
\begin{CompactList}\small\item\em The single molecule this mgr works on.\item\end{CompactList}\end{CompactItemize}
\subsection*{Private Attributes}
\begin{CompactItemize}
\item 
{\bf j\-Vector} {\bf Type\-Weights}
\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Constraint\-Registry}
\item 
class {\bf Constraint}
\end{CompactItemize}


\subsection{Member Typedef Documentation}
\index{ConstraintManager@{Constraint\-Manager}!dynamicGraph@{dynamicGraph}}
\index{dynamicGraph@{dynamicGraph}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef {\bf dd\-Graph}$<$ {\bf Constraint} $\ast$$>$ Constraint\-Manager::dynamic\-Graph\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_t0}




Definition at line 207 of file constraint\_\-manager.h.

Referenced by make\-Dynamic().\index{ConstraintManager@{Constraint\-Manager}!staticGraph@{staticGraph}}
\index{staticGraph@{staticGraph}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef {\bf sd\-Graph}$<$ {\bf Constraint} $\ast$$>$ Constraint\-Manager::static\-Graph\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_t1}




Definition at line 208 of file constraint\_\-manager.h.

Referenced by make\-Static().

\subsection{Constructor \& Destructor Documentation}
\index{ConstraintManager@{Constraint\-Manager}!ConstraintManager@{ConstraintManager}}
\index{ConstraintManager@{ConstraintManager}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Constraint\-Manager::Constraint\-Manager (const {\bf Molecule} \& {\em in\_\-mol})}\label{class_ConstraintManager_a0}




Definition at line 4 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00005 {
00006   M = in_mol;
00007 
00008   //  Weightlist.Resize(M.Number());
00009   
00010   dG = new dynamicGraph;
00011   sG = 0;
00012   EC = 0;
00013   
00014   // assign a constraint to each atom here and add it to the graph.
00015   // assures that constraints numbered 0 -- n-1 are all atom
00016   // constraints 
00017   for(int i=0; i<M.Number(); ++i){
00018     add(*(new AtomConstraint(*this)));
00019     getConstraint(i)->myType = AtomConstraint::Identifier;
00020   }
00021 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!~ConstraintManager@{$\sim$ConstraintManager}}
\index{~ConstraintManager@{$\sim$ConstraintManager}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Constraint\-Manager::$\sim$Constraint\-Manager ()\hspace{0.3cm}{\tt  [virtual]}}\label{class_ConstraintManager_a1}




Definition at line 24 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00025 {
00026   //
00027   // We *do* remove the constraints since we dont know if we
00028   // were responsible for allocating this space or not (we could have
00029   // read in some constraints from a file, allocated the space for these
00030   // constraints, and then extra constraints could've been added later
00031   // that someone else allocated.  The client should *not* deallocate
00032   // constraints!
00033   //
00034 
00035   makeStatic();
00036   
00037   // cycle through complete graph and delete all constraints
00038   int num = Number();
00039   for(int i = 0; i < num; i++){
00040     delete (sG->GetData(i));
00041   }
00042 \end{verbatim}\normalsize 


\subsection{Member Function Documentation}
\index{ConstraintManager@{Constraint\-Manager}!AbsDistResiduals@{AbsDistResiduals}}
\index{AbsDistResiduals@{AbsDistResiduals}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::Abs\-Dist\-Residuals (double \& {\em max\_\-rv}, double \& {\em ave\_\-rv}) const}\label{class_ConstraintManager_a44}


Summary Functions.



Definition at line 499 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00499                                                                         {
00500   int max_c = Number();  
00501   int dc_type = ConstraintRegistry::getIntType(DistanceConstraint::Identifier);
00502   int n_dist = 0;
00503   
00504   double temp;
00505 
00506   max_rv = -1 * INF;
00507   ave_rv = 0;
00508 
00509   for (int i = numAtoms();i<max_c;i++){
00510     if (constraintON(i)){
00511       if (getConstraint(i)->IntType() == dc_type){
00512         n_dist++;
00513         temp = getConstraint(i)->computeAbsRes();
00514         //      cerr << getConstraint(i)->Label();
00515         if (max_rv < temp)
00516           max_rv = temp;
00517         ave_rv += temp;
00518       }
00519     }
00520   }
00521 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!CombineStress@{CombineStress}}
\index{CombineStress@{CombineStress}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Constraint\-Manager::Combine\-Stress (const {\bf Int\-Vec} \& {\em Id\-List}, const {\bf j\-Vector} \& {\em stress\-List}) const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{class_ConstraintManager_a37}




Definition at line 142 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00143                                                 {
00144     //    not defn yet
00145     return 0;
00146 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!InvalidateAtoms@{InvalidateAtoms}}
\index{InvalidateAtoms@{InvalidateAtoms}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::Invalidate\-Atoms (void) const}\label{class_ConstraintManager_a14}




Definition at line 554 of file constraint\_\-manager.C.

Referenced by read\-New\-Molecule\-Xmol().\footnotesize\begin{verbatim}00555 {  for (int i = numAtoms()-1;i>=0;i--){
00556   //for (int i =0;i<numAtoms();i++) {
00557   getConstraint(i)->assertValidity(false);}
00558 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!InvalidateEnvelope@{InvalidateEnvelope}}
\index{InvalidateEnvelope@{InvalidateEnvelope}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::Invalidate\-Envelope (void) const}\label{class_ConstraintManager_a12}




Definition at line 528 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00529 {if (EC) EC->assertValidity(false);}
00530 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!Number@{Number}}
\index{Number@{Number}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Constraint\-Manager::Number () const}\label{class_ConstraintManager_a2}




Definition at line 212 of file constraint\_\-manager.C.

Referenced by Abs\-Dist\-Residuals(), num\-Constraints(), Constraint\-Registry::read\-Constraints(), and $\sim$Constraint\-Manager().\footnotesize\begin{verbatim}00213 {
00214   if (sG)
00215     return sG->NumVertices();
00216   else         
00217     return dG->NumVertices();
00218 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!PrintGraph@{PrintGraph}}
\index{PrintGraph@{PrintGraph}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ostream \& Constraint\-Manager::Print\-Graph (ostream \& {\em os})}\label{class_ConstraintManager_a23}


output a graphical version of the constraint graph for examination.



Definition at line 220 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00220                                                  {
00221   makeStatic();
00222   sG->PrintDotty(os,0);
00223   return os;
00224 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!RandomPerturb@{RandomPerturb}}
\index{RandomPerturb@{RandomPerturb}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::Random\-Perturb (double {\em dist})}\label{class_ConstraintManager_a34}


Perturbs all atoms +/- dist in each direction.



Definition at line 71 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00072 {
00073 
00074   RanDbl randomDist((-1)*dist, dist);
00075   jVector tempPos(3); // 3 element vector
00076 
00077     for(int i=0; i<M.Number(); i++)
00078     {
00079       tempPos = getPosition(i); 
00080       tempPos[0] += randomDist.Get();
00081       tempPos[1] += randomDist.Get();
00082       tempPos[2] += randomDist.Get();
00083       setPosition(i, tempPos);  
00084     }
00085 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!TranslateModel@{TranslateModel}}
\index{TranslateModel@{TranslateModel}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::Translate\-Model ({\bf j\-Vector} {\em dir})}\label{class_ConstraintManager_a33}


Moves all atoms in model dir.



Definition at line 51 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00052 {
00053   if (dir.nrm() < 0.0001)
00054     return;
00055 
00056   jVector tempV1;
00057   int num = numAtoms();
00058 
00059   for (int a = 0; a < num; a++){
00060     if (constraintON(a)){
00061       tempV1 = getPosition(a);
00062       tempV1[0] += dir[0];
00063       tempV1[1] += dir[1];
00064       tempV1[2] += dir[2];
00065       setPosition(a, tempV1);
00066     }
00067   }
00068 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!TurnAtomOn@{TurnAtomOn}}
\index{TurnAtomOn@{TurnAtomOn}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::Turn\-Atom\-On (int {\em i}) const}\label{class_ConstraintManager_a31}


Turn single atom on.



Definition at line 377 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00377                                          {
00378   if (i<M.Number()){
00379     cerr  << setw(3)  << i << " ";
00380     if (0 == i%10) {cerr << endl;}
00381     
00382 #ifdef NOISY_CONSTRAINTS
00383     cerr  << endl << "CM is turning atom " << i << " on " << endl;
00384 #endif
00385     getConstraint(i)->switchOff(false);
00386   } else {
00387     DIE ("Tried to turn non-atom constraint on");
00388   }
00389 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!TurnAtomsOff@{TurnAtomsOff}}
\index{TurnAtomsOff@{TurnAtomsOff}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::Turn\-Atoms\-Off () const}\label{class_ConstraintManager_a30}


Turn all atoms constratins off.



Definition at line 365 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00365                                       {
00366 
00367   for(int i=0; i<M.Number(); ++i){
00368 #ifdef NOISY_CONSTRAINTS
00369     cerr  << endl << "CM is turning constaint " << i << " off " << endl;
00370 #endif
00371     
00372     getConstraint(i)->switchOff(true);
00373   }
00374 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!TurnConstraintOn@{TurnConstraintOn}}
\index{TurnConstraintOn@{TurnConstraintOn}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::Turn\-Constraint\-On (int {\em i}) const}\label{class_ConstraintManager_a32}




Definition at line 392 of file constraint\_\-manager.C.

Referenced by Turn\-Envelope\-On().\footnotesize\begin{verbatim}00392                                                {
00393 
00394 #ifdef NOISY_CONSTRAINTS
00395     cerr  << endl << "CM is turning constraint " << i << " on " << endl;
00396 #endif
00397     getConstraint(i)->switchOff(false);
00398 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!TurnEnvelopeOn@{TurnEnvelopeOn}}
\index{TurnEnvelopeOn@{TurnEnvelopeOn}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::Turn\-Envelope\-On (void) const}\label{class_ConstraintManager_a13}




Definition at line 531 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00531                                                  {
00532   if (EC) {
00533     int i = EC->ID();
00534     if (!(constraintON(i))){
00535       TurnConstraintOn(i);
00536     }  
00537   }
00538 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!add@{add}}
\index{add@{add}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Constraint\-Manager::add ({\bf Constraint} \& {\em c})\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_b4}


Only friends (e.g. Constraints) and derived classes may add  or remove themselves from the manager. The {\bf add}() {\rm (p.\,\pageref{class_ConstraintManager_b4})} function  returns the id assigned to the newly added constraint. 

Definition at line 226 of file constraint\_\-manager.C.

Referenced by Constraint\-Manager(), Constraint::Input(), Constraint::Input\-Binary(), and Constraint::set\-Manager().\footnotesize\begin{verbatim}00227 {
00228 
00229   makeDynamic();
00230 
00231   // Must add all atoms before any constraints on atoms.
00232   // This reserves the indices from 0...(M.Number()-1)
00233   // for use as atom ids.  The rest of the indices are used for 
00234   // assigning unique identifiers to constraints.
00235 
00236   // Generate an ID for this constraint.
00237   if((c.myID = dG->AddVertex(&c))<0)
00238     {
00239       DIE("ConstraintManager::add-> Problems adding new constraint to constraint graph.\n");
00240       return 1;
00241     }
00242 
00243   // Create edges to children' of c'  
00244   IntVec children = cat(c.atomSupport(),c.constraintSupport());
00245   Constraint * child;
00246   
00247   for(int i=0; i<children.Length(); ++i)
00248     {
00249       // Add an edge from this constraint to the atom/constraint
00250       // it needs to compute its stress function:
00251 
00252       if (children[i]>=0){ 
00253         // NB uninitialized constraints declare support intvecs with
00254         // appropriate length and set values = -1
00255         
00256         child = dG->GetData(children[i]);
00257         dG->AddEdge(&c, child);
00258       }
00259     }
00260 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!approx_neighbor_i@{approx\_\-neighbor\_\-i}}
\index{approx_neighbor_i@{approx\_\-neighbor\_\-i}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DLList}$<$ int $>$ Constraint\-Manager::approx\_\-neighbor\_\-i (const {\bf j\-Vector} \& {\em p}, double {\em distance}) const\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a17}




Definition at line 282 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00283 {return M.approx_neighbor_i(p,distance); }
00284 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!clearAllConstraints@{clearAllConstraints}}
\index{clearAllConstraints@{clearAllConstraints}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::clear\-All\-Constraints ()\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_b6}


Erases all the constraints, even atoms.



Definition at line 424 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00424                                        {
00425   makeDynamic();
00426     for (int i = (dG->NumVertices())-1; i >=0; i--)
00427       remove(*(dG->GetData(i)));
00428 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!clearConstraints@{clearConstraints}}
\index{clearConstraints@{clearConstraints}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::clear\-Constraints ()\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_b5}


Erases all the constraints that are not atoms.



Definition at line 430 of file constraint\_\-manager.C.

Referenced by Constraint\-Registry::read\-Constraints().\footnotesize\begin{verbatim}00431 {
00432   makeDynamic();
00433     for (int i = (dG->NumVertices())-1; i >=M.Number(); i--)
00434       remove(*(dG->GetData(i)));
00435 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!constraintON@{constraintON}}
\index{constraintON@{constraintON}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Constraint\-Manager::constraint\-ON (int {\em i}) const}\label{class_ConstraintManager_a19}




Definition at line 541 of file constraint\_\-manager.C.

Referenced by Abs\-Dist\-Residuals(), Translate\-Model(), Turn\-Envelope\-On(), molecule\_\-center(), num\-Atoms\-ON(), and set\-Position().\footnotesize\begin{verbatim}00541                                             {
00542   //  cerr << "CONSTRAINT " << i << " (off) is " << getConstraint(i)->isOff() << endl;  
00543 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!dStress@{dStress}}
\index{dStress@{dStress}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf j\-Vector} Constraint\-Manager::d\-Stress (int {\em atom}, const {\bf j\-Vector} \& {\em position}) const}\label{class_ConstraintManager_a43}


Returns the gradient and hessian of stress for an atom for a new position.



Definition at line 186 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00187 {
00188   return getConstraint(atom)->dStress(atom,position) ;
00189   
00190 //  /*
00191 //  jVector return_vect(12);
00192 //  // FIX THIS ... THIS IS A TEMPORARY HACK
00193 //  // 0,1,2 are gradient, 3-11 are hessian
00194 //  // The way dStress now works, the CM *has* to also
00195 //  // return the hessian.  Come see me w/ questions -jd
00196 //  
00197 //   DLList<Constraint*>::ConstIterator it;
00198 //
00199 //   for(it = AtomConstraintList[atom].GetConstIterator(); it; ++it)
00200 //     return_vect += (*it)->dStress(atom, position);
00201 //   return return_vect;
00202 //  */
00203 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!dStress@{dStress}}
\index{dStress@{dStress}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf j\-Vector} Constraint\-Manager::d\-Stress (int {\em atom}) const}\label{class_ConstraintManager_a42}


Returns the gradient and hessian of stress for an atom.



Definition at line 205 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00206 {
00207 
00208   return getConstraint(atom)->dStress(atom, M(atom));
00209 
00210 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!getAssocAtoms@{getAssocAtoms}}
\index{getAssocAtoms@{getAssocAtoms}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DLList}$<$ {\bf Constraint} $\ast$$>$ Constraint\-Manager::get\-Assoc\-Atoms (int {\em Id}) const}\label{class_ConstraintManager_a21}


Returns the list of atoms that are involved in some constraint with the atom.



Definition at line 299 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00300 {
00301   DLList<Constraint*> ReturnList;
00302   
00303   if (Id >= M.Number()) return ReturnList;
00304 
00305   DLList<Constraint*> ParentList;
00306   ParentList = getParents(Id);
00307 
00308   IntVec atomSeen(M.Number());  // Keeps track of which atoms we've seen.
00309   IntVec atomList;      // List of atom (indices) in a constraint.
00310   int sibling;
00311   
00312   atomSeen.zero();      // Mark that we havent seen anything.
00313   atomSeen[Id] = 1; // Mark that we've seen the source atom.
00314 
00315   DLList<Constraint *>::ConstIterator it;
00316 
00317   for(it = ParentList.GetConstIterator(); it; ++it)
00318     {
00319       atomList = ($\ast$it)->atomSupport();
00320       for(int i=0; i<atomList.Length(); i++)      {
00321         sibling = atomList[i];  // A mutually-constrained atom index.
00322         
00323         // If we havent seen this atom, add it to our list.
00324         if(!atomSeen[sibling])  {
00325           ReturnList.AddToBack(sG->GetData(sibling));
00326           atomSeen[sibling] = 1;
00327         }
00328       }
00329     }
00330 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!getAtom@{getAtom}}
\index{getAtom@{getAtom}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Atom} \& Constraint\-Manager::get\-Atom (int {\em i}) const\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a7}




Definition at line 277 of file constraint\_\-manager.h.

Referenced by operator[$\,$]().\footnotesize\begin{verbatim}00277                                                          { return M[i]; }
00278 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!getConstraint@{getConstraint}}
\index{getConstraint@{getConstraint}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Constraint} $\ast$ Constraint\-Manager::get\-Constraint (int {\em id}) const}\label{class_ConstraintManager_a22}


Returns the pointer to the constraint with id id'.



Definition at line 447 of file constraint\_\-manager.C.

Referenced by Abs\-Dist\-Residuals(), Constraint\-Manager(), Invalidate\-Atoms(), Turn\-Atom\-On(), Turn\-Atoms\-Off(), Turn\-Constraint\-On(), Constraint::assert\-Validity(), constraint\-ON(), d\-Stress(), set\-Position(), and stress().\footnotesize\begin{verbatim}00448 {if(sG)
00449     return sG->GetData(id);
00450   else
00451 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!getEnvelope@{getEnvelope}}
\index{getEnvelope@{getEnvelope}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Envelope\-Constraint} $\ast$ Constraint\-Manager::get\-Envelope () const\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a11}




Definition at line 291 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00292 {return EC;}
00293 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!getMolecule@{getMolecule}}
\index{getMolecule@{getMolecule}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Molecule} \& Constraint\-Manager::get\-Molecule () const\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a6}




Definition at line 274 of file constraint\_\-manager.h.

Referenced by Satisfy\-Molecule::get\-Molecule(), and Constraint::get\-Molecule().\footnotesize\begin{verbatim}00274                                                             { return M; }
00275 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!getParents@{getParents}}
\index{getParents@{getParents}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DLList}$<$ {\bf Constraint} $\ast$$>$ Constraint\-Manager::get\-Parents (int {\em Id}) const}\label{class_ConstraintManager_a20}


Returns the parents of a constraint or atom. The parents are those constraints whose support contains a' or c'. 

Definition at line 277 of file constraint\_\-manager.C.

Referenced by get\-Assoc\-Atoms().\footnotesize\begin{verbatim}00278 {
00279   //  makeStatic();
00280   DLList<Constraint*> ReturnList;
00281   if (sG){
00282 
00283     
00284     staticGraph::neighbor_iterator it;
00285     // cycle through our parents and collect pointers in list
00286     for(it = sG->begin_neighbor(Id,1);it; ++it)
00287       {
00288         ReturnList.AddToBack(sG->GetData(*it));
00289         // *it is an int
00290       }
00291     return ReturnList;
00292     
00293   }
00294   else {
00295     DIE("getParents called on dynamic constraint graph");
00296     return ReturnList; // keep compiler happy
00297   }
00298 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!getPosition@{getPosition}}
\index{getPosition@{getPosition}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf j\-Vector} \& Constraint\-Manager::get\-Position (int {\em i}) const\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a8}




Definition at line 278 of file constraint\_\-manager.h.

Referenced by Random\-Perturb(), Translate\-Model(), molecule\_\-center(), and operator()().\footnotesize\begin{verbatim}00278                                                                 { return M(i); }
00279 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!getRadius@{getRadius}}
\index{getRadius@{getRadius}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Constraint\-Manager::get\-Radius (int {\em i}) const\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a10}




Definition at line 279 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00279                                                       { return M.VDW(i); }
00280 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!getStressList@{getStressList}}
\index{getStressList@{getStressList}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf j\-Vector} Constraint\-Manager::get\-Stress\-List ()}\label{class_ConstraintManager_a41}


Returns a {\bf j\-Vector} {\rm (p.\,\pageref{class_jVector})} of the stress values; one for each atom.



Definition at line 152 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00153 {
00154   int numCyc = M.Number();
00155   jVector StressList(numCyc);
00156   for (int i =0; i<numCyc; i++){
00157     StressList[i] = stress(i);
00158     //    cerr << "Label: " << getConstraint(i)->Label() << "STRESS: " << stress(i) << endl;
00159       
00160   }
00161 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!getWeight@{getWeight}}
\index{getWeight@{getWeight}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Constraint\-Manager::get\-Weight (int {\em id}) const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{class_ConstraintManager_a24}




Definition at line 105 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00105                                         {
00106     // not defn yet
00107     return 0;
00108 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!isDynamic@{isDynamic}}
\index{isDynamic@{isDynamic}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Constraint\-Manager::is\-Dynamic () const\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_b0}


Returns true if the constraint graph is dynamic at this moment, and false if it is stored statically. 

Definition at line 460 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00461 { return (dG!=0); }
00462 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!makeDynamic@{makeDynamic}}
\index{makeDynamic@{makeDynamic}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Constraint\-Manager::make\-Dynamic ()\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_b2}


Converts the graph from dynamic to static and vice verca. Returns true if successful and false otherwise. 

Definition at line 479 of file constraint\_\-manager.C.

Referenced by Constraint::Input(), add(), clear\-All\-Constraints(), clear\-Constraints(), remove(), and set\-Molecule().\footnotesize\begin{verbatim}00480 {
00481   if(dG)
00482     return true;
00483   if(sG)
00484     {
00485       if(!(dG = new dynamicGraph(*sG)))
00486         return false;
00487       delete sG; sG = 0;
00488       return true;
00489     }
00490 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!makeStatic@{makeStatic}}
\index{makeStatic@{makeStatic}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Constraint\-Manager::make\-Static ()\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_b1}


Converts the graph from dynamic to static and vice verca. Returns true if successful and false otherwise. 

Definition at line 463 of file constraint\_\-manager.C.

Referenced by Print\-Graph(), Constraint::assert\-Validity(), Constraint::switch\-Off(), and $\sim$Constraint\-Manager().\footnotesize\begin{verbatim}00464 {
00465   if(sG)
00466     return true;
00467 
00468   if(!dG)
00469     return false;
00470     
00471   if(!(sG = new staticGraph(*dG, true)))
00472     return false;
00473 
00474   delete dG; dG = 0;
00475 
00476   return true;
00477 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!molecule_center@{molecule\_\-center}}
\index{molecule_center@{molecule\_\-center}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf j\-Vector} Constraint\-Manager::molecule\_\-center (void) const}\label{class_ConstraintManager_a9}




Definition at line 138 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00139 {
00140   jVector rv(3,0);
00141   double m;
00142   
00143   for(int i=numAtoms()-1; i>=0; i--){    
00144     if (constraintON(i)){
00145       rv += getPosition(i);
00146       m++;
00147     }
00148   }
00149 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!neighbor_i@{neighbor\_\-i}}
\index{neighbor_i@{neighbor\_\-i}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DLList}$<$ int $>$ Constraint\-Manager::neighbor\_\-i (const {\bf j\-Vector} \& {\em p}, double {\em distance}) const\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a18}




Definition at line 284 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00285 {return M.neighbor_i(p,distance); }
00286 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!numAtoms@{numAtoms}}
\index{numAtoms@{numAtoms}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Constraint\-Manager::num\-Atoms () const\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a3}




Definition at line 286 of file constraint\_\-manager.h.

Referenced by Abs\-Dist\-Residuals(), Anim\-Frame::Anim\-Frame(), Invalidate\-Atoms(), Translate\-Model(), molecule\_\-center(), Constraint::notify\-Off(), num\-Atoms\-ON(), num\-Constraints(), Constraint::stress(), and Constraint::switch\-Off().\footnotesize\begin{verbatim}00286                                               { return M.Number(); }
00287 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!numAtomsON@{numAtomsON}}
\index{numAtomsON@{numAtomsON}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Constraint\-Manager::num\-Atoms\-ON () const}\label{class_ConstraintManager_a4}




Definition at line 545 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00545                                          {
00546   int rv = 0;
00547   for (int i = numAtoms()-1;i>=0;i--){
00548     if (constraintON(i))
00549       rv++;
00550   }
00551 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!numConstraints@{numConstraints}}
\index{numConstraints@{numConstraints}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Constraint\-Manager::num\-Constraints () const\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a5}




Definition at line 61 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00062     {
00063       return Number()-numAtoms();
00064 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!operator()@{operator()}}
\index{operator()@{operator()}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf j\-Vector} \& Constraint\-Manager::operator() (int {\em i}) const\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a16}




Definition at line 281 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00281                                                                  { return getPosition(i); }
00282 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!operator[]@{operator[]}}
\index{operator[]@{operator[]}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Atom} \& Constraint\-Manager::operator[$\,$] (int {\em i}) const\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a15}




Definition at line 280 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00280                                                               { return getAtom(i); }
00281 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!readNewMoleculeXmol@{readNewMoleculeXmol}}
\index{readNewMoleculeXmol@{readNewMoleculeXmol}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::read\-New\-Molecule\-Xmol (ifstream \& {\em is})\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a26}




Definition at line 276 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00276                                                                 {M.readXmol(is);InvalidateAtoms();}
00277 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!registerEnvelope@{registerEnvelope}}
\index{registerEnvelope@{registerEnvelope}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::register\-Envelope ({\bf Envelope\-Constraint} $\ast$ {\em EC\_\-in})\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a29}




Definition at line 289 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00290 {if (EC) DIE("only 1 envelope allowed"); EC = EC_in;}
00291 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!remove@{remove}}
\index{remove@{remove}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::remove ({\bf Constraint} \& {\em c})\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_b3}


Only friends (e.g. Constraints) and derived classes may add  or remove themselves from the manager. The {\bf add}() {\rm (p.\,\pageref{class_ConstraintManager_b4})} function  returns the id assigned to the newly added constraint. 

Definition at line 263 of file constraint\_\-manager.C.

Referenced by Constraint::Input(), Constraint::Input\-Binary(), clear\-All\-Constraints(), clear\-Constraints(), Constraint::notify\-Remove(), and Constraint::set\-Manager().\footnotesize\begin{verbatim}00264 {
00265   // Make sure this constraint has a valid ID:
00266   if(dG && !dG->HasVertex(&c))
00267     return;
00268   else if(sG && !sG->HasVertex(&c))
00269     return;
00270 
00271   makeDynamic();                // Changing graph architecture, so need dynamic.
00272   c.notifyRemove();             // Notify the constraint it's being removed.
00273   // Recursively calls CM->remove() on all of c''s constraint support.
00274   dG->RemVertex(&c);    // Disconnect its node in the graph.
00275 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!resetMoved@{resetMoved}}
\index{resetMoved@{resetMoved}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::reset\-Moved (void)\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a35}


set all atoms in molecule to 'not moved yet'.



Definition at line 287 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00288 {for (int i = 0; i < M.Number(); i++) M[i].Moved()=false;}
00289 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!setAtom@{setAtom}}
\index{setAtom@{setAtom}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::set\-Atom (int {\em i}, const {\bf Atom} \& {\em a})\hspace{0.3cm}{\tt  [inline]}}\label{class_ConstraintManager_a28}




Definition at line 117 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00117                                      { M[i] = a; }
00118 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!setMolecule@{setMolecule}}
\index{setMolecule@{setMolecule}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::set\-Molecule (const {\bf Molecule} \& {\em mol})}\label{class_ConstraintManager_a25}




Definition at line 115 of file constraint\_\-manager.C.

Referenced by Satisfy\-Molecule::set\-Molecule().\footnotesize\begin{verbatim}00116 {
00117   if(M.Number() != mol.Number())
00118     {
00119       DIE("Invalid new molecule!\n");
00120     }
00121 
00122   M = mol;
00123   Constraint * constraint;
00124   if(makeDynamic())
00125     {
00126       int numCyc = dG->NumVertices();
00127       for(int i=M.Number(); i<=numCyc; i++)
00128         {
00129           constraint = dG->GetData(i);
00130           constraint->assertValidity(false);
00131         }
00132     }  else {
00133       DIE(" Error in setMolecule(...)");
00134     }
00135 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!setPosition@{setPosition}}
\index{setPosition@{setPosition}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::set\-Position (int {\em i}, const {\bf j\-Vector} \& {\em v})}\label{class_ConstraintManager_a27}




Definition at line 87 of file constraint\_\-manager.C.

Referenced by Random\-Perturb(), and Translate\-Model().\footnotesize\begin{verbatim}00088 {
00089   if (i>M.Number()-1){
00090     DIE("tried to setPosition on non-Atom constraint");
00091   }
00092   
00093   if (constraintON(i)){
00094   
00095     // Set this constraint to be invalid when moved
00096     Constraint * C = getConstraint(i);
00097     C->assertValidity(false);
00098 
00099     // Notify those constraints which depend on this atom
00100     // position that I have changed.
00101     Constraint * SuppC = 0;
00102     int numC = C->supportC.Length();
00103 
00104     for (int j = 0;j<numC;j++){
00105       SuppC = getConstraint(C->supportC[j]);    
00106       SuppC->notifyValid(C,false);    
00107     }
00108     M.setPosition(i,v);
00109     M[i].Moved() = true; // set atom moved' to true
00110   } else {
00111     DIE ("setPosition called for atom that is off");
00112   }
00113 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!setWeight@{setWeight}}
\index{setWeight@{setWeight}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Constraint\-Manager::set\-Weight (int {\em id})\hspace{0.3cm}{\tt  [inline, virtual]}}\label{class_ConstraintManager_a36}




Definition at line 137 of file constraint\_\-manager.h.\footnotesize\begin{verbatim}00137                                 {
00138     // not defined yet
00139     return;
00140 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!stress@{stress}}
\index{stress@{stress}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Constraint\-Manager::stress ()}\label{class_ConstraintManager_a40}


Return sum of stress over all aloms in the molecule.



Definition at line 175 of file constraint\_\-manager.C.

Referenced by gw\-Numerics::add\-LPERTSegments(), and get\-Stress\-List().\footnotesize\begin{verbatim}00176 {
00177 
00178   // calculates the stress of te whole molecule as the sum
00179   
00180   double total = 0;
00181   for (int i =0; i<M.Number(); i++)
00182     total += stress(i);
00183   return total;
00184 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!stress@{stress}}
\index{stress@{stress}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Constraint\-Manager::stress (int {\em atom}, const {\bf j\-Vector} \& {\em position}) const}\label{class_ConstraintManager_a39}


Return total stress for an atom as if it were in a new posistion.



Definition at line 170 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00171 {  
00172   return getConstraint(atom)->stress(atom,position) ;
00173 \end{verbatim}\normalsize 
\index{ConstraintManager@{Constraint\-Manager}!stress@{stress}}
\index{stress@{stress}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Constraint\-Manager::stress (int {\em Id})}\label{class_ConstraintManager_a38}


Return stress total stress for an atom.



Definition at line 165 of file constraint\_\-manager.C.\footnotesize\begin{verbatim}00166 {
00167   return getConstraint(Id)->stress();
00168 \end{verbatim}\normalsize 


\subsection{Friends And Related Function Documentation}
\index{ConstraintManager@{Constraint\-Manager}!Constraint@{Constraint}}
\index{Constraint@{Constraint}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}class Constraint\hspace{0.3cm}{\tt  [friend]}}\label{class_ConstraintManager_l1}




Definition at line 48 of file constraint\_\-manager.h.\index{ConstraintManager@{Constraint\-Manager}!ConstraintRegistry@{ConstraintRegistry}}
\index{ConstraintRegistry@{ConstraintRegistry}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}class Constraint\-Registry\hspace{0.3cm}{\tt  [friend]}}\label{class_ConstraintManager_l0}




Definition at line 47 of file constraint\_\-manager.h.

\subsection{Member Data Documentation}
\index{ConstraintManager@{Constraint\-Manager}!AtomConstraints@{AtomConstraints}}
\index{AtomConstraints@{AtomConstraints}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Atom\-Constraint} $\ast$ Constraint\-Manager::Atom\-Constraints\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_n3}


Array of dummy constraints, each holding one atom in the graph.



Definition at line 224 of file constraint\_\-manager.h.\index{ConstraintManager@{Constraint\-Manager}!EC@{EC}}
\index{EC@{EC}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Envelope\-Constraint} $\ast$ Constraint\-Manager::EC\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_n0}


////////////////////////////////////////////////////////////////////////

{\bf Constraint} {\rm (p.\,\pageref{class_Constraint})} Graphs:

Description:

There are 2 constraint graphs: one that is dynamic and one that is static. Only one of these graphs exists at any one point in  time. When a constraint manager is constructed, it is given a new dynamic graph, d\-G, and the static graph, s\-G, is undefined. Friend classes will check whether the current graph of constraints is being stored statically or dynamically and act accordingly.

//////////////////////////////////////////////////////////////////////// 

Definition at line 205 of file constraint\_\-manager.h.\index{ConstraintManager@{Constraint\-Manager}!M@{M}}
\index{M@{M}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Molecule} Constraint\-Manager::M\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_n4}


The single molecule this mgr works on.



Definition at line 260 of file constraint\_\-manager.h.

Referenced by d\-Stress(), and get\-Position().\index{ConstraintManager@{Constraint\-Manager}!TypeWeights@{TypeWeights}}
\index{TypeWeights@{TypeWeights}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf j\-Vector} Constraint\-Manager::Type\-Weights\hspace{0.3cm}{\tt  [private]}}\label{class_ConstraintManager_o0}




Definition at line 269 of file constraint\_\-manager.h.\index{ConstraintManager@{Constraint\-Manager}!dG@{dG}}
\index{dG@{dG}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf dynamic\-Graph} $\ast$ Constraint\-Manager::d\-G\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_n1}


The dynamic constraint graph.



Definition at line 211 of file constraint\_\-manager.h.\index{ConstraintManager@{Constraint\-Manager}!sG@{sG}}
\index{sG@{sG}!ConstraintManager@{Constraint\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf static\-Graph} $\ast$ Constraint\-Manager::s\-G\hspace{0.3cm}{\tt  [protected]}}\label{class_ConstraintManager_n2}


The static constraint graph.



Definition at line 214 of file constraint\_\-manager.h.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
{\bf constraint\_\-manager.h}\item 
{\bf constraint\_\-manager.C}\end{CompactItemize}
