KJB
kjb::Vector_adapter< Vec > Class Template Reference

Default adapter for the hessian function. More...

`#include <diff_util.h>`

## Public Types

typedef Vec Model_type

## Public Member Functions

double get (const Vec *x, size_t i) const
Returns the ith element of x; i.e., x[i]. More...

void set (Vec *x, size_t i, double v) const
Sets the ith element of x; i.e., x[i] = v. More...

void set (Vec *x, size_t i, size_t j, double v, double w) const
Sets the ith element of x; i.e., x[i] = v. More...

void set (Vec *x, const Vec &v) const
Sets the all elements of x; i.e., x = v. More...

size_t size (const Vec *x) const
Returns the size of x; i.e., x.size(). More...

## Detailed Description

### template<class Vec> class kjb::Vector_adapter< Vec >

Default adapter for the hessian function.

This class makes any model type that behaves as a vector usable with the hessian function. A model must implement operator[] for both const and non const, and the size() member function.

If your model does not behave this way, you must write your own adapter which provides the same functionality.

## Member Typedef Documentation

template<class Vec >

## Member Function Documentation

template<class Vec >
 double kjb::Vector_adapter< Vec >::get ( const Vec * x, size_t i ) const
inline

Returns the ith element of x; i.e., x[i].

template<class Vec >
 void kjb::Vector_adapter< Vec >::set ( Vec * x, size_t i, double v ) const
inline

Sets the ith element of x; i.e., x[i] = v.

template<class Vec >
 void kjb::Vector_adapter< Vec >::set ( Vec * x, size_t i, size_t j, double v, double w ) const
inline

Sets the ith element of x; i.e., x[i] = v.

template<class Vec >
 void kjb::Vector_adapter< Vec >::set ( Vec * x, const Vec & v ) const

Sets the all elements of x; i.e., x = v.

template<class Vec >
 size_t kjb::Vector_adapter< Vec >::size ( const Vec * x ) const
inline

Returns the size of x; i.e., x.size().

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