Teuchos Package Browser (Single Doxygen Collection)
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 |
Private Member Functions | |
TwoDArray (size_type numRows, size_type numCols, Array< T > data) | |
Private Attributes | |
size_type | _numRows |
size_type | _numCols |
Array< T > | _data |
bool | _symmetrical |
Related Functions | |
(Note that these are not member functions.) | |
std::string | getTwoDArrayTypeNameTraitsFormat () |
Get the format that is used for the specialization of the TypeName traits class for TwoDArray. More... | |
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. More... | |
TwoDArray () | |
Constructs an empty TwoDArray. More... | |
virtual | ~TwoDArray () |
Getters and Setters | |
ArrayView< T > | operator[] (size_type i) |
Returns an ArrayView containing the contents of row i. More... | |
ArrayView< const T > | operator[] (size_type i) const |
Returns a const ArrayView containing the contents of row i. More... | |
size_type | getNumRows () const |
returns the number of rows in the TwoDArray. More... | |
size_type | getNumCols () const |
returns the number of columns in the TwoDArray. More... | |
const Array< T > & | getDataArray () const |
Returns the 1D array that is backing this TwoDArray. More... | |
T & | operator() (size_type i, size_type j) |
Returns the element located at i,j. More... | |
const T & | operator() (size_type i, size_type j) const |
Returns the element located at i,j. More... | |
void | clear () |
delets all the entries from the TwoDArray More... | |
bool | isEmpty () |
bool | isSymmetrical () const |
A simple flag indicating whether or not this TwoDArray should be interpurted as symmetrical. More... | |
void | setSymmetrical (bool symmetrical) |
Sets whether or not the the TwoDArray should be interpurted as symetric. More... | |
Resizing Functions | |
void | resizeRows (size_type numberOfRows) |
Changes the number of rows in the matrix. More... | |
void | resizeCols (size_type numberOfCols) |
Changes the number of rows in the matrix. More... | |
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. More... | |
static const std::string & | getDimensionsDelimiter () |
returns the string used as the dimension dilimeter when convering the TwoDArray to a string. More... | |
static std::string | toString (const TwoDArray< T > array) |
Converts a given TwoDArray to a valid string representation. More... | |
static TwoDArray< T > | fromString (const std::string &string) |
Converts a valid string to it's corresponding TwoDArray. More... | |
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 36 of file Teuchos_TwoDArray.hpp.
typedef Ordinal Teuchos::TwoDArray< T >::size_type |
Definition at line 41 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 54 of file Teuchos_TwoDArray.hpp.
|
inline |
Constructs an empty TwoDArray.
Definition at line 63 of file Teuchos_TwoDArray.hpp.
|
inlinevirtual |
Definition at line 67 of file Teuchos_TwoDArray.hpp.
|
inlineprivate |
Definition at line 221 of file Teuchos_TwoDArray.hpp.
|
inline |
Returns an ArrayView containing the contents of row i.
Definition at line 232 of file Teuchos_TwoDArray.hpp.
|
inline |
Returns a const ArrayView containing the contents of row i.
Definition at line 237 of file Teuchos_TwoDArray.hpp.
|
inline |
returns the number of rows in the TwoDArray.
Definition at line 81 of file Teuchos_TwoDArray.hpp.
|
inline |
returns the number of columns in the TwoDArray.
Definition at line 86 of file Teuchos_TwoDArray.hpp.
|
inline |
Returns the 1D array that is backing this TwoDArray.
Definition at line 91 of file Teuchos_TwoDArray.hpp.
|
inline |
Returns the element located at i,j.
Definition at line 96 of file Teuchos_TwoDArray.hpp.
|
inline |
Returns the element located at i,j.
Definition at line 101 of file Teuchos_TwoDArray.hpp.
|
inline |
delets all the entries from the TwoDArray
Definition at line 106 of file Teuchos_TwoDArray.hpp.
|
inline |
Definition at line 112 of file Teuchos_TwoDArray.hpp.
|
inline |
A simple flag indicating whether or not this TwoDArray should be interpurted as symmetrical.
Definition at line 131 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 150 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 242 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 249 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 197 of file Teuchos_TwoDArray.hpp.
|
inlinestatic |
returns the string used as the dimension dilimeter when convering the TwoDArray to a string.
Definition at line 205 of file Teuchos_TwoDArray.hpp.
|
static |
Converts a given TwoDArray to a valid string representation.
Definition at line 263 of file Teuchos_TwoDArray.hpp.
|
static |
Converts a valid string to it's corresponding TwoDArray.
Definition at line 279 of file Teuchos_TwoDArray.hpp.
|
related |
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 410 of file Teuchos_TwoDArray.hpp.
|
private |
Definition at line 219 of file Teuchos_TwoDArray.hpp.
|
private |
Definition at line 219 of file Teuchos_TwoDArray.hpp.
|
private |
Definition at line 220 of file Teuchos_TwoDArray.hpp.
|
private |
Definition at line 228 of file Teuchos_TwoDArray.hpp.