158 T min_value, T max_value,
159 T min_first_derivative_neg, T max_first_derivative_pos,
160 T min_first_derivative_pos, T max_first_derivative_neg,
161 T min_second_derivative, T max_second_derivative)
164 min_value, max_value,
165 min_first_derivative_neg, max_first_derivative_pos,
166 min_first_derivative_pos, max_first_derivative_neg,
167 min_second_derivative, max_second_derivative
174 T min_value, T max_value,
175 T min_first_derivative_neg, T max_first_derivative_pos,
176 T min_first_derivative_pos, T max_first_derivative_neg,
177 T min_second_derivative, T max_second_derivative)
179 min_value_ = min_value;
180 max_value_ = max_value;
181 min_first_derivative_neg_ = min_first_derivative_neg;
182 max_first_derivative_pos_ = max_first_derivative_pos;
183 min_first_derivative_pos_ = min_first_derivative_pos;
184 max_first_derivative_neg_ = max_first_derivative_neg;
185 min_second_derivative_ = min_second_derivative;
186 max_second_derivative_ = max_second_derivative;
188 if (std::isnan(max_value_))
190 has_value_limits_ =
false;
192 if (std::isnan(min_value_))
194 min_value_ = -max_value_;
196 if (has_value_limits_ && min_value_ > max_value_)
198 throw std::invalid_argument(
"Invalid value limits");
201 if (std::isnan(max_first_derivative_pos_))
203 has_first_derivative_limits_ =
false;
205 if (std::isnan(min_first_derivative_neg_))
207 min_first_derivative_neg_ = -max_first_derivative_pos_;
209 if (has_first_derivative_limits_ && min_first_derivative_neg_ > max_first_derivative_pos_)
211 throw std::invalid_argument(
"Invalid first derivative limits");
213 if (has_first_derivative_limits_)
215 if (std::isnan(max_first_derivative_neg_))
217 max_first_derivative_neg_ = max_first_derivative_pos_;
219 if (std::isnan(min_first_derivative_pos_))
221 min_first_derivative_pos_ = min_first_derivative_neg_;
223 if (has_first_derivative_limits_ && min_first_derivative_pos_ > max_first_derivative_neg_)
225 throw std::invalid_argument(
"Invalid first derivative limits");
229 if (std::isnan(max_second_derivative_))
231 has_second_derivative_limits_ =
false;
233 if (std::isnan(min_second_derivative_))
235 min_second_derivative_ = -max_second_derivative_;
237 if (has_second_derivative_limits_ && min_second_derivative_ > max_second_derivative_)
239 throw std::invalid_argument(
"Invalid second derivative limits");