@@ -109,22 +109,55 @@ namespace qlibs {
109109 /* *
110110 * @brief Constructor for the 1D interpolation instance.
111111 * @param[in] xTable An array of size @a sizeTable with the x points sorted in ascending order.
112- * @param[in] yTabLe An array of size @a sizeTable with the y points.
112+ * @param[in] yTable An array of size @a sizeTable with the y points.
113113 * @param[in] sizeTable The number of points in @a xTable @a yTable
114114 */
115115 interp1 ( const real_t * const xTable,
116- const real_t * const yTabLe ,
117- const size_t sizeTable ) : xData( xTable ), yData( yTabLe ), dataSize( sizeTable ) {}
116+ const real_t * const yTable ,
117+ const size_t sizeTable ) : xData( xTable ), yData( yTable ), dataSize( sizeTable ) {}
118118
119119 /* *
120120 * @brief Constructor for the 1D interpolation instance.
121121 * @param[in] xTable An array of size @a sizeTable with the x points sorted in ascending order.
122- * @param[in] yTabLe An array of size @a sizeTable with the y points.
122+ * @param[in] yTable An array of size @a sizeTable with the y points.
123123 */
124124 template <size_t sizeTable>
125125 interp1 ( real_t (&xTable)[ sizeTable ],
126126 real_t (&yTable)[ sizeTable ] ) : interp1( xTable, yTable, sizeTable ) {}
127127
128+ /* *
129+ * @brief Set the data table for the 1D interpolation instance.
130+ * @param[in] xTable An array of size @a sizeTable with the x points sorted in ascending order.
131+ * @param[in] yTable An array of size @a sizeTable with the y points.
132+ * @param[in] sizeTable The number of points in @a xTable @a yTable
133+ */
134+ bool setData ( const real_t * const xTable,
135+ const real_t * const yTable,
136+ const size_t sizeTable )
137+ {
138+ bool retValue = false ;
139+
140+ if ( ( nullptr != xTable ) && ( nullptr != yTable ) && ( sizeTable >= 4U ) ) {
141+ xData = xTable;
142+ yData = yTable;
143+ dataSize = sizeTable;
144+ retValue = true ;
145+ }
146+ return retValue;
147+ }
148+
149+ /* *
150+ * @brief Set the data for the 1D interpolation instance.
151+ * @param[in] xTable An array of size @a sizeTable with the x points sorted in ascending order.
152+ * @param[in] yTable An array of size @a sizeTable with the y points.
153+ */
154+ template <size_t sizeTable>
155+ bool setData ( real_t (&xTable)[ sizeTable ],
156+ real_t (&yTable)[ sizeTable ] )
157+ {
158+ return setData ( xTable, yTable, sizeTable );
159+ }
160+
128161 /* *
129162 * @brief Specify the interpolation method to use.
130163 * @param[in] m The interpolation method.
0 commit comments