Skip to content

Commit

Permalink
Per #2887, update NumArray::vals() to return a reference to the vecto…
Browse files Browse the repository at this point in the history
…r rather a pointer to doubles.
  • Loading branch information
JohnHalleyGotway committed Aug 28, 2024
1 parent 1382951 commit 09f802e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/basic/vx_util/num_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class NumArray {

double operator[](int) const;

const double * vals() const;
const std::vector<double> & vals() const;
double * buf();

int has(int, bool forward=true) const;
Expand Down Expand Up @@ -128,8 +128,9 @@ class NumArray {


inline int NumArray::n_elements() const { return ( e.size() ); }
inline int NumArray::n () const { return ( e.size() ); }
inline const double * NumArray::vals() const { return ( e.data() ); }
inline int NumArray::n() const { return ( e.size() ); }
inline const std::vector<double> &
NumArray::vals() const { return ( e ); }
inline double * NumArray::buf() { return ( e.data() ); }
inline void NumArray::inc(int i, int v) { e[i] += v; return; }
inline void NumArray::inc(int i, double v) { e[i] += v; return; }
Expand Down

0 comments on commit 09f802e

Please sign in to comment.