Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

ClpMatrixBase.cpp

00001 // Copyright (C) 2002, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 
00004 #include "CoinPragma.hpp"
00005 
00006 #include <iostream>
00007 
00008 #include "ClpMatrixBase.hpp"
00009 #include "ClpSimplex.hpp"
00010 
00011 //#############################################################################
00012 // Constructors / Destructor / Assignment
00013 //#############################################################################
00014 
00015 //-------------------------------------------------------------------
00016 // Default Constructor 
00017 //-------------------------------------------------------------------
00018 ClpMatrixBase::ClpMatrixBase () :
00019   type_(-1)
00020 {
00021 
00022 }
00023 
00024 //-------------------------------------------------------------------
00025 // Copy constructor 
00026 //-------------------------------------------------------------------
00027 ClpMatrixBase::ClpMatrixBase (const ClpMatrixBase & source) :
00028   type_(source.type_)
00029 {  
00030 
00031 }
00032 
00033 //-------------------------------------------------------------------
00034 // Destructor 
00035 //-------------------------------------------------------------------
00036 ClpMatrixBase::~ClpMatrixBase ()
00037 {
00038 
00039 }
00040 
00041 //----------------------------------------------------------------
00042 // Assignment operator 
00043 //-------------------------------------------------------------------
00044 ClpMatrixBase &
00045 ClpMatrixBase::operator=(const ClpMatrixBase& rhs)
00046 {
00047   if (this != &rhs) {
00048     type_ = rhs.type_;
00049   }
00050   return *this;
00051 }
00052 // And for scaling - default aborts for when scaling not supported
00053 void 
00054 ClpMatrixBase::times(double scalar,
00055                      const double * x, double * y,
00056                      const double * rowScale, 
00057                      const double * columnScale) const
00058 {
00059   if (rowScale) {
00060     std::cerr<<"Scaling not supported - ClpMatrixBase"<<std::endl;
00061     abort();
00062   } else {
00063     times(scalar,x,y);
00064   }
00065 }
00066 // And for scaling - default aborts for when scaling not supported
00067 void 
00068 ClpMatrixBase::transposeTimes(double scalar,
00069                                 const double * x, double * y,
00070                                 const double * rowScale, 
00071                                 const double * columnScale) const
00072 {
00073   if (rowScale) {
00074     std::cerr<<"Scaling not supported - ClpMatrixBase"<<std::endl;
00075     abort();
00076   } else {
00077     transposeTimes(scalar,x,y);
00078   }
00079 }
00080 /* Subset clone (without gaps).  Duplicates are allowed
00081    and order is as given.
00082    Derived classes need not provide this as it may not always make
00083    sense */
00084 ClpMatrixBase * 
00085 ClpMatrixBase::subsetClone (
00086                             int numberRows, const int * whichRows,
00087                             int numberColumns, const int * whichColumns) const
00088  
00089 
00090 {
00091   std::cerr<<"subsetClone not supported - ClpMatrixBase"<<std::endl;
00092   abort();
00093   return NULL;
00094 }
00095 /* Given positive integer weights for each row fills in sum of weights
00096    for each column (and slack).
00097    Returns weights vector
00098    Default returns vector of ones
00099 */
00100 CoinBigIndex * 
00101 ClpMatrixBase::dubiousWeights(const ClpSimplex * model,int * inputWeights) const
00102 {
00103   int number = model->numberRows()+model->numberColumns();
00104   CoinBigIndex * weights = new CoinBigIndex[number];
00105   int i;
00106   for (i=0;i<number;i++)
00107     weights[i]=1;
00108   return weights;
00109 }
00110 // Append Columns
00111 void 
00112 ClpMatrixBase::appendCols(int number, const CoinPackedVectorBase * const * columns)
00113 {
00114   std::cerr<<"appendCols not supported - ClpMatrixBase"<<std::endl;
00115   abort();
00116 }
00117 // Append Rows
00118 void 
00119 ClpMatrixBase::appendRows(int number, const CoinPackedVectorBase * const * rows)
00120 {
00121   std::cerr<<"appendRows not supported - ClpMatrixBase"<<std::endl;
00122   abort();
00123 }
00124 /* Returns largest and smallest elements of both signs.
00125    Largest refers to largest absolute value.
00126 */
00127 void 
00128 ClpMatrixBase::rangeOfElements(double & smallestNegative, double & largestNegative,
00129                        double & smallestPositive, double & largestPositive)
00130 {
00131   smallestNegative=0.0;
00132   largestNegative=0.0;
00133   smallestPositive=0.0;
00134   largestPositive=0.0;
00135 }
00136 // Says whether it can do partial pricing
00137 bool 
00138 ClpMatrixBase::canDoPartialPricing() const
00139 {
00140   return false; // default is no
00141 }
00142 // Partial pricing 
00143 void 
00144 ClpMatrixBase::partialPricing(ClpSimplex * model, int start, int end,
00145                               int & bestSequence, int & numberWanted)
00146 {
00147   std::cerr<<"partialPricing not supported - ClpMatrixBase"<<std::endl;
00148   abort();
00149 }

Generated on Wed Dec 3 14:37:26 2003 for CLP by doxygen 1.3.5