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
......@@ -1013,6 +1013,28 @@ 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)
{
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);
}
//-----------------------------------------------------------------------------
// inspect the matrix: dimension, symmetry, zero_rows, zero_cols, nnz, max, min, max_abs, min_abs, NAN, INF
template<class MatrixT>
void inspect_matrix( const MatrixT& _A)
......
......@@ -236,6 +236,9 @@ double residuum_norm( MatrixT& _A, VectorT& _x, VectorT& _rhs );
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)
/** Prints useful matrix informations such as, dimension, symmetry, zero_rows, zero_cols, nnz, max, min, max_abs, min_abs, NAN, INF
......
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