41 #ifndef __ADMB_DVECTOR_H__
42 #define __ADMB_DVECTOR_H__
56 #if defined(THREAD_SAFE)
58 ts_vector_shapex *
shape;
68 return (
shape == NULL);
73 return (
shape != NULL);
168 const double &
elem(
int i)
const
173 void fill(
const char *s);
233 dvector(
unsigned int sz,
double *
x);
270 void write_on(
const ostream &)
const;
339 istream&
parse(istream& input_json);
Description not yet available.
friend dvector elem_div(const dvector &, const dvector &)
Element-wise division of two vectors; constant objects.
dvector & operator*=(double v1)
Multiply elements of a vector by a constant.
dvector sub(int lb, int ub)
Get subvector.
Base class for dvariable.
double * v
pointer to the data
void safe_deallocate(void)
Safely deallocates memory by reporting if shallow copies are still in scope.
friend double norm2(const dvector &)
Squared norm of a vector; constant objects.
unsigned int get_ncopies(void)
Description not yet available.
Uses polymorphism to get index information from various data types to be used in constructing and all...
friend double operator*(const dvector &, const dvector &)
Compute the dot product of two vectors.
dvector()
Construct a dvector without allocating memory.
int allocated(void) const
Returns 1 (TRUE) if memory is allocated.
double * get_v(void) const
friend dvector operator+(const dvector &, const dvector &)
Add two dvectors.
void save_dvector_derivatives_na(const dvar_vector_position &pos) const
Description not yet available.
dvector operator-()
Description not yet available.
double * initpointer(void)
Vector of double precision numbers.
Description not yet available.
int indexmin() const
Get minimum valid index.
friend dvector log(const dvector &)
Description not yet available.
void fill_seqadd(double, double)
Fills dvector elements with values starting from base and incremented by offset.
dvector & operator=(const dvector &t)
Assignment operator for dvector argument.
friend double sumsq(const dvector &)
Description not yet available.
void allocatec(const dvector &dv)
Make shallow copy of dvector shape.
int operator!(void) const
Returns 1 (TRUE) if memory is NOT allocated.
Description not yet available.
friend double min(const dvector &)
Returns the minimum value of vector vec.
void allocate(void)
Allocate dvector without allocating memory.
Null class to allow specialized function overloads.
void save_dvector_derivatives(void) const
void write_on(const ostream &) const
Description not yet available.
void fill_randu(long int &n)
Fill vector with random numbers.
void fill_randpoisson(double lambda, const random_number_generator &rng)
Fill vector with Poisson pseudorandom numbers.
friend dvector second_difference(const dvector &)
friend dvector elem_prod(const dvector &, const dvector &)
Element-wise multiplication of two vectors; constant objects.
friend double max(const dvector &)
Returns the maximum value of vector vec.
void fill_randn(long int &n)
Fill vector with random numbers.
Description not yet available.
const double * address() const
Array of integers(int) with indexes from index_min to indexmax.
double & operator[](int i)
friend dvector exp(const dvector &)
Description not yet available.
Description not yet available.
int indexmax() const
Get maximum valid index.
void safe_allocate(int, int)
Safely allocate memory for a dvector.
void fill_randbi(long int &n, double)
Fill vector with binary random numbers.
Description not yet available.
friend dvector first_difference(const dvector &)
Returns dvector containing the differences of an values(i) and values(i + 1) for i = 1 to values...
dvector & operator++(void)
Increment vector indices array pointer.
void fill_randnegbinomial(double lambda, double tau, const random_number_generator &rng)
Description not yet available.
void shallow_copy(const dvector &)
Explicit shallow copy.
Description not yet available.
friend double norm(const dvector &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
void fill_randcau(const random_number_generator &rng)
Description not yet available.
void initialize(void)
Initialze all elements of dvector to zero.
dvector & shift(int min)
Shift valid range of subscripts.
unsigned int get_ncopies() const
unsigned int size() const
Get number of elements in array.
int index_min
minimum valid subscript
Holds "shape" information for vector objects.
dvector & operator--(void)
Decrement vector indices array pointer.
~dvector()
Default destructor.
const double & elem(int i) const
friend dvector fabs(const dvector &)
Description not yet available.
istream & parse(istream &input_json)
vector_shapex * shape
pointer to vector "shape"
size_t pos(const adstring &substr, const adstring &s)
friend char * fform(const char *, const dvector &)
dvector & operator-=(const dvector &v1)
Subtract values from dvector element-wise.
Class definition of matrix with derivitive information .
void fill_randn_ni(long int &n)
Description not yet available.
void fill(const char *s)
Fill vectors from values in string s.
dvector & operator/=(double v1)
Divide elements of a vector by a constant.
const double * initpointer(void) const
Description not yet available.
dvector column(const dmatrix &matrix, int j)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
int index_max
maximum valid subscript
void fill_multinomial(const int &seed, const dvector &p)
Description not yet available.
dvector operator()(int lb, int ub)
Get subvector.
void read_from(const uistream &)
Description not yet available.
void reallocate(double size)
Reallocate size of array.
Fundamental data type for reverse mode automatic differentiation.
dvector & operator+=(const dvector &v1)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
bool is_valid_index(const int i) const
Check index i is in dvector bounds [index_min, index_max].
Description not yet available.
void deallocate(void)
Called by destructor to deallocate memory for a dvector object.
void fill_randbi_ni(long int &n, double)
Description not yet available.
void save_dvector_position() const
Description not yet available.
void save_dvector_value() const
Saves the size, address, and value information for a dvector.
void fill_randu_ni(long int &n)
Description not yet available.