Interior-point-optimisation  1.0-1
Interior-pointoptimisationlibrary
Var.cc
Go to the documentation of this file.
1 /*
2  * $Id: Var.cc 105 2013-06-02 15:46:43Z 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 #ifdef HAVE_CONFIG_H
21 # include<config.h>
22 #endif
23 
24 #include"Var.hpp"
25 
26 using namespace ipo::detail;
27 
28 Var::Var( ModelBase& model ) : model( model ){}
29 
31 
32 Var&
34  if( &var.model != &model )
35  throw IPOE( "ipo::Var::operator=(): cannot assign var to different model." );
36  return *this;
37 }
38 
39 Var&
41  if( &var.model != &model )
42  throw IPOE( "ipo::Var::operator=(): cannot assign var to different model." );
43  return *this;
44 }
Var(ModelBase &model)
Constructor needs a model so that variable can only be attached to one model.
Definition: Var.cc:28
virtual ~Var()=0
Virtual destructor to make class abstract.
Definition: Var.cc:30
ModelBase & model
A Model to attach this to.
Definition: Var.hpp:101
#define IPOE(message)
Macro to allow file and line names in exceptions.
Abstract base class for model.
Definition: Var.hpp:39
Namespace for classes that handle details of interior-point optimisation that are not ordinarily acce...
Definition: Model.hpp:316
Var & operator=(Var &var)
Copy assignment operator.
Definition: Var.cc:40
Abstract base class for Variable and Array;.
Definition: Var.hpp:49