ADMB Documentation  11.5.3289
 All Classes Files Functions Variables Typedefs Friends Defines
dvect13.cpp
Go to the documentation of this file.
00001 
00005 #include <fvar.hpp>
00006 
00010 dmatrix column_vector(const dvector& v)
00011 {
00012   int min = v.indexmin();
00013   int max = v.indexmax();
00014   dmatrix ret(min, max, 1, 1);
00015   for (int i = min; i <= max; ++i)
00016   {
00017     ret.elem(i, 1) = v.elem(i);
00018   }
00019   return ret;
00020 }
00024 dmatrix row_vector(const dvector& v)
00025 {
00026   int min = v.indexmin();
00027   int max = v.indexmax();
00028   dmatrix ret(1, 1, min, max);
00029   for (int i = min; i <= max; ++i)
00030   {
00031     ret.elem(1, i) = v.elem(i);
00032   }
00033   return ret;
00034 }
00038 dvar_matrix column_vector(const dvar_vector& v)
00039 {
00040   int min = v.indexmin();
00041   int max = v.indexmax();
00042   dvar_matrix ret(min, max, 1, 1);
00043   for (int i = min; i <= max; ++i)
00044   {
00045     ret.elem(i, 1) = v.elem(i);
00046   }
00047   return ret;
00048 }
00052 dvar_matrix row_vector(const dvar_vector& v)
00053 {
00054   int min = v.indexmin();
00055   int max = v.indexmax();
00056   dvar_matrix ret(1, 1, min, max);
00057   for (int i = min; i <= max; ++i)
00058   {
00059     ret.elem(1, i) = v.elem(i);
00060   }
00061   return ret;
00062 }