#include <ovector_tlate.h>
Definition at line 60 of file ovector_tlate.h.
Public Member Functions | |
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 | |
data_t | norm () const |
Norm. | |
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] |
Method to return capacity.
Analogous to std::vector<>.capacity()
.
Definition at line 193 of file ovector_tlate.h.
bool is_owner | ( | ) | const [inline] |
Return true if this object owns the data it refers to.
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 262 of file ovector_tlate.h.
size_t lookup | ( | const data_t | x0 | ) | const [inline] |
Exhaustively look through the vector for a particular value and return the closest match.
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 277 of file ovector_tlate.h.
data_t max | ( | ) | const [inline] |
Find the maximum element.
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 309 of file ovector_tlate.h.
size_t max_index | ( | ) | const [inline] |
Find the location of the maximum element.
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 344 of file ovector_tlate.h.
data_t min | ( | ) | const [inline] |
Find the minimum element.
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 382 of file ovector_tlate.h.
size_t min_index | ( | ) | const [inline] |
Find the location of the minimum element.
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 417 of file ovector_tlate.h.
data_t norm | ( | ) | const [inline] |
Norm.
For an empty vector, this function returns zero and does not call the error handler.
Definition at line 220 of file ovector_tlate.h.
size_t size | ( | ) | const [inline] |
Method to return vector size.
If no memory has been allocated, this will quietly return zero.
Definition at line 184 of file ovector_tlate.h.
size_t stride | ( | ) | const [inline] |
Method to return vector stride.
If no memory has been allocated, this will quietly return zero.
Definition at line 204 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