Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

base/LCP.cpp

Go to the documentation of this file.
00001 /****************************************************************************
00002   Copyright (C)1996 David Jung <opensim@pobox.com>
00003 
00004   This program/file is free software; you can redistribute it and/or modify
00005   it under the terms of the GNU General Public License as published by
00006   the Free Software Foundation; either version 2 of the License, or
00007   (at your option) any later version.
00008   
00009   This program is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012   GNU General Public License for more details. (http://www.gnu.org)
00013   
00014   You should have received a copy of the GNU General Public License
00015   along with this program; if not, write to the Free Software
00016   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017   
00018   $Id: Matrix4.cpp,v 1.6 2001/05/22 19:24:19 jungd Exp $
00019   $Revision: 1.6 $
00020   $Date: 2001/05/22 19:24:19 $
00021   $Author: jungd $
00022  
00023 ****************************************************************************/
00024 
00025 #include <base/LCP>
00026 
00027 #include <vector>
00028 
00029 using base::Matrix;
00030 using base::Vector;
00031 
00032 using std::ostream;
00033 
00034 
00035 namespace {
00036 
00037   typedef std::vector<bool> IndexSet;
00038 
00039   
00040   Real AiSxqS(const Matrix& A, Int i, 
00041               const IndexSet& S, const Vector& q)
00042   {
00043     Real sum=0;
00044     for(Int k=1; k<=q.dimension(); k++)
00045       if (S[k]) sum += A(i,k)*q[k];
00046     return sum;
00047   }
00048 
00049   
00050   void transferiToN(Int i)
00051   {
00052     #ifdef DEBUG
00053 
00054     #endif
00055   }
00056 
00057 
00058 }
00059 
00060 
00061 void base::LCPSolve(const Matrix& A, Vector& x, 
00062                     const Vector& b, Vector& w)
00063 {
00064   Int n=b.dimension();
00065 
00066   Matrix L(A.rows(), A.columns());
00067   Vector d(n);
00068   Vector delta_x(n), delta_w(n);
00069   Vector Dell(n), ell(n), tmp(n);
00070   IndexSet p(n),C(n);
00071   Int i;//,k;
00072 
00073   x = Vector(n);
00074   w = Vector(n);
00075 
00076   for(i=1; i<=n; i++) {
00077     w[i] = AiSxqS(A,i,C,x) - b[i];
00078     if (w[i] >= 0)
00079       ;
00080     //...
00081 
00082   }
00083 
00084 }
00085 
00086 
00087 
00088 void base::LCPSolve(const Matrix& A, Vector& x, 
00089                     const Vector& b, Vector& w,
00090                     Int numUnbounded,
00091                     const Vector& lo, const Vector& hi)
00092 {
00093 }
00094 
00095 

Generated on Thu Jul 29 15:56:06 2004 for OpenSim by doxygen 1.3.6