source: trunk/ClpDummyMatrix.cpp @ 437

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

Stuff for gub - I hope it does not break anything

  • 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.
141   Squashes small elements and knows about ClpSimplex */
142void 
143ClpDummyMatrix::subsetTransposeTimes(const ClpSimplex * model,
144                              const CoinIndexedVector * rowArray,
145                              const CoinIndexedVector * y,
146                              CoinIndexedVector * columnArray) const
147{
148  std::cerr<<"subsetTransposeTimes not supported - ClpDummyMatrix"<<std::endl;
149  abort();
150}
151/* If element NULL returns number of elements in column part of basis,
152   If not NULL fills in as well */
153CoinBigIndex
154ClpDummyMatrix::fillBasis(ClpSimplex * model,
155                                 const int * whichColumn, 
156                                 int numberBasic,
157                                 int & numberColumnBasic,
158                                 int * indexRowU, int * indexColumnU,
159                                 double * elementU) 
160{
161  std::cerr<<"fillBasis not supported - ClpDummyMatrix"<<std::endl;
162  abort();
163  return 0;
164}
165/* Unpacks a column into an CoinIndexedvector
166 */
167void 
168ClpDummyMatrix::unpack(const ClpSimplex * model,CoinIndexedVector * rowArray,
169                   int iColumn) const 
170{
171  std::cerr<<"unpack not supported - ClpDummyMatrix"<<std::endl;
172  abort();
173}
174/* Unpacks a column into an CoinIndexedvector
175** in packed foramt
176Note that model is NOT const.  Bounds and objective could
177be modified if doing column generation (just for this variable) */
178void 
179ClpDummyMatrix::unpackPacked(ClpSimplex * model,
180                            CoinIndexedVector * rowArray,
181                            int iColumn) const
182{
183  std::cerr<<"unpackPacked not supported - ClpDummyMatrix"<<std::endl;
184  abort();
185}
186/* Adds multiple of a column into an CoinIndexedvector
187      You can use quickAdd to add to vector */
188void 
189ClpDummyMatrix::add(const ClpSimplex * model,CoinIndexedVector * rowArray,
190                   int iColumn, double multiplier) const 
191{
192  std::cerr<<"add not supported - ClpDummyMatrix"<<std::endl;
193  abort();
194}
195/* Adds multiple of a column into an array */
196void 
197ClpDummyMatrix::add(const ClpSimplex * model,double * array,
198                    int column, double multiplier) const
199{
200  std::cerr<<"add not supported - ClpDummyMatrix"<<std::endl;
201  abort();
202}
203
204// Return a complete CoinPackedMatrix
205CoinPackedMatrix * 
206ClpDummyMatrix::getPackedMatrix() const 
207{
208  std::cerr<<"getPackedMatrix not supported - ClpDummyMatrix"<<std::endl;
209  abort();
210  return NULL;
211}
212/* A vector containing the elements in the packed matrix. Note that there
213   might be gaps in this list, entries that do not belong to any
214   major-dimension vector. To get the actual elements one should look at
215   this vector together with vectorStarts and vectorLengths. */
216const double * 
217ClpDummyMatrix::getElements() const 
218{
219  std::cerr<<"getElements not supported - ClpDummyMatrix"<<std::endl;
220  abort();
221  return NULL;
222}
223
224const CoinBigIndex * 
225ClpDummyMatrix::getVectorStarts() const 
226{
227  std::cerr<<"getVectorStarts not supported - ClpDummyMatrix"<<std::endl;
228  abort();
229  return NULL;
230}
231/* The lengths of the major-dimension vectors. */
232const int * 
233ClpDummyMatrix::getVectorLengths() const
234{
235  std::cerr<<"get VectorLengths not supported - ClpDummyMatrix"<<std::endl;
236  abort();
237  return NULL;
238}
239/* Delete the columns whose indices are listed in <code>indDel</code>. */
240void ClpDummyMatrix::deleteCols(const int numDel, const int * indDel) 
241{
242  std::cerr<<"deleteCols not supported - ClpDummyMatrix"<<std::endl;
243  abort();
244}
245/* Delete the rows whose indices are listed in <code>indDel</code>. */
246void ClpDummyMatrix::deleteRows(const int numDel, const int * indDel) 
247{
248  std::cerr<<"deleteRows not supported - ClpDummyMatrix"<<std::endl;
249  abort();
250}
251const int *
252ClpDummyMatrix::getIndices() const
253{
254  std::cerr<<"getIndices not supported - ClpDummyMatrix"<<std::endl;
255  abort();
256  return NULL;
257}
Note: See TracBrowser for help on using the repository browser.