CouenneSparseMatrix.cpp
Go to the documentation of this file.
1 /* $Id: CouenneSparseMatrix.cpp 716 2011-06-26 12:43:43Z pbelotti $
2  *
3  * Name: CouenneSparseMatrix.cpp
4  * Authors: Pietro Belotti, Clemson University
5  * Purpose: Implementation of a sparse Matrix for use in distance
6  * measurements in Feasibility Pump
7  *
8  * This file is licensed under the Eclipse Public License (EPL)
9  */
10 
11 #include "CouenneSparseMatrix.hpp"
12 #include "CoinHelperFunctions.hpp"
13 
14 using namespace Couenne;
15 
18 
19  num_ (0),
20  val_ (NULL),
21  col_ (NULL),
22  row_ (NULL) {}
23 
24 
27 
28  if (val_) {
29 
30  free (val_);
31  free (col_);
32  free (row_);
33  }
34 }
35 
38 {operator= (rhs);}
39 
42 
43  num_ = rhs.num_;
44 
45  val_ = rhs.val_ && num_ ? CoinCopyOfArray (rhs.val_, num_) : NULL;
46  col_ = rhs.col_ && num_ ? CoinCopyOfArray (rhs.col_, num_) : NULL;
47  row_ = rhs.row_ && num_ ? CoinCopyOfArray (rhs.row_, num_) : NULL;
48 
49  return *this;
50 }
51 
54 {return new CouenneSparseMatrix (*this);}
int num_
Stores the values of the Matrix of the Lagrangian at optimum for later use.
Class for sparse Matrixs (used in modifying distances in FP)
CouenneSparseMatrix & operator=(const CouenneSparseMatrix &rhs)
Assignment.
CouenneSparseMatrix * clone()
Clone.
virtual ~CouenneSparseMatrix()
Destructor.