47 #ifndef XPETRA_BLOCKREORDERMANAGER_HPP_
48 #define XPETRA_BLOCKREORDERMANAGER_HPP_
52 #include <Teuchos_StrUtils.hpp>
75 virtual Teuchos::RCP<BlockReorderManager>
Copy()
const {
96 virtual void SetBlock(
int blockIndex,
int reorder);
108 virtual void SetBlock(
int blockIndex,
const Teuchos::RCP<BlockReorderManager>& reorder);
114 virtual const Teuchos::RCP<BlockReorderManager>
GetBlock(
int blockIndex) {
115 TEUCHOS_ASSERT(blockIndex < (
int)
children_.size());
117 if (
children_[blockIndex] == Teuchos::null)
123 virtual const Teuchos::RCP<const BlockReorderManager>
GetBlock(
int blockIndex)
const {
124 TEUCHOS_ASSERT(blockIndex < (
int)
children_.size());
131 std::stringstream ss;
133 for (
size_t i = 0; i <
children_.size(); i++) {
137 ss <<
" " <<
children_[i]->toString() <<
" ";
146 for (
size_t i = 0; i <
children_.size(); i++) {
148 int subMax =
children_[i]->LargestIndex();
149 max = max > subMax ? max : subMax;
157 std::vector<Teuchos::RCP<BlockReorderManager> >
children_;
167 virtual Teuchos::RCP<BlockReorderManager>
Copy()
const {
174 virtual void SetBlock(
int ,
const Teuchos::RCP<BlockReorderManager>& ) {}
175 virtual const Teuchos::RCP<BlockReorderManager>
GetBlock(
int ) {
176 return Teuchos::null;
178 virtual const Teuchos::RCP<const BlockReorderManager>
GetBlock(
int )
const {
179 return Teuchos::null;
184 std::stringstream ss;
199 void tokenize(std::string srcInput, std::string whitespace, std::string prefer, std::vector<std::string>& tokens);
204 std::vector<std::string>::const_iterator begin,
205 std::vector<std::string>::const_iterator end,
206 std::vector<std::string>& subBlock);
virtual ~BlockReorderManager()
empty destructor
std::vector< std::string >::const_iterator buildSubBlock(std::vector< std::string >::const_iterator begin, std::vector< std::string >::const_iterator end, std::vector< std::string > &subBlock)
virtual std::string toString() const
for sanities sake, print a readable string
virtual std::string toString() const
for sanities sake, print a readable string
virtual int LargestIndex() const
returns largest index in this BlockReorderManager class
virtual const Teuchos::RCP< const BlockReorderManager > GetBlock(int blockIndex) const
Get a particular block. If there is no block at this index location return a new one.
Teuchos::RCP< const Xpetra::BlockReorderManager > blockedReorderFromString(std::string reorder)
Convert a string to a block reorder manager object.
BlockReorderManager()
Basic empty constructor.
void tokenize(std::string srcInput, std::string whitespace, std::string prefer, std::vector< std::string > &tokens)
BlockReorderLeaf(int ind)
virtual const Teuchos::RCP< BlockReorderManager > GetBlock(int)
Get a particular block. If there is no block at this index location return a new one.
virtual int LargestIndex() const
returns largest index in this BlockReorderManager class
int GetIndex() const
Get the index that is stored in this block/leaf.
virtual size_t GetNumBlocks() const
Returns number of subblocks.
virtual size_t GetNumBlocks() const
Returns number of subblocks.
virtual void SetBlock(int blockIndex, int reorder)
Sets the subblock to a specific index value.
int value_
The value of the index for this leaf.
virtual const Teuchos::RCP< BlockReorderManager > GetBlock(int blockIndex)
Get a particular block. If there is no block at this index location return a new one.
Teuchos::RCP< Xpetra::BlockReorderManager > blockedReorderFromTokens(const std::vector< std::string > &tokens)
virtual void SetNumBlocks(size_t sz)
Sets number of subblocks.
virtual void SetBlock(int, int)
Sets the subblock to a specific index value.
BlockReorderManager(const BlockReorderManager &bmm)
Copy constructor.
virtual void SetNumBlocks(size_t)
Sets number of subblocks.
virtual void SetBlock(int, const Teuchos::RCP< BlockReorderManager > &)
Sets the subblock to a specific index value.
BlockReorderLeaf(const BlockReorderLeaf &brl)
virtual const Teuchos::RCP< const BlockReorderManager > GetBlock(int) const
Get a particular block. If there is no block at this index location return a new one.
std::vector< Teuchos::RCP< BlockReorderManager > > children_
definitions of the subblocks
virtual Teuchos::RCP< BlockReorderManager > Copy() const
returns copy of this object
virtual Teuchos::RCP< BlockReorderManager > Copy() const
returns copy of this object