I'm looking to do some calculations and pass the resultant Jacobian NxN matrix and a right hand side vector(n) to boost's ublas and eventually ViennaCL.
The vector was no issue using copy(), however, the matrix is proving to be difficult. Any help would be greatly appreciated
// Global Variables
vector< vector<float> > Jacobian(0, vector<float>(0)); //Jacobian matrix
vector<float> delta_PQ; //rhs
//
// Set up some ublas objects
//
ublas::vector<ScalarType> rhs;
ublas::vector<ScalarType> result;
ublas::compressed_matrix<ScalarType> ublas_matrix;
using namespace boost::numeric;
typedef float ScalarType;
// Resize RHS from main program
resize_vector(rhs2, j_dimension);
ublas_matrix2.resize(j_dimension, j_dimension);
//copy content to GPU vector (recommended initialization)
copy(delta_PQ.begin(), delta_PQ.end(), rhs.begin()); //works
copy(Jacobian.begin(), Jacobian.end(), ublas_matrix); //won't compile
I have tried numerous variations and looked at the documentation:
http://ublas.sourceforge.net/refdoc/classboost_1_1numeric_1_1ublas_1_1compressed__matrix.html
Also, ViennaCL's example does not work for me:
http://viennacl.sourceforge.net/viennacl-examples-sparse-matrix.html
After a few hours of googling I decided to post on here in hopes someone else can crack it and it will be easier to find for the next person.