32 #ifndef __VMML__VMMLIB_LAPACK_GAUSSIAN_ELIMINATION__HPP__
33 #define __VMML__VMMLIB_LAPACK_GAUSSIAN_ELIMINATION__HPP__
35 #include <vmmlib/matrix.hpp>
36 #include <vmmlib/vector.hpp>
37 #include <vmmlib/exception.hpp>
39 #include <vmmlib/lapack_types.hpp>
40 #include <vmmlib/lapack_includes.hpp>
72 template<
typename float_t >
84 friend std::ostream& operator << ( std::ostream& os,
101 int dgesv_(integer *n, integer *nrhs, doublereal *a, integer
102 *lda, integer *ipiv, doublereal *b, integer *ldb, integer *info);
106 template<
typename float_t >
110 VMMLIB_ERROR(
"not implemented for this type.", VMMLIB_HERE );
116 xgesv_call( xgesv_params< float >& p )
134 xgesv_call( xgesv_params< double >& p )
149 template<
size_t M,
size_t N,
typename float_t >
174 template<
size_t M,
size_t N,
typename float_t >
185 lapack::xgesv_call( p );
190 VMMLIB_ERROR(
"invalid value in input matrix", VMMLIB_HERE );
192 VMMLIB_ERROR(
"factor U is exactly singular, solution could not be computed.", VMMLIB_HERE );
198 template<
size_t M,
size_t N,
typename float_t >
200 gaussian_elimination< M, N, float_t >::
202 matrix< N, N, float_t >& A,
203 vector< N, float_t >& b
209 lapack::xgesv_call( p );
214 VMMLIB_ERROR(
"invalid value in input matrix", VMMLIB_HERE );
216 VMMLIB_ERROR(
"factor U is exactly singular, solution could not be computed.", VMMLIB_HERE );
222 template<
size_t M,
size_t N,
typename float_t >
223 gaussian_elimination< M, N, float_t >::
224 gaussian_elimination()
230 p.ipiv =
new lapack_int[ N ];
236 template<
size_t M,
size_t N,
typename float_t >
237 gaussian_elimination< M, N, float_t >::
238 ~gaussian_elimination()