source: trunk/ClpDummyMatrix.cpp @ 240

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

Add returns

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