Loading [MathJax]/extensions/tex2jax.js

Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
row.h
Go to the documentation of this file.
1
30#pragma once
31
34
35namespace abacus {
36
37
39
51class Row : public SparVec {
52public:
53
55
64 int nnz,
65 const Array<int> &s,
66 const Array<double> &c,
67 const CSense &sense,
68 double r)
69 : SparVec(glob, nnz, s, c), sense_(sense), rhs_(r) { }
70
72
81 int nnz,
82 const Array<int> &s,
83 const Array<double> &c,
84 const CSense::SENSE sense,
85 double r)
86 : SparVec(glob, nnz, s, c), sense_(sense), rhs_(r) { }
87
89
98 int nnz,
99 int *s,
100 double *c,
102 double r)
103 : SparVec(glob, nnz, s, c), sense_(sense), rhs_(r) { }
104
106
111
113 ~Row() { }
114
116
129 friend std::ostream &operator<<(std::ostream& out, const Row &rhs);
130
132 double rhs() const { return rhs_; }
133
135
138 void rhs(double r) { rhs_ = r; }
139
141 CSense *sense() { return &sense_; }
142
144 const CSense *sense() const { return &sense_; }
145
147
150 void sense(CSense &s) { sense_ = s; }
151
153
157
159
165 void copy(const Row &row);
166
168
172 void delInd(ArrayBuffer<int> &buf, double rhsDelta) {
173 leftShift(buf);
174 rhs_ -= rhsDelta;
175 }
176
177protected:
178
180 double rhs_;
181};
182
183
184}
Global data and functions.
Definition global.h:57
Sense of constraints.
Definition csense.h:48
SENSE sense() const
Returns the sense of the constraint.
Definition csense.h:97
Representation of constraints in the row format.
Definition row.h:51
double rhs() const
Returns the right hand side stored in the row format.
Definition row.h:132
CSense * sense()
Returns a pointer to the sense of the row.
Definition row.h:141
void sense(CSense &s)
Sets the sense of the row to s.
Definition row.h:150
const CSense * sense() const
Returns a const pointer to the sense of the row.
Definition row.h:144
~Row()
The destructor.
Definition row.h:113
Row(AbacusGlobal *glob, int size)
Creates a row without initialization of the nonzeros of the row.
Definition row.h:110
Row(AbacusGlobal *glob, int nnz, const Array< int > &s, const Array< double > &c, const CSense &sense, double r)
Creates a row and initializes it.
Definition row.h:63
void rhs(double r)
Sets the right hand side of the row to r.
Definition row.h:138
Row(AbacusGlobal *glob, int nnz, const Array< int > &s, const Array< double > &c, const CSense::SENSE sense, double r)
Creates a row and initializes it.
Definition row.h:80
void delInd(ArrayBuffer< int > &buf, double rhsDelta)
Removes the indices listed in buf from the support of the row and subtracts rhsDelta from its right h...
Definition row.h:172
void sense(CSense::SENSE s)
Sets the sense of the row to s.
Definition row.h:156
Row(AbacusGlobal *glob, int nnz, int *s, double *c, CSense::SENSE sense, double r)
Creates a row and initializes it using C-style arrays.
Definition row.h:97
CSense sense_
The sense of the row.
Definition row.h:179
double rhs_
The right hand side of the row.
Definition row.h:180
void copy(const Row &row)
Copies row.
friend std::ostream & operator<<(std::ostream &out, const Row &rhs)
The output operator.
Sparse vectors.
Definition sparvec.h:47
int size() const
Returns the maximal length of the sparse vector.
Definition sparvec.h:224
void leftShift(ArrayBuffer< int > &del)
Deletes the elements listed in a buffer from the sparse vector.
int nnz() const
Returns the number of nonzero elements.
Definition sparvec.h:232
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition ArrayBuffer.h:56
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:214
csense.
int r[]
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
sparse vector.