42 double avg(
double x,
double y)
81 cerr <<
" Trying to delete NULL pointer in ~dvector\n";
116 cerr <<
"trying to deallocate a dvector with copies" <<
endl;
160 cout <<
"starting out in dvector contructor\n";
170 cerr <<
"Making a copy of an unallocated dvector"<<
endl;
187 if (pdv.
lb < mmin || pdv.
ub > mmax)
189 cerr <<
"index out of bounds in dvector subvector operator" <<
endl;
200 cerr <<
"Waring: Taking a subvector of an unallocated dvector.\n";
223 double* pvi =
v +
min;
224 for (
int i = min; i <=
max; ++i)
250 #if defined (AD_FAST_ASSIGN)
265 cerr <<
"Index bounds do not match in "
266 "dvector& operator = (const dvector&)\n";
273 constexpr
size_t sizeofdouble =
sizeof(double);
274 double* pv =
v +
min;
303 cerr <<
"Index bounds do not match in "
304 "independent_variables& independent_variables::operator=(const dvector& t)\n";
312 constexpr
size_t sizeofdouble =
sizeof(double);
313 double* pv =
v +
min;
332 assert(sz > 0 && sz - 1 <= INT_MAX);
335 for (
unsigned int i = 0; i < sz; i++)
394 cerr <<
"trying to allocate an already allocated dvector " <<
endl;
418 unsigned int size =
static_cast<unsigned int>(nch - ncl + 1);
419 v =
new double[
size];
423 cerr <<
" Error: Unable to allocate v in"
424 <<
" dvector::allocate(int, int).\n";
428 #if defined(THREAD_SAFE)
429 shape =
new ts_vector_shapex(ncl, nch,
v);
435 cerr <<
" Error: Unable to allocate shape in"
436 <<
" dvector::allocate(int, int).\n";
487 cerr <<
"Trying to alocate to an already allocated dvector" <<
endl;
519 cerr <<
"Index bounds do not match in "
520 "dvector operator * (const dvector&, const dvector&)\n";
530 dp_dotproduct(&tmp,&(t1(min)),&(t2(min)),n);
534 for (
int i = min; i <=
max; ++i)
562 cerr <<
"Index bounds do not match in "
563 "dvector operator+(const dvector&, const dvector&)\n";
572 for (
int i = min; i <=
max; ++i)
574 *ptmp += *pt1 + *pt2;
601 cerr <<
"Index bounds do not match in "
602 "dvector operator+(const dvector&, const dvector&)\n";
611 for (
int i = min; i <=
max; ++i)
613 *ptmp += *pt1 - *pt2;
639 for (
int i = min; i <=
max; ++i)
void myheapcheck(char *msg)
Does nothing.
double * v
pointer to the data
void safe_deallocate(void)
Safely deallocates memory by reporting if shallow copies are still in scope.
void * trueptr
Address of first element in the vector.
void memcpy(test_smartlist &dest, void *source, const size_t nsize)
memcpy for test_smartlist
dvector()
Construct a dvector without allocating memory.
int allocated(void) const
Returns 1 (TRUE) if memory is allocated.
d3_array operator-(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements addition of a(i, j, k) + b(i, j, k).
Vector of double precision numbers.
int indexmin() const
Get minimum valid index.
independent_variables & operator=(const dvector &t)
Assignment operator for dvector argument.
dvector & operator=(const dvector &t)
Assignment operator for dvector argument.
d3_array operator+(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements addition of a(i, j, k) + b(i, j, k).
void allocatec(const dvector &dv)
Make shallow copy of dvector shape.
Description not yet available.
friend double min(const dvector &)
Returns the minimum value of vector vec.
void allocate(void)
Allocate dvector without allocating memory.
d3_array cube(const d3_array &m)
Description not yet available.
Null class to allow specialized function overloads.
dmatrix operator*(const d3_array &t, const dvector &v)
Description not yet available.
friend double max(const dvector &)
Returns the maximum value of vector vec.
int heapcheck(void)
Does nothing.
prnstream & endl(prnstream &)
const double * address() const
Description not yet available.
double avg(double x, double y)
Average of two numbers; constant objects.
int indexmax() const
Get maximum valid index.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void safe_allocate(int, int)
Safely allocate memory for a dvector.
void shallow_copy(const dvector &)
Explicit shallow copy.
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 ncopies
Copy counter to enable shallow copies.
unsigned int size() const
Get number of elements in array.
int index_min
minimum valid subscript
Holds "shape" information for vector objects.
~dvector()
Default destructor.
vector_shapex * shape
pointer to vector "shape"
void shift(int min)
Description not yet available.
int index_max
maximum valid subscript
double fourth(const double m)
Fourth power of a number; constant objects.
void deallocate(void)
Called by destructor to deallocate memory for a dvector object.
d3_array pow(const d3_array &m, int e)
Description not yet available.