So-Bogus
A c++ sparse block matrix library aimed at Second Order cone problems
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
LCPLaw.hpp
1 /*
2  * This file is part of bogus, a C++ sparse block matrix library.
3  *
4  * Copyright 2013 Gilles Daviet <gdaviet@gmail.com>
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 */
10 
11 #ifndef BOGUS_LCPLAW_HPP
12 #define BOGUS_LCPLAW_HPP
13 
14 #include <cmath>
15 
16 namespace bogus
17 {
18 
20 
25 template < typename Scalar >
26 class LCPLaw
27 {
28 public:
29  enum{ dimension = 1 } ;
30 
32 
34  LCPLaw( ) {}
35 
37  Scalar eval( const unsigned problemIndex,
38  const typename Traits::Vector &x,
39  const typename Traits::Vector &y ) const ;
40 
42 
45  bool solveLocal(
46  const unsigned problemIndex,
47  const typename Traits::Matrix &A,
48  const typename Traits::Vector &b,
49  typename Traits::Vector &x,
50  const Scalar scaling
51  ) const ;
52 
54  void projectOnConstraint( const unsigned problemIndex, typename Traits::Vector &x ) const ;
55 
57  template< typename Segment >
58  void dualityCOV( const unsigned , const Segment& ,
59  typename Traits::Vector& s ) const
60  { s->setZero() ; }
61 } ;
62 
63 
64 }
65 
66 #endif
void projectOnConstraint(const unsigned problemIndex, typename Traits::Vector &x) const
Projects x on .
LCPLaw()
Constructor.
Definition: LCPLaw.hpp:34
bool solveLocal(const unsigned problemIndex, const typename Traits::Matrix &A, const typename Traits::Vector &b, typename Traits::Vector &x, const Scalar scaling) const
Solves the local problem.
LCP local solver that can be used within GaussSeidel and ProjectedGradient solvers.
Definition: LCPLaw.hpp:26
void dualityCOV(const unsigned, const Segment &, typename Traits::Vector &s) const
This NSLaw is always associated, so dualityCOV is null.
Definition: LCPLaw.hpp:58
Definition: EigenProblemTraits.hpp:38
Scalar eval(const unsigned problemIndex, const typename Traits::Vector &x, const typename Traits::Vector &y) const