Commit 8e56bb81 authored by prudhomm's avatar prudhomm
Browse files

now properly check sizeof(size_t) with sizeof(uint)

and define LIFEV_SIZET_SAME_AS_UINT if they are the same
parent 8eda864c
......@@ -48,6 +48,26 @@ LIFEV_CHECK_COMPILERS
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_CHECK_TYPE(size_t, unsigned)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING(for size_t == uint)
AC_TRY_RUN([
return sizeof(size_t)==sizeof(uint);
],
[
AC_MSG_RESULT(yes)
size_t_same_as_uint=yes
AC_DEFINE(LIFEV_SIZET_SAME_AS_UINT, 1, [sizeof(size_t)==sizeof(uint)])
],
[
AC_MSG_RESULT(no)
size_t_same_as_uint=no
])
AC_LANG_RESTORE
# pdflatex
AC_CHECK_PROG(PDFLATEX, pdflatex,[pdflatex],[no])
......@@ -66,7 +86,6 @@ AC_CHECK_BOOST_PROGRAM_OPTIONS
AM_CONDITIONAL(HAVE_BOOST_PROGRAM_OPTIONS, test "x$boost_program_options_error" = "xno")
dnl
dnl checks for some scientific computing libraries
dnl
......
......@@ -215,6 +215,20 @@ SolverPETSC::setTolerances( double __rtol, double __atol, double __dtol,
KSPSetTolerances( _M_p->__ksp, __rtol, __atol, __dtol, __maxits );
}
void
SolverPETSC::setMatrix( uint __nrows, const uint* __r, const uint *__i,
const double* __v )
{
MatCreateSeqAIJWithArrays( PETSC_COMM_SELF,
__nrows, __nrows,
( int* ) __r,
( int* ) __i,
const_cast<PetscScalar*>( __v ),
&_M_p->__A );
_M_p->_M_use_A = true;
}
#if !defined( LIFEV_SIZET_SAME_AS_UINT )
void
SolverPETSC::setMatrix( size_t __nrows, const size_t* __r, const size_t *__i,
const double* __v )
......@@ -228,6 +242,7 @@ SolverPETSC::setMatrix( size_t __nrows, const size_t* __r, const size_t *__i,
_M_p->_M_use_A = true;
}
#endif
void SolverPETSC::setMatrix( const MSRMatr<value_type>& m )
{
......
......@@ -210,8 +210,13 @@ public:
*/
//@{
//! set matrix from raw CSR arrays
void setMatrix( uint, const uint*, const uint*, const double* );
#if !defined( LIFEV_SIZET_SAME_AS_UINT )
//! set matrix from raw CSR arrays
void setMatrix( size_t, const size_t*, const size_t*, const double* );
#endif
//! set matrix from CSRMatr
template <typename PatternType>
......
Supports Markdown
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