17 struct vector : Array<Type,Dynamic,1>
19 typedef Type value_type;
20 typedef Array<Type,Dynamic,1> Base;
21 vector(
void):Base() {}
24 vector(T1 x):Base(x) {}
26 template<
class T1,
class T2>
27 vector(T1 x, T2 y):Base(x,y) {}
31 vector & operator= (
const T1 & other)
33 this->Base::operator=(other);
42 using Base::operator();
45 vector<Type> operator()(vector<int> ind){
46 vector<Type> ans(ind.size());
47 for(
int i=0;i<ind.size();i++)ans[i]=this->
operator[](ind[i]);
57 operator CppAD::vector<T>(){
59 CppAD::vector<T> x(n);
60 for(
int i=0; i<n; i++) x[i] = T(this->
operator[](i));
72 vector(CppAD::vector<T> x):Base(){
75 for(
int i=0; i<n; i++) this->
operator[](i) = Type(x[i]);
79 operator std::vector<Type>(){
81 std::vector<Type> x(n);
82 for(
int i=0; i<n; i++) x[i] = (*
this)(i);
85 vector(
const std::vector<Type> &x) : Base(){
88 for(
int i=0; i<n; i++) (*
this)[i] = x[i];
91 vector<Type> vec() {
return *
this; }
100 template <
class Type>
101 struct matrix : Matrix<Type,Dynamic,Dynamic>
103 typedef Matrix<Type,Dynamic,Dynamic> Base;
107 template<
class T1,
class T2>
108 matrix(T1 x, T2 y):Base(x,y) {}
111 matrix & operator= (
const T1 & other)
113 this->Base::operator=(other);
121 Array<Type,Dynamic,Dynamic> a = this->
array();
122 a.resize(a.size(), 1);
Matrix class used by TMB.