FEI Version of the Day

#include <fei_EqnBuffer.hpp>
Public Member Functions  
EqnBuffer ()  
EqnBuffer (const EqnBuffer &src)  
virtual  ~EqnBuffer () 
EqnBuffer *  deepCopy () 
EqnBuffer &  operator= (const EqnBuffer &src) 
int  getNumEqns () 
std::vector< int > &  eqnNumbers () 
std::vector< fei::CSVec * > &  eqns () 
int  getNumRHSs () 
void  setNumRHSs (int n) 
int  addRHS (int eqnNumber, int rhsIndex, double value, bool accumulate=true) 
std::vector< std::vector < double > * > *  rhsCoefsPtr () 
int  getEqnIndex (int eqn) 
int  isInIndices (int eqn) 
int  addEqn (int eqnNumber, const double *coefs, const int *indices, int len, bool accumulate, bool create_indices_union=false) 
int  addEqns (EqnBuffer &inputEqns, bool accumulate) 
int  getCoef (int eqnNumber, int colIndex, double &coef) 
int  removeIndex (int eqnNumber, int colIndex) 
int  getCoefAndRemoveIndex (int eqnNumber, int colIndex, double &coef) 
void  resetCoefs () 
int  addIndices (int eqnNumber, const int *indices, int len) 
A class for holding equation data, along with optional RHS coefficients for the equations.
Definition at line 21 of file fei_EqnBuffer.hpp.
EqnBuffer::EqnBuffer  (  ) 
Constructor
Definition at line 17 of file fei_EqnBuffer.cpp.
EqnBuffer::EqnBuffer  (  const EqnBuffer &  src  ) 
copy constructor
Definition at line 32 of file fei_EqnBuffer.cpp.
EqnBuffer::~EqnBuffer  (  )  [virtual] 
Destructor
Definition at line 78 of file fei_EqnBuffer.cpp.
EqnBuffer * EqnBuffer::deepCopy  (  ) 
Return a 'clone' of this object, including a copy of all internal data.
Definition at line 83 of file fei_EqnBuffer.cpp.
assignment operator
Definition at line 48 of file fei_EqnBuffer.cpp.
int EqnBuffer::getNumEqns  (  )  [inline] 
Return the number of equations held in this object.
Definition at line 40 of file fei_EqnBuffer.hpp.
std::vector<int>& EqnBuffer::eqnNumbers  (  )  [inline] 
Return a list of the equationnumbers held in this object.
Definition at line 43 of file fei_EqnBuffer.hpp.
std::vector<fei::CSVec*>& EqnBuffer::eqns  (  )  [inline] 
Return a table (actually an array of pointers to fei::CSVecs) of the equations. Numberofarrays is 'getNumEqns', length of ith array is 'lengthsPtr()[i]'.
Definition at line 48 of file fei_EqnBuffer.hpp.
int EqnBuffer::getNumRHSs  (  )  [inline] 
Return the number of righthandside coefficientss stored for each equation.
Definition at line 52 of file fei_EqnBuffer.hpp.
void EqnBuffer::setNumRHSs  (  int  n  ) 
Set the number of righthandside coefficients to be stored for each equation. This function internally allocates a table to hold the rhs coefficients. This table has numberofrows == 'getNumEqns()', and numberofcolumns == 'n'. Note that this function should not be called after rhs coefficients have been added, because it destroys and reallocates the rhscoef table.
n 
Definition at line 112 of file fei_EqnBuffer.cpp.
int EqnBuffer::addRHS  (  int  eqnNumber, 
int  rhsIndex,  
double  value,  
bool  accumulate = true 

) 
Set a righthandside coefficient.
eqnNumber  Must correspond to one of the equationnumbers in the list 'eqnNumbers()'. 
rhsIndex  Must be in the range [0 .. getNumRHSs()1]. 
value  The coefficient. 
Definition at line 127 of file fei_EqnBuffer.cpp.
std::vector<std::vector<double>*>* EqnBuffer::rhsCoefsPtr  (  )  [inline] 
Return the table (actually an array of pointers to arrays) of righthandside coefficients. Numberofarrays == 'getNumEqns()', numberofcolumns == 'getNumRHSs()'.
Definition at line 76 of file fei_EqnBuffer.hpp.
int EqnBuffer::getEqnIndex  (  int  eqn  ) 
Return an offset into the 'eqnNumbers()' list, being the position at which equationnumber 'eqn' is located.
eqn 
Definition at line 106 of file fei_EqnBuffer.cpp.
int EqnBuffer::isInIndices  (  int  eqn  ) 
Query whether 'eqn' is present in the table of columnindices.
eqn 
Definition at line 148 of file fei_EqnBuffer.cpp.
int EqnBuffer::addEqn  (  int  eqnNumber, 
const double *  coefs,  
const int *  indices,  
int  len,  
bool  accumulate,  
bool  create_indices_union = false 

) 
Add an equation, with associated coefficients and columnindices.
eqnNumber  
coefs  
indices  
len  Number of coefficients and indices 
accumulate  If this equation is already present, indicate whether incoming coefficients should replace existing ones, or be accumulated into them. Note that this only matters if eqnNumber is already present AND if one or more of 'indices' are already present. 
create_indices_union  defaults to false. If true, adds each set of indices to a union of all indices. This will be used if the 'isInIndices' method is called later. 
Definition at line 172 of file fei_EqnBuffer.cpp.
int EqnBuffer::addEqns  (  EqnBuffer &  inputEqns, 
bool  accumulate  
) 
Add the equations in inputEqns. Upon completion, the set of equations in 'this' EqnBuffer is the union of the equations that were already present, and the equations in inputEqns.
inputEqns  EqnBuffer containing equations to be added to this EqnBuffer. 
accumulate  If an equation is already present, determines whether to add its coefficients to those already in place, or replace them. 
Definition at line 271 of file fei_EqnBuffer.cpp.
int EqnBuffer::getCoef  (  int  eqnNumber, 
int  colIndex,  
double &  coef  
) 
Given an equation number and a columnindex in that equation, get the corresponding coefficient.
eqnNumber  Input Equationnumber 
colIndex  Input Columnindex in equationnumber. 
coef  Output coefficient corresponding to colIndex in eqnNumber. 
Definition at line 201 of file fei_EqnBuffer.cpp.
int EqnBuffer::removeIndex  (  int  eqnNumber, 
int  colIndex  
) 
Remove the specified columnindex from the specified equationnumber.
Definition at line 214 of file fei_EqnBuffer.cpp.
int EqnBuffer::getCoefAndRemoveIndex  (  int  eqnNumber, 
int  colIndex,  
double &  coef  
) 
Combine the functions 'getCoef()' and 'removeIndex()'. Has the same effect as calling those two functions separately, but saves two searches.
Definition at line 242 of file fei_EqnBuffer.cpp.
void EqnBuffer::resetCoefs  (  ) 
Reset all coefficients to 0.0
Definition at line 351 of file fei_EqnBuffer.cpp.
int EqnBuffer::addIndices  (  int  eqnNumber, 
const int *  indices,  
int  len  
) 
Add an equation, with associated columnindices but not coefficients.
Definition at line 359 of file fei_EqnBuffer.cpp.