End Google Ads 201810 - BS.net 01 --> I have some incomplete code

matrix gauss_jordan(void) { // Gauss-Jordan matrix inversion
matrix ret = *this;
assert(this->data[].size() == this->data.size()); // Must be a square
ret.data.resize(ret.data.size() * 2); // stretch the width to accommodate the identity matrix
for (int i = this->data.size(); i < ret.data.size(); i++)
ret[i-this->data.size()][i] = (base)1; // load the identity matrix
return ret.gauss(); // call Gauss
// copy rhs back to lhs
};

what I want to do is leverage the exiting module to put a matrix into row echelon form, the idea is to stretch the matrix to 2x wider like i have done.

Just not so sure how to take the rhs part of the matrix and move it to the original size, re dimension and return.

My vector template is complete so I leverage it heavily.
http://www.contract-developer.tk