34 #ifndef JacSubMatrix_hh
35 #define JacSubMatrix_hh
46 std::vector<const ExpandableRowVector *>
xm;
51 std::vector<ExpandableRowElement>
v;
78 const std::vector<doublereal>& cc,
const doublereal c = 1.)
const;
81 const std::vector<doublereal>& cc,
const doublereal c = 1.)
const;
82 std::ostream &
Write(std::ostream &out,
const char *sFill =
"")
const;
91 std::vector<ExpandableColBlock>
v;
98 std::vector<ExpandableRowVector>
rows;
104 for (std::vector<ExpandableRowVector>::iterator i =
rows.begin();
105 i !=
rows.end(); ++i)
114 for (std::vector<ExpandableRowVector>::iterator i =
rows.begin();
115 i !=
rows.end(); ++i)
125 return rows[0].GetDim();
131 for (std::vector<ExpandableRowVector>::iterator i =
rows.begin();
132 i !=
rows.end(); ++i)
155 for (std::vector<ExpandableRowVector>::size_type
eq = 0;
eq <
rows.size();
eq++) {
157 for (
integer rhs_block = 1; rhs_block <=
160 rows[
eq].Link(col, &(xp->
v[rhs_block - 1].rows[col - 1]), rhs_block);
168 for (std::vector<ExpandableRowVector>::size_type
eq = 0;
eq <
rows.size();
eq++) {
176 for (std::vector<ExpandableRowVector>::size_type
eq = 0;
eq <
rows.size();
eq++) {
178 rows[
eq].SetIdx(col, iidx);
186 rows[e].Add(WM, eq + e,
c);
191 rows[e].Sub(WM, eq + e,
c);
194 std::ostream &
Write(std::ostream &out,
const char *sFill)
const {
196 out << sFill <<
"Row: " <<
eq << std::endl;
197 rows[
eq].Write(out,
"\t\t");
238 std::ostream &
Write(std::ostream &out,
const char *sFill =
"")
const;
integer GetBlockNCols(const integer block) const
integer GetBlockNRows() const
integer GetDim(void) const
void Set(doublereal xx, integer i, integer iidx)
std::vector< ExpandableColBlock > v
std::vector< ExpandableRowElement > v
void Add(doublereal xx, integer i)
void Set(doublereal xx, integer eq, integer block, integer block_col=1)
void Sub(doublereal xx, integer eq, integer block, integer block_col=1)
void SetBlockDim(const integer nrows, const integer ncols)
std::ostream & Write(std::ostream &out, const char *sFill) const
ExpandableMatrix & operator=(const ExpandableMatrix &)
std::vector< const ExpandableRowVector * > xm
void Link(const ExpandableRowVector *const xp)
ExpandableRowVector(void)
void SetColIdx(integer iidx)
void ReDim(const integer n)
void Sub(FullSubMatrixHandler &WM, const integer eq, const doublereal c=1.) const
integer GetBlockNCols() const
ExpandableRowElement(void)
void Link(const ExpandableMatrix *const xp)
void ReDim(const integer nrows)
void Add(doublereal xx, integer eq, integer block, integer block_col=1)
virtual ~ExpandableRowVector(void)
std::ostream & Write(std::ostream &out, const char *sFill="") const
void Link(const integer i, const ExpandableRowVector *const xp, const integer rhs_block=1)
void ReDim(const integer n, const integer m)
std::vector< ExpandableRowVector > rows
static std::stack< cleanup * > c
virtual ~ExpandableMatrix(void)
void Add(FullSubMatrixHandler &WM, const integer eq, const doublereal c=1.) const
void SetIdx(integer i, integer iidx)
std::ostream & Write(std::ostream &out, const char *sFill="") const
void Sub(doublereal xx, integer i)
doublereal & operator()(integer i)
std::ostream & operator<<(std::ostream &s, const ExpandableRowVector &z)
void SetBlockDim(const integer block, const integer ncols)
void Link(const integer block, const ExpandableMatrix *const xp)
integer GetNBlocks() const
void SetBlockIdx(integer block, integer iidx)