ADMB Documentation  11.6-git.4513
Public Member Functions | Protected Attributes | Friends | List of all members
dvector Class Reference

Vector of double precision numbers. More...

#include <dvector.h>

Public Member Functions

 dvector (const predvector &pd)
 Creates a dvector from an instance of class predvector. More...
 
 dvector (const dvar_vector_position &dvp, const kkludge_object &)
 Construct a dvector object from a dvar_vector_position object. More...
 
 dvector (const ad_integer &, const index_type &)
 Description not yet available. More...
 
 dvector ()
 Construct a dvector without allocating memory. More...
 
 dvector (const dvector &)
 Copy constructor. More...
 
 dvector (const ivector &)
 Description not yet available. More...
 
 dvector (const lvector &)
 Construct dvector with values in lvector. More...
 
 dvector (const char *)
 Construct dvector from s. More...
 
 dvector (int ncl, int ncu)
 Construct a dvector with specified range of valid subscript. More...
 
 dvector (unsigned int sz, double *x)
 Construct a dvector object from a C style array of doubles. More...
 
 dvector (char *filename, const int &column)
 Construct dvector using matrix input from text filename. More...
 
 ~dvector ()
 Default destructor. More...
 
const double * address () const
 
void allocate (int ncl, int ncu)
 Allocate memory for a dvector. More...
 
void allocate (const dvector &dv)
 Allocate memory for a dvector the same size as it's argument. More...
 
void allocate (const dvar_vector &)
 Allocate memory for a dvector the same size as it's argument. More...
 
void allocate (const char *)
 Allocate dvector from s. More...
 
void allocate (void)
 Allocate dvector without allocating memory. More...
 
void allocate (const ad_integer &, const index_type &)
 Allocate vector of reals with dimension [_ncl to _nch]. More...
 
void allocatec (const dvector &dv)
 Make shallow copy of dvector shape. More...
 
int allocated (void) const
 Returns 1 (TRUE) if memory is allocated. More...
 
double * begin () const
 
void deallocate (void)
 Called by destructor to deallocate memory for a dvector object. More...
 
double & elem (int i)
 
const double & elem (int i) const
 
double * end () const
 
void fill (const char *s)
 Fill vectors from values in string s. More...
 
void fill_multinomial (const int &seed, const dvector &p)
 Description not yet available. More...
 
void fill_multinomial (const random_number_generator &rng, const dvector &p)
 Description not yet available. More...
 
void fill_randbi (long int &n, double)
 Fill vector with binary random numbers. More...
 
void fill_randbi (double p, const random_number_generator &rng)
 Description not yet available. More...
 
void fill_randbi_ni (long int &n, double)
 Description not yet available. More...
 
void fill_randcau (const random_number_generator &rng)
 Description not yet available. More...
 
void fill_randn (long int &n)
 Fill vector with random numbers. More...
 
void fill_randn (const random_number_generator &rng)
 Description not yet available. More...
 
void fill_randn_ni (long int &n)
 Description not yet available. More...
 
void fill_randnegbinomial (double lambda, double tau, const random_number_generator &rng)
 Description not yet available. More...
 
void fill_randpoisson (double lambda, const random_number_generator &rng)
 Fill vector with Poisson pseudorandom numbers. More...
 
void fill_randu (long int &n)
 Fill vector with random numbers. More...
 
void fill_randu (const random_number_generator &rng)
 Description not yet available. More...
 
void fill_randu_ni (long int &n)
 Description not yet available. More...
 
void fill_seqadd (double, double)
 Fills dvector elements with values starting from base and incremented by offset. More...
 
unsigned int get_ncopies () const
 
double *& get_v (void)
 
double * get_v (void) const
 
int indexmax () const
 Get maximum valid index. More...
 
int indexmin () const
 Get minimum valid index. More...
 
void initialize (void)
 Initialze all elements of dvector to zero. More...
 
double * initpointer (void)
 
const double * initpointer (void) const
 
bool is_valid_index (const int i) const
 Check index i is in dvector bounds [index_min, index_max]. More...
 
int operator! (void) const
 Returns 1 (TRUE) if memory is NOT allocated. More...
 
dvector operator() (int lb, int ub)
 Get subvector. More...
 
dvector operator() (const lvector &)
 Description not yet available. More...
 
dvector operator() (const ivector &u)
 Description not yet available. More...
 
double & operator() (int i)
 
const double & operator() (int i) const
 
dvectoroperator*= (double v1)
 Multiply elements of a vector by a constant. More...
 
dvectoroperator++ (void)
 Increment vector indices array pointer. More...
 
dvectoroperator+= (const dvector &v1)
 Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California. More...
 
dvectoroperator+= (double v1)
 Add value to each element of dvector. More...
 
dvector operator- ()
 Description not yet available. More...
 
dvectoroperator-- (void)
 Decrement vector indices array pointer. More...
 
dvectoroperator-= (const dvector &v1)
 Subtract values from dvector element-wise. More...
 
dvectoroperator-= (double v1)
 Subtract value to each element of dvector. More...
 
dvectoroperator/= (double v1)
 Divide elements of a vector by a constant. More...
 
dvectoroperator= (const dvector &t)
 Assignment operator for dvector argument. More...
 
dvectoroperator= (double x)
 Assignment operator for double argument. More...
 
double & operator[] (int i)
 
const double & operator[] (int i) const
 
istream & parse (istream &input_json)
 
void read_from (const uistream &)
 Description not yet available. More...
 
void read_from (const istream &)
 Description not yet available. More...
 
void reallocate (double size)
 Reallocate size of array. More...
 
void safe_allocate (int, int)
 Safely allocate memory for a dvector. More...
 
void safe_deallocate (void)
 Safely deallocates memory by reporting if shallow copies are still in scope. More...
 
void save_dvector_derivatives (const dvar_vector_position &pos) const
 Puts the derivative values in a dvector into a dvar_vector's guts. More...
 
void save_dvector_derivatives (void) const
 
void save_dvector_derivatives_na (const dvar_vector_position &pos) const
 Description not yet available. More...
 
void save_dvector_position (void) const
 Description not yet available. More...
 
void save_dvector_value (void) const
 Saves the size, address, and value information for a dvector. More...
 
void shallow_copy (const dvector &)
 Explicit shallow copy. More...
 
dvectorshift (int min)
 Shift valid range of subscripts. More...
 
unsigned int size () const
 Get number of elements in array. More...
 
dvector sub (int lb, int ub)
 Get subvector. More...
 
void write_on (const ostream &) const
 Description not yet available. More...
 
void write_on (const uostream &) const
 Description not yet available. More...
 

Protected Attributes

int index_max
 maximum valid subscript More...
 
int index_min
 minimum valid subscript More...
 
vector_shapexshape
 pointer to vector "shape" More...
 
double * v
 pointer to the data More...
 

Friends

class banded_lower_triangular_dmatrix
 
class banded_lower_triangular_dvar_matrix
 
class banded_symmetric_dmatrix
 
class banded_symmetric_dvar_matrix
 
class d3_array
 
class dmatrix
 
class dvar_vector
 
dvector elem_div (const dvector &, const dvector &)
 Element-wise division of two vectors; constant objects. More...
 
dvar_vector elem_div (const dvector &, const dvar_vector &)
 Description not yet available. More...
 
dvar_vector elem_div (const dvar_vector &, const dvector &)
 Description not yet available. More...
 
dvector elem_prod (const dvector &, const dvector &)
 Element-wise multiplication of two vectors; constant objects. More...
 
dvar_vector elem_prod (const dvector &, const dvar_vector &)
 Description not yet available. More...
 
dvar_vector elem_prod (const dvar_vector &, const dvector &)
 Description not yet available. More...
 
dvector exp (const dvector &)
 Description not yet available. More...
 
dvector fabs (const dvector &)
 Description not yet available. More...
 
char * fform (const char *, const dvector &)
 
dvector first_difference (const dvector &)
 Returns dvector containing the differences of an values(i) and values(i + 1) for i = 1 to values.indexmax() - 1. More...
 
dvector log (const dvector &)
 Description not yet available. More...
 
double max (const dvector &)
 Returns the maximum value of vector vec. More...
 
double min (const dvector &)
 Returns the minimum value of vector vec. More...
 
double norm (const dvector &)
 Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California. More...
 
double norm2 (const dvector &)
 Squared norm of a vector; constant objects. More...
 
double operator* (const dvector &, const dvector &)
 Compute the dot product of two vectors. More...
 
dvariable operator* (const dvector &, const dvar_vector &)
 Description not yet available. More...
 
dvariable operator* (const dvar_vector &, const dvector &)
 Description not yet available. More...
 
dvar_vector operator* (const prevariable &, const dvector &)
 Description not yet available. More...
 
dvector operator* (double, const dvector &)
 Multiply a dvector by a constant. More...
 
dvector operator* (const dvector &x, const dmatrix &m)
 Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California. More...
 
dvector operator* (const dmatrix &x, const dvector &m)
 Returns product of AB where A is a dmatrix and B is a dvector. More...
 
dvar_vector operator* (const dvector &x, const dvar_matrix &m)
 Description not yet available. More...
 
dvar_vector operator* (const dvar_matrix &x, const dvector &m)
 Description not yet available. More...
 
dvector operator+ (const dvector &, const dvector &)
 Add two dvectors. More...
 
dvar_vector operator+ (const dvar_vector &, const dvector &)
 Description not yet available. More...
 
dvar_vector operator+ (const dvector &, const dvar_vector &)
 Description not yet available. More...
 
dvector operator- (const dvector &, const dvector &)
 Subtract two dvectors. More...
 
dvar_vector operator- (const dvar_vector &, const dvector &)
 Description not yet available. More...
 
dvar_vector operator- (const dvector &, const dvar_vector &)
 Description not yet available. More...
 
class sdmatrix
 
dvector second_difference (const dvector &)
 
double sumsq (const dvector &)
 

Detailed Description

Vector of double precision numbers.

A basic container class for a one dimensional array of double precision floating point numbers. Fundamental building block for higher dimensional arrays. All ADMB vector classes have similar functionality.

Definition at line 50 of file dvector.h.

Constructor & Destructor Documentation

dvector::dvector ( const predvector pdv)

Creates a dvector from an instance of class predvector.

Creates a shallow copy.

Parameters
pdvan instance of class predvector. Updated by Martell, March 10, 2014, from Dave's email

Definition at line 184 of file dvector.cpp.

dvector::dvector ( const dvar_vector_position dvp,
const kkludge_object kk 
)

Construct a dvector object from a dvar_vector_position object.

Used in writing adjoint functions callled by the autodif library,

Parameters
dvpReference to a dvar_vector_position object (usually read from stack)
kkKludge to avoid ambiguous function references

Definition at line 349 of file dvector.cpp.

dvector::dvector ( const ad_integer ncl,
const index_type nch 
)

Description not yet available.

Parameters

Definition at line 413 of file indextyp.cpp.

dvector::dvector ( void  )

Construct a dvector without allocating memory.

Useful in creating classes containing dvectors.

Definition at line 371 of file dvector.cpp.

Referenced by operator()(), and size().

dvector::dvector ( const dvector other)

Copy constructor.

This constructor make a "shallow" copy. Values of existing pointers are copied, and no memory is allocated. Invoked by the compiler in some circumstances such as function call containing an argument of class dvector passed by value.

The following code segments creates the dvector object x and fills it with uniform random numbers (using the constant 79 as seed; fill_randu). The new dvector object y will reference the same memory locations as x, and any change s in y will also appear in x. The new dvector object z does not refer to the same memory locations as x, and any changes in z will be unique to z.

dvector x(1,10);
y.fill_randu(79L);
dvector y = x; // shallow copy
z = x; // "deep" copy

Definition at line 149 of file dvector.cpp.

dvector::dvector ( const ivector u)

Description not yet available.

Parameters

Definition at line 22 of file dvect8.cpp.

dvector::dvector ( const lvector u)

Construct dvector with values in lvector.

Parameters
uvalues to copy

Definition at line 36 of file dvect8.cpp.

dvector::dvector ( const char *  s)

Construct dvector from s.

s is either a filename or a ascii text vector of doubles with format "{ d[1], ..., d[n]}" where d are doubles with range 1 to n.

Parameters
sfile input or ascii text

Definition at line 51 of file dvect9.cpp.

dvector::dvector ( int  ncl,
int  nch 
)

Construct a dvector with specified range of valid subscript.

Parameters
nclInteger specifying lowest valid subscript.
nchInteger specifying highest valid subscript.

Definition at line 359 of file dvector.cpp.

dvector::dvector ( unsigned int  sz,
double *  x 
)

Construct a dvector object from a C style array of doubles.

Parameters
szNumber of valid memory locations allocated in the array The range of valid subscripts for the dvector object will be [0,sz-1].
xPointer to double pointing to the first element in the array.

Definition at line 322 of file dvector.cpp.

dvector::dvector ( char *  filename,
const int &  column 
)

Construct dvector using matrix input from text filename.

Select column from matrix.

Definition at line 49 of file dvec_io1.cpp.

dvector::~dvector ( )

Default destructor.

Invoked by the compiler. Only frees allocated memory if all shallow copies in scope have been removed. Produces an error if the double* member v is NULL.

Definition at line 66 of file dvector.cpp.

Referenced by size().

Member Function Documentation

const double* dvector::address ( ) const
inline

Definition at line 144 of file dvector.h.

Referenced by independent_variables::operator=().

void dvector::allocate ( int  ncl,
int  nch 
)

Allocate memory for a dvector.

Exits with an error message if subscript range makes no sense.

Parameters
nclInteger specifying lowest valid subscript.
nchInteger specifying highest valid subscript.

Definition at line 402 of file dvector.cpp.

Referenced by param_stddev_vector::allocate(), dmatrix::allocate(), sdmatrix::allocate(), cube(), cubic_spline_function::cubic_spline_function(), function_minimizer::hybrid_mcmc_routine(), function_minimizer::mcmc_routine(), function_minimizer::set_runtime_crit(), function_minimizer::set_runtime_maxfn(), and square().

void dvector::allocate ( const dvector other)

Allocate memory for a dvector the same size as it's argument.

Parameters
dvReference to a dvector.

Definition at line 447 of file dvector.cpp.

void dvector::allocate ( const dvar_vector dv)

Allocate memory for a dvector the same size as it's argument.

Parameters
dvReference to a dvar_vector.

Definition at line 456 of file dvector.cpp.

void dvector::allocate ( const char *  s)

Allocate dvector from s.

s is either a filename or a ascii text vector of doubles with format "{ d[1], ..., d[n]}" where d are doubles with range 1 to n.

Parameters
sfile input or ascii text

Definition at line 237 of file dvect9.cpp.

void dvector::allocate ( void  )

Allocate dvector without allocating memory.

All pointers set to NULL and subscript range is invalid.

Definition at line 489 of file dvector.cpp.

Referenced by allocate(), named_dvector::allocate(), data_vector::allocate(), dll_data_vector::allocate(), dvector(), reallocate(), safe_allocate(), and size().

void dvector::allocate ( const ad_integer _ncl,
const index_type _nch 
)

Allocate vector of reals with dimension [_ncl to _nch].

Parameters
_ncllower vector index
_nchupper vector index

Definition at line 424 of file indextyp.cpp.

void dvector::allocatec ( const dvector t)

Make shallow copy of dvector shape.

Copies the shape of its argument.

Parameters
tReference to a dvector.

Definition at line 466 of file dvector.cpp.

Referenced by operator=().

int dvector::allocated ( void  ) const
inline

Returns 1 (TRUE) if memory is allocated.

Definition at line 71 of file dvector.h.

Referenced by df1b2vector::df1b2vector(), initialize(), reallocate(), and safe_allocate().

double* dvector::begin ( ) const
inline

Definition at line 115 of file dvector.h.

Referenced by end().

void dvector::deallocate ( void  )

Called by destructor to deallocate memory for a dvector object.

Definition at line 93 of file dvector.cpp.

Referenced by operator=(), reallocate(), safe_deallocate(), function_minimizer::set_runtime_crit(), function_minimizer::set_runtime_maxfn(), and ~dvector().

double& dvector::elem ( int  i)
inline

Definition at line 152 of file dvector.h.

Referenced by acos(), allocate(), asin(), atan(), cmdv_prod(), dmatrix::colfill_randn(), dmatrix::colfill_randn_ni(), dmatrix::colfill_randu(), dmatrix::colfill_randu_ni(), dmatrix::colfill_seqadd(), column_value(), column_vector(), cos(), cosh(), cvdv_add(), cvdv_dot(), cvdv_elem_div(), cvdv_elem_prod(), cvdv_sub(), det(), DF_cdble_dv_div(), DF_cdvpow(), DF_dble_dv_div(), DF_dvatan(), DF_dvcos(), DF_dvcpow(), DF_dvcube(), DF_dvdvpow(), DF_dvexp(), DF_dvfourth(), DF_dvlog(), DF_dvmfexp(), DF_dvpow(), DF_dvsin(), DF_dvsqrt(), DF_dvsquare(), DF_dvtan(), DF_first_diference(), dfinvpret(), dmcv_prod(), dmdv_prod(), dmdv_solve(), dv_assign(), dv_eqprev(), dv_init(), dv_subassign(), dvcm_prod(), dvcv_add(), dvcv_dot(), dvcv_elem_div(), dvcv_elem_prod(), dvcv_sub(), dvdm_prod(), dvdv_add(), dvdv_dot(), dvdv_elem_div(), dvdv_elem_prod(), dvdv_sub(), dvector(), elem_div(), elem_prod(), exp(), extract_column(), extract_diagonal(), fabs(), fill(), fill_randbi(), fill_randbi_ni(), dmatrix::fill_randcau(), d3_array::fill_randcau(), dmatrix::fill_randn(), d3_array::fill_randn(), fill_randn_ni(), dmatrix::fill_randn_ni(), d3_array::fill_randn_ni(), fill_randnegbinomial(), fill_randpoisson(), fill_randu(), dmatrix::fill_randu(), d3_array::fill_randu(), fill_randu_ni(), dmatrix::fill_randu_ni(), d3_array::fill_randu_ni(), ivector::fill_seqadd(), fill_seqadd(), lvector::fill_seqadd(), first_difference(), fmm::fmin(), fmmt1::fmin(), initialize(), dvar_vector::initialize(), inv(), ivector::ivector(), ln_det(), log(), log10(), lvector::lvector(), max(), mean(), mfexp(), min(), operator*(), operator*=(), operator+(), operator+=(), dvar_vector::operator+=(), operator-(), operator-(), operator-=(), dvar_vector::operator-=(), operator/(), operator/=(), operator=(), outer_prod(), pow(), read_from(), restore_dvar_vector_der_nozero(), row_vector(), dmatrix::rowfill(), dmatrix::rowfill_randn(), dmatrix::rowfill_randn_ni(), dmatrix::rowfill_randu(), dmatrix::rowfill_randu_ni(), dmatrix::rowfill_seqadd(), sfabs(), sin(), sinh(), solve(), sqr(), sqrt(), sum(), tan(), tanh(), and value().

const double& dvector::elem ( int  i) const
inline

Definition at line 168 of file dvector.h.

double* dvector::end ( ) const
inline

Definition at line 119 of file dvector.h.

void dvector::fill ( const char *  s)

Fill vectors from values in string s.

Parameters
sshould be in {v1, ..., vn} format.

Definition at line 48 of file dvect10.cpp.

Referenced by elem(), ivector::fill(), and lvector::fill().

void dvector::fill_multinomial ( const int &  seed,
const dvector p 
)

Description not yet available.

Parameters

Definition at line 17 of file dvect11.cpp.

Referenced by elem(), and dvar_vector::fill_multinomial().

void dvector::fill_multinomial ( const random_number_generator rng,
const dvector p 
)

Description not yet available.

Parameters

Definition at line 17 of file dvect25.cpp.

void dvector::fill_randbi ( long int &  n,
double  p 
)

Fill vector with binary random numbers.

If random number is less than p, vector element is set to 1, otherwise it is set to 0.

Parameters
nseed
pvalue between 0 and 1

Definition at line 164 of file ranfill.cpp.

Referenced by elem().

void dvector::fill_randbi ( double  p,
const random_number_generator rng 
)

Description not yet available.

Parameters

Definition at line 207 of file rngen.cpp.

void dvector::fill_randbi_ni ( long int &  n,
double  p 
)

Description not yet available.

Parameters

Definition at line 33 of file ranf_ni.cpp.

Referenced by elem().

void dvector::fill_randcau ( const random_number_generator rng)

Description not yet available.

Parameters

Definition at line 27 of file drancau.cpp.

Referenced by elem().

void dvector::fill_randn ( long int &  n)
void dvector::fill_randn ( const random_number_generator rng)

Description not yet available.

Parameters

Definition at line 268 of file rngen.cpp.

void dvector::fill_randn_ni ( long int &  n)

Description not yet available.

Parameters

Definition at line 102 of file ranf_ni.cpp.

Referenced by elem().

void dvector::fill_randnegbinomial ( double  lambda,
double  tau,
const random_number_generator rng 
)

Description not yet available.

Parameters

Definition at line 17 of file drannegbin.cpp.

Referenced by end().

void dvector::fill_randu ( long int &  n)

Fill vector with random numbers.

Parameters
nseed

Definition at line 190 of file ranfill.cpp.

Referenced by elem(), ivector::fill_multinomial(), fill_multinomial(), and lvector::fill_multinomial().

void dvector::fill_randu ( const random_number_generator rng)

Description not yet available.

Parameters

Definition at line 232 of file rngen.cpp.

void dvector::fill_randu_ni ( long int &  n)

Description not yet available.

Parameters

Definition at line 60 of file ranf_ni.cpp.

Referenced by elem().

void dvector::fill_seqadd ( double  base,
double  offset 
)
unsigned int dvector::get_ncopies ( ) const
inline

Definition at line 193 of file dvector.h.

double*& dvector::get_v ( void  )
inline

Definition at line 148 of file dvector.h.

Referenced by dvector_position::dvector_position().

double* dvector::get_v ( void  ) const
inline

Definition at line 164 of file dvector.h.

int dvector::indexmax ( void  ) const
inline

Get maximum valid index.

Definition at line 204 of file dvector.h.

Referenced by acos(), ageLengthKey(), ALK(), allocate(), ivector::allocate(), dvar_vector::allocate(), as_factor(), asin(), atan(), laplace_approximation_calculator::banded_calculations_trust_region_approach(), calculate_laplace_approximation(), cmdv_prod(), column_vector(), copy_value_from_vector(), cos(), cosh(), count_factor(), cs_ipvec(), cs_pvec(), cube(), cvdv_add(), cvdv_dot(), cvdv_elem_div(), cvdv_elem_prod(), cvdv_sub(), derch(), df1b2vector::df1b2vector(), DF_cdble_dv_diveq(), DF_cdvpow(), DF_dvatan(), DF_dvcos(), DF_dvcpow(), DF_dvcube(), DF_dvdvpow(), DF_dvexp(), DF_dvfourth(), DF_dvlog(), DF_dvmfexp(), DF_dvpow(), DF_dvsin(), DF_dvsqrt(), DF_dvsquare(), DF_dvtan(), DF_vdble_dv_diveq(), dfcholeski_sparse(), dfouter_prodvv(), dgamma(), dmcv_prod(), dmdv_prod(), dmultinom(), dnbinom(), dnbinom_tau(), dnorm(), laplace_approximation_calculator::do_newton_raphson_banded(), dv_assign(), dv_eqprev(), dv_subassign(), dvar_vector::dvar_vector(), dvcv_add(), dvcv_dot(), dvcv_elem_div(), dvcv_elem_prod(), dvcv_sub(), dvdm_prod(), dvdv_add(), dvdv_dot(), dvdv_elem_div(), dvdv_elem_prod(), dvdv_sub(), dvector(), dvector_position::dvector_position(), dzinbinom(), elem_div(), elem_prod(), evaluate_function_gradient(), exp(), fabs(), factln(), fill(), ivector::fill_multinomial(), fill_multinomial(), lvector::fill_multinomial(), fill_randbi(), fill_randbi_ni(), fill_randcau(), fill_randn(), fill_randn_ni(), fill_randnegbinomial(), fill_randpoisson(), fill_randu(), fill_randu_ni(), ivector::fill_seqadd(), fill_seqadd(), lvector::fill_seqadd(), first_difference(), fmmc::fmin(), funnel_derivatives(), gammln(), gauss_hermite(), gauss_legendre(), get_confidence_interval(), get_eigen_values(), get_ft(), get_onesided_intervals(), laplace_approximation_calculator::get_uhat_quasi_newton_block_diagonal(), ghk(), function_minimizer::hess_routine_noparallel_random_effects(), histogram(), imtqlx(), dvector_index::indexmax(), dcompressed_triplet::indexmax(), dvar_vector::initialize(), function_minimizer::limited_memory_quasi_newton(), function_minimizer::limited_memory_quasi_newton_block(), laplace_approximation_calculator::lincg(), log(), log10(), log_comb(), lower_triangular_solve(), lower_triangular_solve_trans(), lvector::lvector(), make_preliminary_hist(), MAT(), max(), maxnz(), function_minimizer::mcmc_routine(), mean(), mfexp(), min(), function_minimizer::minimize(), minnz(), multifan(), nograd_assign(), nograd_assign_column(), nograd_assign_row(), nograd_assign_trans(), function_minimizer::normalize_posterior_distribution(), operator&(), vcubic_spline_function::operator()(), cubic_spline_function::operator()(), operator*(), operator*=(), operator+(), operator+=(), dvar_vector::operator+=(), operator-(), operator-(), operator-=(), dvar_vector::operator-=(), operator/(), operator/=(), operator<<(), operator=(), independent_variables::operator=(), dvar_vector::operator=(), cifstream::operator>>(), outer_prod(), pow(), print_hist_data(), print_is_diagnostics(), function_minimizer::prof_minimize(), function_minimizer::prof_minimize_re(), function_minimizer::quasi_newton_block(), function_minimizer::random_effects_maximization(), rdirichlet(), read_from(), read_hist_data(), reallocate(), rmvlogistic(), robust_regression(), row_vector(), sample(), dvar_vector::save_dvar_vector_value(), save_dvector_value(), ivector::save_ivector_value(), function_minimizer::set_runtime_crit(), function_minimizer::set_runtime_maxfn(), param_init_vector_vector::set_scalefactor(), param_init_bounded_vector_vector::set_scalefactor(), param_init_matrix_vector::set_scalefactor(), param_init_bounded_matrix_vector::set_scalefactor(), param_init_number_vector::set_scalefactor(), param_init_bounded_number_vector::set_scalefactor(), init_df1b2vector::set_value(), set_value_inv(), set_value_inv_partial(), sfabs(), sgn(), shape_check(), sin(), sinh(), smooth(), solve(), solve_trans(), admb_deprecated::sort(), sort(), spline(), splint(), sqr(), sqrt(), square(), sum(), tan(), tanh(), tmpxchol1(), trans(), unique(), varchol(), write_empirical_covariance_matrix(), and write_on().

int dvector::indexmin ( void  ) const
inline

Get minimum valid index.

Definition at line 199 of file dvector.h.

Referenced by acos(), ageLengthKey(), ALK(), allocate(), ivector::allocate(), dvar_vector::allocate(), as_factor(), asin(), atan(), laplace_approximation_calculator::banded_calculations_trust_region_approach(), cmdv_prod(), column_vector(), copy_value_from_vector(), cos(), cosh(), count_factor(), cube(), cvdv_add(), cvdv_dot(), cvdv_elem_div(), cvdv_elem_prod(), cvdv_sub(), derch(), df1b2vector::df1b2vector(), DF_cdble_dv_diveq(), DF_cdvpow(), DF_dvatan(), DF_dvcos(), DF_dvcpow(), DF_dvcube(), DF_dvdvpow(), DF_dvexp(), DF_dvfourth(), DF_dvlog(), DF_dvmfexp(), DF_dvpow(), DF_dvsin(), DF_dvsqrt(), DF_dvsquare(), DF_dvtan(), DF_vdble_dv_diveq(), dfcholeski_sparse(), dfouter_prodvv(), dgamma(), dmcv_prod(), dmdv_prod(), dmultinom(), dnbinom(), dnbinom_tau(), dnorm(), dv_assign(), dv_eqprev(), dv_subassign(), dvar_vector::dvar_vector(), dvcv_add(), dvcv_dot(), dvcv_elem_div(), dvcv_elem_prod(), dvcv_sub(), dvdm_prod(), dvdv_add(), dvdv_dot(), dvdv_elem_div(), dvdv_elem_prod(), dvdv_sub(), dvector(), dvector_position::dvector_position(), dzinbinom(), elem_div(), elem_prod(), exp(), fabs(), factln(), fill(), ivector::fill_multinomial(), fill_multinomial(), lvector::fill_multinomial(), fill_randbi(), fill_randbi_ni(), fill_randcau(), fill_randn(), fill_randn_ni(), fill_randnegbinomial(), fill_randpoisson(), fill_randu(), fill_randu_ni(), ivector::fill_seqadd(), fill_seqadd(), lvector::fill_seqadd(), first_difference(), fmm::fmin(), fmmt1::fmin(), fmmc::fmin(), gammln(), gauss_hermite(), get_confidence_interval(), get_eigen_values(), get_ft(), get_onesided_intervals(), gradcalc(), function_minimizer::hess_inv(), function_minimizer::hess_routine_noparallel_random_effects(), histogram(), imtqlx(), dvector_index::indexmin(), dcompressed_triplet::indexmin(), initialize(), dvar_vector::initialize(), initpointer(), gradient_structure::jacobcalc(), log(), log10(), log_comb(), lower_triangular_solve(), lower_triangular_solve_trans(), lvector::lvector(), make_preliminary_hist(), MAT(), max(), maxnz(), function_minimizer::mcmc_routine(), mean(), mfexp(), min(), minnz(), multifan(), function_minimizer::neldmead(), nograd_assign(), nograd_assign_column(), nograd_assign_row(), nograd_assign_trans(), operator&(), vcubic_spline_function::operator()(), cubic_spline_function::operator()(), operator*(), operator*=(), operator+(), operator+=(), dvar_vector::operator+=(), operator-(), operator-(), operator-=(), dvar_vector::operator-=(), operator/(), operator/=(), operator<<(), operator=(), independent_variables::operator=(), dvar_vector::operator=(), cifstream::operator>>(), outer_prod(), pow(), print_is_diagnostics(), function_minimizer::random_effects_maximization(), rdirichlet(), read_from(), reallocate(), rmvlogistic(), robust_regression(), row_vector(), sample(), dvar_vector::save_dvar_vector_value(), save_dvector_value(), ivector::save_ivector_value(), function_minimizer::set_runtime_crit(), function_minimizer::set_runtime_maxfn(), param_init_vector_vector::set_scalefactor(), param_init_bounded_vector_vector::set_scalefactor(), param_init_matrix_vector::set_scalefactor(), param_init_bounded_matrix_vector::set_scalefactor(), param_init_number_vector::set_scalefactor(), param_init_bounded_number_vector::set_scalefactor(), init_df1b2vector::set_value(), set_value_inv(), set_value_inv_partial(), sfabs(), sgn(), shape_check(), shift(), sin(), sinh(), smooth(), solve(), solve_trans(), admb_deprecated::sort(), sort(), spline(), spline_cubic_val(), spline_cubic_val2(), splint(), sqr(), sqrt(), square(), sum(), tan(), tanh(), tmpxchol1(), trans(), tri_dag(), tri_dagv(), unique(), varchol(), vector2matrix(), and write_on().

void dvector::initialize ( void  )

Initialze all elements of dvector to zero.

Definition at line 10 of file dvect5.cpp.

Referenced by laplace_approximation_calculator::banded_calculations(), laplace_approximation_calculator::block_diagonal_calculations(), bounded_multivariate_cauchy(), bounded_multivariate_mixture(), bounded_multivariate_normal(), bounded_multivariate_uniform(), bounded_robust_multivariate_normal(), choleski_decomp_trust_bound(), cmdv_prod(), colsum(), cs_add(), DF_first_diference(), df_ln_det_choleski(), df_xdet(), df_xldet(), dfbltsolve(), dfcholeski_decomp(), dfcholeski_decomp_banded(), dfcholeski_decomp_banded_positive(), dfcholeski_decomp_positive(), dfcholeski_sparse(), dfinvpret(), dfouter_prodvv(), dmdv_solve(), dmultinom(), dmvlogistic(), laplace_approximation_calculator::do_newton_raphson_banded(), laplace_approximation_calculator::do_separable_stuff_laplace_approximation_block_diagonal(), laplace_approximation_calculator::do_separable_stuff_laplace_approximation_importance_sampling_adjoint(), dvcm_prod(), elem(), fcomp1(), fmm::fmin(), fmmt1::fmmt1(), laplace_approximation_calculator::generate_antithetical_rvs(), laplace_approximation_calculator::get_fx_fu(), laplace_approximation_calculator::get_gradient_for_hessian_calcs(), get_inverse_sparse_hessian(), get_solution_vector(), laplace_approximation_calculator::get_uhat_lm_newton2(), laplace_approximation_calculator::get_uhat_quasi_newton(), laplace_approximation_calculator::get_uhat_quasi_newton_block_diagonal(), laplace_approximation_calculator::get_uhat_quasi_newton_qd(), gradcalc(), function_minimizer::hess_routine_noparallel_random_effects(), function_minimizer::hybrid_mcmc_routine(), dmatrix::initialize(), inv(), gradient_structure::jacobcalc(), laplace_approximation_calculator::laplace_approximation_calculator(), function_minimizer::limited_memory_quasi_newton(), laplace_approximation_calculator::local_minimization(), function_minimizer::mcmc_routine(), fmm::minimize(), function_minimizer::monte_carlo_routine(), new_probing_bounded_multivariate_normal(), new_probing_bounded_multivariate_normal_mcmc(), function_minimizer::nuts_mcmc_routine(), operator*(), probing_bounded_multivariate_normal(), reallocate(), function_minimizer::shmc_mcmc_routine(), and solve().

double* dvector::initpointer ( void  )
inline

Definition at line 156 of file dvector.h.

const double* dvector::initpointer ( void  ) const
inline

Definition at line 160 of file dvector.h.

bool dvector::is_valid_index ( const int  i) const

Check index i is in dvector bounds [index_min, index_max].

Parameters
irow index

Definition at line 20 of file dvec_acc.cpp.

Referenced by dmatrix::is_valid_row().

int dvector::operator! ( void  ) const
inline

Returns 1 (TRUE) if memory is NOT allocated.

Definition at line 66 of file dvector.h.

dvector dvector::operator() ( int  lb,
int  ub 
)
inline

Get subvector.

Parameters
lbstarting index of subvector
ubending index of subvector
Returns
dvector contining a shallow copy of calling instance of dvector with valid subscripts from lb to ub.

Definition at line 108 of file dvector.h.

Referenced by is_valid_index(), and size().

dvector dvector::operator() ( const lvector u)

Description not yet available.

Parameters

Definition at line 64 of file dvect8.cpp.

dvector dvector::operator() ( const ivector u)

Description not yet available.

Parameters

Definition at line 49 of file dvect8.cpp.

double & dvector::operator() ( int  i)
inline

Definition at line 347 of file dvector.h.

const double & dvector::operator() ( int  i) const
inline

Definition at line 355 of file dvector.h.

dvector & dvector::operator*= ( double  v1)

Multiply elements of a vector by a constant.

Parameters
xconstant for multiplication.

Definition at line 30 of file dvect20.cpp.

Referenced by size().

dvector& dvector::operator++ ( void  )
inline

Increment vector indices array pointer.

Definition at line 84 of file dvector.h.

dvector & dvector::operator+= ( const dvector values)

Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.

Add values to dvector element-wise.

Parameters
valuesdvector

Definition at line 12 of file dvect16.cpp.

Referenced by size().

dvector & dvector::operator+= ( double  v1)

Add value to each element of dvector.

Parameters
valuedouble

Definition at line 50 of file dvect16.cpp.

dvector dvector::operator- ( void  )

Description not yet available.

Parameters

Definition at line 17 of file dvect22.cpp.

dvector& dvector::operator-- ( void  )
inline

Decrement vector indices array pointer.

Definition at line 76 of file dvector.h.

dvector & dvector::operator-= ( const dvector values)

Subtract values from dvector element-wise.

Parameters
valuesdvector

Definition at line 31 of file dvect16.cpp.

Referenced by size().

dvector & dvector::operator-= ( double  v1)

Subtract value to each element of dvector.

Parameters
valuedouble

Definition at line 63 of file dvect16.cpp.

dvector & dvector::operator/= ( double  v1)

Divide elements of a vector by a constant.

Parameters
xconstant to divide vector by.

Definition at line 17 of file dvect20.cpp.

Referenced by size().

double & dvector::operator[] ( int  i)
inline

Definition at line 343 of file dvector.h.

Referenced by is_valid_index().

const double & dvector::operator[] ( int  i) const
inline

Definition at line 351 of file dvector.h.

istream & dvector::parse ( istream &  input_json)

Definition at line 125 of file adjson.cpp.

void dvector::read_from ( const uistream _s)

Description not yet available.

Parameters

Definition at line 77 of file dvec_io2.cpp.

Referenced by operator>>(), and size().

void dvector::read_from ( const istream &  _s)

Description not yet available.

Parameters

Definition at line 96 of file dvect_io.cpp.

void dvector::reallocate ( double  s)

Reallocate size of array.

Parameters
percentchange

Definition at line 18 of file dvect26.cpp.

Referenced by operator++().

void dvector::safe_allocate ( int  ncl,
int  nch 
)

Safely allocate memory for a dvector.

Exits with an error message if memory for this instance has already been allocated.

Parameters
nclInteger specifying lowest valid subscript.
nchInteger specifying highest valid subscript.

Definition at line 383 of file dvector.cpp.

void dvector::safe_deallocate ( void  )

Safely deallocates memory by reporting if shallow copies are still in scope.

Definition at line 111 of file dvector.cpp.

void dvector::save_dvector_derivatives ( const dvar_vector_position pos) const
void dvector::save_dvector_derivatives ( void  ) const

Referenced by size().

void dvector::save_dvector_derivatives_na ( const dvar_vector_position pos) const

Description not yet available.

Parameters

Definition at line 193 of file cmpdif5.cpp.

Referenced by size().

void dvector::save_dvector_position ( void  ) const

Description not yet available.

Parameters

Definition at line 28 of file cmpdif4.cpp.

Referenced by det(), elem_prod(), funnel_gradcalc(), inv(), ln_det(), operator*(), pow(), size(), and solve().

void dvector::save_dvector_value ( void  ) const

Saves the size, address, and value information for a dvector.

Definition at line 101 of file cmpdif4.cpp.

Referenced by det(), elem_prod(), funnel_gradcalc(), inv(), ln_det(), operator*(), pow(), size(), and solve().

void dvector::shallow_copy ( const dvector other)

Explicit shallow copy.

Parameters
tdvector to be copied

Definition at line 158 of file dvector.cpp.

Referenced by dvector(), and end().

unsigned int dvector::size ( ) const
inline
dvector dvector::sub ( int  lb,
int  ub 
)
inline

Get subvector.

Parameters
lbstarting index of subvector
ubending index of subvector
Returns
dvector contining a shallow copy of calling instance of dvector with valid subscripts from lb to ub.

Definition at line 98 of file dvector.h.

void dvector::write_on ( const ostream &  _s) const

Description not yet available.

Parameters

Definition at line 49 of file dvect_io.cpp.

Referenced by operator<<().

void dvector::write_on ( const uostream _s) const

Description not yet available.

Parameters

Definition at line 62 of file dvec_io2.cpp.

Friends And Related Function Documentation

friend class banded_lower_triangular_dmatrix
friend

Definition at line 132 of file dvector.h.

Definition at line 130 of file dvector.h.

friend class banded_symmetric_dmatrix
friend

Definition at line 131 of file dvector.h.

friend class banded_symmetric_dvar_matrix
friend

Definition at line 129 of file dvector.h.

friend class d3_array
friend

Definition at line 267 of file dvector.h.

friend class dmatrix
friend

Definition at line 266 of file dvector.h.

friend class dvar_vector
friend

Definition at line 265 of file dvector.h.

dvector elem_div ( const dvector t1,
const dvector t2 
)
friend

Element-wise division of two vectors; constant objects.

Exits with error if bounds of the two arguments differ.

Parameters
t1A vector, $u$ with valid subscripts in $[i_1,i_n]$
t2A vector, $v$ with valid subscripts in $[i_1,i_n]$
Returns
A vector containing $z_i = u_i\div v_i; [i_1,i_n]$.

Definition at line 52 of file dvect2.cpp.

dvar_vector elem_div ( const dvector v1,
const dvar_vector v2 
)
friend

Description not yet available.

Parameters

Definition at line 173 of file fvar_a46.cpp.

dvar_vector elem_div ( const dvar_vector v1,
const dvector v2 
)
friend

Description not yet available.

Parameters

Definition at line 107 of file fvar_a46.cpp.

dvector elem_prod ( const dvector t1,
const dvector t2 
)
friend

Element-wise multiplication of two vectors; constant objects.

Exits with error if bounds of the two arguments differ.

Parameters
t1A vector, $u$ with valid subscripts in $[i_1,i_n]$
t2A vector, $v$ with valid subscripts in $[i_1,i_n]$
Returns
A vector containing $z_i = u_i\times v_i; [i_1,i_n]$.

Definition at line 20 of file dvect2.cpp.

dvar_vector elem_prod ( const dvector v1,
const dvar_vector v2 
)
friend

Description not yet available.

Parameters

Definition at line 96 of file fvar_a45.cpp.

dvar_vector elem_prod ( const dvar_vector v1,
const dvector v2 
)
friend

Description not yet available.

Parameters

Definition at line 155 of file fvar_a45.cpp.

dvector exp ( const dvector )
friend

Description not yet available.

Parameters

Definition at line 32 of file dvect7.cpp.

dvector fabs ( const dvector t1)
friend

Description not yet available.

Parameters

Definition at line 47 of file dvect7.cpp.

char* fform ( const char *  ,
const dvector  
)
friend
dvector first_difference ( const dvector values)
friend

Returns dvector containing the differences of an values(i) and values(i + 1) for i = 1 to values.indexmax() - 1.

Parameters
valuesdvector

Definition at line 14 of file dvec_dif.cpp.

dvector log ( const dvector )
friend

Description not yet available.

Parameters

Definition at line 17 of file dvect7.cpp.

double max ( const dvector )
friend

Returns the maximum value of vector vec.

Note: vec is an allocated vector.

Parameters
vecscalar vector

Definition at line 64 of file dvect7.cpp.

Referenced by operator*(), operator=(), reallocate(), dvar_matrix::save_dvar_matrix_value(), dvar_vector::save_dvar_vector_value(), save_dvector_value(), and ivector::save_ivector_value().

double min ( const dvector vec)
friend

Returns the minimum value of vector vec.

Note: vec is an allocated vector.

Parameters
vecscalar vector

Definition at line 82 of file dvect7.cpp.

Referenced by operator*(), operator=(), dvar_matrix::save_dvar_matrix_value(), dvar_vector::save_dvar_vector_value(), save_dvector_value(), ivector::save_ivector_value(), shift(), and size().

double norm ( const dvector t1)
friend

Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.

Norm of a vector; constant objects.

Parameters
t1A vector, $v$.
Returns
$||v|| = (v\times v)^{1/2} = (\sum_i v_i^2)^{1/2}$

Definition at line 13 of file dvect3.cpp.

double norm2 ( const dvector t1)
friend

Squared norm of a vector; constant objects.

Computes the sum of squares of its vector argument.

Parameters
t1A vector, $v$.
Returns
$||v||^2 = v\times v = \sum_i v_i^2$

Definition at line 28 of file dvect3.cpp.

double operator* ( const dvector t1,
const dvector t2 
)
friend

Compute the dot product of two vectors.

The minimum and maxium legal subscripts of the arguments must agree; otherwize an error message is printed and execution terminates.

Parameters
t1A dvector, $a$.
t2A dvector, $b$.
Returns
A double, $z = a\cdot b = \sum_i a_i\cdot b_i$ containing the value of the dot product of the two arguments.

Definition at line 506 of file dvector.cpp.

dvariable operator* ( const dvector cv1,
const dvar_vector v2 
)
friend

Description not yet available.

Parameters

Definition at line 32 of file fvar_a15.cpp.

dvariable operator* ( const dvar_vector v2,
const dvector cv1 
)
friend

Description not yet available.

Parameters

Definition at line 31 of file fvar_a16.cpp.

dvar_vector operator* ( const prevariable x,
const dvector t1 
)
friend

Description not yet available.

Parameters

Definition at line 43 of file fvar_a55.cpp.

dvector operator* ( double  x,
const dvector t1 
)
friend

Multiply a dvector by a constant.

Parameters
xDouble constant, $x$.
t1dvector reference, $y$.
Returns
A dvector $z_i = x*y_i$.

Definition at line 629 of file dvector.cpp.

dvector operator* ( const dvector x,
const dmatrix m 
)
friend

Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.

Returns product of AB where A is a vector and B is a matrix.

Parameters
vecdvector
matdmatrix

Definition at line 13 of file dmat1.cpp.

dvector operator* ( const dmatrix x,
const dvector m 
)
friend

Returns product of AB where A is a dmatrix and B is a dvector.

Parameters
Admatrix
Bdvector

Definition at line 62 of file dmat1.cpp.

dvar_vector operator* ( const dvector x,
const dvar_matrix m 
)
friend

Description not yet available.

Parameters

Definition at line 17 of file fvar_ma1.cpp.

dvar_vector operator* ( const dvar_matrix x,
const dvector m 
)
friend

Description not yet available.

Parameters

Definition at line 19 of file fvar_m34.cpp.

dvector operator+ ( const dvector t1,
const dvector t2 
)
friend

Add two dvectors.

Exits with error if bounds of the two arguments differ.

Parameters
t1dvector reference, $a$.
t2dvector reference, $b$.
Returns
A dvector, $z_i = a_i + b_i$ containing the value of the sum of the two arguments.

Definition at line 553 of file dvector.cpp.

dvar_vector operator+ ( const dvar_vector v1,
const dvector v2 
)
friend

Description not yet available.

Parameters

Definition at line 18 of file fvar_a19.cpp.

dvar_vector operator+ ( const dvector v1,
const dvar_vector v2 
)
friend

Description not yet available.

Parameters

Definition at line 18 of file fvar_a18.cpp.

dvector operator- ( const dvector t1,
const dvector t2 
)
friend

Subtract two dvectors.

Exits with error if bounds of the two arguments differ.

Parameters
t1dvector reference, $a$.
t2dvector reference, $b$.
Returns
A dvector, $z_i = a_i - b_i$ containing the value of the difference of the two arguments.

Definition at line 592 of file dvector.cpp.

dvar_vector operator- ( const dvar_vector v1,
const dvector v2 
)
friend

Description not yet available.

Parameters

Definition at line 18 of file fvar_a23.cpp.

dvar_vector operator- ( const dvector v1,
const dvar_vector v2 
)
friend

Description not yet available.

Parameters

Definition at line 18 of file fvar_a21.cpp.

friend class sdmatrix
friend

Definition at line 261 of file dvector.h.

dvector second_difference ( const dvector )
friend
double sumsq ( const dvector t1)
friend

Definition at line 33 of file dvect3.cpp.

Member Data Documentation

int dvector::index_max
protected

maximum valid subscript

Definition at line 55 of file dvector.h.

Referenced by allocate(), allocatec(), dvector(), indexmax(), is_valid_index(), shallow_copy(), and shift().

int dvector::index_min
protected

minimum valid subscript

Definition at line 54 of file dvector.h.

Referenced by allocate(), allocatec(), begin(), dvector(), indexmin(), is_valid_index(), shallow_copy(), and shift().

vector_shapex* dvector::shape
protected

pointer to vector "shape"

Definition at line 60 of file dvector.h.

Referenced by allocate(), allocatec(), deallocate(), dvector(), operator=(), safe_deallocate(), shallow_copy(), shift(), and ~dvector().

double* dvector::v
protected

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