Interior-point-optimisation  1.0-1
Interior-pointoptimisationlibrary
ModelFunction.hpp
Go to the documentation of this file.
1 /*
2  * $Id: ModelFunction.hpp 174 2013-07-02 16:57:30Z jdl3 $
3  * Copyright (C) 2013 John D Lamb
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or (at
8  * your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19 
20 #ifndef IPO_FUNCTION_DETAIL_MODELFUNCTION_HPP
21 #define IPO_FUNCTION_DETAIL_MODELFUNCTION_HPP
22 
23 #include"../Array.hpp"
24 #include"SharedFunctionPtr.hpp"
25 #include"../../ipo_function/Function.hpp"
26 
27 namespace ipo {
28  namespace detail {
32  class ModelFunction {
33  public:
38  ModelFunction( SharedFunctionPtr function );
57  virtual ipo::Array& getVariables() = 0;
63  virtual void addVariable( ipo::Variable& variable );
71  bool checkSize() const;
76  std::tuple<size_t,size_t> getSizes() const;
81  virtual::ipo_function::Function* getFunction(){ return function.get(); }
82  protected:
87  };
88 
89  }
90 }
91 
92 #endif
Shared pointer to ipo::Function object.
std::tuple< size_t, size_t > getSizes() const
Get size of vector for function arguments and number of variables supplied.
Abstract base class for Objective and Constraint.
ModelFunction(SharedFunctionPtr function)
Use this constructor to construct from a SharedFunctionPtr object.
This class computes a function at a vector.
Definition: Function.hpp:38
virtual ipo::Array & getVariables()=0
Get variables used by Objective or Constraint function.
This class represents a variable.
Definition: Variable.hpp:36
virtual ::ipo_function::Function * getFunction()
Get function.
This class represents an array of Variable objects.
Definition: Array.hpp:45
bool checkSize() const
Check size of vector for function arguments matches number of variables supplied. ...
virtual void addVariable(ipo::Variable &variable)
Add a Variable to the end of the Array of variables.
This namespace holds all the interior-point optimisation classes.
Definition: Array.hpp:28