void LinearSolver :: solve( Factor& A, vector<Quaternion>& x, const vector<Quaternion>& b ) // solves the linear system Ax = b where A is positive-semidefinite { int n = x.size(); Dense result( cc, n*4, 1 ); Dense rhs( cc, n*4, 1 ); // convert right-hand side to real values toReal( b, rhs ); // solve real linear system result = cholmod_l_solve( CHOLMOD_A, *A, *rhs, cc ); // convert solution back to quaternions toQuat( result, x ); }
void toQuat( angles_t &src, quat_t &dst ) { mat3_t temp; toMatrix( src, temp ); toQuat( temp, dst ); }