source: branches/pre/ClpDummyMatrix.cpp @ 1926

Last change on this file since 1926 was 217, checked in by forrest, 17 years ago

Nearly there

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