MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
ExpandableMatrix::ExpandableColBlock Struct Reference

#include <JacSubMatrix.h>

Collaboration diagram for ExpandableMatrix::ExpandableColBlock:

Public Member Functions

 ExpandableColBlock (void)
 
void Zero (void)
 
void ReDim (const integer nrows)
 
void SetBlockDim (const integer nrows, const integer ncols)
 
integer GetBlockNRows () const
 
integer GetBlockNCols () const
 
void Reset ()
 
void Link (const ExpandableMatrix *const xp)
 
void Link (const ExpandableRowVector *const xp)
 
void SetColIdx (integer iidx)
 
void Add (FullSubMatrixHandler &WM, const integer eq, const doublereal c=1.) const
 
void Sub (FullSubMatrixHandler &WM, const integer eq, const doublereal c=1.) const
 
std::ostream & Write (std::ostream &out, const char *sFill) const
 

Public Attributes

std::vector< ExpandableRowVectorrows
 

Detailed Description

Definition at line 97 of file JacSubMatrix.h.

Constructor & Destructor Documentation

ExpandableMatrix::ExpandableColBlock::ExpandableColBlock ( void  )
inline

Definition at line 102 of file JacSubMatrix.h.

102 : rows(0) {}; //, idx(0) {};
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98

Member Function Documentation

void ExpandableMatrix::ExpandableColBlock::Add ( FullSubMatrixHandler WM,
const integer  eq,
const doublereal  c = 1. 
) const
inline

Definition at line 182 of file JacSubMatrix.h.

References c, GetBlockNRows(), and rows.

182  {
183 // std::cerr << "\t\tBlock::Add " << std::endl;
184  for (integer e = 0; e < GetBlockNRows(); e++) {
185 // std::cerr << "\t\t\te " << e << " eq+e " << eq+e << std::endl;
186  rows[e].Add(WM, eq + e, c);
187  }
188  };
static const char * eq[]
Definition: drvdisp.cc:196
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98
static std::stack< cleanup * > c
Definition: cleanup.cc:59
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

integer ExpandableMatrix::ExpandableColBlock::GetBlockNCols ( ) const
inline

Definition at line 123 of file JacSubMatrix.h.

References rows.

Referenced by Link(), and SetColIdx().

123  {
124  if (rows.begin() != rows.end()) {
125  return rows[0].GetDim();
126  } else {
127  return 0;
128  }
129  };
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98
integer ExpandableMatrix::ExpandableColBlock::GetBlockNRows ( ) const
inline

Definition at line 120 of file JacSubMatrix.h.

References rows.

Referenced by Add(), Sub(), and Write().

120  {
121  return rows.size();
122  };
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98
void ExpandableMatrix::ExpandableColBlock::Link ( const ExpandableMatrix *const  xp)
inline

Definition at line 144 of file JacSubMatrix.h.

References eq, GetBlockNCols(), ExpandableMatrix::GetNBlocks(), rows, and ExpandableMatrix::v.

144  {
145 // xm = xp;
146 // integer rhs_block = 0;
147 // integer rhs_block_nrows = xp->GetNRows();
148 // std::cerr << "ExpandableColBlock::Link" << std::endl;
149  for (integer col = 1; col <= GetBlockNCols(); col++) {
150 // std::cerr << "\t col " << col << std::endl;
151 // if (col >= rhs_block_ncols) {
152 // rhs_block++;
153 // rhs_block_ncols += xp->v[rhs_block].GetBlockNCols();
154 // }
155  for (std::vector<ExpandableRowVector>::size_type eq = 0; eq < rows.size(); eq++) {
156 // std::cerr << "\t\t eq " << eq << std::endl;
157  for (integer rhs_block = 1; rhs_block <=
158  xp->GetNBlocks(); rhs_block++) {
159 // std::cerr << "\t\t\t rhs_block " << rhs_block << std::endl;
160  rows[eq].Link(col, &(xp->v[rhs_block - 1].rows[col - 1]), rhs_block);
161  }
162  }
163  }
164 // std::cerr << "-------------------" << std::endl;
165  };
std::vector< ExpandableColBlock > v
Definition: JacSubMatrix.h:89
static const char * eq[]
Definition: drvdisp.cc:196
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98
long int integer
Definition: colamd.c:51
integer GetNBlocks() const

Here is the call graph for this function:

void ExpandableMatrix::ExpandableColBlock::Link ( const ExpandableRowVector *const  xp)
inline

Definition at line 166 of file JacSubMatrix.h.

References eq, and rows.

166  {
167 // xm = xp;
168  for (std::vector<ExpandableRowVector>::size_type eq = 0; eq < rows.size(); eq++) {
169  rows[eq].Link(1, xp);
170  }
171  };
static const char * eq[]
Definition: drvdisp.cc:196
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98
void ExpandableMatrix::ExpandableColBlock::ReDim ( const integer  nrows)
inline

Definition at line 110 of file JacSubMatrix.h.

References rows.

110  {
111  rows.resize(nrows);
112  };
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98
void ExpandableMatrix::ExpandableColBlock::Reset ( void  )
inline

Definition at line 130 of file JacSubMatrix.h.

References rows.

130  {
131  for (std::vector<ExpandableRowVector>::iterator i = rows.begin();
132  i != rows.end(); ++i)
133  {
134  i->Reset();
135  }
136  };
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98
void ExpandableMatrix::ExpandableColBlock::SetBlockDim ( const integer  nrows,
const integer  ncols 
)
inline

Definition at line 113 of file JacSubMatrix.h.

References rows.

113  {
114  for (std::vector<ExpandableRowVector>::iterator i = rows.begin();
115  i != rows.end(); ++i)
116  {
117  i->ReDim(ncols);
118  }
119  };
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98
void ExpandableMatrix::ExpandableColBlock::SetColIdx ( integer  iidx)
inline

Definition at line 172 of file JacSubMatrix.h.

References eq, GetBlockNCols(), and rows.

172  {
173 // std::cerr << "\tBloc::SetColIdx" << std::endl;
174  for (integer col = 1; col <= GetBlockNCols(); col++, iidx++) {
175 // std::cerr << "\t\tcol " << col << " iidx " << iidx << std::endl;
176  for (std::vector<ExpandableRowVector>::size_type eq = 0; eq < rows.size(); eq++) {
177 // std::cerr << "\t\t\teq " << eq <<std::endl;
178  rows[eq].SetIdx(col, iidx);
179  }
180  }
181  };
static const char * eq[]
Definition: drvdisp.cc:196
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void ExpandableMatrix::ExpandableColBlock::Sub ( FullSubMatrixHandler WM,
const integer  eq,
const doublereal  c = 1. 
) const
inline

Definition at line 189 of file JacSubMatrix.h.

References c, GetBlockNRows(), and rows.

189  {
190  for (integer e = 0; e < GetBlockNRows(); e++) {
191  rows[e].Sub(WM, eq + e, c);
192  }
193  };
static const char * eq[]
Definition: drvdisp.cc:196
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98
static std::stack< cleanup * > c
Definition: cleanup.cc:59
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

std::ostream& ExpandableMatrix::ExpandableColBlock::Write ( std::ostream &  out,
const char *  sFill 
) const
inline

Definition at line 194 of file JacSubMatrix.h.

References eq, GetBlockNRows(), and rows.

194  {
195  for (integer eq = 0; eq < GetBlockNRows(); eq++) {
196  out << sFill << "Row: " << eq << std::endl;
197  rows[eq].Write(out, "\t\t");
198  }
199  return out;
200  }
static const char * eq[]
Definition: drvdisp.cc:196
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void ExpandableMatrix::ExpandableColBlock::Zero ( void  )
inline

Definition at line 103 of file JacSubMatrix.h.

References rows.

103  {
104  for (std::vector<ExpandableRowVector>::iterator i = rows.begin();
105  i != rows.end(); ++i)
106  {
107  i->Zero();
108  }
109  };
std::vector< ExpandableRowVector > rows
Definition: JacSubMatrix.h:98

Member Data Documentation

std::vector<ExpandableRowVector> ExpandableMatrix::ExpandableColBlock::rows

The documentation for this struct was generated from the following file: