ADMB Documentation
-a65f1c97
|
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 |
dvector & | operator*= (double v1) |
Multiply elements of a vector by a constant. More... | |
dvector & | operator++ (void) |
Increment vector indices array pointer. More... | |
dvector & | operator+= (const dvector &v1) |
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California. More... | |
dvector & | operator+= (double v1) |
Add value to each element of dvector. More... | |
dvector | operator- () |
Description not yet available. More... | |
dvector & | operator-- (void) |
Decrement vector indices array pointer. More... | |
dvector & | operator-= (const dvector &v1) |
Subtract values from dvector element-wise. More... | |
dvector & | operator-= (double v1) |
Subtract value to each element of dvector. More... | |
dvector & | operator/= (double v1) |
Divide elements of a vector by a constant. More... | |
dvector & | operator= (const dvector &t) |
Assignment operator for dvector argument. More... | |
dvector & | operator= (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 () const |
Description not yet available. More... | |
void | save_dvector_value () const |
Saves the size, address, and value information for a dvector. More... | |
void | shallow_copy (const dvector &) |
Explicit shallow copy. More... | |
dvector & | shift (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_shapex * | shape |
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 &) |
Element-wise division of v1 by v2 into a dvar_vector. More... | |
dvar_vector | elem_div (const dvar_vector &, const dvector &) |
Element-wise division of v1 by v2 into a dvar_vector. 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 &) |
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.
dvector::dvector | ( | const predvector & | pdv | ) |
Creates a dvector from an instance of class predvector.
Creates a shallow copy.
pdv | an instance of class predvector. Updated by Martell, March 10, 2014, from Dave's email |
Definition at line 183 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,
dvp | Reference to a dvar_vector_position object (usually read from stack) |
kk | Kludge to avoid ambiguous function references |
Definition at line 356 of file dvector.cpp.
dvector::dvector | ( | const ad_integer & | ncl, |
const index_type & | nch | ||
) |
dvector::dvector | ( | void | ) |
Construct a dvector without allocating memory.
Useful in creating classes containing dvectors.
Definition at line 378 of file dvector.cpp.
Referenced by data_vector::allocate().
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
.
Definition at line 148 of file dvector.cpp.
dvector::dvector | ( | const ivector & | u | ) |
dvector::dvector | ( | const lvector & | u | ) |
Construct dvector with values in lvector.
u | values 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.
s | file input or ascii text |
Definition at line 48 of file dvect9.cpp.
dvector::dvector | ( | int | ncl, |
int | nch | ||
) |
Construct a dvector with specified range of valid subscript.
ncl | Integer specifying lowest valid subscript. |
nch | Integer specifying highest valid subscript. |
Definition at line 366 of file dvector.cpp.
dvector::dvector | ( | unsigned int | sz, |
double * | x | ||
) |
Construct a dvector object from a C style array of doubles.
sz | Number of valid memory locations allocated in the array The range of valid subscripts for the dvector object will be [0,sz-1]. |
x | Pointer to double pointing to the first element in the array. |
Definition at line 329 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 46 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 65 of file dvector.cpp.
|
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.
ncl | Integer specifying lowest valid subscript. |
nch | Integer specifying highest valid subscript. |
Definition at line 409 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(), laplace_approximation_calculator::laplace_approximation_calculator(), function_minimizer::mcmc_routine(), function_minimizer::rwm_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.
dv | Reference to a dvector. |
Definition at line 453 of file dvector.cpp.
void dvector::allocate | ( | const dvar_vector & | dv | ) |
Allocate memory for a dvector the same size as it's argument.
dv | Reference to a dvar_vector. |
Definition at line 462 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.
s | file input or ascii text |
Definition at line 296 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 495 of file dvector.cpp.
Referenced by allocate(), named_dvector::allocate(), data_vector::allocate(), dll_data_vector::allocate(), dvector(), independent_variables::operator=(), parse(), reallocate(), and safe_allocate().
void dvector::allocate | ( | const ad_integer & | _ncl, |
const index_type & | _nch | ||
) |
Allocate vector of reals with dimension [_ncl to _nch].
_ncl | lower vector index |
_nch | upper vector index |
Definition at line 433 of file indextyp.cpp.
void dvector::allocatec | ( | const dvector & | t | ) |
Make shallow copy of dvector shape.
Copies the shape of its argument.
t | Reference to a dvector. |
Definition at line 472 of file dvector.cpp.
Referenced by operator=().
|
inline |
Returns 1 (TRUE) if memory is allocated.
Definition at line 71 of file dvector.h.
Referenced by dll_data_vector::allocate(), df1b2vector::df1b2vector(), initialize(), parse(), reallocate(), and safe_allocate().
|
inline |
void dvector::deallocate | ( | void | ) |
Called by destructor to deallocate memory for a dvector object.
Definition at line 92 of file dvector.cpp.
Referenced by dcompressed_triplet::deallocate(), operator=(), parse(), reallocate(), safe_deallocate(), function_minimizer::set_runtime_crit(), function_minimizer::set_runtime_maxfn(), ~dvector(), and function_minimizer::~function_minimizer().
|
inline |
Definition at line 152 of file dvector.h.
Referenced by acos(), allocate(), asin(), atan(), column_value(), column_vector(), cvdv_add(), cvdv_dot(), cvdv_elem_div(), det(), DF_cdble_dv_div(), DF_cdvpow(), DF_dble_dv_div(), DF_dvatan(), DF_dvcos(), DF_dvcpow(), DF_dvcube(), DF_dvdvpow(), DF_dvfourth(), DF_dvlog(), DF_dvpow(), DF_dvsin(), DF_dvsqrt(), DF_dvtan(), DF_first_diference(), dfinvpret(), dv_init(), dv_subassign(), dvcm_prod(), dvcv_add(), dvcv_dot(), dvcv_elem_div(), dvdm_prod(), dvdv_add(), dvdv_sub(), dvector(), elem_div(), extract_diagonal(), 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(), dvar_vector::initialize(), ivector::ivector(), ln_det(), log10(), lvector::lvector(), mean(), operator*(), operator+(), dvar_vector::operator-=(), pow(), read_from(), restore_dvar_vector_der_nozero(), row_vector(), sqr(), sqrt(), and value().
void dvector::fill | ( | const char * | s | ) |
Fill vectors from values in string s.
s | should be in {v1, ..., vn} format. |
Definition at line 43 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.
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 | ||
) |
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.
n | seed |
p | value between 0 and 1 |
Definition at line 164 of file ranfill.cpp.
void dvector::fill_randbi | ( | double | p, |
const random_number_generator & | rng | ||
) |
void dvector::fill_randbi_ni | ( | long int & | n, |
double | p | ||
) |
void dvector::fill_randcau | ( | const random_number_generator & | rng | ) |
Description not yet available.
Definition at line 27 of file drancau.cpp.
Referenced by dmatrix::fill_randcau().
void dvector::fill_randn | ( | long int & | n | ) |
Fill vector with random numbers.
n | seed |
Definition at line 231 of file ranfill.cpp.
Referenced by dmatrix::fill_randn(), function_minimizer::hybrid_mcmc_routine(), function_minimizer::nuts_mcmc_routine(), rmvlogistic(), and function_minimizer::shmc_mcmc_routine().
void dvector::fill_randn | ( | const random_number_generator & | rng | ) |
void dvector::fill_randn_ni | ( | long int & | n | ) |
Description not yet available.
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 | ||
) |
void dvector::fill_randu | ( | long int & | n | ) |
Fill vector with random numbers.
n | seed |
Definition at line 190 of file ranfill.cpp.
Referenced by ivector::fill_multinomial(), fill_multinomial(), lvector::fill_multinomial(), and dmatrix::fill_randu().
void dvector::fill_randu | ( | const random_number_generator & | rng | ) |
void dvector::fill_randu_ni | ( | long int & | n | ) |
Description not yet available.
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 | ||
) |
Fills dvector elements with values starting from base and incremented by offset.
base | initial value |
offset | incremental value |
Definition at line 58 of file cranfill.cpp.
Referenced by bicubic_spline(), calculate_laplace_approximation(), cubic_spline(), function_minimizer::dep_hess_routine(), dmatrix::fill_seqadd(), laplace_approximation_calculator::generate_antithetical_rvs(), get_solution_vector(), function_minimizer::hess_routine_and_constraint(), function_minimizer::hess_routine_noparallel(), function_minimizer::hess_routine_noparallel_random_effects(), reorder(), and dmatrix::rowfill_seqadd().
|
inline |
Definition at line 148 of file dvector.h.
Referenced by param_init_vector::add_value(), bounded_multivariate_normal(), bounded_multivariate_normal_mcmc(), cmdv_prod(), colsum(), copy_value_to_vector(), cos(), cosh(), cvdv_elem_prod(), cvdv_sub(), DF_ccv_dble_prod(), DF_cdble_dv_add(), DF_cdble_dv_diff(), DF_cdble_dv_diveq(), DF_dble_dv_add(), DF_dv_dble_div(), DF_dv_dble_prod(), DF_dv_double_prod(), DF_dv_minus(), DF_dvexp(), DF_dvlog(), DF_dvmfexp(), DF_dvsquare(), DF_v_xdble_diff(), DF_vdble_dv_diveq(), df_xldet(), dfinvpret(), dfouter_prodvv(), dmatrix_position::dmatrix_position(), dmcv_prod(), dmdv_prod(), dmdv_solve(), laplace_approximation_calculator::do_separable_stuff_laplace_approximation_block_diagonal(), laplace_approximation_calculator::do_separable_stuff_newton_raphson_banded(), laplace_approximation_calculator::do_separable_stuff_newton_raphson_block_diagonal(), laplace_approximation_calculator::do_separable_stuff_x_u_block_diagonal(), dv_assign(), dv_eqprev(), dvar_vector::dvar_vector(), dvcv_elem_prod(), dvcv_sub(), dvdv_dot(), dvdv_elem_div(), dvdv_elem_prod(), dvector_position::dvector_position(), elem_div(), elem_prod(), exp(), extract_column(), fabs(), fmm::fmin(), funnel_derivatives(), gradient_structure::funnel_gradcalc(), laplace_approximation_calculator::get_block_diagonal_hessian(), laplace_approximation_calculator::get_gradient_for_hessian_calcs(), get_maxpar(), laplace_approximation_calculator::get_uhat_quasi_newton_block_diagonal(), gradient_structure::gradcalc(), inv(), gradient_structure::jacobcalc(), ln_det(), log(), ludcmp(), max(), function_minimizer::mcmc_routine(), mfexp(), min(), nograd_assign(), nograd_assign_column(), nograd_assign_trans(), operator*(), operator+(), operator+=(), dvar_vector::operator+=(), operator-(), operator-(), operator-=(), operator/(), operator=(), independent_variables::operator=(), outer_prod(), pow(), read_pass2_1_prod_vector(), read_pass2_2_prod_vector(), read_pass2_3_prod_vector(), restore_dvar_matrix_derivative_column(), restore_dvar_vector_der_nozero(), restore_dvar_vector_derivatives(), DF_FILE::restore_dvar_vector_value(), DF_FILE::restore_dvector_value(), restore_value_from_vector(), rowsum(), DF_FILE::save_dvector_value(), function_minimizer::sd_routine(), set_value_inv_mc(), sfabs(), sin(), sinh(), solve(), square(), sum(), tan(), tanh(), value(), and X_dv_sum().
|
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(), dmatrix_position::dmatrix_position(), dmcv_prod(), dmdv_prod(), dmultinom(), dnbinom(), dnbinom_tau(), dnorm(), laplace_approximation_calculator::do_newton_raphson_banded(), dv_assign(), dv_eqprev(), dv_subassign(), dvar_matrix::dvar_matrix(), 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(), fmmc::fmin(), funnel_derivatives(), gammln(), gauss_hermite(), gauss_legendre(), get_confidence_interval(), get_eigen_values(), get_ft(), get_maxpar(), get_onesided_intervals(), ghk(), function_minimizer::hess_routine_noparallel_random_effects(), histogram(), imtqlx(), dvector_index::indexmax(), dvar_compressed_triplet::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(), function_minimizer::rotate_gradient(), function_minimizer::rotate_pars(), row_vector(), function_minimizer::rwm_mcmc_routine(), sample(), save_dvector_derivatives(), save_dvector_derivatives_na(), DF_FILE::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(), admb_deprecated::sort(), sort(), spline(), splint(), sqr(), sqrt(), square(), sum(), tan(), tanh(), tmpxchol1(), trans(), unique(), use_shape(), varchol(), write_empirical_covariance_matrix(), write_on(), and dll_data_vector::~dll_data_vector().
|
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(), dmatrix_position::dmatrix_position(), dmcv_prod(), dmdv_prod(), dmultinom(), dnbinom(), dnbinom_tau(), dnorm(), dv_assign(), dv_eqprev(), dv_subassign(), dvar_matrix::dvar_matrix(), 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(), fmmc::fmin(), gammln(), gauss_hermite(), get_confidence_interval(), get_eigen_values(), get_ft(), get_maxpar(), get_onesided_intervals(), gradient_structure::gradcalc(), function_minimizer::hess_inv(), function_minimizer::hess_routine_noparallel_random_effects(), histogram(), imtqlx(), dvector_index::indexmin(), dvar_compressed_triplet::indexmin(), dcompressed_triplet::indexmin(), 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(), function_minimizer::rotate_gradient(), function_minimizer::rotate_pars(), row_vector(), function_minimizer::rwm_mcmc_routine(), sample(), save_dvector_derivatives(), save_dvector_derivatives_na(), DF_FILE::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(), 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(), use_shape(), varchol(), vector2matrix(), write_on(), and dll_data_vector::~dll_data_vector().
void dvector::initialize | ( | void | ) |
Initialze all elements of dvector to zero.
Definition at line 10 of file dvect5.cpp.
Referenced by allocate(), 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(), gradient_structure::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(), function_minimizer::nuts_mcmc_routine(), probing_bounded_multivariate_normal(), reallocate(), function_minimizer::rwm_mcmc_routine(), function_minimizer::shmc_mcmc_routine(), and solve().
bool dvector::is_valid_index | ( | const int | i | ) | const |
Check index i is in dvector bounds [index_min, index_max].
i | row index |
Definition at line 17 of file dvec_acc.cpp.
|
inline |
|
inline |
dvector & dvector::operator*= | ( | double | v1 | ) |
Multiply elements of a vector by a constant.
x | constant for multiplication. |
Definition at line 34 of file dvect20.cpp.
|
inline |
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Add values to dvector element-wise.
values | dvector |
Definition at line 12 of file dvect16.cpp.
dvector & dvector::operator+= | ( | double | v1 | ) |
Add value to each element of dvector.
value | double |
Definition at line 67 of file dvect16.cpp.
dvector dvector::operator- | ( | void | ) |
|
inline |
Subtract values from dvector element-wise.
values | dvector |
Definition at line 40 of file dvect16.cpp.
dvector & dvector::operator-= | ( | double | v1 | ) |
Subtract value to each element of dvector.
value | double |
Definition at line 84 of file dvect16.cpp.
dvector & dvector::operator/= | ( | double | v1 | ) |
Divide elements of a vector by a constant.
x | constant to divide vector by. |
Definition at line 17 of file dvect20.cpp.
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.
Definition at line 77 of file dvec_io2.cpp.
Referenced by operator>>().
void dvector::read_from | ( | const istream & | _s | ) |
void dvector::reallocate | ( | double | s | ) |
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.
ncl | Integer specifying lowest valid subscript. |
nch | Integer specifying highest valid subscript. |
Definition at line 390 of file dvector.cpp.
void dvector::safe_deallocate | ( | void | ) |
Safely deallocates memory by reporting if shallow copies are still in scope.
Definition at line 110 of file dvector.cpp.
void dvector::save_dvector_derivatives | ( | const dvar_vector_position & | pos | ) | const |
Puts the derivative values in a dvector into a dvar_vector's guts.
Definition at line 212 of file cmpdif5.cpp.
Referenced by cmdv_prod(), cvdv_elem_prod(), cvdv_sub(), DF_cdble_dv_add(), DF_cdble_dv_diff(), DF_cdble_dv_div(), DF_cdble_dv_diveq(), DF_dble_dv_add(), DF_dv_cdble_div(), DF_dv_dble_prod(), DF_dv_double_prod(), DF_dv_minus(), DF_dvatan(), DF_dvexp(), DF_dvlog(), DF_dvmfexp(), DF_dvsqrt(), DF_dvsquare(), DF_vdble_dv_diveq(), dfbltsolve(), dfcholeski_sparse(), dfouter_prodvv(), dmdv_solve(), dv_assign(), dv_minuseq(), dv_pluseq(), dvcm_prod(), dvcv_elem_prod(), dvcv_sub(), dvdm_prod(), dvdv_add(), dvdv_dot(), dvdv_elem_div(), dvdv_elem_prod(), dmatrix::save_dmatrix_derivatives(), banded_lower_triangular_dmatrix::save_dmatrix_derivatives(), and X_dv_sum().
void dvector::save_dvector_derivatives | ( | void | ) | const |
void dvector::save_dvector_derivatives_na | ( | const dvar_vector_position & | pos | ) | const |
Description not yet available.
Definition at line 236 of file cmpdif5.cpp.
Referenced by dmatrix::save_dmatrix_derivatives_na().
void dvector::save_dvector_position | ( | ) | const |
void dvector::save_dvector_value | ( | ) | const |
Saves the size, address, and value information for a dvector.
Definition at line 126 of file cmpdif4.cpp.
void dvector::shallow_copy | ( | const dvector & | other | ) |
Explicit shallow copy.
t | dvector to be copied |
Definition at line 157 of file dvector.cpp.
Referenced by dvector().
|
inline |
Get number of elements in array.
Definition at line 209 of file dvector.h.
Referenced by allocate(), bracket_report(), calculate_importance_sample(), calculate_importance_sample_block_diagonal(), calculate_importance_sample_block_diagonal_funnel(), calculate_importance_sample_block_diagonal_option2(), calculate_importance_sample_block_diagonal_option_antithetical(), calculate_importance_sample_funnel(), calculate_importance_sample_shess(), calculate_laplace_approximation(), do_gauss_hermite_block_diagonal(), do_gauss_hermite_block_diagonal_multi(), dvector(), end(), fill(), ivector::fill_multinomial(), fill_multinomial(), lvector::fill_multinomial(), dmatrix::fill_seqadd(), first_difference(), fmm::fmin(), fmmt1::fmin(), fmmc::fmin(), get_eigen(), get_eigen_values(), get_eigenv(), gradient_structure::gradcalc(), function_minimizer::hybrid_mcmc_routine(), initialize(), lvector::lvector(), mean(), fmm::minimize(), nllBeta(), nllGamma(), nllInverseGamma(), nllLognormal(), nllLognormal2(), nllNegativeBinomial(), nllNormal(), nllNormal2(), nllPoisson(), operator&(), operator=(), independent_variables::operator=(), parse(), rdirichlet(), sample(), size_count(), admb_deprecated::sort(), sort(), spline(), splint(), tri_dag(), tri_dagv(), unique(), var(), and vector2matrix().
|
inline |
void dvector::write_on | ( | const ostream & | _s | ) | const |
Description not yet available.
Definition at line 49 of file dvect_io.cpp.
Referenced by operator<<().
void dvector::write_on | ( | const uostream & | _s | ) | const |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Element-wise division of two vectors; constant objects.
Exits with error if bounds of the two arguments differ.
t1 | A vector, with valid subscripts in |
t2 | A vector, with valid subscripts in |
Definition at line 58 of file dvect2.cpp.
|
friend |
Element-wise division of v1 by v2 into a dvar_vector.
v1 | dvector of numerators |
v2 | dvar_vector of denominators |
Definition at line 226 of file fvar_a46.cpp.
|
friend |
Element-wise division of v1 by v2 into a dvar_vector.
v1 | dvar_vector of numerators |
v2 | dvector of denominators |
Definition at line 141 of file fvar_a46.cpp.
Element-wise multiplication of two vectors; constant objects.
Exits with error if bounds of the two arguments differ.
t1 | A vector, with valid subscripts in |
t2 | A vector, with valid subscripts in |
Definition at line 20 of file dvect2.cpp.
|
friend |
|
friend |
|
friend |
Returns dvector containing the differences of an values(i) and values(i + 1) for i = 1 to values.indexmax() - 1.
values | dvector |
Definition at line 17 of file dvec_dif.cpp.
|
friend |
Returns the maximum value of vector vec.
Note: vec is an allocated vector.
vec | scalar vector |
Definition at line 85 of file dvect7.cpp.
Referenced by operator*=(), operator+=(), operator-=(), operator/=(), operator=(), independent_variables::operator=(), reallocate(), save_dvector_derivatives(), and save_dvector_derivatives_na().
|
friend |
Returns the minimum value of vector vec.
Note: vec is an allocated vector.
vec | scalar vector |
Definition at line 107 of file dvect7.cpp.
Referenced by operator*=(), operator+=(), operator-=(), operator/=(), operator=(), independent_variables::operator=(), save_dvector_derivatives(), save_dvector_derivatives_na(), and shift().
|
friend |
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Norm of a vector; constant objects.
t1 | A vector, . |
Definition at line 13 of file dvect3.cpp.
|
friend |
Squared norm of a vector; constant objects.
Computes the sum of squares of its vector argument.
t1 | A vector, . |
Definition at line 28 of file dvect3.cpp.
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.
t1 | A dvector, . |
t2 | A dvector, . |
Definition at line 512 of file dvector.cpp.
|
friend |
|
friend |
|
friend |
Multiply a dvector by a constant.
x | Double constant, . |
t1 | dvector reference, . |
Definition at line 630 of file dvector.cpp.
|
friend |
|
friend |
Add two dvectors.
Exits with error if bounds of the two arguments differ.
t1 | dvector reference, . |
t2 | dvector reference, . |
Definition at line 554 of file dvector.cpp.
|
friend |
|
friend |
Subtract two dvectors.
Exits with error if bounds of the two arguments differ.
t1 | dvector reference, . |
t2 | dvector reference, . |
Definition at line 593 of file dvector.cpp.
|
friend |
|
friend |
|
friend |
Definition at line 33 of file dvect3.cpp.
|
protected |
maximum valid subscript
Definition at line 55 of file dvector.h.
Referenced by allocate(), allocatec(), dvector(), indexmax(), is_valid_index(), operator++(), operator--(), operator=(), shallow_copy(), shift(), and size().
|
protected |
minimum valid subscript
Definition at line 54 of file dvector.h.
Referenced by allocate(), allocatec(), begin(), dvector(), indexmin(), initialize(), is_valid_index(), operator++(), operator--(), operator=(), shallow_copy(), shift(), and size().
|
protected |
pointer to vector "shape"
Definition at line 60 of file dvector.h.
Referenced by allocate(), allocatec(), allocated(), deallocate(), dvector(), get_ncopies(), operator!(), operator=(), safe_deallocate(), shallow_copy(), shift(), and ~dvector().
|
protected |
pointer to the data
Definition at line 53 of file dvector.h.
Referenced by address(), allocate(), allocatec(), begin(), deallocate(), dvar_vector::dvar_vector(), dvector(), elem(), end(), get_v(), initialize(), initpointer(), operator()(), operator*=(), operator++(), operator+=(), operator-(), operator--(), operator-=(), operator/=(), operator=(), independent_variables::operator=(), operator[](), parse(), save_dvector_derivatives(), save_dvector_derivatives_na(), shallow_copy(), shift(), and ~dvector().
Generated on Wed Sep 7 2022 00:01:33 for ADMB Documentation by 1.8.5 |