67 explicit GNodeArray(
const std::vector<double>& vector);
68 GNodeArray(
const int& num,
const double* array);
75 const double&
operator[](
const int& index)
const;
81 double&
at(
const int& index);
82 const double&
at(
const int& index)
const;
85 void append(
const double& node);
86 void insert(
const int& index,
const double& node);
87 void remove(
const int& index);
90 void nodes(
const int& num,
const double* array);
92 void nodes(
const std::vector<double>& vector);
94 const std::vector<double>& vector)
const;
95 void set_value(
const double& value)
const;
104 const bool& clobber =
false)
const;
107 const std::string& extname =
"NODES")
const;
115 void setup(
void)
const;
145 return (
"GNodeArray");
194 return (
int)
m_node.size();
Definition of interface for container classes.
Interface class for container classes.
Abstract interface for FITS table.
double m_wgt_grad_left
Weight gradient for left node.
void save(const GFilename &filename, const bool &clobber=false) const
Save node array into FITS file.
void set_value(const double &value) const
Set indices and weighting factors for interpolation.
GNodeArray & operator=(const GNodeArray &array)
Assignment operator.
GNodeArray(void)
Void constructor.
const double & wgt_grad_left(void) const
Returns left node weight gradient.
double interpolate(const double &value, const std::vector< double > &vector) const
Interpolate value.
void copy_members(const GNodeArray &array)
Copy class members.
double & operator[](const int &index)
Node access operator.
void free_members(void)
Delete class members.
bool m_has_last_value
Last value is valid.
double m_wgt_right
Weight for right node for linear interpolation.
double m_linear_slope
Slope for linear array.
double m_wgt_grad_right
Weight gradient for right node.
virtual ~GNodeArray(void)
Destructor.
bool m_need_setup
Call of setup is required.
std::vector< double > m_node
Array of nodes.
const int & inx_right(void) const
Returns right node index.
const int & inx_left(void) const
Returns left node index.
const double & wgt_grad_right(void) const
Returns right node weight gradient.
bool is_empty(void) const
Signals if there are no nodes in node array.
double & at(const int &index)
Node access operator.
void reserve(const int &num)
Reserves space for nodes in node array.
const double & wgt_right(void) const
Returns right node weight.
bool m_is_linear
Nodes form a linear array.
const double & wgt_left(void) const
Returns left node weight.
void remove(const int &index)
Remove one node into array.
int m_inx_right
Index of right node for linear interpolation.
void load(const GFilename &filename)
Load nodes from FITS file.
void init_members(void)
Initialise class members.
void insert(const int &index, const double &node)
Insert one node into array.
void clear(void)
Clear node array.
std::string classname(void) const
Return class name.
GNodeArray * clone(void) const
Clone node array.
void extend(const GNodeArray &nodes)
Append node array.
void setup(void) const
Compute distance array and linear slope/offset.
void nodes(const int &num, const double *array)
Set node array.
double m_wgt_left
Weight for left node for linear interpolation.
std::string print(const GChatter &chatter=NORMAL) const
Print nodes.
int m_inx_left
Index of left node for linear interpolation.
int size(void) const
Return number of nodes in node array.
double m_linear_offset
Offset for linear array.
std::vector< double > m_step
Distance to next node.
void write(GFits &fits, const std::string &extname="NODES") const
Write nodes into FITS object.
double m_last_value
Last requested value.
void append(const double &node)
Append one node to array.
void read(const GFitsTable &table)
Read nodes from FITS table.