00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00028 #ifndef __IE_RETTYPE_HPP__
00029 #define __IE_RETTYPE_HPP__
00030
00031 namespace coco {
00032
00033 inline const info_contents& ie_return_type::get_info() const
00034 {
00035 return info;
00036 }
00037
00038 inline void ie_return_type::set_termination_reason(const termination_reason& __t)
00039 {
00040 termr = __t;
00041 }
00042
00043 inline const termination_reason& ie_return_type::term_reason() const
00044 {
00045 return termr;
00046 }
00047
00048 inline ie_return_type ie_return_type::operator+(
00049 const std::pair<delta_base*,double>& __d)
00050 {
00051 ie_return_type __tmp(*this);
00052 __tmp.deltas.push_back(__d.first->new_copy());
00053 __tmp.weights.push_back(__d.second);
00054 __tmp.certs.push_back(certificate(no_certificate()));
00055 return __tmp;
00056 }
00057
00058 inline ie_return_type& ie_return_type::operator+=(
00059 const std::pair<delta_base*,double>& __d)
00060 {
00061 no_certificate ncrt;
00062
00063 deltas.push_back(__d.first->new_copy());
00064 weights.push_back(__d.second);
00065 certs.push_back(ncrt.new_copy());
00066 return *this;
00067 }
00068
00069 inline ie_return_type ie_return_type::operator+(
00070 const std::triple<delta_base*,double,certificate_base*>& __d)
00071 {
00072 ie_return_type __tmp(*this);
00073 __tmp.deltas.push_back(__d.first->new_copy());
00074 __tmp.weights.push_back(__d.second);
00075 __tmp.certs.push_back(__d.third->new_copy());
00076 return __tmp;
00077 }
00078
00079 inline ie_return_type& ie_return_type::operator+=(
00080 const std::triple<delta_base*,double,certificate_base*>& __d)
00081 {
00082 deltas.push_back(__d.first->new_copy());
00083 weights.push_back(__d.second);
00084 certs.push_back(__d.third->new_copy());
00085 return *this;
00086 }
00087
00088 #if 0
00089 inline ie_return_type ie_return_type::operator+(const std::pair<delta,double>& __d)
00090 {
00091 ie_return_type __tmp(*this);
00092 __tmp.deltas.push_back(__d.first);
00093 __tmp.weights.push_back(__d.second);
00094 return __tmp;
00095 }
00096
00097 inline ie_return_type& ie_return_type::operator+=(const std::pair<delta,double>& __d)
00098 {
00099 deltas.push_back(__d.first);
00100 weights.push_back(__d.second);
00101 return *this;
00102 }
00103 #endif
00104
00105 inline ie_return_type& ie_return_type::operator=(const ie_return_type& __d)
00106 {
00107 if (this != & __d) {
00108 termr = __d.termr;
00109 deltas = __d.deltas;
00110 weights = __d.weights;
00111 certs = __d.certs;
00112 _d = __d._d;
00113 info = __d.info;
00114 }
00115 return *this;
00116 }
00117
00118 inline bool ie_return_type::set_information(const std::string& iname,
00119 const basic_alltype& a, bool force)
00120 {
00121 return info.sinsert(iname, a, force);
00122 }
00123
00124 inline bool ie_return_type::set_information(const char* iname,
00125 const basic_alltype& a, bool force)
00126 {
00127 return set_information(std::string(iname), a, force);
00128 }
00129
00130 inline bool ie_return_type::set_information_i(const std::string& iname, int i,
00131 const basic_alltype& a, bool force)
00132 {
00133 return info.sinsert(iname, i, a, force);
00134 }
00135
00136 inline bool ie_return_type::set_information_i(const char *iname, int i,
00137 const basic_alltype& a, bool force)
00138 {
00139 return set_information_i(std::string(iname), i, a, force);
00140 }
00141
00142 inline const basic_alltype& ie_return_type::information(
00143 const std::string& iname) const
00144 {
00145 return info.sfind(iname);
00146 }
00147
00148 inline const basic_alltype& ie_return_type::information(const char* iname)
00149 const
00150 {
00151 return information(std::string(iname));
00152 }
00153
00154 inline const basic_alltype& ie_return_type::information(
00155 const std::string& iname, int i) const
00156 {
00157 return info.sfind(iname, i);
00158 }
00159
00160 inline const basic_alltype& ie_return_type::information(const char* iname,
00161 int i) const
00162 {
00163 return information(std::string(iname), i);
00164 }
00165
00166 inline bool ie_return_type::has_information(const std::string& __s) const
00167 {
00168 return info.defd(__s);
00169 }
00170
00171 inline bool ie_return_type::has_information(const char* __cp) const
00172 {
00173 return has_information(std::string(__cp));
00174 }
00175
00176 inline bool ie_return_type::has_information(const std::string& __s, int i) const
00177 {
00178 return info.defd(__s, i);
00179 }
00180
00181 inline bool ie_return_type::has_information(const char* __cp, int i) const
00182 {
00183 return has_information(std::string(__cp), i);
00184 }
00185
00186 inline bool ie_return_type::information_indices_set(const std::string& __s,
00187 std::vector<int>& __idx) const
00188 {
00189 return info.which(__s, __idx);
00190 }
00191
00192 inline bool ie_return_type::information_indices_set(const char* __cp,
00193 std::vector<int>& __idx) const
00194 {
00195 return information_indices_set(std::string(__cp), __idx);
00196 }
00197
00198 inline void ie_return_type::unset_information(const std::string& __s)
00199 {
00200 info.remove(__s);
00201 }
00202
00203 inline void ie_return_type::unset_information(const char* __cp)
00204 {
00205 unset_information(std::string(__cp));
00206 }
00207
00208 inline void ie_return_type::unset_information(const std::string& __s, int i)
00209 {
00210 info.remove(__s, i);
00211 }
00212
00213 inline void ie_return_type::unset_information(const char* __cp, int i)
00214 {
00215 unset_information(std::string(__cp), i);
00216 }
00217
00218 template <class _TS>
00219 inline bool ie_return_type::retrieve_from_info(const std::string& __s,
00220 const std::vector<_TS>*& __b) const
00221 {
00222 return info.retrieve(__s, __b);
00223 }
00224
00225 template <class _TS>
00226 inline bool ie_return_type::retrieve_from_info(const std::string& __s,
00227 const linalg::matrix<_TS>*& __b) const
00228 {
00229 return info.retrieve(__s, __b);
00230 }
00231
00232 template <class _TS>
00233 inline bool ie_return_type::retrieve_from_info(const std::string& __s, _TS& __b)
00234 const
00235 {
00236 return info.retrieve(__s, __b);
00237 }
00238
00239 template <class _TS>
00240 inline bool ie_return_type::retrieve_from_info(const std::string& __s,
00241 const std::vector<_TS>*& __b, const std::vector<_TS>* __def) const
00242 {
00243 return info.retrieve(__s, __b, __def);
00244 }
00245
00246 template <class _TS>
00247 inline bool ie_return_type::retrieve_from_info(const std::string& __s,
00248 const linalg::matrix<_TS>*& __b, const linalg::matrix<_TS>* __def) const
00249 {
00250 return info.retrieve(__s, __b, __def);
00251 }
00252
00253 template <class _TS>
00254 inline bool ie_return_type::retrieve_from_info(const std::string& __s, _TS& __b,
00255 const _TS& __def) const
00256 {
00257 return info.retrieve(__s, __b, __def);
00258 }
00259
00260 template <class _TS>
00261 inline bool ie_return_type::retrieve_from_info(const char* __s,
00262 const std::vector<_TS>*& __b) const
00263 {
00264 return retrieve_from_info(std::string(__s), __b);
00265 }
00266
00267 template <class _TS>
00268 inline bool ie_return_type::retrieve_from_info(const char* __s,
00269 const linalg::matrix<_TS>*& __b) const
00270 {
00271 return retrieve_from_info(std::string(__s), __b);
00272 }
00273
00274 template <class _TS>
00275 inline bool ie_return_type::retrieve_from_info(const char* __s, _TS& __b) const
00276 {
00277 return retrieve_from_info(std::string(__s), __b);
00278 }
00279
00280 template <class _TS>
00281 inline bool ie_return_type::retrieve_from_info(const char* __s,
00282 const std::vector<_TS>*& __b, const std::vector<_TS>* __def) const
00283 {
00284 return retrieve_from_info(std::string(__s), __b, __def);
00285 }
00286
00287 template <class _TS>
00288 inline bool ie_return_type::retrieve_from_info(const char* __s,
00289 const linalg::matrix<_TS>*& __b, const linalg::matrix<_TS>* __def) const
00290 {
00291 return retrieve_from_info(std::string(__s), __b, __def);
00292 }
00293
00294 template <class _TS>
00295 inline bool ie_return_type::retrieve_from_info(const char* __s, _TS& __b,
00296 const _TS& __def) const
00297 {
00298 return retrieve_from_info(std::string(__s), __b, __def);
00299 }
00300
00301 template <class _TS>
00302 inline bool ie_return_type::retrieve_from_info_i(const std::string& __s, int i,
00303 const std::vector<_TS>*& __b) const
00304 {
00305 return info.retrieve_i(__s, i, __b);
00306 }
00307
00308 template <class _TS>
00309 inline bool ie_return_type::retrieve_from_info_i(const std::string& __s, int i,
00310 const linalg::matrix<_TS>*& __b) const
00311 {
00312 return info.retrieve_i(__s, i, __b);
00313 }
00314
00315 template <class _TS>
00316 inline bool ie_return_type::retrieve_from_info_i(const std::string& __s, int i,
00317 _TS& __b) const
00318 {
00319 return info.retrieve_i(__s, i, __b);
00320 }
00321
00322 template <class _TS>
00323 inline bool ie_return_type::retrieve_from_info_i(const std::string& __s, int i,
00324 const std::vector<_TS>*& __b, const std::vector<_TS>* __def) const
00325 {
00326 return info.retrieve(__s, i, __b, __def);
00327 }
00328
00329 template <class _TS>
00330 inline bool ie_return_type::retrieve_from_info_i(const std::string& __s, int i,
00331 const linalg::matrix<_TS>*& __b, const linalg::matrix<_TS>* __def) const
00332 {
00333 return info.retrieve(__s, i, __b, __def);
00334 }
00335
00336 template <class _TS>
00337 inline bool ie_return_type::retrieve_from_info_i(const std::string& __s, int i,
00338 _TS& __b, const _TS& __def) const
00339 {
00340 return info.retrieve(__s, i, __b, __def);
00341 }
00342
00343 template <class _TS>
00344 inline bool ie_return_type::retrieve_from_info_i(const char* __s, int i,
00345 const std::vector<_TS>*& __b) const
00346 {
00347 return retrieve_from_info(std::string(__s), i, __b);
00348 }
00349
00350 template <class _TS>
00351 inline bool ie_return_type::retrieve_from_info_i(const char* __s, int i,
00352 const linalg::matrix<_TS>*& __b) const
00353 {
00354 return retrieve_from_info(std::string(__s), i, __b);
00355 }
00356
00357 template <class _TS>
00358 inline bool ie_return_type::retrieve_from_info_i(const char* __s, int i,
00359 _TS& __b) const
00360 {
00361 return retrieve_from_info(std::string(__s), i, __b);
00362 }
00363
00364 template <class _TS>
00365 inline bool ie_return_type::retrieve_from_info_i(const char* __s, int i,
00366 const std::vector<_TS>*& __b, const std::vector<_TS>* __def) const
00367 {
00368 return retrieve_from_info(std::string(__s), i, __b, __def);
00369 }
00370
00371 template <class _TS>
00372 inline bool ie_return_type::retrieve_from_info_i(const char* __s, int i,
00373 const linalg::matrix<_TS>*& __b, const linalg::matrix<_TS>* __def) const
00374 {
00375 return retrieve_from_info(std::string(__s), i, __b, __def);
00376 }
00377
00378 template <class _TS>
00379 inline bool ie_return_type::retrieve_from_info_i(const char* __s, int i,
00380 _TS& __b, const _TS& __def) const
00381 {
00382 return retrieve_from_info(std::string(__s), i, __b, __def);
00383 }
00384
00385
00386 }
00387
00388 #endif