|
Teuchos - Trilinos Tools Package Version of the Day
|
A thin wrapper around the Array class which causes it to be interpreted as a 2D Array. More...
#include <Teuchos_TwoDArray.hpp>
Public Types | |
| typedef Ordinal | size_type |
Public Member Functions | |
Constructors and Destructors | |
| TwoDArray (size_type numRows, size_type numCols, T value=T()) | |
| Constructs a TwoDArray with the given number of rows and columns with each entry being populated with the specified value. | |
| TwoDArray () | |
| Constructs an empty TwoDArray. | |
| virtual | ~TwoDArray () |
Getters and Setters | |
| ArrayView< T > | operator[] (size_type i) |
| Returns an ArrayView containing the contents of row i. | |
| ArrayView< const T > | operator[] (size_type i) const |
| Returns a const ArrayView containing the contents of row i. | |
| size_type | getNumRows () const |
| returns the number of rows in the TwoDArray. | |
| size_type | getNumCols () const |
| returns the number of columns in the TwoDArray. | |
| const Array< T > & | getDataArray () const |
| Returns the 1D array that is backing this TwoDArray. | |
| T & | operator() (size_type i, size_type j) |
| Returns the element located at i,j. | |
| const T & | operator() (size_type i, size_type j) const |
| Returns the element located at i,j. | |
| void | clear () |
| delets all the entries from the TwoDArray | |
| bool | isSymmetrical () const |
| A simple flag indicating whether or not this TwoDArray should be interpurted as symmetrical. | |
| void | setSymmetrical (bool symmetrical) |
| Sets whether or not the the TwoDArray should be interpurted as symetric. | |
Resizing Functions | |
| void | resizeRows (size_type numberOfRows) |
| Changes the number of rows in the matrix. | |
| void | resizeCols (size_type numberOfCols) |
| Changes the number of rows in the matrix. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| std::string | getTwoDArrayTypeNameTraitsFormat () |
| Get the format that is used for the specialization of the TypeName traits class for TwoDArray. | |
String conversion functions | |
| static const std::string & | getMetaSeperator () |
| returns the string used to seperate meta information from actual data information when converting a TwoDArray to a string. | |
| static const std::string & | getDimensionsDelimiter () |
| returns the string used as the dimension dilimeter when convering the TwoDArray to a string. | |
| static std::string | toString (const TwoDArray< T > array) |
| Converts a given TwoDArray to a valid string representation. | |
| static TwoDArray< T > | fromString (const std::string &string) |
| Converts a valid string to it's corresponding TwoDArray. | |
A thin wrapper around the Array class which causes it to be interpreted as a 2D Array.
2D Array's can also be "symetric". This means that anyone viewing the Array should only consider the lower half of the array as valid. The
Definition at line 37 of file Teuchos_TwoDArray.hpp.
| typedef Ordinal Teuchos::TwoDArray< T >::size_type |
Definition at line 42 of file Teuchos_TwoDArray.hpp.
|
inline |
Constructs a TwoDArray with the given number of rows and columns with each entry being populated with the specified value.
| numCols | The number of columns in the TwoDArray. |
| numRows | The number of rows in the TwoDArray. |
| value | The value with which to populate the TwoDArray. |
Definition at line 55 of file Teuchos_TwoDArray.hpp.
|
inline |
Constructs an empty TwoDArray.
Definition at line 64 of file Teuchos_TwoDArray.hpp.
|
inlinevirtual |
Definition at line 68 of file Teuchos_TwoDArray.hpp.
|
inline |
Returns an ArrayView containing the contents of row i.
Definition at line 233 of file Teuchos_TwoDArray.hpp.
|
inline |
Returns a const ArrayView containing the contents of row i.
Definition at line 238 of file Teuchos_TwoDArray.hpp.
|
inline |
returns the number of rows in the TwoDArray.
Definition at line 82 of file Teuchos_TwoDArray.hpp.
|
inline |
returns the number of columns in the TwoDArray.
Definition at line 87 of file Teuchos_TwoDArray.hpp.
|
inline |
Returns the 1D array that is backing this TwoDArray.
Definition at line 92 of file Teuchos_TwoDArray.hpp.
|
inline |
Returns the element located at i,j.
Definition at line 97 of file Teuchos_TwoDArray.hpp.
|
inline |
Returns the element located at i,j.
Definition at line 102 of file Teuchos_TwoDArray.hpp.
|
inline |
delets all the entries from the TwoDArray
Definition at line 107 of file Teuchos_TwoDArray.hpp.
|
inline |
A simple flag indicating whether or not this TwoDArray should be interpurted as symmetrical.
Definition at line 132 of file Teuchos_TwoDArray.hpp.
|
inline |
Sets whether or not the the TwoDArray should be interpurted as symetric.
| symmetrical | Whether or not the matrix should be interpurted as symetric. |
Definition at line 151 of file Teuchos_TwoDArray.hpp.
| void Teuchos::TwoDArray< T >::resizeRows | ( | size_type | numberOfRows | ) |
Changes the number of rows in the matrix.
If the new number of rows is less than the current number, the last rows in the array will be deleted (i.e. if an array has 10 rows and it is resized to have only 5 rows, rows 5-9 are deleted). If the new number of rows is greater than the current number of rows, the rows are appended on to the end of the array and the new entries are initialized to T's default value.
| numberOfRows | The new number of rows the TwoDArray should have. |
Definition at line 243 of file Teuchos_TwoDArray.hpp.
| void Teuchos::TwoDArray< T >::resizeCols | ( | size_type | numberOfCols | ) |
Changes the number of rows in the matrix.
If the new number of columns is less than the current number, the last columns in the array will be deleted (i.e. if an array has 10 columns and it is resized to have only 5 columns, columns 5-9 are deleted). If the new number of columns is greater than the current number of columns, the columns are appended on to the end of the array and the new entries are initialized to T's default value.
| numberOfCols | The new number of rows the TwoDArray should have. |
Definition at line 250 of file Teuchos_TwoDArray.hpp.
|
inlinestatic |
returns the string used to seperate meta information from actual data information when converting a TwoDArray to a string.
Definition at line 198 of file Teuchos_TwoDArray.hpp.
|
inlinestatic |
returns the string used as the dimension dilimeter when convering the TwoDArray to a string.
Definition at line 206 of file Teuchos_TwoDArray.hpp.
|
static |
Converts a given TwoDArray to a valid string representation.
Definition at line 264 of file Teuchos_TwoDArray.hpp.
|
static |
Converts a valid string to it's corresponding TwoDArray.
Definition at line 280 of file Teuchos_TwoDArray.hpp.
|
Get the format that is used for the specialization of the TypeName traits class for TwoDArray.
The string returned will contain only one "*" character. The "*" character should then be replaced with the actual template type of the array.
Definition at line 420 of file Teuchos_TwoDArray.hpp.