omatrix_view_tlate Class Template Reference

#include <omatrix_tlate.h>

Inheritance diagram for omatrix_view_tlate:

omatrix_array_tlate omatrix_tlate omatrix_tlate< double, gsl_matrix, gsl_vector, gsl_block > ofmatrix

Detailed Description

template<class data_t, class mparent_t, class block_t>
class omatrix_view_tlate< data_t, mparent_t, block_t >

A matrix view of double-precision numbers.

Idea for future:
This class isn't sufficiently general for some applications, such as sub-matrices of higher-dimensional structures. It might be nice to create a more general class with a "stride" and a "tda".
Idea for future:
The xmatrix class demonstrates how operator[] could return an ovector_array object and thus provide better bounds-checking. This would demand including a new parameter in omatrix_view_tlate which contains the vector type.

Definition at line 62 of file omatrix_tlate.h.


Public Member Functions

Copy constructors
 omatrix_view_tlate (const omatrix_view_tlate &v)
 Shallow copy constructor - create a new view of the same matrix.
omatrix_view_tlateoperator= (const omatrix_view_tlate &v)
 Shallow copy constructor - create a new view of the same matrix.
Get and set methods
data_t * operator[] (size_t i)
 Array-like indexing.
const data_t * operator[] (size_t i) const
 Array-like indexing.
data_t & operator() (size_t i, size_t j)
 Array-like indexing.
const data_t & operator() (size_t i, size_t j) const
 Array-like indexing.
data_t get (size_t i, size_t j) const
 Get (with optional range-checking).
data_t * get_ptr (size_t i, size_t j)
 Get pointer (with optional range-checking).
const data_t * get_const_ptr (size_t i, size_t j) const
 Get pointer (with optional range-checking).
int set (size_t i, size_t j, data_t val)
 Set (with optional range-checking).
int set_all (double val)
 Set all of the value to be the value val.
size_t rows () const
 Method to return number of rows.
size_t cols () const
 Method to return number of columns.
size_t tda () const
 Method to return matrix tda.
Other methods
bool is_owner () const
 Return true if this object owns the data it refers to.
mparent_t * get_gsl_matrix ()
 Return a gsl matrix.
const mparent_t * get_gsl_matrix_const () const
 Return a const gsl matrix.
Arithmetic
omatrix_view_tlate< data_t,
mparent_t, block_t > & 
operator+= (const omatrix_view_tlate< data_t, mparent_t, block_t > &x)
 operator+=
omatrix_view_tlate< data_t,
mparent_t, block_t > & 
operator-= (const omatrix_view_tlate< data_t, mparent_t, block_t > &x)
 operator-=
omatrix_view_tlate< data_t,
mparent_t, block_t > & 
operator+= (const data_t &y)
 operator+=
omatrix_view_tlate< data_t,
mparent_t, block_t > & 
operator-= (const data_t &y)
 operator-=
omatrix_view_tlate< data_t,
mparent_t, block_t > & 
operator*= (const data_t &y)
 operator*=

Protected Member Functions

 omatrix_view_tlate ()
 Empty constructor provided for use by omatrix_tlate(const omatrix_tlate &v).

Member Function Documentation

size_t rows (  )  const [inline]

Method to return number of rows.

If no memory has been allocated, this will quietly return zero.

Definition at line 252 of file omatrix_tlate.h.

size_t cols (  )  const [inline]

Method to return number of columns.

If no memory has been allocated, this will quietly return zero.

Definition at line 262 of file omatrix_tlate.h.

size_t tda (  )  const [inline]

Method to return matrix tda.

If no memory has been allocated, this will quietly return zero.

Definition at line 272 of file omatrix_tlate.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page