Skip to content
Snippets Groups Projects
Commit 55a910fd authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

made MTL optional

parent e744545f
Branches
No related tags found
No related merge requests found
# File for module specific CMake tests.
include(AMDiSCXXFeatures)
# some additional packages and flags
find_package(MTL REQUIRED
PATHS /usr/local/lib/mtl4 /opt/sources/mtl4 /opt/development/mtl4)
find_package(MTL
PATHS ${MTL_DIR}
HINTS /usr/local/lib/mtl4 /opt/sources/mtl4 /opt/development/mtl4
)
if (MTL_FOUND)
set(CXX_ELEVEN_FEATURE_LIST "MOVE" "AUTO" "RANGEDFOR" "INITLIST" "STATICASSERT" "DEFAULTIMPL")
set(MTL_COMPILE_DEFINITIONS "")
foreach(feature ${CXX_ELEVEN_FEATURE_LIST})
list(APPEND MTL_COMPILE_DEFINITIONS "MTL_WITH_${feature}")
endforeach()
set(CXX_ELEVEN_FEATURE_LIST "MOVE" "AUTO" "RANGEDFOR" "INITLIST" "STATICASSERT" "DEFAULTIMPL")
set(MTL_COMPILE_DEFINITIONS "")
foreach(feature ${CXX_ELEVEN_FEATURE_LIST})
list(APPEND MTL_COMPILE_DEFINITIONS "MTL_WITH_${feature}")
endforeach()
find_package(SuiteSparse QUIET)
if (SuiteSparse_FOUND)
list(APPEND MTL_COMPILE_DEFINITIONS "MTL_HAS_UMFPACK")
endif (SuiteSparse_FOUND)
endif (MTL_FOUND)
if(HAVE_UMFPACK OR ENABLE_SUITESPARSE OR SuiteSparse_FOUND)
list(APPEND MTL_COMPILE_DEFINITIONS "MTL_HAS_UMFPACK")
endif()
set(HAVE_MTL MTL_FOUND)
dune_register_package_flags(
COMPILE_DEFINITIONS ${MTL_COMPILE_DEFINITIONS}
INCLUDE_DIRS ${MTL_INCLUDE_DIRS})
if (MTL_FOUND)
list(APPEND MTL_COMPILE_DEFINITIONS "ENABLE_MTL=1")
dune_register_package_flags(
COMPILE_DEFINITIONS ${MTL_COMPILE_DEFINITIONS}
INCLUDE_DIRS ${MTL_INCLUDE_DIRS})
endif (MTL_FOUND)
\ No newline at end of file
/* begin dune-amdis
/* begin amdis
put the definitions for config.h specific to
your project here. Everything above will be
overwritten
......@@ -40,12 +40,13 @@
/* Define to the revision of amdis */
#define AMDIS_VERSION_REVISION @AMDIS_VERSION_REVISION@
/* Define to ENABLE_UMFPACK if the MTL library is available */
#cmakedefine HAVE_MTL ENABLE_MTL
/* some detected compiler features may be used in AMDiS */
#cmakedefine AMDIS_HAS_CXX_FOLD_EXPRESSIONS 1
#cmakedefine AMDIS_HAS_CXX_CONSTEXPR_IF 1
/* end dune-amdis
/* end amdis
Everything below here will be overwritten
*/
......@@ -4,6 +4,7 @@
namespace AMDiS
{
/// \brief The transposed view onto a matrix
template <class Matrix>
class TransposedMatrix
{
......@@ -47,9 +48,9 @@ namespace AMDiS
return ConstRowProxy{&matrix_, row};
}
template <class SizeType, class M = Matrix,
template <class M = Matrix,
std::enable_if_t<not std::is_const<M>::value, int> = 0>
MutableRowProxy operator[](SizeType row)
MutableRowProxy operator[](size_type row)
{
return MutableRowProxy{&matrix_, row};
}
......
......@@ -43,7 +43,6 @@ namespace AMDiS
void solve(Matrix const& A, VectorX& x, VectorB const& b,
SolverInfo& solverInfo)
{
assert( num_cols(A) == size(x) && num_rows(A) == size(b) );
solveImpl(A, x, b, solverInfo);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment