source: trunk/ClpDummyMatrix.cpp @ 451

Last change on this file since 451 was 451, checked in by forrest, 16 years ago

Changes to make a difficult problem faster (dual) + quadratic

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.3 KB
Line 
1// Copyright (C) 2003, International Business Machines
2// Corporation and others.  All Rights Reserved.
3
4
5#include <cstdio>
6
7#include "CoinPragma.hpp"
8
9#include "ClpSimplex.hpp"
10#include "ClpDummyMatrix.hpp"
11#include "ClpFactorization.hpp"
12#include "ClpMessage.hpp"
13
14//#############################################################################
15// Constructors / Destructor / Assignment
16//#############################################################################
17
18//-------------------------------------------------------------------
19// Default Constructor
20//-------------------------------------------------------------------
21ClpDummyMatrix::ClpDummyMatrix () 
22  : ClpMatrixBase()
23{
24  setType(14);
25  numberRows_=0;
26  numberColumns_=0;
27  numberElements_=0;
28}
29
30/* Constructor from data */
31ClpDummyMatrix::ClpDummyMatrix(int numberColumns, int numberRows,
32                                   int numberElements)
33  : ClpMatrixBase()
34{
35  setType(14);
36  numberRows_=numberRows;
37  numberColumns_=numberColumns;
38  numberElements_=numberElements;
39}
40//-------------------------------------------------------------------
41// Copy constructor
42//-------------------------------------------------------------------
43ClpDummyMatrix::ClpDummyMatrix (const ClpDummyMatrix & rhs) 
44: ClpMatrixBase(rhs)
45{ 
46  numberRows_=rhs.numberRows_;
47  numberColumns_=rhs.numberColumns_;
48  numberElements_=rhs.numberElements_;
49}
50
51ClpDummyMatrix::ClpDummyMatrix (const CoinPackedMatrix & rhs) 
52  : ClpMatrixBase()
53{ 
54  std::cerr<<"Constructor from CoinPackedMatrix nnot supported - ClpDummyMatrix"<<std::endl;
55  abort();
56}
57
58//-------------------------------------------------------------------
59// Destructor
60//-------------------------------------------------------------------
61ClpDummyMatrix::~ClpDummyMatrix ()
62{
63}
64
65//----------------------------------------------------------------
66// Assignment operator
67//-------------------------------------------------------------------
68ClpDummyMatrix &
69ClpDummyMatrix::operator=(const ClpDummyMatrix& rhs)
70{
71  if (this != &rhs) {
72    ClpMatrixBase::operator=(rhs);
73    numberRows_=rhs.numberRows_;
74    numberColumns_=rhs.numberColumns_;
75    numberElements_=rhs.numberElements_;
76  }
77  return *this;
78}
79//-------------------------------------------------------------------
80// Clone
81//-------------------------------------------------------------------
82ClpMatrixBase * ClpDummyMatrix::clone() const
83{
84  return new ClpDummyMatrix(*this);
85}
86
87/* Returns a new matrix in reverse order without gaps */
88ClpMatrixBase * 
89ClpDummyMatrix::reverseOrderedCopy() const
90{
91  std::cerr<<"reverseOrderedCopy not supported - ClpDummyMatrix"<<std::endl;
92  abort();
93  return NULL;
94}
95//unscaled versions
96void 
97ClpDummyMatrix::times(double scalar,
98                   const double * x, double * y) const
99{
100  std::cerr<<"times not supported - ClpDummyMatrix"<<std::endl;
101  abort();
102}
103void 
104ClpDummyMatrix::transposeTimes(double scalar,
105                                const double * x, double * y) const
106{
107  std::cerr<<"transposeTimes not supported - ClpDummyMatrix"<<std::endl;
108  abort();
109}
110void 
111ClpDummyMatrix::times(double scalar,
112                       const double * x, double * y,
113                       const double * rowScale, 
114                       const double * columnScale) const
115{
116  std::cerr<<"timesnot supported - ClpDummyMatrix"<<std::endl;
117  abort();
118}
119void 
120ClpDummyMatrix::transposeTimes( double scalar,
121                                 const double * x, double * y,
122                                 const double * rowScale, 
123                                 const double * columnScale) const
124{
125  std::cerr<<"transposeTimesnot supported - ClpDummyMatrix"<<std::endl;
126  abort();
127}
128/* Return <code>x * A + y</code> in <code>z</code>.
129        Squashes small elements and knows about ClpSimplex */
130void 
131ClpDummyMatrix::transposeTimes(const ClpSimplex * model, double scalar,
132                              const CoinIndexedVector * rowArray,
133                              CoinIndexedVector * y,
134                              CoinIndexedVector * columnArray) const
135{
136  std::cerr<<"transposeTimes not supported - ClpDummyMatrix"<<std::endl;
137  abort();
138}
139/* Return <code>x *A in <code>z</code> but
140   just for indices in y */
141void 
142ClpDummyMatrix::subsetTransposeTimes(const ClpSimplex * model,
143                              const CoinIndexedVector * rowArray,
144                              const CoinIndexedVector * y,
145                              CoinIndexedVector * columnArray) const
146{
147  std::cerr<<"subsetTransposeTimes not supported - ClpDummyMatrix"<<std::endl;
148  abort();
149}
150/* If element NULL returns number of elements in column part of basis,
151   If not NULL fills in as well */
152CoinBigIndex
153ClpDummyMatrix::fillBasis(ClpSimplex * model,
154                                 const int * whichColumn, 
155                                 int numberBasic,
156                                 int & numberColumnBasic,
157                                 int * indexRowU, int * indexColumnU,
158                                 double * elementU) 
159{
160  std::cerr<<"fillBasis not supported - ClpDummyMatrix"<<std::endl;
161  abort();
162  return 0;
163}
164/* Unpacks a column into an CoinIndexedvector
165 */
166void 
167ClpDummyMatrix::unpack(const ClpSimplex * model,CoinIndexedVector * rowArray,
168                   int iColumn) const 
169{
170  std::cerr<<"unpack not supported - ClpDummyMatrix"<<std::endl;
171  abort();
172}
173/* Unpacks a column into an CoinIndexedvector
174** in packed foramt
175Note that model is NOT const.  Bounds and objective could
176be modified if doing column generation (just for this variable) */
177void 
178ClpDummyMatrix::unpackPacked(ClpSimplex * model,
179                            CoinIndexedVector * rowArray,
180                            int iColumn) const
181{
182  std::cerr<<"unpackPacked not supported - ClpDummyMatrix"<<std::endl;
183  abort();
184}
185/* Adds multiple of a column into an CoinIndexedvector
186      You can use quickAdd to add to vector */
187void 
188ClpDummyMatrix::add(const ClpSimplex * model,CoinIndexedVector * rowArray,
189                   int iColumn, double multiplier) const 
190{
191  std::cerr<<"add not supported - ClpDummyMatrix"<<std::endl;
192  abort();
193}
194/* Adds multiple of a column into an array */
195void 
196ClpDummyMatrix::add(const ClpSimplex * model,double * array,
197                    int column, double multiplier) const
198{
199  std::cerr<<"add not supported - ClpDummyMatrix"<<std::endl;
200  abort();
201}
202
203// Return a complete CoinPackedMatrix
204CoinPackedMatrix * 
205ClpDummyMatrix::getPackedMatrix() const 
206{
207  std::cerr<<"getPackedMatrix not supported - ClpDummyMatrix"<<std::endl;
208  abort();
209  return NULL;
210}
211/* A vector containing the elements in the packed matrix. Note that there
212   might be gaps in this list, entries that do not belong to any
213   major-dimension vector. To get the actual elements one should look at
214   this vector together with vectorStarts and vectorLengths. */
215const double * 
216ClpDummyMatrix::getElements() const 
217{
218  std::cerr<<"getElements not supported - ClpDummyMatrix"<<std::endl;
219  abort();
220  return NULL;
221}
222
223const CoinBigIndex * 
224ClpDummyMatrix::getVectorStarts() const 
225{
226  std::cerr<<"getVectorStarts not supported - ClpDummyMatrix"<<std::endl;
227  abort();
228  return NULL;
229}
230/* The lengths of the major-dimension vectors. */
231const int * 
232ClpDummyMatrix::getVectorLengths() const
233{
234  std::cerr<<"get VectorLengths not supported - ClpDummyMatrix"<<std::endl;
235  abort();
236  return NULL;
237}
238/* Delete the columns whose indices are listed in <code>indDel</code>. */
239void ClpDummyMatrix::deleteCols(const int numDel, const int * indDel) 
240{
241  std::cerr<<"deleteCols not supported - ClpDummyMatrix"<<std::endl;
242  abort();
243}
244/* Delete the rows whose indices are listed in <code>indDel</code>. */
245void ClpDummyMatrix::deleteRows(const int numDel, const int * indDel) 
246{
247  std::cerr<<"deleteRows not supported - ClpDummyMatrix"<<std::endl;
248  abort();
249}
250const int *
251ClpDummyMatrix::getIndices() const
252{
253  std::cerr<<"getIndices not supported - ClpDummyMatrix"<<std::endl;
254  abort();
255  return NULL;
256}
Note: See TracBrowser for help on using the repository browser.