Skip to content
Snippets Groups Projects
Commit fe7e64fb authored by Amaury Johnen's avatar Amaury Johnen
Browse files

fix bug invertion

parent 2250f72e
No related branches found
No related tags found
No related merge requests found
......@@ -296,8 +296,12 @@ bool fullMatrix<double>::invert(fullMatrix<double> &result) const
{
int M = size1(), N = size2(), lda = size1(), info;
int *ipiv = new int[std::min(M, N)];
if (result._own_data)
result.resize(M,N,false);
if (result.size2() != M || result.size1() != N) {
if (result._own_data || !result._data)
result.resize(M,N,false);
else
Msg::Fatal("FullMatrix: Bad dimension, I cannot write in proxy");
}
result.setAll(*this);
F77NAME(dgetrf)(&M, &N, result._data, &lda, ipiv, &info);
if(info == 0){
......
......@@ -474,7 +474,8 @@ class fullMatrix
if(resetValue)
setAll(scalar(0.));
return false; // no reallocation
} void setAsProxy(const fullMatrix<scalar> &original)
}
void setAsProxy(const fullMatrix<scalar> &original)
{
if(_data && _own_data)
delete [] _data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment