20 #ifndef ESSENTIA_TNT2VECTOR_H
21 #define ESSENTIA_TNT2VECTOR_H
31 throw EssentiaException(
"You are trying to convert an empty vector of vector into a Array2D.");
35 for (
int i=0; i<v2D.
dim1(); i++) {
36 for (
int j=0; j<v2D.
dim2(); j++) {
46 if (v2D.
dim1() == 0) {
47 throw EssentiaException(
"You are trying to convert an empty Array2D into a vector of vector.");
50 std::vector<std::vector<Real> > v;
53 for (
uint i=0; i<v.size(); i++) {
54 v[i].resize(v2D.
dim2());
55 for (
uint j=0; j<v[i].size(); j++) {
56 v[i][j] = v2D[(int)i][(
int)j];
int dim1() const
Definition: tnt_array2d.h:231
int dim2() const
Definition: tnt_array2d.h:234
Definition: algorithm.h:28
std::vector< std::vector< Real > > array2DToVecvec(const TNT::Array2D< Real > &v2D)
Definition: tnt2vector.h:44
TNT::Array2D< Real > vecvecToArray2D(const std::vector< std::vector< Real > > &v)
Definition: tnt2vector.h:28
unsigned int uint
Definition: types.h:49