Commit 1a019e55 authored by Marcel Campen's avatar Marcel Campen

Added factored_to_quadratic_rhs_only()

git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@297 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent 9865aa75
......@@ -1008,6 +1008,28 @@ void factored_to_quadratic( MatrixT& _F, MatrixT2& _Q, VectorT& _rhs)
_rhs.resize( n - 1);
gmm::copy ( Q, _Q);
}
//-----------------------------------------------------------------------------
template<class MatrixT, class VectorT>
void factored_to_quadratic_rhs_only( MatrixT& _F, VectorT& _rhs)
{
unsigned int m = gmm::mat_nrows(_F);
unsigned int n = gmm::mat_ncols(_F);
gmm::resize(_rhs, n);
// compute quadratic matrix
MatrixT Q(n,n);
gmm::mult(gmm::transposed(_F),_F,Q);
// extract rhs
gmm::copy( gmm::scaled(gmm::mat_const_row( Q, n - 1),-1.0), _rhs);
_rhs.resize( n - 1);
}
//-----------------------------------------------------------------------------
......
......@@ -235,6 +235,9 @@ double residuum_norm( MatrixT& _A, VectorT& _x, VectorT& _rhs );
* @param _rhs right hand side (output) */
template<class MatrixT, class MatrixT2, class VectorT>
void factored_to_quadratic( MatrixT& _F, MatrixT2& _Q, VectorT& _rhs);
template<class MatrixT, class VectorT>
void factored_to_quadratic_rhs_only( MatrixT& _F, VectorT& _rhs);
/// Inspect the matrix (print)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment