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