DACE 2.0 API Manual
Differential Algebra Core Engine
DA_t.h
Go to the documentation of this file.
1 /******************************************************************************
2 * *
3 * DIFFERENTIAL ALGEBRA CORE ENGINE *
4 * *
5 *******************************************************************************
6 * *
7 * Copyright 2016 Politecnico di Milano (2014 Dinamica Srl) *
8 * Licensed under the Apache License, Version 2.0 (the "License"); *
9 * you may not use this file except in compliance with the License. *
10 * You may obtain a copy of the License at *
11 * *
12 * http://www.apache.org/licenses/LICENSE-2.0 *
13 * *
14 * Unless required by applicable law or agreed to in writing, software *
15 * distributed under the License is distributed on an "AS IS" BASIS, *
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
17 * See the License for the specific language governing permissions and *
18 * limitations under the License. *
19 * *
20 *******************************************************************************/
21 
22 /*
23  * DA_t.h
24  *
25  * Created on: Apr 07, 2014
26  * Author: Dinamica Srl
27  */
28 
29 #ifndef DINAMICA_DA_T_H_
30 #define DINAMICA_DA_T_H_
31 
32 // DACE classes
33 #include "dace/compiledDA.h"
34 #include "dace/DA.h"
35 
36 namespace DACE{
37 
38 /********************************************************************************
39 * DA polynomial evaluation routines
40 *********************************************************************************/
41 template<class T> T DA::eval(const std::vector<T> &args) const{
55  return compiledDA(*this).eval(args)[0];
56 }
57 
58 template<class T> T DA::eval(const T args[], const unsigned int length) const{
69  return compiledDA(*this).eval(args,length)[0];
70 }
71 
72 template<class T> T DA::evalScalar(const T &arg) const{
81  return compiledDA(*this).evalScalar(arg)[0];
82 }
83 
84 template<class T> T eval(const DA &da, const std::vector<T> &args) {
99  return da.eval(args);
100 }
101 
102 template<class T> T eval(const DA &da, const T args[], const unsigned int length) {
114  return da.eval(args,length);
115 }
116 
117 template<class T> T evalScalar(const DA &da, const T &arg) {
128  return da.evalScalar(arg);
129 }
130 
131 }
132 #endif /* DINAMICA_DA_T_H_ */
T eval(const std::vector< T > &args) const
Evaluation with a vector of arguments (not efficient for repeated evaluation!)
Definition: DA_t.h:41
Definition: DA.h:57
Definition: AlgebraicMatrix.cpp:39
friend class compiledDA
Definition: DA.h:59
T evalScalar(const T &arg) const
Evaluation with a single arithmetic type T argument (not efficient for repeated evaluation!) ...
Definition: DA_t.h:72