Loading...
Searching...
No Matches
ClpNetworkMatrix.hpp
Go to the documentation of this file.
/* $Id$ */
// Copyright (C) 2003, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
#ifndef ClpNetworkMatrix_H
#define ClpNetworkMatrix_H
#include "CoinPragma.hpp"
#include "ClpMatrixBase.hpp"
class ClpNetworkMatrix : public ClpMatrixBase {
public:
virtual CoinPackedMatrix *getPackedMatrix() const;
virtual bool isColOrdered() const
{
return true;
}
virtual CoinBigIndex getNumElements() const
{
return 2 * numberColumns_;
}
virtual int getNumCols() const
{
return numberColumns_;
}
virtual int getNumRows() const
{
return numberRows_;
}
virtual const double *getElements() const;
virtual const int *getIndices() const
{
return indices_;
}
virtual const CoinBigIndex *getVectorStarts() const;
virtual const int *getVectorLengths() const;
virtual void deleteCols(const int numDel, const int *indDel);
virtual void deleteRows(const int numDel, const int *indDel);
virtual void appendCols(int number, const CoinPackedVectorBase *const *columns);
virtual void appendRows(int number, const CoinPackedVectorBase *const *rows);
#ifndef SLIM_CLP
virtual int appendMatrix(int number, int type,
const CoinBigIndex *starts, const int *index,
const double *element, int numberOther = -1);
#endif
virtual ClpMatrixBase *reverseOrderedCopy() const;
virtual int countBasis(
const int *whichColumn,
int &numberColumnBasic);
virtual void fillBasis(ClpSimplex *model,
const int *whichColumn,
int &numberColumnBasic,
int *row, int *start,
int *rowCount, int *columnCount,
CoinFactorizationDouble *element);
virtual CoinBigIndex *dubiousWeights(const ClpSimplex *model, int *inputWeights) const;
virtual void rangeOfElements(double &smallestNegative, double &largestNegative,
double &smallestPositive, double &largestPositive);
virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray,
int column) const;
virtual void unpackPacked(ClpSimplex *model,
CoinIndexedVector *rowArray,
int column) const;
virtual void add(const ClpSimplex *model, CoinIndexedVector *rowArray,
int column, double multiplier) const;
virtual void add(const ClpSimplex *model, double *array,
int column, double multiplier) const;
virtual void releasePackedMatrix() const;
virtual bool canDoPartialPricing() const;
virtual void partialPricing(ClpSimplex *model, double start, double end,
int &bestSequence, int &numberWanted);
virtual void times(double scalar,
const double *x, double *y) const;
virtual void times(double scalar,
const double *x, double *y,
const double *rowScale,
const double *columnScale) const;
virtual void transposeTimes(double scalar,
const double *x, double *y) const;
virtual void transposeTimes(double scalar,
const double *x, double *y,
const double *rowScale,
const double *columnScale, double *spare = NULL) const;
virtual void transposeTimes(const ClpSimplex *model, double scalar,
const CoinIndexedVector *x,
CoinIndexedVector *y,
CoinIndexedVector *z) const;
virtual void subsetTransposeTimes(const ClpSimplex *model,
const CoinIndexedVector *x,
const CoinIndexedVector *y,
CoinIndexedVector *z) const;
inline bool trueNetwork() const
{
return trueNetwork_;
}
ClpNetworkMatrix();
ClpNetworkMatrix(int numberColumns, const int *head,
const int *tail);
virtual ~ClpNetworkMatrix();
ClpNetworkMatrix(const ClpNetworkMatrix &);
ClpNetworkMatrix(const CoinPackedMatrix &);
ClpNetworkMatrix &operator=(const ClpNetworkMatrix &);
virtual ClpMatrixBase *clone() const;
ClpNetworkMatrix(const ClpNetworkMatrix &wholeModel,
int numberRows, const int *whichRows,
int numberColumns, const int *whichColumns);
virtual ClpMatrixBase *subsetClone(
int numberRows, const int *whichRows,
int numberColumns, const int *whichColumns) const;
protected:
mutable CoinPackedMatrix *matrix_;
mutable int *lengths_;
int *indices_;
int numberRows_;
int numberColumns_;
bool trueNetwork_;
};
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
ClpMatrixBase.hpp
ClpMatrixBase::ClpMatrixBase
ClpMatrixBase()
Default constructor.
ClpMatrixBase::type
int type() const
Returns type.
Definition ClpMatrixBase.hpp:383
ClpNetworkMatrix::indices_
int * indices_
Data -1, then +1 rows in pairs (row==-1 if one entry).
Definition ClpNetworkMatrix.hpp:221
ClpNetworkMatrix::getPackedMatrix
virtual CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
ClpNetworkMatrix::trueNetwork_
bool trueNetwork_
True if all entries have two elements.
Definition ClpNetworkMatrix.hpp:227
ClpNetworkMatrix::numberRows_
int numberRows_
Number of rows.
Definition ClpNetworkMatrix.hpp:223
ClpNetworkMatrix::deleteCols
virtual void deleteCols(const int numDel, const int *indDel)
Delete the columns whose indices are listed in indDel.
ClpNetworkMatrix::clone
virtual ClpMatrixBase * clone() const
Clone.
ClpNetworkMatrix::appendCols
virtual void appendCols(int number, const CoinPackedVectorBase *const *columns)
Append Columns.
ClpNetworkMatrix::operator=
ClpNetworkMatrix & operator=(const ClpNetworkMatrix &)
ClpNetworkMatrix::unpackPacked
virtual void unpackPacked(ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
Unpacks a column into an CoinIndexedvector in packed format Note that model is NOT const.
ClpNetworkMatrix::trueNetwork
bool trueNetwork() const
Return true if really network, false if has slacks.
Definition ClpNetworkMatrix.hpp:174
ClpNetworkMatrix::lengths_
int * lengths_
Definition ClpNetworkMatrix.hpp:219
ClpNetworkMatrix::ClpNetworkMatrix
ClpNetworkMatrix()
Default constructor.
ClpNetworkMatrix::rangeOfElements
virtual void rangeOfElements(double &smallestNegative, double &largestNegative, double &smallestPositive, double &largestPositive)
Returns largest and smallest elements of both signs.
ClpNetworkMatrix::isColOrdered
virtual bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
Definition ClpNetworkMatrix.hpp:26
ClpNetworkMatrix::canDoPartialPricing
virtual bool canDoPartialPricing() const
Says whether it can do partial pricing.
ClpNetworkMatrix::add
virtual void add(const ClpSimplex *model, double *array, int column, double multiplier) const
Adds multiple of a column into an array.
ClpNetworkMatrix::ClpNetworkMatrix
ClpNetworkMatrix(const ClpNetworkMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
Subset constructor (without gaps).
ClpNetworkMatrix::subsetClone
virtual ClpMatrixBase * subsetClone(int numberRows, const int *whichRows, int numberColumns, const int *whichColumns) const
Subset clone (without gaps).
ClpNetworkMatrix::transposeTimes
virtual void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
ClpNetworkMatrix::fillBasis
virtual void fillBasis(ClpSimplex *model, const int *whichColumn, int &numberColumnBasic, int *row, int *start, int *rowCount, int *columnCount, CoinFactorizationDouble *element)
Fills in column part of basis.
ClpNetworkMatrix::add
virtual void add(const ClpSimplex *model, CoinIndexedVector *rowArray, int column, double multiplier) const
Adds multiple of a column into an CoinIndexedvector You can use quickAdd to add to vector.
ClpNetworkMatrix::getElements
virtual const double * getElements() const
A vector containing the elements in the packed matrix.
ClpNetworkMatrix::getVectorStarts
virtual const CoinBigIndex * getVectorStarts() const
ClpNetworkMatrix::releasePackedMatrix
virtual void releasePackedMatrix() const
Allow any parts of a created CoinMatrix to be deleted.
ClpNetworkMatrix::~ClpNetworkMatrix
virtual ~ClpNetworkMatrix()
Destructor.
ClpNetworkMatrix::ClpNetworkMatrix
ClpNetworkMatrix(const ClpNetworkMatrix &)
The copy constructor.
ClpNetworkMatrix::partialPricing
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
ClpNetworkMatrix::unpack
virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
Unpacks a column into an CoinIndexedvector.
ClpNetworkMatrix::countBasis
virtual int countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
ClpNetworkMatrix::reverseOrderedCopy
virtual ClpMatrixBase * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
ClpNetworkMatrix::getNumCols
virtual int getNumCols() const
Number of columns.
Definition ClpNetworkMatrix.hpp:36
ClpNetworkMatrix::getNumRows
virtual int getNumRows() const
Number of rows.
Definition ClpNetworkMatrix.hpp:41
ClpNetworkMatrix::appendRows
virtual void appendRows(int number, const CoinPackedVectorBase *const *rows)
Append Rows.
ClpNetworkMatrix::getIndices
virtual const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
Definition ClpNetworkMatrix.hpp:56
ClpNetworkMatrix::ClpNetworkMatrix
ClpNetworkMatrix(int numberColumns, const int *head, const int *tail)
Constructor from two arrays.
ClpNetworkMatrix::times
virtual void times(double scalar, const double *x, double *y, const double *rowScale, const double *columnScale) const
And for scaling.
ClpNetworkMatrix::getNumElements
virtual CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
Definition ClpNetworkMatrix.hpp:31
ClpNetworkMatrix::deleteRows
virtual void deleteRows(const int numDel, const int *indDel)
Delete the rows whose indices are listed in indDel.
ClpNetworkMatrix::times
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
ClpNetworkMatrix::appendMatrix
virtual int appendMatrix(int number, int type, const CoinBigIndex *starts, const int *index, const double *element, int numberOther=-1)
Append a set of rows/columns to the end of the matrix.
ClpNetworkMatrix::getVectorLengths
virtual const int * getVectorLengths() const
The lengths of the major-dimension vectors.
ClpNetworkMatrix::subsetTransposeTimes
virtual void subsetTransposeTimes(const ClpSimplex *model, const CoinIndexedVector *x, const CoinIndexedVector *y, CoinIndexedVector *z) const
Return x *A in z but just for indices in y.
ClpNetworkMatrix::matrix_
CoinPackedMatrix * matrix_
For fake CoinPackedMatrix.
Definition ClpNetworkMatrix.hpp:218
ClpNetworkMatrix::ClpNetworkMatrix
ClpNetworkMatrix(const CoinPackedMatrix &)
The copy constructor from an CoinNetworkMatrix.
ClpNetworkMatrix::transposeTimes
virtual void transposeTimes(double scalar, const double *x, double *y, const double *rowScale, const double *columnScale, double *spare=NULL) const
And for scaling.
ClpNetworkMatrix::dubiousWeights
virtual CoinBigIndex * dubiousWeights(const ClpSimplex *model, int *inputWeights) const
Given positive integer weights for each row fills in sum of weights for each column (and slack).
ClpNetworkMatrix::transposeTimes
virtual void transposeTimes(const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
Return x * scalar * A + y in z.
ClpNetworkMatrix::numberColumns_
int numberColumns_
Number of columns.
Definition ClpNetworkMatrix.hpp:225
ClpSimplex
This solves LPs using the simplex method.
Definition ClpSimplex.hpp:106