17 std::vector<double> vec(denseVec.size());
19 for (
size_t i = 0;
i < (size_t) denseVec.size(); ++
i)
21 vec.at(
i) = denseVec(
i);
29 DenseVector denseVec(vec.size());
31 for (
size_t i = 0;
i < vec.size(); ++
i)
33 denseVec(
i) = vec.at(
i);
40 const DenseMatrix& mat)
42 std::vector<std::vector<double>> vec(mat.rows());
44 for (
size_t i = 0;
i < (size_t) mat.rows(); ++
i)
46 for (
size_t j = 0; j < (size_t) mat.cols(); ++j)
48 vec.at(
i).push_back(mat(
i, j));
58 size_t numRows = vec.size();
59 size_t numCols = numRows > 0 ? vec.at(0).size() : 0;
60 DenseMatrix mat(numRows, numCols);
62 for (
size_t i = 0;
i < numRows; ++
i)
64 for (
size_t j = 0; j < numCols; ++j)
66 mat(
i, j) = vec.at(
i).at(j);
73std::vector<double>
linspace(
double start,
double stop,
unsigned int num)
75 std::vector<double> ret;
80 dx = (stop - start) / (num - 1);
83 for (
unsigned int i = 0;
i < num; ++
i)
85 ret.push_back(start +
i * dx);
DenseMatrix vectorVectorToDenseMatrix(const std::vector< std::vector< double > > &vec)
DenseVector vectorToDenseVector(const std::vector< double > &vec)
std::vector< std::vector< double > > denseMatrixToVectorVector(const DenseMatrix &mat)
std::vector< double > linspace(double start, double stop, unsigned int num)
std::vector< double > denseVectorToVector(const DenseVector &denseVec)