ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
Public Member Functions | Protected Attributes | Friends
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.
 dvector (const dvar_vector_position &dvp, const kkludge_object &)
 Construct a dvector object from a dvar_vector_position object.
 dvector (const ad_integer &, const index_type &)
 Description not yet available.
 dvector (void)
 Construct a dvector without allocating memory.
 dvector (const dvector &)
 Copy constructor.
 dvector (const ivector &)
 Description not yet available.
 dvector (const lvector &)
 Description not yet available.
 dvector (const char *)
 Description not yet available.
 dvector (int ncl, int ncu)
 Construct a dvector with specified range of valid subscript.
 dvector (unsigned int sz, double *x)
 Construct a dvector object from a C style array of doubles.
 dvector (char *filename, const int &column)
 Construct dvector using matrix input from text filename.
 ~dvector ()
 Default destructor.
const double * address () const
void allocate (int ncl, int ncu)
 Allocate memory for a dvector.
void allocate (const dvector &dv)
 Allocate memory for a dvector the same size as it's argument.
void allocate (const dvar_vector &)
 Allocate memory for a dvector the same size as it's argument.
void allocate (const char *)
 Description not yet available.
void allocate (void)
 Allocate dvector without allocating memory.
void allocate (const ad_integer &, const index_type &)
 Description not yet available.
void allocatec (const dvector &dv)
 Make shallow copy of dvector shape.
int allocated (void) const
 Returns 1 (TRUE) if memory is allocated.
void deallocate (void)
 Called by destructor to deallocate memory for a dvector object.
double & elem (int i)
const double & elem (int i) const
void fill (const char *s)
 Fill vectors from values in string s.
void fill_multinomial (const int &seed, const dvector &p)
 Description not yet available.
void fill_multinomial (const random_number_generator &rng, const dvector &p)
 Description not yet available.
void fill_randbi (long int &n, double)
 Description not yet available.
void fill_randbi (double p, const random_number_generator &rng)
 Description not yet available.
void fill_randbi_ni (long int &n, double)
 Description not yet available.
void fill_randcau (const random_number_generator &rng)
 Description not yet available.
void fill_randn (long int &n)
 Description not yet available.
void fill_randn (const random_number_generator &rng)
 Description not yet available.
void fill_randn_ni (long int &n)
 Description not yet available.
void fill_randnegbinomial (double lambda, double tau, const random_number_generator &rng)
 Description not yet available.
void fill_randpoisson (double lambda, const random_number_generator &rng)
 Fill vector with Poisson pseudorandom numbers.
void fill_randu (long int &n)
 Description not yet available.
void fill_randu (const random_number_generator &rng)
 Description not yet available.
void fill_randu_ni (long int &n)
 Description not yet available.
void fill_seqadd (double, double)
 Description not yet available.
unsigned int get_ncopies () const
double *& get_v (void)
double * get_v (void) const
int indexmax () const
 Get maximum valid index.
int indexmin () const
 Get minimum valid index.
void initialize (void)
 Sets all elements to zero.
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].
int operator! (void) const
 Returns 1 (TRUE) if memory is NOT allocated.
dvector operator() (int lb, int ub)
 Get subvector.
dvector operator() (const lvector &)
 Description not yet available.
dvector operator() (const ivector &u)
 Description not yet available.
double & operator() (int i)
const double & operator() (int i) const
dvectoroperator*= (double v1)
 Multiply elements of a vector by a constant.
dvectoroperator++ (void)
 Increment vector indices array pointer.
dvectoroperator+= (const dvector &v1)
 Description not yet available.
dvectoroperator+= (double v1)
 Description not yet available.
dvector operator- ()
 Description not yet available.
dvectoroperator-- (void)
 Decrement vector indices array pointer.
dvectoroperator-= (const dvector &v1)
 Description not yet available.
dvectoroperator-= (double v1)
 Description not yet available.
dvectoroperator/= (double v1)
 Divide elements of a vector by a constant.
dvectoroperator= (const dvector &t)
 Assignment operator for dvector argument.
dvectoroperator= (double x)
 Assignment operator for double argument.
double & operator[] (int i)
const double & operator[] (int i) const
void read_from (const uistream &)
 Description not yet available.
void read_from (const istream &)
 Description not yet available.
void reallocate (double size)
 Reallocate size of array.
void safe_allocate (int, int)
 Safely allocate memory for a dvector.
void safe_deallocate (void)
 Safely deallocates memory by reporting if shallow copies are still in scope.
void save_dvector_derivatives (const dvar_vector_position &pos) const
 Puts the derivative values in a dvector into a dvar_vector's guts.
void save_dvector_derivatives (void) const
void save_dvector_derivatives_na (const dvar_vector_position &pos) const
 Description not yet available.
void save_dvector_position (void) const
 Description not yet available.
void save_dvector_value (void) const
 Saves the size, address, and value information for a dvector.
void shallow_copy (const dvector &)
 Explicit shallow copy.
dvectorshift (int min)
 Shift valid range of subscripts.
int size () const
 Get number of elements in array.
dvector sub (int lb, int ub)
 Get subvector.
int & testmax ()
int & testmin ()
void write_on (const ostream &) const
 Description not yet available.
void write_on (const uostream &) const
 Description not yet available.

Protected Attributes

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

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.
dvar_vector elem_div (const dvector &, const dvar_vector &)
 Description not yet available.
dvar_vector elem_div (const dvar_vector &, const dvector &)
 Description not yet available.
dvector elem_prod (const dvector &, const dvector &)
 Element-wise multiplication of two vectors; constant objects.
dvar_vector elem_prod (const dvector &, const dvar_vector &)
 Description not yet available.
dvar_vector elem_prod (const dvar_vector &, const dvector &)
 Description not yet available.
dvector exp (const dvector &)
 Description not yet available.
dvector fabs (const dvector &)
 Description not yet available.
char * fform (const char *, const dvector &)
dvector first_difference (const dvector &)
 Description not yet available.
dvector log (const dvector &)
 Description not yet available.
double max (const dvector &)
 Description not yet available.
double min (const dvector &)
 Description not yet available.
double norm (const dvector &)
 Norm of a vector; constant objects.
double norm2 (const dvector &)
 Squared norm of a vector; constant objects.
double operator* (const dvector &, const dvector &)
 Compute the dot product of two vectors.
dvariable operator* (const dvector &, const dvar_vector &)
 Description not yet available.
dvariable operator* (const dvar_vector &, const dvector &)
 Description not yet available.
dvar_vector operator* (const prevariable &, const dvector &)
 Description not yet available.
dvector operator* (double, const dvector &)
 Multiply a dvector by a constant.
dvector operator* (const dvector &x, const dmatrix &m)
 Description not yet available.
dvector operator* (const dmatrix &x, const dvector &m)
 Description not yet available.
dvar_vector operator* (const dvector &x, const dvar_matrix &m)
 Description not yet available.
dvar_vector operator* (const dvar_matrix &x, const dvector &m)
 Description not yet available.
dvector operator+ (const dvector &, const dvector &)
 Add two dvectors.
dvar_vector operator+ (const dvar_vector &, const dvector &)
 Description not yet available.
dvar_vector operator+ (const dvector &, const dvar_vector &)
 Description not yet available.
dvector operator- (const dvector &, const dvector &)
 Subtract two dvectors.
dvar_vector operator- (const dvar_vector &, const dvector &)
 Description not yet available.
dvar_vector operator- (const dvector &, const dvar_vector &)
 Description not yet available.
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 197 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 362 of file dvector.cpp.

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

Description not yet available.

Parameters:

Definition at line 414 of file indextyp.cpp.

dvector::dvector ( void  )

Construct a dvector without allocating memory.

Useful in creating classes containing dvectors.

Definition at line 384 of file dvector.cpp.

Referenced by data_vector::allocate().

dvector::dvector ( const dvector t)

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
dvector z;
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)

Description not yet available.

Parameters:

Definition at line 35 of file dvect8.cpp.

dvector::dvector ( const char *  s)

Description not yet available.

Parameters:

Definition at line 55 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 372 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 335 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.

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.


Member Function Documentation

const double* dvector::address ( ) const [inline]

Definition at line 135 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 415 of file dvector.cpp.

Referenced by param_stddev_vector::allocate(), dmatrix::allocate(), sdmatrix::allocate(), dcompressed_triplet::allocate(), cube(), cubic_spline_function::cubic_spline_function(), dmatrix::dmatrix(), 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 dv)

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

Parameters:
dvReference to a dvector.

Definition at line 464 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 473 of file dvector.cpp.

void dvector::allocate ( const char *  s)

Description not yet available.

Parameters:

Reimplemented in named_dvector.

Definition at line 251 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 506 of file dvector.cpp.

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

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

Description not yet available.

Parameters:

Definition at line 423 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 483 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 dll_data_vector::allocate(), df1b2vector::df1b2vector(), reallocate(), and safe_allocate().

void dvector::deallocate ( void  )

Called by destructor to deallocate memory for a dvector object.

Definition at line 93 of file dvector.cpp.

Referenced by dcompressed_triplet::deallocate(), 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 143 of file dvector.h.

Referenced by acos(), allocate(), asin(), atan(), cmdv_prod(), 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(), extract_row(), fabs(), fill(), fill_randbi(), fill_randbi_ni(), fill_randn_ni(), fill_randnegbinomial(), fill_randpoisson(), fill_randu(), fill_randu_ni(), 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(), save_dvector_derivatives(), save_dvector_derivatives_na(), sfabs(), sin(), sinh(), solve(), sqr(), sqrt(), sum(), tan(), tanh(), and value().

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

Definition at line 159 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 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 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 
)

Description not yet available.

Parameters:

Definition at line 141 of file ranfill.cpp.

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.

Description not yet available.

Parameters:

Definition at line 27 of file drancau.cpp.

Referenced by dmatrix::fill_randcau().

void dvector::fill_randn ( long int &  n)

Description not yet available.

Parameters:

Definition at line 210 of file ranfill.cpp.

Referenced by dmatrix::fill_randn(), function_minimizer::hybrid_mcmc_routine(), rmvlogistic(), and test_mcmc_options_window().

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 dmatrix::fill_randn(), and dmatrix::fill_randn_ni().

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.

void dvector::fill_randu ( long int &  n)

Description not yet available.

Parameters:

Definition at line 168 of file ranfill.cpp.

Referenced by ivector::fill_multinomial(), fill_multinomial(), lvector::fill_multinomial(), and dmatrix::fill_randu().

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 dmatrix::fill_randu(), and dmatrix::fill_randu_ni().

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

Definition at line 196 of file dvector.h.

double*& dvector::get_v ( void  ) [inline]

Definition at line 139 of file dvector.h.

Referenced by dvector_position::dvector_position().

double* dvector::get_v ( void  ) const [inline]

Definition at line 155 of file dvector.h.

int dvector::indexmax ( void  ) const [inline]

Get maximum valid index.

Reimplemented in dvector_index.

Definition at line 208 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(), fill_seqadd(), first_difference(), 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(), dvar_compressed_triplet::indexmax(), dcompressed_triplet::indexmax(), initialize(), 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(), 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(), save_dvector_derivatives(), save_dvector_derivatives_na(), save_dvector_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(), sort(), spline(), splint(), sqr(), sqrt(), square(), sum(), tan(), tanh(), tmpxchol1(), trans(), unique(), varchol(), write_empirical_covariance_matrix(), write_on(), and dll_data_vector::~dll_data_vector().

int dvector::indexmin ( void  ) const [inline]

Get minimum valid index.

Reimplemented in dvector_index.

Definition at line 202 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(), fill_seqadd(), first_difference(), fmm::fmin(), fmmt1::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(), dvar_compressed_triplet::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(), 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(), save_dvector_derivatives(), save_dvector_derivatives_na(), save_dvector_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(), sort(), spline(), spline_cubic_val(), spline_cubic_val2(), splint(), sqr(), sqrt(), square(), sum(), tan(), tanh(), tmpxchol1(), trans(), tri_dag(), tri_dagv(), unique(), varchol(), vector2matrix(), write_on(), and dll_data_vector::~dll_data_vector().

void dvector::initialize ( void  )

Sets all elements to zero.

Definition at line 16 of file dvect5.cpp.

Referenced by betacf(), 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_newton_raphson_state_space(), laplace_approximation_calculator::do_separable_stuff_laplace_approximation_block_diagonal(), laplace_approximation_calculator::do_separable_stuff_laplace_approximation_importance_sampling_adjoint(), dvcm_prod(), 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(), dcompressed_triplet::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::normalize_posterior_distribution(), probing_bounded_multivariate_normal(), reallocate(), and solve().

double* dvector::initpointer ( void  ) [inline]

Definition at line 147 of file dvector.h.

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

Definition at line 151 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.

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.

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

Description not yet available.

Parameters:

Definition at line 67 of file dvect8.cpp.

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

Description not yet available.

Parameters:

Definition at line 52 of file dvect8.cpp.

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

Definition at line 350 of file dvector.h.

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

Definition at line 358 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.

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

Increment vector indices array pointer.

Definition at line 84 of file dvector.h.

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

Description not yet available.

Parameters:

Definition at line 17 of file dvect16.cpp.

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

Description not yet available.

Parameters:

Definition at line 61 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 v1)

Description not yet available.

Parameters:

Definition at line 39 of file dvect16.cpp.

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

Description not yet available.

Parameters:

Definition at line 74 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.

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

Reimplemented in dvector_index.

Definition at line 346 of file dvector.h.

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

Definition at line 354 of file dvector.h.

void dvector::read_from ( const uistream _s)

Description not yet available.

Parameters:

Definition at line 77 of file dvec_io2.cpp.

Referenced by operator>>().

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.

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 396 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 ( void  ) const

Description not yet available.

Parameters:

Definition at line 193 of file cmpdif5.cpp.

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(), 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(), and solve().

void dvector::shallow_copy ( const dvector t)

Explicit shallow copy.

Parameters:
tdvector to be copied

Definition at line 172 of file dvector.cpp.

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.

int& dvector::testmax ( ) [inline]

Definition at line 191 of file dvector.h.

int& dvector::testmin ( ) [inline]

Definition at line 185 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 123 of file dvector.h.

friend class banded_lower_triangular_dvar_matrix [friend]

Definition at line 121 of file dvector.h.

friend class banded_symmetric_dmatrix [friend]

Definition at line 122 of file dvector.h.

friend class banded_symmetric_dvar_matrix [friend]

Definition at line 120 of file dvector.h.

friend class d3_array [friend]

Definition at line 272 of file dvector.h.

friend class dmatrix [friend]

Definition at line 271 of file dvector.h.

friend class dvar_vector [friend]

Definition at line 270 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 x) [friend]

Description not yet available.

Parameters:

Definition at line 17 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]

Description not yet available.

Parameters:

Definition at line 62 of file dvect7.cpp.

Referenced by operator=(), reallocate(), save_dvector_derivatives(), save_dvector_derivatives_na(), and save_dvector_value().

double min ( const dvector t1) [friend]

Description not yet available.

Parameters:

Definition at line 79 of file dvect7.cpp.

Referenced by operator=(), save_dvector_derivatives(), save_dvector_derivatives_na(), save_dvector_value(), and shift().

double norm ( const dvector t1) [friend]

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 18 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 34 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 523 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 646 of file dvector.cpp.

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

Description not yet available.

Parameters:

Definition at line 17 of file dmat1.cpp.

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

Description not yet available.

Parameters:

Definition at line 67 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 570 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 609 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 266 of file dvector.h.

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

Definition at line 39 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(), operator++(), operator--(), shallow_copy(), shift(), and size().

int dvector::index_min [protected]

minimum valid subscript

Definition at line 54 of file dvector.h.

Referenced by allocate(), allocatec(), dvector(), indexmin(), is_valid_index(), operator++(), operator--(), shallow_copy(), shift(), and size().

double* dvector::v [protected]

List of all members.


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