source: trunk/Clp/src/ClpDummyMatrix.cpp @ 754

Last change on this file since 754 was 754, checked in by andreasw, 14 years ago

first version

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