#include <ovector_tlate.h>
Definition at line 109 of file ovector_tlate.h.
Data Structures | |
class | const_iterator |
A const iterator for ovectors. More... | |
class | iterator |
An iterator for ovectors. More... | |
Public Member Functions | |
const_iterator | begin () const |
An iterator for the beginning of the vector. | |
const_iterator | end () const |
An iterator for the end of the vector. | |
Copy constructors | |
ovector_const_view_tlate (const ovector_const_view_tlate &v) | |
Shallow copy constructor - create a new view of the same vector. | |
ovector_const_view_tlate & | operator= (const ovector_const_view_tlate &v) |
Shallow copy constructor - create a new view of the same vector. | |
ovector_const_view_tlate (const uvector_const_view_tlate< data_t > &v) | |
Shallow copy constructor - view a unit-stride vector. | |
ovector_const_view_tlate & | operator= (const uvector_const_view_tlate< data_t > &v) |
Shallow copy constructor - view a unit-stride vector. | |
Get methods | |
const data_t & | operator[] (size_t i) const |
Array-like indexing. | |
const data_t & | operator() (size_t i) const |
Array-like indexing with operator(). | |
data_t | get (size_t i) const |
Get (with optional range-checking). | |
const data_t * | get_const_ptr (size_t i) const |
Get pointer (with optional range-checking). | |
size_t | size () const |
Method to return vector size. | |
size_t | capacity () const |
Method to return capacity. | |
size_t | stride () const |
Method to return vector stride. | |
Other methods | |
bool | is_owner () const |
Return true if this object owns the data it refers to. | |
size_t | lookup (const data_t x0) const |
Exhaustively look through the vector for a particular value and return the closest match. | |
data_t | max () const |
Find the maximum element. | |
size_t | max_index () const |
Find the location of the maximum element. | |
data_t | min () const |
Find the minimum element. | |
size_t | min_index () const |
Find the location of the minimum element. | |
Protected Member Functions | |
ovector_const_view_tlate () | |
Empty constructor provided for use by ovector_view_tlate(const ovector_view_tlate &v). |
size_t capacity | ( | ) | const [inline] |
Analogous to std::vector<>.capacity()
.
Definition at line 372 of file ovector_tlate.h.
bool is_owner | ( | ) | const [inline] |
This can be used to determine if an object is a "vector_view", or a "vector". If is_owner() is true, then it is an ovector_tlate object.
If any O2scl class creates a ovector_tlate object in which is_owner() returns false, then it is a bug and should be reported.
Definition at line 401 of file ovector_tlate.h.
size_t lookup | ( | const data_t | x0 | ) | const [inline] |
This can only fail if the vector is empty or if all of the entries in the vector are not finite. In these cases the function calls the error handler and returns 0.
If more than one entry is the same distance from x0
, this function returns the entry with smallest index.
Definition at line 416 of file ovector_tlate.h.
data_t max | ( | ) | const [inline] |
This can only fail if all of the entries in the array are not finite or if the vector is empty, in which case it calls the error handler and returns 0.
Definition at line 448 of file ovector_tlate.h.
size_t max_index | ( | ) | const [inline] |
This can only fail if all of the entries in the array are not finite or if the vector is empty, in which case it calls the error handler and returns 0.
Definition at line 483 of file ovector_tlate.h.
data_t min | ( | ) | const [inline] |
This can only fail if all of the entries in the array are not finite or if the vector is empty, in which case it calls the error handler and returns 0.
Definition at line 521 of file ovector_tlate.h.
size_t min_index | ( | ) | const [inline] |
This can only fail if all of the entries in the array are not finite or if the vector is empty, in which case it calls the error handler and returns 0.
Definition at line 556 of file ovector_tlate.h.
size_t size | ( | ) | const [inline] |
If no memory has been allocated, this will quietly return zero.
Definition at line 363 of file ovector_tlate.h.
size_t stride | ( | ) | const [inline] |
If no memory has been allocated, this will quietly return zero.
Definition at line 383 of file ovector_tlate.h.
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page