diff options
Diffstat (limited to 'basegfx/source/workbench/gauss.hxx')
-rw-r--r-- | basegfx/source/workbench/gauss.hxx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/basegfx/source/workbench/gauss.hxx b/basegfx/source/workbench/gauss.hxx index fc352fe7e675..4ef050ccbc52 100644 --- a/basegfx/source/workbench/gauss.hxx +++ b/basegfx/source/workbench/gauss.hxx @@ -39,8 +39,7 @@ @return true, if elimination succeeded. */ -#ifndef INCLUDED_BASEGFX_SOURCE_WORKBENCH_GAUSS_HXX -#define INCLUDED_BASEGFX_SOURCE_WORKBENCH_GAUSS_HXX +#pragma once template <class Matrix, typename BaseType> bool eliminate( Matrix& matrix, @@ -48,8 +47,6 @@ bool eliminate( Matrix& matrix, int cols, const BaseType& minPivot ) { - BaseType temp; - /* i, j, k *must* be signed, when looping like: j>=0 ! */ /* eliminate below main diagonal */ for(int i=0; i<cols-1; ++i) @@ -67,9 +64,7 @@ bool eliminate( Matrix& matrix, /* interchange rows 'max' and 'i' */ for(int k=0; k<cols; ++k) { - temp = matrix[ i*cols + k ]; - matrix[ i*cols + k ] = matrix[ max*cols + k ]; - matrix[ max*cols + k ] = temp; + std::swap(matrix[ i*cols + k ], matrix[ max*cols + k ]); } /* eliminate column */ @@ -165,6 +160,4 @@ bool solve( Matrix& matrix, return false; } -#endif // INCLUDED_BASEGFX_SOURCE_WORKBENCH_GAUSS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |