source: trunk/ClpMatrixBase.cpp @ 225

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

This should break everything

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1// Copyright (C) 2002, International Business Machines
2// Corporation and others.  All Rights Reserved.
3
4#include "CoinPragma.hpp"
5
6#include <iostream>
7
8#include "ClpMatrixBase.hpp"
9#include "ClpSimplex.hpp"
10
11//#############################################################################
12// Constructors / Destructor / Assignment
13//#############################################################################
14
15//-------------------------------------------------------------------
16// Default Constructor
17//-------------------------------------------------------------------
18ClpMatrixBase::ClpMatrixBase () :
19  type_(-1)
20{
21
22}
23
24//-------------------------------------------------------------------
25// Copy constructor
26//-------------------------------------------------------------------
27ClpMatrixBase::ClpMatrixBase (const ClpMatrixBase & source) :
28  type_(source.type_)
29{ 
30
31}
32
33//-------------------------------------------------------------------
34// Destructor
35//-------------------------------------------------------------------
36ClpMatrixBase::~ClpMatrixBase ()
37{
38
39}
40
41//----------------------------------------------------------------
42// Assignment operator
43//-------------------------------------------------------------------
44ClpMatrixBase &
45ClpMatrixBase::operator=(const ClpMatrixBase& rhs)
46{
47  if (this != &rhs) {
48    type_ = rhs.type_;
49  }
50  return *this;
51}
52// And for scaling - default aborts for when scaling not supported
53void 
54ClpMatrixBase::times(double scalar,
55                     const double * x, double * y,
56                     const double * rowScale, 
57                     const double * columnScale) const
58{
59  if (rowScale) {
60    std::cerr<<"Scaling not supported - ClpMatrixBase"<<std::endl;
61    abort();
62  } else {
63    times(scalar,x,y);
64  }
65}
66// And for scaling - default aborts for when scaling not supported
67void 
68ClpMatrixBase::transposeTimes(double scalar,
69                                const double * x, double * y,
70                                const double * rowScale, 
71                                const double * columnScale) const
72{
73  if (rowScale) {
74    std::cerr<<"Scaling not supported - ClpMatrixBase"<<std::endl;
75    abort();
76  } else {
77    transposeTimes(scalar,x,y);
78  }
79}
80/* Subset clone (without gaps).  Duplicates are allowed
81   and order is as given.
82   Derived classes need not provide this as it may not always make
83   sense */
84ClpMatrixBase * 
85ClpMatrixBase::subsetClone (
86                            int numberRows, const int * whichRows,
87                            int numberColumns, const int * whichColumns) const
88 
89
90{
91  std::cerr<<"subsetClone not supported - ClpMatrixBase"<<std::endl;
92  abort();
93}
94/* Given positive integer weights for each row fills in sum of weights
95   for each column (and slack).
96   Returns weights vector
97   Default returns vector of ones
98*/
99CoinBigIndex * 
100ClpMatrixBase::dubiousWeights(const ClpSimplex * model,int * inputWeights) const
101{
102  int number = model->numberRows()+model->numberColumns();
103  CoinBigIndex * weights = new CoinBigIndex[number];
104  int i;
105  for (i=0;i<number;i++)
106    weights[i]=1;
107  return weights;
108}
109// Append Columns
110void 
111ClpMatrixBase::appendCols(int number, const CoinPackedVectorBase * const * columns)
112{
113  std::cerr<<"appendCols not supported - ClpMatrixBase"<<std::endl;
114  abort();
115}
116// Append Rows
117void 
118ClpMatrixBase::appendRows(int number, const CoinPackedVectorBase * const * rows)
119{
120  std::cerr<<"appendRows not supported - ClpMatrixBase"<<std::endl;
121  abort();
122}
123/* Returns largest and smallest elements of both signs.
124   Largest refers to largest absolute value.
125*/
126void 
127ClpMatrixBase::rangeOfElements(double & smallestNegative, double & largestNegative,
128                       double & smallestPositive, double & largestPositive)
129{
130  smallestNegative=0.0;
131  largestNegative=0.0;
132  smallestPositive=0.0;
133  largestPositive=0.0;
134}
Note: See TracBrowser for help on using the repository browser.