ovector_cx_tlate Class Template Reference

#include <ovector_cx_tlate.h>

Inheritance diagram for ovector_cx_tlate:

ovector_cx_view_tlate ofvector_cx

Detailed Description

template<class data_t, class vparent_t, class block_t, class complex_t>
class ovector_cx_tlate< data_t, vparent_t, block_t, complex_t >

A vector of double-precision numbers.

If the memory allocation fails, either in the constructor or in allocate(), then the error handler will be called, partially allocated memory will be freed, and the size will be reset to zero. You can test to see if the allocation succeeded using something like

      const size_t n=10;
      ovector_cx x(10);
      if (x.size()==0) cout << "Failed." << endl;

Todo:
There is a slight difference between how this works in comparison to MV++. The function allocate() operates a little differently than newsize(), as it will feel free to allocate new memory when owner is false. It's not clear if this is an issue, however, since it doesn't appear possible to create an ovector_cx_tlate with a value of owner equal to zero. This situation ought to be clarified further.
Todo:
Add subvector_stride, const_subvector_stride

Definition at line 503 of file ovector_cx_tlate.h.


Public Member Functions

Standard constructor
 ovector_cx_tlate (size_t n=0)
 Create an ovector_cx of size n with owner as 'true'.
Copy constructors
 ovector_cx_tlate (const ovector_cx_tlate &v)
 Deep copy constructor, allocate new space and make a copy.
 ovector_cx_tlate (const ovector_cx_view_tlate< data_t, vparent_t, block_t, complex_t > &v)
 Deep copy constructor, allocate new space and make a copy.
ovector_cx_tlateoperator= (const ovector_cx_tlate &v)
 Deep copy constructor, if owner is true, allocate space and make a new copy, otherwise, just copy into the view.
ovector_cx_tlateoperator= (const ovector_cx_view_tlate< data_t, vparent_t, block_t, complex_t > &v)
 Deep copy constructor, if owner is true, allocate space and make a new copy, otherwise, just copy into the view.
Memory allocation
int allocate (size_t nsize)
 Allocate memory for size n after freeing any memory presently in use.
int free ()
 Free the memory.
Other methods
vparent_t * get_gsl_vector_complex ()
 Return a gsl vector_cx.
const vparent_t * get_gsl_vector_complex_const () const
 Return a gsl vector_cx.

Member Function Documentation

int free (  )  [inline]

Free the memory.

This function will safely do nothing if used without first allocating memory or if called multiple times in succession.

Definition at line 707 of file ovector_cx_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