Browse Source

bump gmm++ version to 5.2 (from 5.0)

main
dehnert 8 years ago
parent
commit
43643b9699
  1. 2
      .gitignore
  2. 2
      resources/3rdparty/CMakeLists.txt
  3. 1
      resources/3rdparty/gmm-5.0/README
  4. 17
      resources/3rdparty/gmm-5.0/m4/ax_check_cxx_flag.m4
  5. 2
      resources/3rdparty/gmm-5.2/AUTHORS
  6. 11
      resources/3rdparty/gmm-5.2/COPYING
  7. 0
      resources/3rdparty/gmm-5.2/ChangeLog
  8. 0
      resources/3rdparty/gmm-5.2/INSTALL
  9. 0
      resources/3rdparty/gmm-5.2/Makefile.am
  10. 0
      resources/3rdparty/gmm-5.2/Makefile.in
  11. 0
      resources/3rdparty/gmm-5.2/NEWS
  12. 29
      resources/3rdparty/gmm-5.2/README
  13. 0
      resources/3rdparty/gmm-5.2/aclocal.m4
  14. 0
      resources/3rdparty/gmm-5.2/compile
  15. 0
      resources/3rdparty/gmm-5.2/config.guess
  16. 0
      resources/3rdparty/gmm-5.2/config.h.in
  17. 0
      resources/3rdparty/gmm-5.2/config.sub
  18. 22
      resources/3rdparty/gmm-5.2/configure
  19. 4
      resources/3rdparty/gmm-5.2/configure.ac
  20. 0
      resources/3rdparty/gmm-5.2/depcomp
  21. 20
      resources/3rdparty/gmm-5.2/gmm-config.in
  22. 10
      resources/3rdparty/gmm-5.2/include/Makefile.am
  23. 10
      resources/3rdparty/gmm-5.2/include/Makefile.in
  24. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm.h
  25. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_MUMPS_interface.h
  26. 20
      resources/3rdparty/gmm-5.2/include/gmm/gmm_algobase.h
  27. 324
      resources/3rdparty/gmm-5.2/include/gmm/gmm_blas.h
  28. 48
      resources/3rdparty/gmm-5.2/include/gmm/gmm_blas_interface.h
  29. 20
      resources/3rdparty/gmm-5.2/include/gmm/gmm_condition_number.h
  30. 152
      resources/3rdparty/gmm-5.2/include/gmm/gmm_conjugated.h
  31. 50
      resources/3rdparty/gmm-5.2/include/gmm/gmm_def.h
  32. 24
      resources/3rdparty/gmm-5.2/include/gmm/gmm_dense_Householder.h
  33. 18
      resources/3rdparty/gmm-5.2/include/gmm/gmm_dense_lu.h
  34. 6
      resources/3rdparty/gmm-5.2/include/gmm/gmm_dense_matrix_functions.h
  35. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_dense_qr.h
  36. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_dense_sylvester.h
  37. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_domain_decomp.h
  38. 94
      resources/3rdparty/gmm-5.2/include/gmm/gmm_except.h
  39. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_inoutput.h
  40. 29
      resources/3rdparty/gmm-5.2/include/gmm/gmm_interface.h
  41. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_interface_bgeot.h
  42. 34
      resources/3rdparty/gmm-5.2/include/gmm/gmm_iter.h
  43. 19
      resources/3rdparty/gmm-5.2/include/gmm/gmm_iter_solvers.h
  44. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_kernel.h
  45. 31
      resources/3rdparty/gmm-5.2/include/gmm/gmm_lapack_interface.h
  46. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_least_squares_cg.h
  47. 37
      resources/3rdparty/gmm-5.2/include/gmm/gmm_matrix.h
  48. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_modified_gram_schmidt.h
  49. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_opt.h
  50. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_precond.h
  51. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_diagonal.h
  52. 63
      resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_ildlt.h
  53. 62
      resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_ildltt.h
  54. 18
      resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_ilu.h
  55. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_ilut.h
  56. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_ilutp.h
  57. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_mr_approx_inverse.h
  58. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_range_basis.h
  59. 346
      resources/3rdparty/gmm-5.2/include/gmm/gmm_real_part.h
  60. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_ref.h
  61. 202
      resources/3rdparty/gmm-5.2/include/gmm/gmm_scaled.h
  62. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_Schwarz_additive.h
  63. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_bfgs.h
  64. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_bicgstab.h
  65. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_cg.h
  66. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_constrained_cg.h
  67. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_gmres.h
  68. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_idgmres.h
  69. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_qmr.h
  70. 132
      resources/3rdparty/gmm-5.2/include/gmm/gmm_std.h
  71. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_sub_index.h
  72. 30
      resources/3rdparty/gmm-5.2/include/gmm/gmm_sub_matrix.h
  73. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_sub_vector.h
  74. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_superlu_interface.h
  75. 20
      resources/3rdparty/gmm-5.2/include/gmm/gmm_transposed.h
  76. 48
      resources/3rdparty/gmm-5.2/include/gmm/gmm_tri_solve.h
  77. 693
      resources/3rdparty/gmm-5.2/include/gmm/gmm_vector.h
  78. 16
      resources/3rdparty/gmm-5.2/include/gmm/gmm_vector_to_matrix.h
  79. 0
      resources/3rdparty/gmm-5.2/install-sh
  80. 0
      resources/3rdparty/gmm-5.2/ltmain.sh
  81. 30
      resources/3rdparty/gmm-5.2/m4/ax_check_cxx_flag.m4
  82. 5
      resources/3rdparty/gmm-5.2/m4/ax_prefix_config_h.m4
  83. 0
      resources/3rdparty/gmm-5.2/m4/libtool.m4
  84. 0
      resources/3rdparty/gmm-5.2/m4/ltoptions.m4
  85. 0
      resources/3rdparty/gmm-5.2/m4/ltsugar.m4
  86. 0
      resources/3rdparty/gmm-5.2/m4/ltversion.m4
  87. 0
      resources/3rdparty/gmm-5.2/m4/lt~obsolete.m4
  88. 0
      resources/3rdparty/gmm-5.2/missing
  89. 0
      resources/3rdparty/gmm-5.2/test-driver
  90. 0
      resources/3rdparty/gmm-5.2/tests/Makefile.am
  91. 0
      resources/3rdparty/gmm-5.2/tests/Makefile.in
  92. 0
      resources/3rdparty/gmm-5.2/tests/dummy.cc
  93. 14
      resources/3rdparty/gmm-5.2/tests/gmm_torture01_lusolve.cc
  94. 14
      resources/3rdparty/gmm-5.2/tests/gmm_torture02_baseop.cc
  95. 14
      resources/3rdparty/gmm-5.2/tests/gmm_torture05_mult.cc
  96. 14
      resources/3rdparty/gmm-5.2/tests/gmm_torture06_mat_mult.cc
  97. 16
      resources/3rdparty/gmm-5.2/tests/gmm_torture10_qr.cc
  98. 20
      resources/3rdparty/gmm-5.2/tests/gmm_torture15_sub.cc
  99. 32
      resources/3rdparty/gmm-5.2/tests/gmm_torture20_iterative_solvers.cc
  100. 6
      resources/3rdparty/gmm-5.2/tests/make_gmm_test.pl

2
.gitignore

@ -2,7 +2,7 @@
resources/3rdparty/log4cplus-1.1.3-rc1/
resources/3rdparty/gtest-1.7.0/
resources/3rdparty/eigen/
resources/3rdparty/gmm-4.2/
resources/3rdparty/gmm-5.2/
resources/3rdparty/cudd-3.0.0/
resources/3rdparty/xercesc-3.1.2/
#Visual Studio files

2
resources/3rdparty/CMakeLists.txt

@ -34,7 +34,7 @@ list(APPEND STORM_DEP_TARGETS l3pp)
##
#############################################################
add_imported_library_interface(gmm "${PROJECT_SOURCE_DIR}/resources/3rdparty/gmm-5.0/include")
add_imported_library_interface(gmm "${PROJECT_SOURCE_DIR}/resources/3rdparty/gmm-5.2/include")
list(APPEND STORM_DEP_TARGETS gmm)
#############################################################

1
resources/3rdparty/gmm-5.0/README

@ -1 +0,0 @@
Please read BUGS, INSTALL

17
resources/3rdparty/gmm-5.0/m4/ax_check_cxx_flag.m4

@ -1,17 +0,0 @@
dnl based on http://www.gnu.org/software/ac-archive/htmldoc/ac_check_cc_opt.html
dnl from Guido Draheim <guidod@gmx.de>
AC_DEFUN([AC_CHECK_CXX_FLAG],
[AC_MSG_CHECKING([whether ${CXX} accepts $1])
echo 'int main(){}' > conftest.c
if test -z "`${CXX} $1 -o conftest conftest.c 2>&1`"; then
$2="${$2} $1"
echo "yes"
else
echo "no"
$3
fi
dnl echo "$2=${$2}"
rm -f conftest*
])

2
resources/3rdparty/gmm-5.0/AUTHORS → resources/3rdparty/gmm-5.2/AUTHORS

@ -1,4 +1,4 @@
Authors of GETFEM++
Authors of GetFEM++
Yves RENARD. Initial project. All the project.

11
resources/3rdparty/gmm-5.0/COPYING → resources/3rdparty/gmm-5.2/COPYING

@ -1,12 +1,13 @@
Getfem++ is free software; you can redistribute it and/or modify it
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version along with the GCC Runtime Library
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
Exception either version 3.1 or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License and the GCC Runtime Library Exception for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
along with this program (see GNU_GPL_V3, GNU_LGPL_V3 and
GNU_GCC_RUNTIME_EXCEPTION files); if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.

0
resources/3rdparty/gmm-5.0/ChangeLog → resources/3rdparty/gmm-5.2/ChangeLog

0
resources/3rdparty/gmm-5.0/INSTALL → resources/3rdparty/gmm-5.2/INSTALL

0
resources/3rdparty/gmm-5.0/Makefile.am → resources/3rdparty/gmm-5.2/Makefile.am

0
resources/3rdparty/gmm-5.0/Makefile.in → resources/3rdparty/gmm-5.2/Makefile.in

0
resources/3rdparty/gmm-5.0/NEWS → resources/3rdparty/gmm-5.2/NEWS

29
resources/3rdparty/gmm-5.2/README

@ -0,0 +1,29 @@
# Copyright (C) 1999-2017 Yves Renard
#
# This file is a part of GetFEM++
#
# GetFEM++ is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version along with the GCC Runtime Library
# Exception either version 3.1 or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License and GCC Runtime Library Exception for more details.
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
Please read BUGS, INSTALL
IMAGES and documentation :
# Permission is granted to copy, distribute and/or modify all
# documentations and images included in GetFEM++ package
# under the terms of the GNU Free Documentation License, Version 1.3
# or any later version published by the Free Software Foundation;
# with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
# A copy of the license is included in top directory.

0
resources/3rdparty/gmm-5.0/aclocal.m4 → resources/3rdparty/gmm-5.2/aclocal.m4

0
resources/3rdparty/gmm-5.0/compile → resources/3rdparty/gmm-5.2/compile

0
resources/3rdparty/gmm-5.0/config.guess → resources/3rdparty/gmm-5.2/config.guess

0
resources/3rdparty/gmm-5.0/config.h.in → resources/3rdparty/gmm-5.2/config.h.in

0
resources/3rdparty/gmm-5.0/config.sub → resources/3rdparty/gmm-5.2/config.sub

22
resources/3rdparty/gmm-5.0/configure → resources/3rdparty/gmm-5.2/configure

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for gmm 5.0.
# Generated by GNU Autoconf 2.69 for gmm 5.2.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gmm'
PACKAGE_TARNAME='gmm'
PACKAGE_VERSION='5.0'
PACKAGE_STRING='gmm 5.0'
PACKAGE_VERSION='5.2'
PACKAGE_STRING='gmm 5.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@ -1323,7 +1323,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures gmm 5.0 to adapt to many kinds of systems.
\`configure' configures gmm 5.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1393,7 +1393,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of gmm 5.0:";;
short | recursive ) echo "Configuration of gmm 5.2:";;
esac
cat <<\_ACEOF
@ -1501,7 +1501,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gmm configure 5.0
gmm configure 5.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1987,7 +1987,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by gmm $as_me 5.0, which was
It was created by gmm $as_me 5.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2335,7 +2335,7 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
PACKAGE="gmm"
MAJOR_VERSION="5"
MINOR_VERSION="0"
MINOR_VERSION="2"
VERSION=$MAJOR_VERSION.$MINOR_VERSION
echo "configuring $PACKAGE $VERSION..."
@ -2845,7 +2845,7 @@ fi
# Define the identity of the package.
PACKAGE='gmm'
VERSION='5.0'
VERSION='5.2'
cat >>confdefs.h <<_ACEOF
@ -15895,7 +15895,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by gmm $as_me 5.0, which was
This file was extended by gmm $as_me 5.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -15961,7 +15961,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
gmm config.status 5.0
gmm config.status 5.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

4
resources/3rdparty/gmm-5.0/configure.ac → resources/3rdparty/gmm-5.2/configure.ac

@ -8,14 +8,14 @@ dnl thus, updating cache ./config.cache avoided.
define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl
AC_INIT(gmm, 5.0)
AC_INIT(gmm, 5.2)
AC_CONFIG_HEADERS(config.h)
AC_PREREQ(2.56)
AC_ARG_PROGRAM
PACKAGE="gmm"
MAJOR_VERSION="5"
MINOR_VERSION="0"
MINOR_VERSION="2"
dnl VERSION=$MAJOR_VERSION.$MINOR_VERSION
VERSION=$MAJOR_VERSION.$MINOR_VERSION
echo "configuring $PACKAGE $VERSION..."

0
resources/3rdparty/gmm-5.0/depcomp → resources/3rdparty/gmm-5.2/depcomp

20
resources/3rdparty/gmm-5.0/gmm-config.in → resources/3rdparty/gmm-5.2/gmm-config.in

@ -1,5 +1,25 @@
#!/bin/sh
# @configure_input@
# Copyright (C) 1999-2017 Yves Renard
#
# This file is a part of GetFEM++
#
# GetFEM++ is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version along with the GCC Runtime Library
# Exception either version 3.1 or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License and GCC Runtime Library Exception for more details.
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
prefix="@prefix@"
exec_prefix="@exec_prefix@"
includedir="@includedir@"

10
resources/3rdparty/gmm-5.0/include/Makefile.am → resources/3rdparty/gmm-5.2/include/Makefile.am

@ -1,6 +1,4 @@
nobase_include_HEADERS=\
gmm/gmm.h\
gmm/gmm_MUMPS_interface.h\
gmm/gmm_algobase.h\
gmm/gmm_blas.h\
gmm/gmm_blas_interface.h\
@ -14,9 +12,10 @@ nobase_include_HEADERS=\
gmm/gmm_dense_sylvester.h\
gmm/gmm_domain_decomp.h\
gmm/gmm_except.h\
gmm/gmm.h\
gmm/gmm_inoutput.h\
gmm/gmm_interface.h\
gmm/gmm_interface_bgeot.h\
gmm/gmm_interface.h\
gmm/gmm_iter.h\
gmm/gmm_iter_solvers.h\
gmm/gmm_kernel.h\
@ -24,9 +23,10 @@ nobase_include_HEADERS=\
gmm/gmm_least_squares_cg.h\
gmm/gmm_matrix.h\
gmm/gmm_modified_gram_schmidt.h\
gmm/gmm_MUMPS_interface.h\
gmm/gmm_opt.h\
gmm/gmm_precond.h\
gmm/gmm_precond_diagonal.h\
gmm/gmm_precond.h\
gmm/gmm_precond_ildlt.h\
gmm/gmm_precond_ildltt.h\
gmm/gmm_precond_ilu.h\
@ -37,7 +37,6 @@ nobase_include_HEADERS=\
gmm/gmm_real_part.h\
gmm/gmm_ref.h\
gmm/gmm_scaled.h\
gmm/gmm_solver_Schwarz_additive.h\
gmm/gmm_solver_bfgs.h\
gmm/gmm_solver_bicgstab.h\
gmm/gmm_solver_cg.h\
@ -45,6 +44,7 @@ nobase_include_HEADERS=\
gmm/gmm_solver_gmres.h\
gmm/gmm_solver_idgmres.h\
gmm/gmm_solver_qmr.h\
gmm/gmm_solver_Schwarz_additive.h\
gmm/gmm_std.h\
gmm/gmm_sub_index.h\
gmm/gmm_sub_matrix.h\

10
resources/3rdparty/gmm-5.0/include/Makefile.in → resources/3rdparty/gmm-5.2/include/Makefile.in

@ -286,8 +286,6 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
nobase_include_HEADERS = \
gmm/gmm.h\
gmm/gmm_MUMPS_interface.h\
gmm/gmm_algobase.h\
gmm/gmm_blas.h\
gmm/gmm_blas_interface.h\
@ -301,9 +299,10 @@ nobase_include_HEADERS = \
gmm/gmm_dense_sylvester.h\
gmm/gmm_domain_decomp.h\
gmm/gmm_except.h\
gmm/gmm.h\
gmm/gmm_inoutput.h\
gmm/gmm_interface.h\
gmm/gmm_interface_bgeot.h\
gmm/gmm_interface.h\
gmm/gmm_iter.h\
gmm/gmm_iter_solvers.h\
gmm/gmm_kernel.h\
@ -311,9 +310,10 @@ nobase_include_HEADERS = \
gmm/gmm_least_squares_cg.h\
gmm/gmm_matrix.h\
gmm/gmm_modified_gram_schmidt.h\
gmm/gmm_MUMPS_interface.h\
gmm/gmm_opt.h\
gmm/gmm_precond.h\
gmm/gmm_precond_diagonal.h\
gmm/gmm_precond.h\
gmm/gmm_precond_ildlt.h\
gmm/gmm_precond_ildltt.h\
gmm/gmm_precond_ilu.h\
@ -324,7 +324,6 @@ nobase_include_HEADERS = \
gmm/gmm_real_part.h\
gmm/gmm_ref.h\
gmm/gmm_scaled.h\
gmm/gmm_solver_Schwarz_additive.h\
gmm/gmm_solver_bfgs.h\
gmm/gmm_solver_bicgstab.h\
gmm/gmm_solver_cg.h\
@ -332,6 +331,7 @@ nobase_include_HEADERS = \
gmm/gmm_solver_gmres.h\
gmm/gmm_solver_idgmres.h\
gmm/gmm_solver_qmr.h\
gmm/gmm_solver_Schwarz_additive.h\
gmm/gmm_std.h\
gmm/gmm_sub_index.h\
gmm/gmm_sub_matrix.h\

16
resources/3rdparty/gmm-5.0/include/gmm/gmm.h → resources/3rdparty/gmm-5.2/include/gmm/gmm.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm.h

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_MUMPS_interface.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_MUMPS_interface.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard, Julien Pommier
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard, Julien Pommier
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_MUMPS_interface.h

20
resources/3rdparty/gmm-5.0/include/gmm/gmm_algobase.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_algobase.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2000-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2000-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/** @file gmm_algobase.h
@ -110,7 +110,9 @@ namespace gmm {
int i;
for ( ; b1 != e1 && b2 != e2; ++b1, ++b2)
if ((i = c(*b1, *b2)) != 0) return i;
if (b1 != e1) return 1; if (b2 != e2) return -1; return 0;
if (b1 != e1) return 1;
if (b2 != e2) return -1;
return 0;
}
template<class CONT, class COMP = gmm::less<typename CONT::value_type> >

324
resources/3rdparty/gmm-5.0/include/gmm/gmm_blas.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_blas.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_blas.h
@ -38,16 +38,17 @@
#ifndef GMM_BLAS_H__
#define GMM_BLAS_H__
// This Version of GMM was modified for StoRM.
// To detect whether the usage of TBB is possible, this include is neccessary
// This Version of gmm++ was modified for Storm.
// To detect whether the usage of TBB is possible, this include is neccessary.
#include "storm-config.h"
#ifdef STORM_HAVE_INTELTBB
# include <new> // This fixes a potential dependency ordering problem between GMM and TBB
# include "tbb/tbb.h"
# include <iterator>
#include <new> // This fixes a potential dependency ordering problem between GMM and TBB
#include "tbb/tbb.h"
#include <iterator>
#endif
#include "gmm_scaled.h"
#include "gmm_transposed.h"
#include "gmm_conjugated.h"
@ -79,9 +80,8 @@ namespace gmm {
{ return nnz(l, typename linalg_traits<L>::linalg_type()); }
///@cond DOXY_SHOW_ALL_FUNCTIONS
template <typename L> inline size_type nnz(const L& l, abstract_vector) {
typename linalg_traits<L>::const_iterator it = vect_const_begin(l),
ite = vect_const_end(l);
template <typename L> inline size_type nnz(const L& l, abstract_vector) {
auto it = vect_const_begin(l), ite = vect_const_end(l);
size_type res(0);
for (; it != ite; ++it) ++res;
return res;
@ -444,10 +444,8 @@ namespace gmm {
typename strongest_value_type<V1,V2>::value_type
vect_sp(const V1 &v1, const V2 &v2, abstract_skyline, abstract_skyline) {
typedef typename strongest_value_type<V1,V2>::value_type T;
typename linalg_traits<V1>::const_iterator it1 = vect_const_begin(v1),
ite1 = vect_const_end(v1);
typename linalg_traits<V2>::const_iterator it2 = vect_const_begin(v2),
ite2 = vect_const_end(v2);
auto it1 = vect_const_begin(v1), ite1 = vect_const_end(v1);
auto it2 = vect_const_begin(v2), ite2 = vect_const_end(v2);
size_type n = std::min(ite1.index(), ite2.index());
size_type l = std::max(it1.index(), it2.index());
@ -557,8 +555,7 @@ namespace gmm {
vect_norm2_sqr(const V &v) {
typedef typename linalg_traits<V>::value_type T;
typedef typename number_traits<T>::magnitude_type R;
typename linalg_traits<V>::const_iterator
it = vect_const_begin(v), ite = vect_const_end(v);
auto it = vect_const_begin(v), ite = vect_const_end(v);
R res(0);
for (; it != ite; ++it) res += gmm::abs_sqr(*it);
return res;
@ -579,10 +576,8 @@ namespace gmm {
vect_dist2_sqr(const V1 &v1, const V2 &v2) { // not fully optimized
typedef typename linalg_traits<V1>::value_type T;
typedef typename number_traits<T>::magnitude_type R;
typename linalg_traits<V1>::const_iterator
it1 = vect_const_begin(v1), ite1 = vect_const_end(v1);
typename linalg_traits<V2>::const_iterator
it2 = vect_const_begin(v2), ite2 = vect_const_end(v2);
auto it1 = vect_const_begin(v1), ite1 = vect_const_end(v1);
auto it2 = vect_const_begin(v2), ite2 = vect_const_end(v2);
size_type k1(0), k2(0);
R res(0);
while (it1 != ite1 && it2 != ite2) {
@ -660,8 +655,7 @@ namespace gmm {
typename number_traits<typename linalg_traits<V>::value_type>
::magnitude_type
vect_norm1(const V &v) {
typename linalg_traits<V>::const_iterator
it = vect_const_begin(v), ite = vect_const_end(v);
auto it = vect_const_begin(v), ite = vect_const_end(v);
typename number_traits<typename linalg_traits<V>::value_type>
::magnitude_type res(0);
for (; it != ite; ++it) res += gmm::abs(*it);
@ -676,10 +670,9 @@ namespace gmm {
typename number_traits<typename linalg_traits<V>::value_type>
::magnitude_type
vect_norminf(const V &v) {
typename linalg_traits<V>::const_iterator
it = vect_const_begin(v), ite = vect_const_end(v);
typename number_traits<typename linalg_traits<V>::value_type>
::magnitude_type res(0);
auto it = vect_const_begin(v), ite = vect_const_end(v);
typename number_traits<typename linalg_traits<V>::value_type>
::magnitude_type res(0);
for (; it != ite; ++it) res = std::max(res, gmm::abs(*it));
return res;
}
@ -709,10 +702,8 @@ namespace gmm {
std::vector<R> aux(mat_ncols(m));
for (size_type i = 0; i < mat_nrows(m); ++i) {
typedef typename linalg_traits<M>::const_sub_row_type row_type;
row_type row = mat_const_row(m, i);
typename linalg_traits<row_type>::const_iterator
it = vect_const_begin(row), ite = vect_const_end(row);
typename linalg_traits<M>::const_sub_row_type row = mat_const_row(m, i);
auto it = vect_const_begin(row), ite = vect_const_end(row);
for (size_type k = 0; it != ite; ++it, ++k)
aux[index_of_it(it, k, store_type())] += gmm::abs(*it);
}
@ -765,10 +756,8 @@ namespace gmm {
std::vector<R> aux(mat_nrows(m));
for (size_type i = 0; i < mat_ncols(m); ++i) {
typedef typename linalg_traits<M>::const_sub_col_type col_type;
col_type col = mat_const_col(m, i);
typename linalg_traits<col_type>::const_iterator
it = vect_const_begin(col), ite = vect_const_end(col);
typename linalg_traits<M>::const_sub_col_type col = mat_const_col(m, i);
auto it = vect_const_begin(col), ite = vect_const_end(col);
for (size_type k = 0; it != ite; ++it, ++k)
aux[index_of_it(it, k, store_type())] += gmm::abs(*it);
}
@ -843,7 +832,7 @@ namespace gmm {
template <typename L, typename T>
void clean(L &l, double threshold, abstract_dense, T) {
typedef typename number_traits<T>::magnitude_type R;
typename linalg_traits<L>::iterator it = vect_begin(l), ite = vect_end(l);
auto it = vect_begin(l), ite = vect_end(l);
for (; it != ite; ++it)
if (gmm::abs(*it) < R(threshold)) *it = T(0);
}
@ -855,7 +844,7 @@ namespace gmm {
template <typename L, typename T>
void clean(L &l, double threshold, abstract_sparse, T) {
typedef typename number_traits<T>::magnitude_type R;
typename linalg_traits<L>::iterator it = vect_begin(l), ite = vect_end(l);
auto it = vect_begin(l), ite = vect_end(l);
std::vector<size_type> ind;
for (; it != ite; ++it)
if (gmm::abs(*it) < R(threshold)) ind.push_back(it.index());
@ -864,7 +853,7 @@ namespace gmm {
template <typename L, typename T>
void clean(L &l, double threshold, abstract_dense, std::complex<T>) {
typename linalg_traits<L>::iterator it = vect_begin(l), ite = vect_end(l);
auto it = vect_begin(l), ite = vect_end(l);
for (; it != ite; ++it){
if (gmm::abs((*it).real()) < T(threshold))
*it = std::complex<T>(T(0), (*it).imag());
@ -879,7 +868,7 @@ namespace gmm {
template <typename L, typename T>
void clean(L &l, double threshold, abstract_sparse, std::complex<T>) {
typename linalg_traits<L>::iterator it = vect_begin(l), ite = vect_end(l);
auto it = vect_begin(l), ite = vect_end(l);
std::vector<size_type> ind;
for (; it != ite; ++it) {
bool r = (gmm::abs((*it).real()) < T(threshold));
@ -972,18 +961,14 @@ namespace gmm {
void copy_mat_by_row(const L1& l1, L2& l2) {
size_type nbr = mat_nrows(l1);
for (size_type i = 0; i < nbr; ++i)
copy_vect(mat_const_row(l1, i), mat_row(l2, i),
typename linalg_traits<L1>::storage_type(),
typename linalg_traits<L2>::storage_type());
copy(mat_const_row(l1, i), mat_row(l2, i));
}
template <typename L1, typename L2>
void copy_mat_by_col(const L1 &l1, L2 &l2) {
size_type nbc = mat_ncols(l1);
for (size_type i = 0; i < nbc; ++i) {
copy_vect(mat_const_col(l1, i), mat_col(l2, i),
typename linalg_traits<L1>::storage_type(),
typename linalg_traits<L2>::storage_type());
copy(mat_const_col(l1, i), mat_col(l2, i));
}
}
@ -1050,24 +1035,21 @@ namespace gmm {
template <typename L1, typename L2>
void copy_mat_mixed_rc(const L1& l1, L2& l2, size_type i, abstract_sparse) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (; it != ite; ++it)
l2(i, it.index()) = *it;
}
template <typename L1, typename L2>
void copy_mat_mixed_rc(const L1& l1, L2& l2, size_type i, abstract_skyline) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (; it != ite; ++it)
l2(i, it.index()) = *it;
}
template <typename L1, typename L2>
void copy_mat_mixed_rc(const L1& l1, L2& l2, size_type i, abstract_dense) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (size_type j = 0; it != ite; ++it, ++j) l2(i, j) = *it;
}
@ -1078,22 +1060,19 @@ namespace gmm {
template <typename L1, typename L2>
void copy_mat_mixed_cr(const L1& l1, L2& l2, size_type i, abstract_sparse) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (; it != ite; ++it) l2(it.index(), i) = *it;
}
template <typename L1, typename L2>
void copy_mat_mixed_cr(const L1& l1, L2& l2, size_type i, abstract_skyline) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (; it != ite; ++it) l2(it.index(), i) = *it;
}
template <typename L1, typename L2>
void copy_mat_mixed_cr(const L1& l1, L2& l2, size_type i, abstract_dense) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (size_type j = 0; it != ite; ++it, ++j) l2(j, i) = *it;
}
@ -1120,15 +1099,13 @@ namespace gmm {
template <typename L1, typename L2> inline // to be optimised ?
void copy_vect(const L1 &l1, L2 &l2, abstract_skyline, abstract_skyline) {
typename linalg_traits<L1>::const_iterator it1 = vect_const_begin(l1),
ite1 = vect_const_end(l1);
auto it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
while (it1 != ite1 && *it1 == typename linalg_traits<L1>::value_type(0))
++it1;
if (ite1 - it1 > 0) {
clear(l2);
typename linalg_traits<L2>::iterator it2 = vect_begin(l2),
ite2 = vect_end(l2);
auto it2 = vect_begin(l2), ite2 = vect_end(l2);
while (*(ite1-1) == typename linalg_traits<L1>::value_type(0)) ite1--;
if (it2 == ite2) {
@ -1155,29 +1132,25 @@ namespace gmm {
template <typename L1, typename L2>
void copy_vect(const L1& l1, L2& l2, abstract_sparse, abstract_dense) {
clear(l2);
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (; it != ite; ++it) { l2[it.index()] = *it; }
}
template <typename L1, typename L2>
void copy_vect(const L1& l1, L2& l2, abstract_sparse, abstract_skyline) {
clear(l2);
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (; it != ite; ++it) l2[it.index()] = *it;
}
template <typename L1, typename L2>
void copy_vect(const L1& l1, L2& l2, abstract_skyline, abstract_dense) {
typedef typename linalg_traits<L1>::value_type T;
typedef typename linalg_traits<L1>::const_iterator l1_const_iterator;
typedef typename linalg_traits<L2>::iterator l2_iterator;
l1_const_iterator it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
if (it == ite)
gmm::clear(l2);
else {
l2_iterator it2 = vect_begin(l2), ite2 = vect_end(l2);
auto it2 = vect_begin(l2), ite2 = vect_end(l2);
size_type i = it.index(), j;
for (j = 0; j < i; ++j, ++it2) *it2 = T(0);
@ -1188,19 +1161,21 @@ namespace gmm {
template <typename L1, typename L2>
void copy_vect(const L1& l1, L2& l2, abstract_sparse, abstract_sparse) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
clear(l2);
for (; it != ite; ++it)
// cout << "copy " << l1 << " of size " << vect_size(l1) << " nnz = " << nnz(l1) << endl;
for (; it != ite; ++it) {
// cout << "*it = " << *it << endl;
// cout << "it.index() = " << it.index() << endl;
if (*it != (typename linalg_traits<L1>::value_type)(0))
l2[it.index()] = *it;
}
}
template <typename L1, typename L2>
void copy_vect(const L1& l1, L2& l2, abstract_dense, abstract_sparse) {
clear(l2);
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (size_type i = 0; it != ite; ++it, ++i)
if (*it != (typename linalg_traits<L1>::value_type)(0))
l2[i] = *it;
@ -1209,8 +1184,7 @@ namespace gmm {
template <typename L1, typename L2> // to be optimised ...
void copy_vect(const L1& l1, L2& l2, abstract_dense, abstract_skyline) {
clear(l2);
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (size_type i = 0; it != ite; ++it, ++i)
if (*it != (typename linalg_traits<L1>::value_type)(0))
l2[i] = *it;
@ -1220,8 +1194,7 @@ namespace gmm {
template <typename L1, typename L2>
void copy_vect(const L1& l1, L2& l2, abstract_skyline, abstract_sparse) {
clear(l2);
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (; it != ite; ++it)
if (*it != (typename linalg_traits<L1>::value_type)(0))
l2[it.index()] = *it;
@ -1258,25 +1231,24 @@ namespace gmm {
template <typename L1, typename L2> inline
void add_spec(const L1& l1, L2& l2, abstract_matrix) {
GMM_ASSERT2(mat_nrows(l1)==mat_nrows(l2) && mat_ncols(l1)==mat_ncols(l2),
"dimensions mismatch");
"dimensions mismatch l1 is " << mat_nrows(l1) << "x"
<< mat_ncols(l1) << " and l2 is " << mat_nrows(l2)
<< "x" << mat_ncols(l2));
add(l1, l2, typename linalg_traits<L1>::sub_orientation(),
typename linalg_traits<L2>::sub_orientation());
}
template <typename L1, typename L2>
void add(const L1& l1, L2& l2, row_major, row_major) {
typename linalg_traits<L1>::const_row_iterator it1 = mat_row_begin(l1),
ite = mat_row_end(l1);
typename linalg_traits<L2>::row_iterator it2 = mat_row_begin(l2);
auto it1 = mat_row_begin(l1), ite = mat_row_end(l1);
auto it2 = mat_row_begin(l2);
for ( ; it1 != ite; ++it1, ++it2)
add(linalg_traits<L1>::row(it1), linalg_traits<L2>::row(it2));
}
template <typename L1, typename L2>
void add(const L1& l1, L2& l2, col_major, col_major) {
typename linalg_traits<L1>::const_col_iterator
it1 = mat_col_const_begin(l1),
ite = mat_col_const_end(l1);
auto it1 = mat_col_const_begin(l1), ite = mat_col_const_end(l1);
typename linalg_traits<L2>::col_iterator it2 = mat_col_begin(l2);
for ( ; it1 != ite; ++it1, ++it2)
add(linalg_traits<L1>::col(it1), linalg_traits<L2>::col(it2));
@ -1289,22 +1261,19 @@ namespace gmm {
template <typename L1, typename L2>
void add_mat_mixed_rc(const L1& l1, L2& l2, size_type i, abstract_sparse) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (; it != ite; ++it) l2(i, it.index()) += *it;
}
template <typename L1, typename L2>
void add_mat_mixed_rc(const L1& l1, L2& l2, size_type i, abstract_skyline) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (; it != ite; ++it) l2(i, it.index()) += *it;
}
template <typename L1, typename L2>
void add_mat_mixed_rc(const L1& l1, L2& l2, size_type i, abstract_dense) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (size_type j = 0; it != ite; ++it, ++j) l2(i, j) += *it;
}
@ -1315,22 +1284,19 @@ namespace gmm {
template <typename L1, typename L2>
void add_mat_mixed_cr(const L1& l1, L2& l2, size_type i, abstract_sparse) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (; it != ite; ++it) l2(it.index(), i) += *it;
}
template <typename L1, typename L2>
void add_mat_mixed_cr(const L1& l1, L2& l2, size_type i, abstract_skyline) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (; it != ite; ++it) l2(it.index(), i) += *it;
}
template <typename L1, typename L2>
void add_mat_mixed_cr(const L1& l1, L2& l2, size_type i, abstract_dense) {
typename linalg_traits<L1>::const_iterator
it = vect_const_begin(l1), ite = vect_const_end(l1);
auto it = vect_const_begin(l1), ite = vect_const_end(l1);
for (size_type j = 0; it != ite; ++it, ++j) l2(j, i) += *it;
}
@ -1490,10 +1456,8 @@ namespace gmm {
template <typename L1, typename L2, typename L3>
void add_spspsp(const L1& l1, const L2& l2, L3& l3, linalg_true) {
typename linalg_traits<L1>::const_iterator
it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
typename linalg_traits<L2>::const_iterator
it2 = vect_const_begin(l2), ite2 = vect_const_end(l2);
auto it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
auto it2 = vect_const_begin(l2), ite2 = vect_const_end(l2);
clear(l3);
while (it1 != ite1 && it2 != ite2) {
ptrdiff_t d = it1.index() - it2.index();
@ -1522,23 +1486,20 @@ namespace gmm {
template <typename L1, typename L2>
void add(const L1& l1, L2& l2, abstract_dense, abstract_dense) {
typename linalg_traits<L1>::const_iterator it1 = vect_const_begin(l1);
typename linalg_traits<L2>::iterator
it2 = vect_begin(l2), ite = vect_end(l2);
auto it1 = vect_const_begin(l1);
auto it2 = vect_begin(l2), ite = vect_end(l2);
for (; it2 != ite; ++it2, ++it1) *it2 += *it1;
}
template <typename L1, typename L2>
void add(const L1& l1, L2& l2, abstract_dense, abstract_skyline) {
typedef typename linalg_traits<L1>::const_iterator const_l1_iterator;
typedef typename linalg_traits<L2>::iterator l2_iterator;
typedef typename linalg_traits<L1>::value_type T;
const_l1_iterator it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
auto it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
size_type i1 = 0, ie1 = vect_size(l1);
while (it1 != ite1 && *it1 == T(0)) { ++it1; ++i1; }
if (it1 != ite1) {
l2_iterator it2 = vect_begin(l2), ite2 = vect_end(l2);
auto it2 = vect_begin(l2), ite2 = vect_end(l2);
while (ie1 && *(ite1-1) == T(0)) { ite1--; --ie1; }
if (it2 == ite2 || i1 < it2.index()) {
@ -1558,10 +1519,9 @@ namespace gmm {
template <typename L1, typename L2>
void add(const L1& l1, L2& l2, abstract_skyline, abstract_dense) {
typename linalg_traits<L1>::const_iterator it1 = vect_const_begin(l1),
ite1 = vect_const_end(l1);
auto it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
if (it1 != ite1) {
typename linalg_traits<L2>::iterator it2 = vect_begin(l2);
auto it2 = vect_begin(l2);
it2 += it1.index();
for (; it1 != ite1; ++it2, ++it1) *it2 += *it1;
}
@ -1570,30 +1530,26 @@ namespace gmm {
template <typename L1, typename L2>
void add(const L1& l1, L2& l2, abstract_sparse, abstract_dense) {
typename linalg_traits<L1>::const_iterator
it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
auto it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
for (; it1 != ite1; ++it1) l2[it1.index()] += *it1;
}
template <typename L1, typename L2>
void add(const L1& l1, L2& l2, abstract_sparse, abstract_sparse) {
typename linalg_traits<L1>::const_iterator
it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
auto it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
for (; it1 != ite1; ++it1) l2[it1.index()] += *it1;
}
template <typename L1, typename L2>
void add(const L1& l1, L2& l2, abstract_sparse, abstract_skyline) {
typename linalg_traits<L1>::const_iterator
it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
auto it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
for (; it1 != ite1; ++it1) l2[it1.index()] += *it1;
}
template <typename L1, typename L2>
void add(const L1& l1, L2& l2, abstract_skyline, abstract_sparse) {
typename linalg_traits<L1>::const_iterator
it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
auto it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
for (; it1 != ite1; ++it1)
if (*it1 != typename linalg_traits<L1>::value_type(0))
l2[it1.index()] += *it1;
@ -1601,16 +1557,14 @@ namespace gmm {
template <typename L1, typename L2>
void add(const L1& l1, L2& l2, abstract_skyline, abstract_skyline) {
typedef typename linalg_traits<L1>::const_iterator const_l1_iterator;
typedef typename linalg_traits<L2>::iterator l2_iterator;
typedef typename linalg_traits<L1>::value_type T1;
typedef typename linalg_traits<L2>::value_type T2;
const_l1_iterator it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
auto it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
while (it1 != ite1 && *it1 == T1(0)) ++it1;
if (ite1 != it1) {
l2_iterator it2 = vect_begin(l2), ite2 = vect_end(l2);
auto it2 = vect_begin(l2), ite2 = vect_end(l2);
while (*(ite1-1) == T1(0)) ite1--;
if (it2 == ite2 || it1.index() < it2.index()) {
l2[it1.index()] = T2(0);
@ -1627,8 +1581,7 @@ namespace gmm {
template <typename L1, typename L2>
void add(const L1& l1, L2& l2, abstract_dense, abstract_sparse) {
typename linalg_traits<L1>::const_iterator
it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
auto it1 = vect_const_begin(l1), ite1 = vect_const_end(l1);
for (size_type i = 0; it1 != ite1; ++it1, ++i)
if (*it1 != typename linalg_traits<L1>::value_type(0)) l2[i] += *it1;
}
@ -1690,7 +1643,7 @@ namespace gmm {
if (aux != T(0)) l3[i] = aux;
}
}
#ifdef STORM_HAVE_INTELTBB
/* Official Intel Hint on blocked_range vs. linear iterators: http://software.intel.com/en-us/forums/topic/289505
@ -1755,19 +1708,18 @@ namespace gmm {
{}
};
#endif
template <typename L1, typename L2, typename L3>
void mult_by_row(const L1& l1, const L2& l2, L3& l3, abstract_dense) {
typename linalg_traits<L3>::iterator it=vect_begin(l3), ite=vect_end(l3);
typename linalg_traits<L1>::const_row_iterator
itr = mat_row_const_begin(l1);
auto itr = mat_row_const_begin(l1);
#ifdef STORM_HAVE_INTELTBB
tbb::parallel_for(forward_range_mult<typename linalg_traits<L3>::iterator, typename linalg_traits<L1>::const_row_iterator>(it, ite, itr), tbbHelper_mult_by_row<L1, L2, L3>(&l2));
#else
for (; it != ite; ++it, ++itr)
*it = vect_sp(linalg_traits<L1>::row(itr), l2,
typename linalg_traits<L1>::storage_type(),
typename linalg_traits<L2>::storage_type());
typename linalg_traits<L1>::storage_type(),
typename linalg_traits<L2>::storage_type());
#endif
}
@ -1783,8 +1735,7 @@ namespace gmm {
void mult_by_col(const L1& l1, const L2& l2, L3& l3, abstract_sparse) {
typedef typename linalg_traits<L2>::value_type T;
clear(l3);
typename linalg_traits<L2>::const_iterator it = vect_const_begin(l2),
ite = vect_const_end(l2);
auto it = vect_const_begin(l2), ite = vect_const_end(l2);
for (; it != ite; ++it)
if (*it != T(0)) add(scaled(mat_const_col(l1, it.index()), *it), l3);
}
@ -1793,8 +1744,7 @@ namespace gmm {
void mult_by_col(const L1& l1, const L2& l2, L3& l3, abstract_skyline) {
typedef typename linalg_traits<L2>::value_type T;
clear(l3);
typename linalg_traits<L2>::const_iterator it = vect_const_begin(l2),
ite = vect_const_end(l2);
auto it = vect_const_begin(l2), ite = vect_const_end(l2);
for (; it != ite; ++it)
if (*it != T(0)) add(scaled(mat_const_col(l1, it.index()), *it), l3);
}
@ -1862,20 +1812,21 @@ namespace gmm {
/** Multiply-accumulate. l4 = l1*l2 + l3; */
template <typename L1, typename L2, typename L3, typename L4> inline
void mult_add(const L1& l1, const L2& l2, const L3& l3, L4& l4) {
size_type m = mat_nrows(l1), n = mat_ncols(l1);
if (!m || !n) return;
GMM_ASSERT2(n==vect_size(l2) && m==vect_size(l3) && vect_size(l3) == vect_size(l4), "dimensions mismatch");
if (!same_origin(l2, l3)) {
mult_add_spec(l1, l2, l3, l4, typename principal_orientation_type<typename
linalg_traits<L1>::sub_orientation>::potype());
}
else {
GMM_WARNING2("Warning, A temporary is used for mult\n");
typename temporary_vector<L3>::vector_type temp(vect_size(l2));
copy(l2, temp);
mult_add_spec(l1, temp, l3, l4, typename principal_orientation_type<typename
linalg_traits<L1>::sub_orientation>::potype());
}
size_type m = mat_nrows(l1), n = mat_ncols(l1);
if (!m || !n) return;
GMM_ASSERT2(n==vect_size(l2) && m==vect_size(l3) && vect_size(l3) == vect_size(l4), "dimensions mismatch");
if (!same_origin(l2, l4) && !same_origin(l3, l4) && !same_origin(l2, l3)) {
mult_add_spec(l1, l2, l3, l4, typename principal_orientation_type<typename
linalg_traits<L1>::sub_orientation>::potype());
} else {
GMM_WARNING2("Warning, Multiple temporaries are used for mult\n");
typename temporary_vector<L2>::vector_type l2tmp(vect_size(l2));
copy(l2, l2tmp);
typename temporary_vector<L3>::vector_type l3tmp(vect_size(l3));
copy(l3, l3tmp);
mult_add_spec(l1, l2tmp, l3tmp, l4, typename principal_orientation_type<typename
linalg_traits<L1>::sub_orientation>::potype());
}
}
///@cond DOXY_SHOW_ALL_FUNCTIONS
@ -1905,21 +1856,20 @@ namespace gmm {
template <typename L1, typename L2, typename L3>
void mult_add_by_row(const L1& l1, const L2& l2, L3& l3, abstract_dense) {
typename linalg_traits<L3>::iterator it=vect_begin(l3), ite=vect_end(l3);
typename linalg_traits<L1>::const_row_iterator
itr = mat_row_const_begin(l1);
auto it=vect_begin(l3), ite=vect_end(l3);
auto itr = mat_row_const_begin(l1);
for (; it != ite; ++it, ++itr)
*it += vect_sp(linalg_traits<L1>::row(itr), l2);
}
template <typename L1, typename L2, typename L3, typename L4>
void mult_add_by_row(const L1& l1, const L2& l2, const L3& l3, L4& l4, abstract_dense) {
typename linalg_traits<L3>::const_iterator add_it=vect_begin(l3), add_ite=vect_end(l3);
typename linalg_traits<L4>::iterator target_it=vect_begin(l4), target_ite=vect_end(l4);
typename linalg_traits<L1>::const_row_iterator
itr = mat_row_const_begin(l1);
typename linalg_traits<L3>::const_iterator add_it=vect_begin(l3), add_ite=vect_end(l3);
typename linalg_traits<L4>::iterator target_it=vect_begin(l4), target_ite=vect_end(l4);
typename linalg_traits<L1>::const_row_iterator
itr = mat_row_const_begin(l1);
for (; add_it != add_ite; ++add_it, ++target_it, ++itr)
*target_it = vect_sp(linalg_traits<L1>::row(itr), l2) + *add_it;
*target_it = vect_sp(linalg_traits<L1>::row(itr), l2) + *add_it;
}
template <typename L1, typename L2, typename L3>
@ -1931,8 +1881,7 @@ namespace gmm {
template <typename L1, typename L2, typename L3>
void mult_add_by_col(const L1& l1, const L2& l2, L3& l3, abstract_sparse) {
typename linalg_traits<L2>::const_iterator it = vect_const_begin(l2),
ite = vect_const_end(l2);
auto it = vect_const_begin(l2), ite = vect_const_end(l2);
for (; it != ite; ++it)
if (*it != typename linalg_traits<L2>::value_type(0))
add(scaled(mat_const_col(l1, it.index()), *it), l3);
@ -1940,8 +1889,7 @@ namespace gmm {
template <typename L1, typename L2, typename L3>
void mult_add_by_col(const L1& l1, const L2& l2, L3& l3, abstract_skyline) {
typename linalg_traits<L2>::const_iterator it = vect_const_begin(l2),
ite = vect_const_end(l2);
auto it = vect_const_begin(l2), ite = vect_const_end(l2);
for (; it != ite; ++it)
if (*it != typename linalg_traits<L2>::value_type(0))
add(scaled(mat_const_col(l1, it.index()), *it), l3);
@ -1954,7 +1902,7 @@ namespace gmm {
template <typename L1, typename L2, typename L3, typename L4> inline
void mult_add_spec(const L1& l1, const L2& l2, const L3& l3, L4& l4, row_major)
{ mult_add_by_row(l1, l2, l3, l4, typename linalg_traits<L3>::storage_type()); }
template <typename L1, typename L2, typename L3> inline
void mult_add_spec(const L1& l1, const L2& l2, L3& l3, col_major)
{ mult_add_by_col(l1, l2, l3, typename linalg_traits<L2>::storage_type()); }
@ -2113,8 +2061,7 @@ namespace gmm {
linalg_traits<L3>::sub_orientation>::potype());
}
else {
typename linalg_traits<L2>::const_col_iterator
it2b = linalg_traits<L2>::col_begin(l2), it2,
auto it2b = linalg_traits<L2>::col_begin(l2), it2 = it2b,
ite = linalg_traits<L2>::col_end(l2);
size_type i,j, k = mat_nrows(l1);
@ -2152,8 +2099,7 @@ namespace gmm {
size_type nn = mat_nrows(l3);
for (size_type i = 0; i < nn; ++i) {
typename linalg_traits<L1>::const_sub_row_type rl1=mat_const_row(l1, i);
typename linalg_traits<typename linalg_traits<L1>::const_sub_row_type>::
const_iterator it = vect_const_begin(rl1), ite = vect_const_end(rl1);
auto it = vect_const_begin(rl1), ite = vect_const_end(rl1);
for (; it != ite; ++it)
add(scaled(mat_const_row(l2, it.index()), *it), mat_row(l3, i));
}
@ -2194,9 +2140,8 @@ namespace gmm {
clear(l3);
size_type nn = mat_ncols(l3);
for (size_type i = 0; i < nn; ++i) {
typename linalg_traits<L2>::const_sub_col_type rc2=mat_const_col(l2, i);
typename linalg_traits<typename linalg_traits<L2>::const_sub_col_type>::
const_iterator it = vect_const_begin(rc2), ite = vect_const_end(rc2);
typename linalg_traits<L2>::const_sub_col_type rc2 = mat_const_col(l2, i);
auto it = vect_const_begin(rc2), ite = vect_const_end(rc2);
for (; it != ite; ++it)
add(scaled(mat_const_col(l1, it.index()), *it), mat_col(l3, i));
}
@ -2246,9 +2191,8 @@ namespace gmm {
clear(l3);
size_type nn = mat_ncols(l1);
for (size_type i = 0; i < nn; ++i) {
typename linalg_traits<L1>::const_sub_col_type rc1=mat_const_col(l1, i);
typename linalg_traits<typename linalg_traits<L1>::const_sub_col_type>::
const_iterator it = vect_const_begin(rc1), ite = vect_const_end(rc1);
typename linalg_traits<L1>::const_sub_col_type rc1 = mat_const_col(l1, i);
auto it = vect_const_begin(rc1), ite = vect_const_end(rc1);
for (; it != ite; ++it)
add(scaled(mat_const_row(l2, i), *it), mat_row(l3, it.index()));
}
@ -2299,10 +2243,8 @@ namespace gmm {
bool is_symmetric(const MAT &A, magnitude_of_linalg(MAT) tol,
row_major) {
for (size_type i = 0; i < mat_nrows(A); ++i) {
typedef typename linalg_traits<MAT>::const_sub_row_type row_type;
row_type row = mat_const_row(A, i);
typename linalg_traits<row_type>::const_iterator
it = vect_const_begin(row), ite = vect_const_end(row);
typename linalg_traits<MAT>::const_sub_row_type row = mat_const_row(A, i);
auto it = vect_const_begin(row), ite = vect_const_end(row);
for (; it != ite; ++it)
if (gmm::abs(*it - A(it.index(), i)) > tol) return false;
}
@ -2313,10 +2255,8 @@ namespace gmm {
bool is_symmetric(const MAT &A, magnitude_of_linalg(MAT) tol,
col_major) {
for (size_type i = 0; i < mat_ncols(A); ++i) {
typedef typename linalg_traits<MAT>::const_sub_col_type col_type;
col_type col = mat_const_col(A, i);
typename linalg_traits<col_type>::const_iterator
it = vect_const_begin(col), ite = vect_const_end(col);
typename linalg_traits<MAT>::const_sub_col_type col = mat_const_col(A, i);
auto it = vect_const_begin(col), ite = vect_const_end(col);
for (; it != ite; ++it)
if (gmm::abs(*it - A(i, it.index())) > tol) return false;
}
@ -2364,10 +2304,8 @@ namespace gmm {
bool is_hermitian(const MAT &A, magnitude_of_linalg(MAT) tol,
row_major) {
for (size_type i = 0; i < mat_nrows(A); ++i) {
typedef typename linalg_traits<MAT>::const_sub_row_type row_type;
row_type row = mat_const_row(A, i);
typename linalg_traits<row_type>::const_iterator
it = vect_const_begin(row), ite = vect_const_end(row);
typename linalg_traits<MAT>::const_sub_row_type row = mat_const_row(A, i);
auto it = vect_const_begin(row), ite = vect_const_end(row);
for (; it != ite; ++it)
if (gmm::abs(gmm::conj(*it) - A(it.index(), i)) > tol) return false;
}
@ -2378,10 +2316,8 @@ namespace gmm {
bool is_hermitian(const MAT &A, magnitude_of_linalg(MAT) tol,
col_major) {
for (size_type i = 0; i < mat_ncols(A); ++i) {
typedef typename linalg_traits<MAT>::const_sub_col_type col_type;
col_type col = mat_const_col(A, i);
typename linalg_traits<col_type>::const_iterator
it = vect_const_begin(col), ite = vect_const_end(col);
typename linalg_traits<MAT>::const_sub_col_type col = mat_const_col(A, i);
auto it = vect_const_begin(col), ite = vect_const_end(col);
for (; it != ite; ++it)
if (gmm::abs(gmm::conj(*it) - A(i, it.index())) > tol) return false;
}

48
resources/3rdparty/gmm-5.0/include/gmm/gmm_blas_interface.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_blas_interface.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_blas_interface.h
@ -47,6 +47,8 @@
namespace gmm {
// Use ./configure --enable-blas-interface to activate this interface.
#define GMMLAPACK_TRACE(f)
// #define GMMLAPACK_TRACE(f) cout << "function " << f << " called" << endl;
@ -168,16 +170,18 @@ namespace gmm {
void sger_(...); void dger_(...); void cgerc_(...); void zgerc_(...);
}
#if 1
/* ********************************************************************* */
/* vect_norm2(x). */
/* ********************************************************************* */
# define nrm2_interface(param1, trans1, blas_name, base_type) \
inline number_traits<base_type >::magnitude_type \
vect_norm2(param1(base_type)) { \
GMMLAPACK_TRACE("nrm2_interface"); \
int inc(1), n(int(vect_size(x))); trans1(base_type); \
return blas_name(&n, &x[0], &inc); \
# define nrm2_interface(param1, trans1, blas_name, base_type) \
inline number_traits<base_type >::magnitude_type \
vect_norm2(param1(base_type)) { \
GMMLAPACK_TRACE("nrm2_interface"); \
int inc(1), n(int(vect_size(x))); trans1(base_type); \
return blas_name(&n, &x[0], &inc); \
}
# define nrm2_p1(base_type) const std::vector<base_type > &x
@ -192,7 +196,7 @@ namespace gmm {
/* vect_sp(x, y). */
/* ********************************************************************* */
# define dot_interface(param1, trans1, mult1, param2, trans2, mult2, \
# define dot_interface(param1, trans1, mult1, param2, trans2, mult2, \
blas_name, base_type) \
inline base_type vect_sp(param1(base_type), param2(base_type)) { \
GMMLAPACK_TRACE("dot_interface"); \
@ -259,8 +263,8 @@ namespace gmm {
/* vect_hp(x, y). */
/* ********************************************************************* */
# define dotc_interface(param1, trans1, mult1, param2, trans2, mult2, \
blas_name, base_type) \
# define dotc_interface(param1, trans1, mult1, param2, trans2, mult2, \
blas_name, base_type) \
inline base_type vect_hp(param1(base_type), param2(base_type)) { \
GMMLAPACK_TRACE("dotc_interface"); \
trans1(base_type); trans2(base_type); int inc(1), n(int(vect_size(y)));\
@ -329,6 +333,7 @@ namespace gmm {
inline void add(param1(base_type), std::vector<base_type > &y) { \
GMMLAPACK_TRACE("axpy_interface"); \
int inc(1), n(int(vect_size(y))); trans1(base_type); \
if (n == 0) return; \
blas_name(&n, &a, &x[0], &inc, &y[0], &inc); \
}
@ -690,7 +695,7 @@ namespace gmm {
# define gemm_interface_nt(blas_name, base_type, is_const) \
inline void mult_spec(const dense_matrix<base_type > &A, \
const transposed_col_ref<is_const<base_type > *> &B_,\
const transposed_col_ref<is_const<base_type > *> &B_, \
dense_matrix<base_type > &C, r_mult) { \
GMMLAPACK_TRACE("gemm_interface_nt"); \
dense_matrix<base_type > &B \
@ -721,9 +726,9 @@ namespace gmm {
# define gemm_interface_tt(blas_name, base_type, isA_const, isB_const) \
inline void mult_spec( \
const transposed_col_ref<isA_const <base_type > *> &A_,\
const transposed_col_ref<isB_const <base_type > *> &B_,\
dense_matrix<base_type > &C, r_mult) { \
const transposed_col_ref<isA_const <base_type > *> &A_, \
const transposed_col_ref<isB_const <base_type > *> &B_, \
dense_matrix<base_type > &C, r_mult) { \
GMMLAPACK_TRACE("gemm_interface_tt"); \
dense_matrix<base_type > &A \
= const_cast<dense_matrix<base_type > &>(*(linalg_origin(A_))); \
@ -935,6 +940,7 @@ namespace gmm {
trsv_interface(upper_tri_solve, trsv_lower, gem_p1_c, gem_trans1_c,
ztrsv_, BLAS_Z)
#endif
}
#endif // GMM_BLAS_INTERFACE_H

20
resources/3rdparty/gmm-5.0/include/gmm/gmm_condition_number.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_condition_number.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard, Julien Pommier
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard, Julien Pommier
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_condition_number.h
@ -60,6 +60,10 @@ namespace gmm {
typedef typename linalg_traits<MAT>::value_type T;
typedef typename number_traits<T>::magnitude_type R;
// Added because of errors in complex with zero det
if (sizeof(T) != sizeof(R) && gmm::abs(gmm::lu_det(M)) == R(0))
return gmm::default_max(R());
size_type m = mat_nrows(M), n = mat_ncols(M);
emax = emin = R(0);
std::vector<R> eig(m+n);

152
resources/3rdparty/gmm-5.0/include/gmm/gmm_conjugated.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_conjugated.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_conjugated.h
@ -195,40 +195,6 @@ namespace gmm {
{ return gmm::conj(linalg_traits<M>::access(begin_+j, i)); }
};
template <typename M>
struct linalg_traits<conjugated_row_matrix_const_ref<M> > {
typedef conjugated_row_matrix_const_ref<M> this_type;
typedef typename linalg_traits<M>::origin_type origin_type;
typedef linalg_const is_reference;
typedef abstract_matrix linalg_type;
typedef typename linalg_traits<M>::value_type value_type;
typedef value_type reference;
typedef typename linalg_traits<M>::storage_type storage_type;
typedef typename linalg_traits<M>::const_sub_row_type vector_type;
typedef conjugated_vector_const_ref<vector_type> sub_col_type;
typedef conjugated_vector_const_ref<vector_type> const_sub_col_type;
typedef conjugated_row_const_iterator<M> col_iterator;
typedef conjugated_row_const_iterator<M> const_col_iterator;
typedef abstract_null_type const_sub_row_type;
typedef abstract_null_type sub_row_type;
typedef abstract_null_type const_row_iterator;
typedef abstract_null_type row_iterator;
typedef col_major sub_orientation;
typedef typename linalg_traits<M>::index_sorted index_sorted;
static inline size_type ncols(const this_type &m) { return m.nc; }
static inline size_type nrows(const this_type &m) { return m.nr; }
static inline const_sub_col_type col(const const_col_iterator &it)
{ return conjugated(linalg_traits<M>::row(it.it)); }
static inline const_col_iterator col_begin(const this_type &m)
{ return const_col_iterator(m.begin_); }
static inline const_col_iterator col_end(const this_type &m)
{ return const_col_iterator(m.end_); }
static inline const origin_type* origin(const this_type &m)
{ return m.origin; }
static value_type access(const const_col_iterator &it, size_type i)
{ return gmm::conj(linalg_traits<M>::access(it.it, i)); }
};
template<typename M> std::ostream &operator <<
(std::ostream &o, const conjugated_row_matrix_const_ref<M>& m)
{ gmm::write(o,m); return o; }
@ -287,39 +253,7 @@ namespace gmm {
{ return gmm::conj(linalg_traits<M>::access(begin_+i, j)); }
};
template <typename M>
struct linalg_traits<conjugated_col_matrix_const_ref<M> > {
typedef conjugated_col_matrix_const_ref<M> this_type;
typedef typename linalg_traits<M>::origin_type origin_type;
typedef linalg_const is_reference;
typedef abstract_matrix linalg_type;
typedef typename linalg_traits<M>::value_type value_type;
typedef value_type reference;
typedef typename linalg_traits<M>::storage_type storage_type;
typedef typename linalg_traits<M>::const_sub_col_type vector_type;
typedef conjugated_vector_const_ref<vector_type> sub_row_type;
typedef conjugated_vector_const_ref<vector_type> const_sub_row_type;
typedef conjugated_col_const_iterator<M> row_iterator;
typedef conjugated_col_const_iterator<M> const_row_iterator;
typedef abstract_null_type const_sub_col_type;
typedef abstract_null_type sub_col_type;
typedef abstract_null_type const_col_iterator;
typedef abstract_null_type col_iterator;
typedef row_major sub_orientation;
typedef typename linalg_traits<M>::index_sorted index_sorted;
static inline size_type nrows(const this_type &m) { return m.nr; }
static inline size_type ncols(const this_type &m) { return m.nc; }
static inline const_sub_row_type row(const const_row_iterator &it)
{ return conjugated(linalg_traits<M>::col(it.it)); }
static inline const_row_iterator row_begin(const this_type &m)
{ return const_row_iterator(m.begin_); }
static inline const_row_iterator row_end(const this_type &m)
{ return const_row_iterator(m.end_); }
static inline const origin_type* origin(const this_type &m)
{ return m.origin; }
static value_type access(const const_row_iterator &it, size_type i)
{ return gmm::conj(linalg_traits<M>::access(it.it, i)); }
};
template<typename M> std::ostream &operator <<
(std::ostream &o, const conjugated_col_matrix_const_ref<M>& m)
@ -387,6 +321,74 @@ namespace gmm {
template <typename L> inline
conjugated_col_matrix_const_ref<L> conjugated(const L &v, col_major)
{ return conjugated_col_matrix_const_ref<L>(v); }
template <typename M>
struct linalg_traits<conjugated_row_matrix_const_ref<M> > {
typedef conjugated_row_matrix_const_ref<M> this_type;
typedef typename linalg_traits<M>::origin_type origin_type;
typedef linalg_const is_reference;
typedef abstract_matrix linalg_type;
typedef typename linalg_traits<M>::value_type value_type;
typedef value_type reference;
typedef typename linalg_traits<M>::storage_type storage_type;
typedef typename org_type<typename linalg_traits<M>::const_sub_row_type>::t vector_type;
typedef conjugated_vector_const_ref<vector_type> sub_col_type;
typedef conjugated_vector_const_ref<vector_type> const_sub_col_type;
typedef conjugated_row_const_iterator<M> col_iterator;
typedef conjugated_row_const_iterator<M> const_col_iterator;
typedef abstract_null_type const_sub_row_type;
typedef abstract_null_type sub_row_type;
typedef abstract_null_type const_row_iterator;
typedef abstract_null_type row_iterator;
typedef col_major sub_orientation;
typedef typename linalg_traits<M>::index_sorted index_sorted;
static inline size_type ncols(const this_type &m) { return m.nc; }
static inline size_type nrows(const this_type &m) { return m.nr; }
static inline const_sub_col_type col(const const_col_iterator &it)
{ return conjugated(linalg_traits<M>::row(it.it)); }
static inline const_col_iterator col_begin(const this_type &m)
{ return const_col_iterator(m.begin_); }
static inline const_col_iterator col_end(const this_type &m)
{ return const_col_iterator(m.end_); }
static inline const origin_type* origin(const this_type &m)
{ return m.origin; }
static value_type access(const const_col_iterator &it, size_type i)
{ return gmm::conj(linalg_traits<M>::access(it.it, i)); }
};
template <typename M>
struct linalg_traits<conjugated_col_matrix_const_ref<M> > {
typedef conjugated_col_matrix_const_ref<M> this_type;
typedef typename linalg_traits<M>::origin_type origin_type;
typedef linalg_const is_reference;
typedef abstract_matrix linalg_type;
typedef typename linalg_traits<M>::value_type value_type;
typedef value_type reference;
typedef typename linalg_traits<M>::storage_type storage_type;
typedef typename org_type<typename linalg_traits<M>::const_sub_col_type>::t vector_type;
typedef conjugated_vector_const_ref<vector_type> sub_row_type;
typedef conjugated_vector_const_ref<vector_type> const_sub_row_type;
typedef conjugated_col_const_iterator<M> row_iterator;
typedef conjugated_col_const_iterator<M> const_row_iterator;
typedef abstract_null_type const_sub_col_type;
typedef abstract_null_type sub_col_type;
typedef abstract_null_type const_col_iterator;
typedef abstract_null_type col_iterator;
typedef row_major sub_orientation;
typedef typename linalg_traits<M>::index_sorted index_sorted;
static inline size_type nrows(const this_type &m) { return m.nr; }
static inline size_type ncols(const this_type &m) { return m.nc; }
static inline const_sub_row_type row(const const_row_iterator &it)
{ return conjugated(linalg_traits<M>::col(it.it)); }
static inline const_row_iterator row_begin(const this_type &m)
{ return const_row_iterator(m.begin_); }
static inline const_row_iterator row_end(const this_type &m)
{ return const_row_iterator(m.end_); }
static inline const origin_type* origin(const this_type &m)
{ return m.origin; }
static value_type access(const const_row_iterator &it, size_type i)
{ return gmm::conj(linalg_traits<M>::access(it.it, i)); }
};
///@endcond

50
resources/3rdparty/gmm-5.0/include/gmm/gmm_def.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_def.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_def.h
@ -221,23 +221,33 @@ namespace gmm {
};
/* ******************************************************************** */
/* types to deal with const object representing a modifiable reference */
/* Original type from a pointer or a reference. */
/* ******************************************************************** */
template <typename V> struct org_type { typedef V t; };
template <typename V> struct org_type<V *> { typedef V t; };
template <typename V> struct org_type<const V *> { typedef V t; };
template <typename V> struct org_type<V &> { typedef V t; };
template <typename V> struct org_type<const V &> { typedef V t; };
/* ******************************************************************** */
/* Types to deal with const object representing a modifiable reference */
/* ******************************************************************** */
template <typename PT, typename R> struct mref_type_
{ typedef abstract_null_type return_type; };
template <typename L, typename R> struct mref_type_<L *, R>
{ typedef L & return_type; };
{ typedef typename org_type<L>::t & return_type; };
template <typename L, typename R> struct mref_type_<const L *, R>
{ typedef const L & return_type; };
{ typedef const typename org_type<L>::t & return_type; };
template <typename L> struct mref_type_<L *, linalg_const>
{ typedef const L & return_type; };
{ typedef const typename org_type<L>::t & return_type; };
template <typename L> struct mref_type_<const L *, linalg_const>
{ typedef const L & return_type; };
{ typedef const typename org_type<L>::t & return_type; };
template <typename L> struct mref_type_<const L *, linalg_modifiable>
{ typedef L & return_type; };
{ typedef typename org_type<L>::t & return_type; };
template <typename L> struct mref_type_<L *, linalg_modifiable>
{ typedef L & return_type; };
{ typedef typename org_type<L>::t & return_type; };
template <typename PT> struct mref_type {
typedef typename std::iterator_traits<PT>::value_type L;
@ -255,7 +265,7 @@ namespace gmm {
template <typename L, typename R> struct cref_type_
{ typedef abstract_null_type return_type; };
template <typename L> struct cref_type_<L, linalg_modifiable>
{ typedef L & return_type; };
{ typedef typename org_type<L>::t & return_type; };
template <typename L> struct cref_type {
typedef typename cref_type_<L,
typename linalg_traits<L>::is_reference>::return_type return_type;
@ -409,13 +419,6 @@ namespace gmm {
# define magnitude_of_linalg(M) typename number_traits<typename \
linalg_traits<M>::value_type>::magnitude_type
template<typename T> inline std::complex<T> operator*(const std::complex<T>& a, int b) {
return a*T(b);
}
template<typename T> inline std::complex<T> operator*(int b, const std::complex<T>& a) {
return a*T(b);
}
/* ******************************************************************** */
/* types promotion */
/* ******************************************************************** */
@ -483,6 +486,7 @@ namespace gmm {
template <typename T> class wsvector;
template <typename T> class rsvector;
template <typename T> class dsvector;
template<typename T> struct sparse_vector_type
{ typedef wsvector<T> vector_type; };

24
resources/3rdparty/gmm-5.0/include/gmm/gmm_dense_Householder.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_dense_Householder.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard, Caroline Lecalvez
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard, Caroline Lecalvez
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_dense_Householder.h
@ -59,7 +59,7 @@ namespace gmm {
for (size_type i = 0; i < N; ++i, ++itx) {
typedef typename linalg_traits<Matrix>::sub_row_type row_type;
row_type row = mat_row(A, i);
typename linalg_traits<row_type>::iterator
typename linalg_traits<typename org_type<row_type>::t>::iterator
it = vect_begin(row), ite = vect_end(row);
typename linalg_traits<VecY>::const_iterator ity = vect_const_begin(y);
T tx = *itx;
@ -78,7 +78,7 @@ namespace gmm {
for (size_type i = 0; i < M; ++i, ++ity) {
typedef typename linalg_traits<Matrix>::sub_col_type col_type;
col_type col = mat_col(A, i);
typename linalg_traits<col_type>::iterator
typename linalg_traits<typename org_type<col_type>::t>::iterator
it = vect_begin(col), ite = vect_end(col);
typename linalg_traits<VecX>::const_iterator itx = vect_const_begin(x);
T ty = *ity;
@ -112,7 +112,7 @@ namespace gmm {
for (size_type i = 0; i < N; ++i, ++itx1, ++ity2) {
typedef typename linalg_traits<Matrix>::sub_row_type row_type;
row_type row = mat_row(A, i);
typename linalg_traits<row_type>::iterator
typename linalg_traits<typename org_type<row_type>::t>::iterator
it = vect_begin(row), ite = vect_end(row);
typename linalg_traits<VecX>::const_iterator itx2 = vect_const_begin(x);
typename linalg_traits<VecY>::const_iterator ity1 = vect_const_begin(y);
@ -134,7 +134,7 @@ namespace gmm {
for (size_type i = 0; i < M; ++i, ++ity1, ++itx2) {
typedef typename linalg_traits<Matrix>::sub_col_type col_type;
col_type col = mat_col(A, i);
typename linalg_traits<col_type>::iterator
typename linalg_traits<typename org_type<col_type>::t>::iterator
it = vect_begin(col), ite = vect_end(col);
typename linalg_traits<VecX>::const_iterator itx1 = vect_const_begin(x);
typename linalg_traits<VecY>::const_iterator ity2 = vect_const_begin(y);

18
resources/3rdparty/gmm-5.0/include/gmm/gmm_dense_lu.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_dense_lu.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
// This file is a modified version of lu.h from MTL.
@ -112,7 +112,7 @@ namespace gmm {
rank_one_update(sub_matrix(A, sub_interval(j+1, M-j-1),
sub_interval(j+1, N-j-1)), c, conjugated(r));
}
ipvt[j] = int_T(j + 1);
ipvt[NN-1] = int_T(NN);
}
return info;
}

6
resources/3rdparty/gmm-5.0/include/gmm/gmm_dense_matrix_functions.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_dense_matrix_functions.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2014-2015 Konstantinos Poulios
Copyright (C) 2014-2017 Konstantinos Poulios
This file is a part of GETFEM++
This file is a part of GetFEM++
Getfem++ is free software; you can redistribute it and/or modify it
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_dense_qr.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_dense_qr.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_dense_qr.h

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_dense_sylvester.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_dense_sylvester.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/** @file gmm_dense_sylvester.h

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_domain_decomp.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_domain_decomp.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2004-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2004-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/** @file gmm_domain_decomp.h

94
resources/3rdparty/gmm-5.0/include/gmm/gmm_except.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_except.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/** @file gmm_except.h
@ -39,15 +39,15 @@
#ifndef GMM_EXCEPT_H__
#define GMM_EXCEPT_H__
#include "gmm_std.h"
//provides external implementation of gmm_exception and logging.
#ifndef EXTERNAL_EXCEPT_
#include "gmm_std.h"
namespace gmm {
/* *********************************************************************** */
/* Getfem++ generic errors. */
/* GetFEM++ generic errors. */
/* *********************************************************************** */
class gmm_error: public std::logic_error {
@ -69,14 +69,14 @@ namespace gmm {
// defined.
// GMM_ASSERT3 : For internal checks. Hidden by default. Active
// only when DEBUG_MODE is defined.
// __EXCEPTIONS is defined by gcc, _CPPUNWIND is defined by visual c++
// __EXCEPTIONS is defined by gcc, _CPPUNWIND is defined by visual c++
#if defined(__EXCEPTIONS) || defined(_CPPUNWIND)
inline void short_error_throw(const char *file, int line, const char *func,
const char *errormsg) {
std::stringstream msg__;
msg__ << "Error in " << file << ", line " << line << " " << func
<< ": \n" << errormsg << std::ends;
throw gmm::gmm_error(msg__.str());
throw gmm::gmm_error(msg__.str());
}
# define GMM_THROW_(type, errormsg) { \
std::stringstream msg__; \
@ -115,7 +115,6 @@ namespace gmm {
# define GMM_ASSERT1(test, errormsg) \
{ if (!(test)) GMM_THROW_(gmm::gmm_error, errormsg); }
// inline void GMM_THROW() IS_DEPRECATED;
inline void GMM_THROW() {}
#define GMM_THROW(a, b) { GMM_THROW_(a,b); gmm::GMM_THROW(); }
@ -134,7 +133,7 @@ namespace gmm {
#endif
/* *********************************************************************** */
/* Getfem++ warnings. */
/* GetFEM++ warnings. */
/* *********************************************************************** */
// This allows to dynamically hide warnings
@ -195,7 +194,7 @@ namespace gmm {
#endif
/* *********************************************************************** */
/* Getfem++ traces. */
/* GetFEM++ traces. */
/* *********************************************************************** */
// This allows to dynamically hide traces
@ -262,66 +261,51 @@ namespace gmm {
/* Definitions for compatibility with old versions. */
/* ********************************************************************* */
using std::invalid_argument;
struct dimension_error : public std::logic_error
{ dimension_error(const std::string& w): std::logic_error(w) {} };
struct file_not_found_error : public std::logic_error
{ file_not_found_error(const std::string& w): std::logic_error (w) {} };
struct internal_error : public std::logic_error
{ internal_error(const std::string& w): std::logic_error(w) {} };
struct failure_error : public std::logic_error
{ failure_error(const std::string& w): std::logic_error (w) {} };
struct not_linear_error : public std::logic_error
{ not_linear_error(const std::string& w): std::logic_error (w) {} };
struct to_be_done_error : public std::logic_error
{ to_be_done_error(const std::string& w): std::logic_error (w) {} };
#define GMM_STANDARD_CATCH_ERROR catch(std::logic_error e) \
{ \
#define GMM_STANDARD_CATCH_ERROR catch(std::logic_error e) \
{ \
std::cerr << "============================================\n"; \
std::cerr << "| An error has been detected !!! |\n"; \
std::cerr << "============================================\n"; \
std::cerr << e.what() << std::endl << std::endl; \
exit(1); \
} \
catch(std::runtime_error e) \
{ \
std::cerr << e.what() << std::endl << std::endl; \
exit(1); \
} \
catch(const std::runtime_error &e) \
{ \
std::cerr << "============================================\n"; \
std::cerr << "| An error has been detected !!! |\n"; \
std::cerr << "============================================\n"; \
std::cerr << e.what() << std::endl << std::endl; \
exit(1); \
} \
catch(std::bad_alloc) { \
std::cerr << e.what() << std::endl << std::endl; \
exit(1); \
} \
catch(const std::bad_alloc &) { \
std::cerr << "============================================\n"; \
std::cerr << "| A bad allocation has been detected !!! |\n"; \
std::cerr << "============================================\n"; \
exit(1); \
} \
catch(std::bad_typeid) { \
exit(1); \
} \
catch(const std::bad_typeid &) { \
std::cerr << "============================================\n"; \
std::cerr << "| A bad typeid has been detected !!! |\n"; \
std::cerr << "============================================\n"; \
exit(1); \
} \
catch(std::bad_exception) { \
exit(1); \
} \
catch(const std::bad_exception &) { \
std::cerr << "============================================\n"; \
std::cerr << "| A bad exception has been detected !!! |\n"; \
std::cerr << "============================================\n"; \
exit(1); \
} \
catch(std::bad_cast) { \
exit(1); \
} \
catch(const std::bad_cast &) { \
std::cerr << "============================================\n"; \
std::cerr << "| A bad cast has been detected !!! |\n"; \
std::cerr << "============================================\n"; \
exit(1); \
} \
catch(...) { \
exit(1); \
} \
catch(...) { \
std::cerr << "============================================\n"; \
std::cerr << "| An unknown error has been detected !!! |\n"; \
std::cerr << "============================================\n"; \
exit(1); \
exit(1); \
}
// catch(ios_base::failure) {
// std::cerr << "============================================\n";

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_inoutput.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_inoutput.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard, Julien Pommier
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard, Julien Pommier
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_inoutput.h

29
resources/3rdparty/gmm-5.0/include/gmm/gmm_interface.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_interface.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
@ -194,6 +194,12 @@ namespace gmm {
std::ostream &operator << (std::ostream &o, const simple_vector_ref<PT>& v)
{ gmm::write(o,v); return o; }
template <typename T, typename alloc>
simple_vector_ref<const std::vector<T,alloc> *>
vref(const std::vector<T, alloc> &vv)
{ return simple_vector_ref<const std::vector<T,alloc> *>(vv); }
/* ********************************************************************* */
/* */
/* Traits for S.T.L. object */
@ -230,12 +236,9 @@ namespace gmm {
{ return it[i]; }
static void resize(this_type &v, size_type n) { v.resize(n); }
};
}
namespace gmm {
template <typename T> std::ostream &operator <<
(std::ostream &o, const std::vector<T>& m) { gmm::write(o,m); return o; }
template <typename T>
inline size_type nnz(const std::vector<T>& l) { return l.size(); }

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_interface_bgeot.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_interface_bgeot.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_interface_bgeot.h

34
resources/3rdparty/gmm-5.0/include/gmm/gmm_iter.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_iter.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_iter.h
@ -111,17 +111,23 @@ namespace gmm {
double get_rhsnorm(void) const { return rhsn; }
void set_rhsnorm(double r) { rhsn = r; }
bool converged(void) { return res <= rhsn * resmax; }
bool converged(void) {
return !isnan(res) && res <= rhsn * resmax;
}
bool converged(double nr) {
res = gmm::abs(nr); resminreach = std::min(resminreach, res);
res = gmm::abs(nr);
resminreach = std::min(resminreach, res);
return converged();
}
template <typename VECT> bool converged(const VECT &v)
{ return converged(gmm::vect_norm2(v)); }
bool diverged(void)
{ return (nit>=maxiter) || (res>=rhsn*diverged_res && nit > 4); }
bool diverged(double nr) {
res = gmm::abs(nr); resminreach = std::min(resminreach, res);
bool diverged(void) {
return isnan(res) || (nit>=maxiter)
|| (res>=rhsn*diverged_res && nit > 4);
}
bool diverged(double nr) {
res = gmm::abs(nr);
resminreach = std::min(resminreach, res);
return diverged();
}

19
resources/3rdparty/gmm-5.0/include/gmm/gmm_iter_solvers.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_iter_solvers.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_iter_solvers.h
@ -70,7 +70,8 @@ namespace gmm {
c = std::max(a, b); a = std::min(a, b); b = c;
while (d > tol) {
c = b - (b - a) * (Gb / (Gb - Ga)); /* regula falsi. */
if (c > b) c = b; if (c < a) c = a;
if (c > b) c = b;
if (c < a) c = a;
Gc = G(c);
if (Gc*Gb > 0) { b = c; Gb = Gc; } else { a = c; Ga = Gc; }
c = (b + a) / 2.0 ; Gc = G(c); /* Dichotomie. */

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_kernel.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_kernel.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_kernel.h

31
resources/3rdparty/gmm-5.0/include/gmm/gmm_lapack_interface.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_lapack_interface.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_lapack_interface.h
@ -149,14 +149,11 @@ namespace gmm {
void lu_inverse(const dense_matrix<base_type > &LU, \
std::vector<int> &ipvt, const dense_matrix<base_type > &A_) { \
GMMLAPACK_TRACE("getri_interface"); \
dense_matrix<base_type >& \
A = const_cast<dense_matrix<base_type > &>(A_); \
int n = int(mat_nrows(A)), info, lwork(-1); base_type work1; \
dense_matrix<base_type> &A \
= const_cast<dense_matrix<base_type > &>(A_); \
int n = int(mat_nrows(A)), info, lwork(10000); base_type work[10000]; \
if (n) { \
gmm::copy(LU, A); \
lapack_name(&n, &A(0,0), &n, &ipvt[0], &work1, &lwork, &info); \
lwork = int(gmm::real(work1)); \
std::vector<base_type > work(lwork); \
std::copy(LU.begin(), LU.end(), A.begin()); \
lapack_name(&n, &A(0,0), &n, &ipvt[0], &work[0], &lwork, &info); \
} \
}
@ -199,8 +196,8 @@ namespace gmm {
GMMLAPACK_TRACE("geqrf_interface2"); \
int m = int(mat_nrows(A)), n = int(mat_ncols(A)), info, lwork(-1); \
base_type work1; \
if (m && n) { \
gmm::copy(A, Q); \
if (m && n) { \
std::copy(A.begin(), A.end(), Q.begin()); \
std::vector<base_type > tau(n); \
lapack_name1(&m, &n, &Q(0,0), &m, &tau[0], &work1 , &lwork, &info); \
lwork = int(gmm::real(work1)); \

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_least_squares_cg.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_least_squares_cg.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard, Benjamin Schleimer
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard, Benjamin Schleimer
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_leastsquares_cg.h

37
resources/3rdparty/gmm-5.0/include/gmm/gmm_matrix.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_matrix.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/** @file gmm_matrix.h
@ -193,8 +193,8 @@ namespace gmm
typedef typename linalg_traits<V>::value_type value_type;
typedef typename linalg_traits<V>::reference reference;
typedef typename linalg_traits<V>::storage_type storage_type;
typedef simple_vector_ref<V *> sub_row_type;
typedef simple_vector_ref<const V *> const_sub_row_type;
typedef V & sub_row_type;
typedef const V & const_sub_row_type;
typedef typename std::vector<V>::iterator row_iterator;
typedef typename std::vector<V>::const_iterator const_row_iterator;
typedef abstract_null_type sub_col_type;
@ -299,8 +299,8 @@ namespace gmm
typedef typename linalg_traits<V>::value_type value_type;
typedef typename linalg_traits<V>::reference reference;
typedef typename linalg_traits<V>::storage_type storage_type;
typedef simple_vector_ref<V *> sub_col_type;
typedef simple_vector_ref<const V *> const_sub_col_type;
typedef V &sub_col_type;
typedef const V &const_sub_col_type;
typedef typename std::vector<V>::iterator col_iterator;
typedef typename std::vector<V>::const_iterator const_col_iterator;
typedef abstract_null_type sub_row_type;
@ -318,9 +318,9 @@ namespace gmm
static const_col_iterator col_end(const this_type &m)
{ return m.end(); }
static const_sub_col_type col(const const_col_iterator &it)
{ return const_sub_col_type(*it); }
{ return *it; }
static sub_col_type col(const col_iterator &it)
{ return sub_col_type(*it); }
{ return *it; }
static origin_type* origin(this_type &m) { return &m; }
static const origin_type* origin(const this_type &m) { return &m; }
static void do_clear(this_type &m) { m.clear_mat(); }
@ -369,6 +369,7 @@ namespace gmm
const std::vector<T> &as_vector(void) const { return *this; }
void resize(size_type, size_type);
void base_resize(size_type, size_type);
void reshape(size_type, size_type);
void fill(T a, T b = T(0));
@ -387,6 +388,10 @@ namespace gmm
nbl = m; nbc = n;
}
template<typename T> void dense_matrix<T>::base_resize(size_type m,
size_type n)
{ std::vector<T>::resize(n*m); nbl = m; nbc = n; }
template<typename T> void dense_matrix<T>::resize(size_type m, size_type n) {
if (n*m > nbc*nbl) std::vector<T>::resize(n*m);
if (m < nbl) {
@ -546,7 +551,7 @@ namespace gmm
ir.resize(jc[nc]);
for (size_type j = 0; j < nc; ++j) {
col_type col = mat_const_col(B, j);
typename linalg_traits<col_type>::const_iterator
typename linalg_traits<typename org_type<col_type>::t>::const_iterator
it = vect_const_begin(col), ite = vect_const_end(col);
for (size_type k = 0; it != ite; ++it, ++k) {
pr[jc[j]-shift+k] = *it;
@ -696,7 +701,7 @@ namespace gmm
ir.resize(jc[nr]);
for (size_type j = 0; j < nr; ++j) {
row_type row = mat_const_row(B, j);
typename linalg_traits<row_type>::const_iterator
typename linalg_traits<typename org_type<row_type>::t>::const_iterator
it = vect_const_begin(row), ite = vect_const_end(row);
for (size_type k = 0; it != ite; ++it, ++k) {
pr[jc[j]-shift+k] = *it;

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_modified_gram_schmidt.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_modified_gram_schmidt.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
//===========================================================================

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_opt.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_opt.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_opt.h

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_precond.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_precond.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2004-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2004-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
#ifndef GMM_PRECOND_H
#define GMM_PRECOND_H

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_precond_diagonal.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_diagonal.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_precond_diagonal.h

63
resources/3rdparty/gmm-5.0/include/gmm/gmm_precond_ildlt.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_ildlt.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
// This file is a modified version of cholesky.h from ITL.
@ -144,7 +144,7 @@ namespace gmm {
for (Tri_loc = 0, i = 0; i < n; ++i) {
typedef typename linalg_traits<M>::const_sub_row_type row_type;
row_type row = mat_const_row(A, i);
typename linalg_traits<row_type>::const_iterator
typename linalg_traits<typename org_type<row_type>::t>::const_iterator
it = vect_const_begin(row), ite = vect_const_end(row);
if (count) { Tri_val[Tri_loc] = T(0); Tri_ind[Tri_loc] = i; }
@ -235,51 +235,6 @@ namespace gmm {
{ copy(v1, v2); gmm::lower_tri_solve(gmm::conjugated(P.U), v2, true); }
// for compatibility with old versions
template <typename Matrix>
struct cholesky_precond : public ildlt_precond<Matrix> {
cholesky_precond(const Matrix& A) : ildlt_precond<Matrix>(A) {}
cholesky_precond(void) {}
} IS_DEPRECATED;
template <typename Matrix, typename V1, typename V2> inline
void mult(const cholesky_precond<Matrix>& P, const V1 &v1, V2 &v2) {
gmm::copy(v1, v2);
gmm::lower_tri_solve(gmm::conjugated(P.U), v2, true);
for (size_type i = 0; i < mat_nrows(P.U); ++i) v2[i] /= P.D(i);
gmm::upper_tri_solve(P.U, v2, true);
}
template <typename Matrix, typename V1, typename V2> inline
void transposed_mult(const cholesky_precond<Matrix>& P,const V1 &v1,V2 &v2)
{ mult(P, v1, v2); }
template <typename Matrix, typename V1, typename V2> inline
void left_mult(const cholesky_precond<Matrix>& P, const V1 &v1, V2 &v2) {
copy(v1, v2);
gmm::lower_tri_solve(gmm::conjugated(P.U), v2, true);
for (size_type i = 0; i < mat_nrows(P.U); ++i) v2[i] /= P.D(i);
}
template <typename Matrix, typename V1, typename V2> inline
void right_mult(const cholesky_precond<Matrix>& P, const V1 &v1, V2 &v2)
{ copy(v1, v2); gmm::upper_tri_solve(P.U, v2, true); }
template <typename Matrix, typename V1, typename V2> inline
void transposed_left_mult(const cholesky_precond<Matrix>& P, const V1 &v1,
V2 &v2) {
copy(v1, v2);
gmm::upper_tri_solve(P.U, v2, true);
for (size_type i = 0; i < mat_nrows(P.U); ++i) v2[i] /= P.D(i);
}
template <typename Matrix, typename V1, typename V2> inline
void transposed_right_mult(const cholesky_precond<Matrix>& P, const V1 &v1,
V2 &v2)
{ copy(v1, v2); gmm::lower_tri_solve(gmm::conjugated(P.U), v2, true); }
}
#endif

62
resources/3rdparty/gmm-5.0/include/gmm/gmm_precond_ildltt.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_ildltt.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_precond_ildltt.h
@ -168,52 +168,6 @@ namespace gmm {
V2 &v2)
{ copy(v1, v2); gmm::lower_tri_solve(gmm::conjugated(P.U), v2, true); }
// for compatibility with old versions
template <typename Matrix>
struct choleskyt_precond : public ildltt_precond<Matrix>{
choleskyt_precond(const Matrix& A, int k_, double eps_)
: ildltt_precond<Matrix>(A, k_, eps_) {}
choleskyt_precond(void) {}
} IS_DEPRECATED;
template <typename Matrix, typename V1, typename V2> inline
void mult(const choleskyt_precond<Matrix>& P, const V1 &v1, V2 &v2) {
gmm::copy(v1, v2);
gmm::lower_tri_solve(gmm::conjugated(P.U), v2, true);
for (size_type i = 0; i < P.indiag.size(); ++i) v2[i] *= P.indiag[i];
gmm::upper_tri_solve(P.U, v2, true);
}
template <typename Matrix, typename V1, typename V2> inline
void transposed_mult(const choleskyt_precond<Matrix>& P,const V1 &v1, V2 &v2)
{ mult(P, v1, v2); }
template <typename Matrix, typename V1, typename V2> inline
void left_mult(const choleskyt_precond<Matrix>& P, const V1 &v1, V2 &v2) {
copy(v1, v2);
gmm::lower_tri_solve(gmm::conjugated(P.U), v2, true);
for (size_type i = 0; i < P.indiag.size(); ++i) v2[i] *= P.indiag[i];
}
template <typename Matrix, typename V1, typename V2> inline
void right_mult(const choleskyt_precond<Matrix>& P, const V1 &v1, V2 &v2)
{ copy(v1, v2); gmm::upper_tri_solve(P.U, v2, true); }
template <typename Matrix, typename V1, typename V2> inline
void transposed_left_mult(const choleskyt_precond<Matrix>& P, const V1 &v1,
V2 &v2) {
copy(v1, v2);
gmm::upper_tri_solve(P.U, v2, true);
for (size_type i = 0; i < P.indiag.size(); ++i) v2[i] *= P.indiag[i];
}
template <typename Matrix, typename V1, typename V2> inline
void transposed_right_mult(const choleskyt_precond<Matrix>& P, const V1 &v1,
V2 &v2)
{ copy(v1, v2); gmm::lower_tri_solve(gmm::conjugated(P.U), v2, true); }
}
#endif

18
resources/3rdparty/gmm-5.0/include/gmm/gmm_precond_ilu.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_ilu.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
// This file is a modified version of ilu.h from ITL.
@ -142,7 +142,7 @@ namespace gmm {
for (i = 0; i < n; ++i) {
typedef typename linalg_traits<M>::const_sub_row_type row_type;
row_type row = mat_const_row(A, i);
typename linalg_traits<row_type>::const_iterator
typename linalg_traits<typename org_type<row_type>::t>::const_iterator
it = vect_const_begin(row), ite = vect_const_end(row);
if (count) { U_val[U_loc] = T(0); U_ind[U_loc] = i; }

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_precond_ilut.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_ilut.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
// This file is a modified version of ilut.h from ITL.

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_precond_ilutp.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_ilutp.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2004-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2004-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_precond_ilutp.h

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_precond_mr_approx_inverse.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_precond_mr_approx_inverse.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_range_basis.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_range_basis.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2009-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2009-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_range_basis.h

346
resources/3rdparty/gmm-5.0/include/gmm/gmm_real_part.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_real_part.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_real_part.h
@ -237,7 +237,163 @@ namespace gmm {
typedef typename linalg_traits<VECT>::V_reference ref_t;
set_to_end(it.it, o, typename linalg_traits<VECT>::pV(), ref_t());
}
template <typename PT, typename PART> std::ostream &operator <<
(std::ostream &o, const part_vector<PT, PART>& m)
{ gmm::write(o,m); return o; }
/* ********************************************************************* */
/* Reference to the real or imaginary part of (complex) matrices */
/* ********************************************************************* */
template <typename PT, typename PART> struct part_row_ref {
typedef part_row_ref<PT, PART> this_type;
typedef typename std::iterator_traits<PT>::value_type M;
typedef M * CPT;
typedef typename std::iterator_traits<PT>::reference ref_M;
typedef typename select_ref<typename linalg_traits<this_type>
::const_row_iterator, typename linalg_traits<this_type>
::row_iterator, PT>::ref_type iterator;
typedef typename linalg_traits<this_type>::value_type value_type;
typedef typename linalg_traits<this_type>::reference reference;
typedef typename linalg_traits<this_type>::porigin_type porigin_type;
iterator begin_, end_;
porigin_type origin;
size_type nr, nc;
part_row_ref(ref_M m)
: begin_(mat_row_begin(m)), end_(mat_row_end(m)),
origin(linalg_origin(m)), nr(mat_nrows(m)), nc(mat_ncols(m)) {}
part_row_ref(const part_row_ref<CPT, PART> &cr) :
begin_(cr.begin_),end_(cr.end_), origin(cr.origin),nr(cr.nr),nc(cr.nc) {}
reference operator()(size_type i, size_type j) const {
return reference(ref_or_value_type<reference>::r(
linalg_traits<M>::access(begin_+i, j),
PART(), value_type()));
}
};
template<typename PT, typename PART> std::ostream &operator <<
(std::ostream &o, const part_row_ref<PT, PART>& m)
{ gmm::write(o,m); return o; }
template <typename PT, typename PART> struct part_col_ref {
typedef part_col_ref<PT, PART> this_type;
typedef typename std::iterator_traits<PT>::value_type M;
typedef M * CPT;
typedef typename std::iterator_traits<PT>::reference ref_M;
typedef typename select_ref<typename linalg_traits<this_type>
::const_col_iterator, typename linalg_traits<this_type>
::col_iterator, PT>::ref_type iterator;
typedef typename linalg_traits<this_type>::value_type value_type;
typedef typename linalg_traits<this_type>::reference reference;
typedef typename linalg_traits<this_type>::porigin_type porigin_type;
iterator begin_, end_;
porigin_type origin;
size_type nr, nc;
part_col_ref(ref_M m)
: begin_(mat_col_begin(m)), end_(mat_col_end(m)),
origin(linalg_origin(m)), nr(mat_nrows(m)), nc(mat_ncols(m)) {}
part_col_ref(const part_col_ref<CPT, PART> &cr) :
begin_(cr.begin_),end_(cr.end_), origin(cr.origin),nr(cr.nr),nc(cr.nc) {}
reference operator()(size_type i, size_type j) const {
return reference(ref_or_value_type<reference>::r(
linalg_traits<M>::access(begin_+j, i),
PART(), value_type()));
}
};
template<typename PT, typename PART> std::ostream &operator <<
(std::ostream &o, const part_col_ref<PT, PART>& m)
{ gmm::write(o,m); return o; }
template <typename TYPE, typename PART, typename PT>
struct part_return_ {
typedef abstract_null_type return_type;
};
template <typename PT, typename PART>
struct part_return_<row_major, PART, PT> {
typedef typename std::iterator_traits<PT>::value_type L;
typedef typename select_return<part_row_ref<const L *, PART>,
part_row_ref< L *, PART>, PT>::return_type return_type;
};
template <typename PT, typename PART>
struct part_return_<col_major, PART, PT> {
typedef typename std::iterator_traits<PT>::value_type L;
typedef typename select_return<part_col_ref<const L *, PART>,
part_col_ref<L *, PART>, PT>::return_type return_type;
};
template <typename PT, typename PART, typename LT> struct part_return__{
typedef abstract_null_type return_type;
};
template <typename PT, typename PART>
struct part_return__<PT, PART, abstract_matrix> {
typedef typename std::iterator_traits<PT>::value_type L;
typedef typename part_return_<typename principal_orientation_type<
typename linalg_traits<L>::sub_orientation>::potype, PART,
PT>::return_type return_type;
};
template <typename PT, typename PART>
struct part_return__<PT, PART, abstract_vector> {
typedef typename std::iterator_traits<PT>::value_type L;
typedef typename select_return<part_vector<const L *, PART>,
part_vector<L *, PART>, PT>::return_type return_type;
};
template <typename PT, typename PART> struct part_return {
typedef typename std::iterator_traits<PT>::value_type L;
typedef typename part_return__<PT, PART,
typename linalg_traits<L>::linalg_type>::return_type return_type;
};
template <typename L> inline
typename part_return<const L *, linalg_real_part>::return_type
real_part(const L &l) {
return typename part_return<const L *, linalg_real_part>::return_type
(linalg_cast(const_cast<L &>(l)));
}
template <typename L> inline
typename part_return<L *, linalg_real_part>::return_type
real_part(L &l) {
return typename part_return<L *, linalg_real_part>::return_type(linalg_cast(l));
}
template <typename L> inline
typename part_return<const L *, linalg_imag_part>::return_type
imag_part(const L &l) {
return typename part_return<const L *, linalg_imag_part>::return_type
(linalg_cast(const_cast<L &>(l)));
}
template <typename L> inline
typename part_return<L *, linalg_imag_part>::return_type
imag_part(L &l) {
return typename part_return<L *, linalg_imag_part>::return_type(linalg_cast(l));
}
template <typename PT, typename PART>
struct linalg_traits<part_vector<PT, PART> > {
typedef part_vector<PT, PART> this_type;
@ -323,47 +479,6 @@ namespace gmm {
{ return reference(linalg_traits<V>::access(o, it.it, ite.it,i)); }
};
template <typename PT, typename PART> std::ostream &operator <<
(std::ostream &o, const part_vector<PT, PART>& m)
{ gmm::write(o,m); return o; }
/* ********************************************************************* */
/* Reference to the real or imaginary part of (complex) matrices */
/* ********************************************************************* */
template <typename PT, typename PART> struct part_row_ref {
typedef part_row_ref<PT, PART> this_type;
typedef typename std::iterator_traits<PT>::value_type M;
typedef M * CPT;
typedef typename std::iterator_traits<PT>::reference ref_M;
typedef typename select_ref<typename linalg_traits<this_type>
::const_row_iterator, typename linalg_traits<this_type>
::row_iterator, PT>::ref_type iterator;
typedef typename linalg_traits<this_type>::value_type value_type;
typedef typename linalg_traits<this_type>::reference reference;
typedef typename linalg_traits<this_type>::porigin_type porigin_type;
iterator begin_, end_;
porigin_type origin;
size_type nr, nc;
part_row_ref(ref_M m)
: begin_(mat_row_begin(m)), end_(mat_row_end(m)),
origin(linalg_origin(m)), nr(mat_nrows(m)), nc(mat_ncols(m)) {}
part_row_ref(const part_row_ref<CPT, PART> &cr) :
begin_(cr.begin_),end_(cr.end_), origin(cr.origin),nr(cr.nr),nc(cr.nc) {}
reference operator()(size_type i, size_type j) const {
return reference(ref_or_value_type<reference>::r(
linalg_traits<M>::access(begin_+i, j),
PART(), value_type()));
}
};
template <typename PT, typename PART>
struct linalg_traits<part_row_ref<PT, PART> > {
typedef part_row_ref<PT, PART> this_type;
@ -380,9 +495,9 @@ namespace gmm {
typedef abstract_null_type const_sub_col_type;
typedef abstract_null_type col_iterator;
typedef abstract_null_type const_col_iterator;
typedef typename linalg_traits<M>::const_sub_row_type
typedef typename org_type<typename linalg_traits<M>::const_sub_row_type>::t
pre_const_sub_row_type;
typedef typename linalg_traits<M>::sub_row_type pre_sub_row_type;
typedef typename org_type<typename linalg_traits<M>::sub_row_type>::t pre_sub_row_type;
typedef part_vector<const pre_const_sub_row_type *, PART>
const_sub_row_type;
typedef typename select_ref<abstract_null_type,
@ -418,47 +533,6 @@ namespace gmm {
PART(), value_type()));
}
};
template <typename PT, typename PART>
void linalg_traits<part_row_ref<PT, PART> >::do_clear(this_type &v) {
row_iterator it = mat_row_begin(v), ite = mat_row_end(v);
for (; it != ite; ++it) clear(row(it));
}
template<typename PT, typename PART> std::ostream &operator <<
(std::ostream &o, const part_row_ref<PT, PART>& m)
{ gmm::write(o,m); return o; }
template <typename PT, typename PART> struct part_col_ref {
typedef part_col_ref<PT, PART> this_type;
typedef typename std::iterator_traits<PT>::value_type M;
typedef M * CPT;
typedef typename std::iterator_traits<PT>::reference ref_M;
typedef typename select_ref<typename linalg_traits<this_type>
::const_col_iterator, typename linalg_traits<this_type>
::col_iterator, PT>::ref_type iterator;
typedef typename linalg_traits<this_type>::value_type value_type;
typedef typename linalg_traits<this_type>::reference reference;
typedef typename linalg_traits<this_type>::porigin_type porigin_type;
iterator begin_, end_;
porigin_type origin;
size_type nr, nc;
part_col_ref(ref_M m)
: begin_(mat_col_begin(m)), end_(mat_col_end(m)),
origin(linalg_origin(m)), nr(mat_nrows(m)), nc(mat_ncols(m)) {}
part_col_ref(const part_col_ref<CPT, PART> &cr) :
begin_(cr.begin_),end_(cr.end_), origin(cr.origin),nr(cr.nr),nc(cr.nc) {}
reference operator()(size_type i, size_type j) const {
return reference(ref_or_value_type<reference>::r(
linalg_traits<M>::access(begin_+j, i),
PART(), value_type()));
}
};
template <typename PT, typename PART>
struct linalg_traits<part_col_ref<PT, PART> > {
@ -476,9 +550,9 @@ namespace gmm {
typedef abstract_null_type const_sub_row_type;
typedef abstract_null_type row_iterator;
typedef abstract_null_type const_row_iterator;
typedef typename linalg_traits<M>::const_sub_col_type
typedef typename org_type<typename linalg_traits<M>::const_sub_col_type>::t
pre_const_sub_col_type;
typedef typename linalg_traits<M>::sub_col_type pre_sub_col_type;
typedef typename org_type<typename linalg_traits<M>::sub_col_type>::t pre_sub_col_type;
typedef part_vector<const pre_const_sub_col_type *, PART>
const_sub_col_type;
typedef typename select_ref<abstract_null_type,
@ -514,92 +588,18 @@ namespace gmm {
PART(), value_type()));
}
};
template <typename PT, typename PART>
void linalg_traits<part_col_ref<PT, PART> >::do_clear(this_type &v) {
col_iterator it = mat_col_begin(v), ite = mat_col_end(v);
for (; it != ite; ++it) clear(col(it));
}
template<typename PT, typename PART> std::ostream &operator <<
(std::ostream &o, const part_col_ref<PT, PART>& m)
{ gmm::write(o,m); return o; }
template <typename TYPE, typename PART, typename PT>
struct part_return_ {
typedef abstract_null_type return_type;
};
template <typename PT, typename PART>
struct part_return_<row_major, PART, PT> {
typedef typename std::iterator_traits<PT>::value_type L;
typedef typename select_return<part_row_ref<const L *, PART>,
part_row_ref< L *, PART>, PT>::return_type return_type;
};
template <typename PT, typename PART>
struct part_return_<col_major, PART, PT> {
typedef typename std::iterator_traits<PT>::value_type L;
typedef typename select_return<part_col_ref<const L *, PART>,
part_col_ref<L *, PART>, PT>::return_type return_type;
};
template <typename PT, typename PART, typename LT> struct part_return__{
typedef abstract_null_type return_type;
};
template <typename PT, typename PART>
struct part_return__<PT, PART, abstract_matrix> {
typedef typename std::iterator_traits<PT>::value_type L;
typedef typename part_return_<typename principal_orientation_type<
typename linalg_traits<L>::sub_orientation>::potype, PART,
PT>::return_type return_type;
};
template <typename PT, typename PART>
struct part_return__<PT, PART, abstract_vector> {
typedef typename std::iterator_traits<PT>::value_type L;
typedef typename select_return<part_vector<const L *, PART>,
part_vector<L *, PART>, PT>::return_type return_type;
};
template <typename PT, typename PART> struct part_return {
typedef typename std::iterator_traits<PT>::value_type L;
typedef typename part_return__<PT, PART,
typename linalg_traits<L>::linalg_type>::return_type return_type;
};
template <typename L> inline
typename part_return<const L *, linalg_real_part>::return_type
real_part(const L &l) {
return typename part_return<const L *, linalg_real_part>::return_type
(linalg_cast(const_cast<L &>(l)));
}
template <typename L> inline
typename part_return<L *, linalg_real_part>::return_type
real_part(L &l) {
return typename part_return<L *, linalg_real_part>::return_type(linalg_cast(l));
}
template <typename L> inline
typename part_return<const L *, linalg_imag_part>::return_type
imag_part(const L &l) {
return typename part_return<const L *, linalg_imag_part>::return_type
(linalg_cast(const_cast<L &>(l)));
}
template <typename L> inline
typename part_return<L *, linalg_imag_part>::return_type
imag_part(L &l) {
return typename part_return<L *, linalg_imag_part>::return_type(linalg_cast(l));
template <typename PT, typename PART>
void linalg_traits<part_row_ref<PT, PART> >::do_clear(this_type &v) {
row_iterator it = mat_row_begin(v), ite = mat_row_end(v);
for (; it != ite; ++it) clear(row(it));
}
}
#endif // GMM_REAL_PART_H

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_ref.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_ref.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2000-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2000-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/

202
resources/3rdparty/gmm-5.0/include/gmm/gmm_scaled.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_scaled.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_scaled.h
@ -110,29 +110,6 @@ namespace gmm {
{ return value_type(r) * linalg_traits<V>::access(origin, begin_, end_, i); }
};
template <typename V, typename S> struct linalg_traits<scaled_vector_const_ref<V,S> > {
typedef scaled_vector_const_ref<V,S> this_type;
typedef linalg_const is_reference;
typedef abstract_vector linalg_type;
typedef typename strongest_numeric_type<S, typename linalg_traits<V>::value_type>::T value_type;
typedef typename linalg_traits<V>::origin_type origin_type;
typedef value_type reference;
typedef abstract_null_type iterator;
typedef scaled_const_iterator<typename linalg_traits<V>::const_iterator, S>
const_iterator;
typedef typename linalg_traits<V>::storage_type storage_type;
typedef typename linalg_traits<V>::index_sorted index_sorted;
static size_type size(const this_type &v) { return v.size_; }
static const_iterator begin(const this_type &v)
{ return const_iterator(v.begin_, v.r); }
static const_iterator end(const this_type &v)
{ return const_iterator(v.end_, v.r); }
static const origin_type* origin(const this_type &v) { return v.origin; }
static value_type access(const origin_type *o, const const_iterator &it,
const const_iterator &ite, size_type i)
{ return it.r * (linalg_traits<V>::access(o, it.it, ite.it, i)); }
};
template<typename V, typename S> std::ostream &operator <<
(std::ostream &o, const scaled_vector_const_ref<V,S>& m)
@ -197,39 +174,6 @@ namespace gmm {
{ return r * linalg_traits<M>::access(begin_+i, j); }
};
template <typename M, typename S> struct linalg_traits<scaled_row_matrix_const_ref<M,S> > {
typedef scaled_row_matrix_const_ref<M,S> this_type;
typedef linalg_const is_reference;
typedef abstract_matrix linalg_type;
typedef typename linalg_traits<M>::origin_type origin_type;
typedef typename strongest_numeric_type<S, typename linalg_traits<M>::value_type>::T value_type;
typedef value_type reference;
typedef typename linalg_traits<M>::storage_type storage_type;
typedef typename linalg_traits<M>::const_sub_row_type vector_type;
typedef scaled_vector_const_ref<vector_type,S> sub_row_type;
typedef scaled_vector_const_ref<vector_type,S> const_sub_row_type;
typedef scaled_row_const_iterator<M,S> row_iterator;
typedef scaled_row_const_iterator<M,S> const_row_iterator;
typedef abstract_null_type const_sub_col_type;
typedef abstract_null_type sub_col_type;
typedef abstract_null_type const_col_iterator;
typedef abstract_null_type col_iterator;
typedef row_major sub_orientation;
typedef typename linalg_traits<M>::index_sorted index_sorted;
static size_type nrows(const this_type &m)
{ return m.nr; }
static size_type ncols(const this_type &m)
{ return m.nc; }
static const_sub_row_type row(const const_row_iterator &it)
{ return scaled(linalg_traits<M>::row(it.it), it.r); }
static const_row_iterator row_begin(const this_type &m)
{ return const_row_iterator(m.begin_, m.r); }
static const_row_iterator row_end(const this_type &m)
{ return const_row_iterator(m.end_, m.r); }
static const origin_type* origin(const this_type &m) { return m.origin; }
static value_type access(const const_row_iterator &it, size_type i)
{ return it.r * (linalg_traits<M>::access(it.it, i)); }
};
template<typename M, typename S> std::ostream &operator <<
(std::ostream &o, const scaled_row_matrix_const_ref<M,S>& m)
@ -291,39 +235,7 @@ namespace gmm {
{ return r * linalg_traits<M>::access(begin_+j, i); }
};
template <typename M, typename S> struct linalg_traits<scaled_col_matrix_const_ref<M,S> > {
typedef scaled_col_matrix_const_ref<M,S> this_type;
typedef linalg_const is_reference;
typedef abstract_matrix linalg_type;
typedef typename strongest_numeric_type<S, typename linalg_traits<M>::value_type>::T value_type;
typedef typename linalg_traits<M>::origin_type origin_type;
typedef value_type reference;
typedef typename linalg_traits<M>::storage_type storage_type;
typedef typename linalg_traits<M>::const_sub_col_type vector_type;
typedef abstract_null_type sub_col_type;
typedef scaled_vector_const_ref<vector_type,S> const_sub_col_type;
typedef abstract_null_type col_iterator;
typedef scaled_col_const_iterator<M,S> const_col_iterator;
typedef abstract_null_type const_sub_row_type;
typedef abstract_null_type sub_row_type;
typedef abstract_null_type const_row_iterator;
typedef abstract_null_type row_iterator;
typedef col_major sub_orientation;
typedef typename linalg_traits<M>::index_sorted index_sorted;
static size_type ncols(const this_type &m)
{ return m.nc; }
static size_type nrows(const this_type &m)
{ return m.nr; }
static const_sub_col_type col(const const_col_iterator &it)
{ return scaled(linalg_traits<M>::col(it.it), it.r); }
static const_col_iterator col_begin(const this_type &m)
{ return const_col_iterator(m.begin_, m.r); }
static const_col_iterator col_end(const this_type &m)
{ return const_col_iterator(m.end_, m.r); }
static const origin_type* origin(const this_type &m) { return m.origin; }
static value_type access(const const_col_iterator &it, size_type i)
{ return it.r * (linalg_traits<M>::access(it.it, i)); }
};
template<typename M, typename S> std::ostream &operator <<
(std::ostream &o, const scaled_col_matrix_const_ref<M,S>& m)
@ -384,7 +296,7 @@ namespace gmm {
return scaled_col_matrix_const_ref<M,S>(m, x);
}
/* ******************************************************************** */
/* matrix or vector scale */
/* ******************************************************************** */
@ -423,6 +335,100 @@ namespace gmm {
for ( ; it != ite; ++it) scale(linalg_traits<L>::col(it), a);
}
template <typename V, typename S> struct linalg_traits<scaled_vector_const_ref<V,S> > {
typedef scaled_vector_const_ref<V,S> this_type;
typedef linalg_const is_reference;
typedef abstract_vector linalg_type;
typedef typename strongest_numeric_type<S, typename linalg_traits<V>::value_type>::T value_type;
typedef typename linalg_traits<V>::origin_type origin_type;
typedef value_type reference;
typedef abstract_null_type iterator;
typedef scaled_const_iterator<typename linalg_traits<V>::const_iterator, S>
const_iterator;
typedef typename linalg_traits<V>::storage_type storage_type;
typedef typename linalg_traits<V>::index_sorted index_sorted;
static size_type size(const this_type &v) { return v.size_; }
static const_iterator begin(const this_type &v)
{ return const_iterator(v.begin_, v.r); }
static const_iterator end(const this_type &v)
{ return const_iterator(v.end_, v.r); }
static const origin_type* origin(const this_type &v) { return v.origin; }
static value_type access(const origin_type *o, const const_iterator &it,
const const_iterator &ite, size_type i)
{ return it.r * (linalg_traits<V>::access(o, it.it, ite.it, i)); }
};
template <typename M, typename S> struct linalg_traits<scaled_row_matrix_const_ref<M,S> > {
typedef scaled_row_matrix_const_ref<M,S> this_type;
typedef linalg_const is_reference;
typedef abstract_matrix linalg_type;
typedef typename linalg_traits<M>::origin_type origin_type;
typedef typename strongest_numeric_type<S, typename linalg_traits<M>::value_type>::T value_type;
typedef value_type reference;
typedef typename linalg_traits<M>::storage_type storage_type;
typedef typename org_type<typename linalg_traits<M>::const_sub_row_type>::t vector_type;
typedef scaled_vector_const_ref<vector_type,S> sub_row_type;
typedef scaled_vector_const_ref<vector_type,S> const_sub_row_type;
typedef scaled_row_const_iterator<M,S> row_iterator;
typedef scaled_row_const_iterator<M,S> const_row_iterator;
typedef abstract_null_type const_sub_col_type;
typedef abstract_null_type sub_col_type;
typedef abstract_null_type const_col_iterator;
typedef abstract_null_type col_iterator;
typedef row_major sub_orientation;
typedef typename linalg_traits<M>::index_sorted index_sorted;
static size_type nrows(const this_type &m)
{ return m.nr; }
static size_type ncols(const this_type &m)
{ return m.nc; }
static const_sub_row_type row(const const_row_iterator &it)
{ return scaled(linalg_traits<M>::row(it.it), it.r); }
static const_row_iterator row_begin(const this_type &m)
{ return const_row_iterator(m.begin_, m.r); }
static const_row_iterator row_end(const this_type &m)
{ return const_row_iterator(m.end_, m.r); }
static const origin_type* origin(const this_type &m) { return m.origin; }
static value_type access(const const_row_iterator &it, size_type i)
{ return it.r * (linalg_traits<M>::access(it.it, i)); }
};
template <typename M, typename S> struct linalg_traits<scaled_col_matrix_const_ref<M,S> > {
typedef scaled_col_matrix_const_ref<M,S> this_type;
typedef linalg_const is_reference;
typedef abstract_matrix linalg_type;
typedef typename strongest_numeric_type<S, typename linalg_traits<M>::value_type>::T value_type;
typedef typename linalg_traits<M>::origin_type origin_type;
typedef value_type reference;
typedef typename linalg_traits<M>::storage_type storage_type;
typedef typename org_type<typename linalg_traits<M>::const_sub_col_type>::t vector_type;
typedef abstract_null_type sub_col_type;
typedef scaled_vector_const_ref<vector_type,S> const_sub_col_type;
typedef abstract_null_type col_iterator;
typedef scaled_col_const_iterator<M,S> const_col_iterator;
typedef abstract_null_type const_sub_row_type;
typedef abstract_null_type sub_row_type;
typedef abstract_null_type const_row_iterator;
typedef abstract_null_type row_iterator;
typedef col_major sub_orientation;
typedef typename linalg_traits<M>::index_sorted index_sorted;
static size_type ncols(const this_type &m)
{ return m.nc; }
static size_type nrows(const this_type &m)
{ return m.nr; }
static const_sub_col_type col(const const_col_iterator &it)
{ return scaled(linalg_traits<M>::col(it.it), it.r); }
static const_col_iterator col_begin(const this_type &m)
{ return const_col_iterator(m.begin_, m.r); }
static const_col_iterator col_end(const this_type &m)
{ return const_col_iterator(m.end_, m.r); }
static const origin_type* origin(const this_type &m) { return m.origin; }
static value_type access(const const_col_iterator &it, size_type i)
{ return it.r * (linalg_traits<M>::access(it.it, i)); }
};
}
#endif // GMM_SCALED_H__

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_solver_Schwarz_additive.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_Schwarz_additive.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_solver_Schwarz_additive.h

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_solver_bfgs.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_bfgs.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2004-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2004-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_solver_bfgs.h

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_solver_bicgstab.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_bicgstab.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
// This file is a modified version of bicgstab.h from ITL.

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_solver_cg.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_cg.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
// This file is a modified version of cg.h from ITL.

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_solver_constrained_cg.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_constrained_cg.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_solver_constrained_cg.h

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_solver_gmres.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_gmres.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
// This file is a modified version of gmres.h from ITL.

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_solver_idgmres.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_idgmres.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard, Caroline Lecalvez
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard, Caroline Lecalvez
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_solver_idgmres.h

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_solver_qmr.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_solver_qmr.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
// This file is a modified version of qmr.h from ITL.

132
resources/3rdparty/gmm-5.0/include/gmm/gmm_std.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_std.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_std.h
@ -38,6 +38,8 @@
#ifndef GMM_STD_H__
#define GMM_STD_H__
// #include <getfem/getfem_arch_config.h>
#ifndef __USE_STD_IOSTREAM
# define __USE_STD_IOSTREAM
#endif
@ -74,7 +76,8 @@
# define SECURE_STRDUP(s) strdup(s)
#endif
#define GMM_NOPERATION(a) { abs(&(a) != &(a)); }
inline void GMM_NOPERATION_(int) { }
#define GMM_NOPERATION(a) { GMM_NOPERATION_(abs(&(a) != &(a))); }
/* ********************************************************************** */
/* Compilers detection. */
@ -85,7 +88,7 @@
# include <stdcomp.h>
# undef _RWSTD_NO_CLASS_PARTIAL_SPEC
# undef _RWSTD_NO_NAMESPACE
#endif
#endif
*/
/* for VISUAL C++ ...
#if defined(_MSC_VER) // && !defined(__MWERKS__)
@ -94,8 +97,8 @@
*/
#if defined(__GNUC__)
# if (__GNUC__ < 3)
# error : PLEASE UPDATE g++ TO AT LEAST 3.0 VERSION
# if (__GNUC__ < 4)
# error : PLEASE UPDATE g++ TO AT LEAST 4.8 VERSION
# endif
#endif
@ -111,7 +114,7 @@
#include <cassert>
#include <climits>
#include <iostream>
//#include <ios>
//#include <ios>
#include <fstream>
#include <ctime>
#include <exception>
@ -126,10 +129,60 @@
#include <limits>
#include <sstream>
#include <numeric>
#include <memory>
#include <array>
#include <locale.h>
namespace std {
#if defined(__GNUC__) && (__cplusplus <= 201103L)
template<typename _Tp>
struct _MakeUniq
{ typedef unique_ptr<_Tp> __single_object; };
template<typename _Tp>
struct _MakeUniq<_Tp[]>
{ typedef unique_ptr<_Tp[]> __array; };
template<typename _Tp, size_t _Bound>
struct _MakeUniq<_Tp[_Bound]>
{ struct __invalid_type { }; };
/// std::make_unique for single objects
template<typename _Tp, typename... _Args>
inline typename _MakeUniq<_Tp>::__single_object
make_unique(_Args&&... __args)
{ return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
/// std::make_unique for arrays of unknown bound
template<typename _Tp>
inline typename _MakeUniq<_Tp>::__array
make_unique(size_t __num)
{ return unique_ptr<_Tp>(new typename remove_extent<_Tp>::type[__num]()); }
/// Disable std::make_unique for arrays of known bound
template<typename _Tp, typename... _Args>
inline typename _MakeUniq<_Tp>::__invalid_type
make_unique(_Args&&...) = delete;
#endif
// Should simply be replaced by std::shared_ptr<T[]> when it will be supported
// by the STL
template <typename T> class shared_array_ptr : shared_ptr<T> {
public:
shared_array_ptr() {}
shared_array_ptr(T *q) : std::shared_ptr<T>(q, default_delete<T[]>()) {}
template <typename Y> shared_array_ptr(const std::shared_ptr<Y> &p, T *q)
: std::shared_ptr<T>(p, q) {}
T *get() const { return shared_ptr<T>::get(); }
T& operator*() const { return shared_ptr<T>::operator*(); }
T* operator->() const { return shared_ptr<T>::operator->(); }
};
template <typename T> shared_array_ptr<T> make_shared_array(size_t num)
{ return shared_array_ptr<T>(new T[num]); }
}
#ifdef GETFEM_HAVE_OPENMP
#ifdef GETFEM_HAVE_OPENMP
#include <omp.h>
/**number of OpenMP threads*/
inline size_t num_threads(){return omp_get_max_threads();}
@ -146,7 +199,7 @@
namespace gmm {
using std::endl; using std::cout; using std::cerr;
using std::ends; using std::cin;
using std::ends; using std::cin; using std::isnan;
#ifdef _WIN32
@ -156,16 +209,16 @@ namespace gmm {
public :
inline standard_locale(void) : cinloc(cin.getloc())
{
if (!me_is_multithreaded_now()){
if (!me_is_multithreaded_now()){
cloc=setlocale(LC_NUMERIC, 0);
setlocale(LC_NUMERIC,"C");
setlocale(LC_NUMERIC,"C");
}
}
inline ~standard_locale() {
if (!me_is_multithreaded_now())
setlocale(LC_NUMERIC, cloc.c_str());
if (!me_is_multithreaded_now())
setlocale(LC_NUMERIC, cloc.c_str());
}
};
#else
@ -176,7 +229,7 @@ namespace gmm {
//public :
// inline standard_locale(void) : oldloc(uselocale((locale_t)0))
// {
// {
// temploc = newlocale(LC_NUMERIC, "C", NULL);
// uselocale(temploc);
// }
@ -192,7 +245,7 @@ namespace gmm {
class standard_locale {
std::string cloc;
std::locale cinloc;
public :
inline standard_locale(void)
: cloc(setlocale(LC_NUMERIC, 0)), cinloc(cin.getloc())
@ -207,20 +260,20 @@ namespace gmm {
class stream_standard_locale {
std::locale cloc;
std::ios &io;
public :
inline stream_standard_locale(std::ios &i)
: cloc(i.getloc()), io(i) { io.imbue(std::locale("C")); }
inline ~stream_standard_locale() { io.imbue(cloc); }
};
/* ******************************************************************* */
/* Clock functions. */
/* ******************************************************************* */
# if defined(HAVE_SYS_TIMES)
inline double uclock_sec(void) {
static double ttclk = 0.;
@ -231,23 +284,23 @@ namespace gmm {
inline double uclock_sec(void)
{ return double(clock())/double(CLOCKS_PER_SEC); }
# endif
/* ******************************************************************** */
/* Fixed size integer types. */
/* ******************************************************************** */
// Remark : the test program dynamic_array tests the lenght of
// Remark : the test program dynamic_array tests the length of
// resulting integers
template <size_t s> struct fixed_size_integer_generator {
typedef void int_base_type;
typedef void uint_base_type;
typedef void uint_base_type;
};
template <> struct fixed_size_integer_generator<sizeof(char)> {
typedef signed char int_base_type;
typedef unsigned char uint_base_type;
};
template <> struct fixed_size_integer_generator<sizeof(short int)
- ((sizeof(short int) == sizeof(char)) ? 78 : 0)> {
typedef signed short int int_base_type;
@ -318,13 +371,13 @@ typedef fixed_size_integer_generator<8>::uint_base_type uint64_type;
// #endif
#if defined(__GNUC__) && !defined(__ICC)
/*
g++ can issue a warning at each usage of a function declared with this special attribute
/*
g++ can issue a warning at each usage of a function declared with this special attribute
(also works with typedefs and variable declarations)
*/
# define IS_DEPRECATED __attribute__ ((__deprecated__))
/*
the specified function is inlined at any optimization level
the specified function is inlined at any optimization level
*/
# define ALWAYS_INLINE __attribute__((always_inline))
#else
@ -339,7 +392,7 @@ typedef fixed_size_integer_generator<8>::uint_base_type uint64_type;
/* ******************************************************************** */
#if defined(EXPORTED_TO_SHARED_LIB)
# if defined(_MSC_VER) || defined(__INTEL_COMPILER)
# if defined(_MSC_VER) || defined(__INTEL_COMPILER)
# define APIDECL __declspec(dllexport)
# elif defined(__GNUC__)
# define __attribute__((visibility("default")))
@ -352,7 +405,7 @@ typedef fixed_size_integer_generator<8>::uint_base_type uint64_type;
#endif
#if defined(IMPORTED_FROM_SHARED_LIB)
# if defined(_MSC_VER) || defined(__INTEL_COMPILER)
# if defined(_MSC_VER) || defined(__INTEL_COMPILER)
# define APIDECL __declspec(dllimport)
# else
# define APIDECL
@ -369,4 +422,3 @@ typedef fixed_size_integer_generator<8>::uint_base_type uint64_type;
#endif
#endif /* GMM_STD_H__ */

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_sub_index.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_sub_index.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_sub_index.h

30
resources/3rdparty/gmm-5.0/include/gmm/gmm_sub_matrix.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_sub_matrix.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_sub_matrix.h
@ -143,11 +143,11 @@ namespace gmm {
typedef abstract_null_type col_iterator;
typedef abstract_null_type const_sub_col_type;
typedef abstract_null_type const_col_iterator;
typedef typename sub_vector_type<const typename
linalg_traits<M>::const_sub_row_type *, SUBI2>::vector_type
typedef typename sub_vector_type<const typename org_type<typename
linalg_traits<M>::const_sub_row_type>::t *, SUBI2>::vector_type
const_sub_row_type;
typedef typename select_ref<abstract_null_type,
typename sub_vector_type<typename linalg_traits<M>::sub_row_type *,
typename sub_vector_type<typename org_type<typename linalg_traits<M>::sub_row_type>::t *,
SUBI2>::vector_type, PT>::ref_type sub_row_type;
typedef gen_sub_row_matrix_iterator<typename const_pointer<PT>::pointer,
SUBI1, SUBI2> const_row_iterator;
@ -290,12 +290,8 @@ namespace gmm {
typedef abstract_null_type row_iterator;
typedef abstract_null_type const_sub_row_type;
typedef abstract_null_type const_row_iterator;
typedef typename sub_vector_type<const typename
linalg_traits<M>::const_sub_col_type *, SUBI1>::vector_type
const_sub_col_type;
typedef typename select_ref<abstract_null_type,
typename sub_vector_type<typename linalg_traits<M>::sub_col_type *,
SUBI1>::vector_type, PT>::ref_type sub_col_type;
typedef typename sub_vector_type<const typename org_type<typename linalg_traits<M>::const_sub_col_type>::t *, SUBI1>::vector_type const_sub_col_type;
typedef typename select_ref<abstract_null_type, typename sub_vector_type<typename org_type<typename linalg_traits<M>::sub_col_type>::t *, SUBI1>::vector_type, PT>::ref_type sub_col_type;
typedef gen_sub_col_matrix_iterator<typename const_pointer<PT>::pointer,
SUBI1, SUBI2> const_col_iterator;
typedef typename select_ref<abstract_null_type,

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_sub_vector.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_sub_vector.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_sub_vector.h

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_superlu_interface.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_superlu_interface.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_superlu_interface.h

20
resources/3rdparty/gmm-5.0/include/gmm/gmm_transposed.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_transposed.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_transposed.h
@ -90,7 +90,7 @@ namespace gmm {
typedef abstract_null_type const_row_iterator;
typedef typename linalg_traits<M>::const_sub_row_type const_sub_col_type;
typedef typename select_ref<abstract_null_type, typename
linalg_traits<M>::sub_row_type, PT>::ref_type sub_col_type;
linalg_traits<M>::sub_row_type, PT>::ref_type sub_col_type;
typedef typename linalg_traits<M>::const_row_iterator const_col_iterator;
typedef typename select_ref<abstract_null_type, typename
linalg_traits<M>::row_iterator, PT>::ref_type col_iterator;
@ -171,7 +171,7 @@ namespace gmm {
typedef abstract_null_type const_col_iterator;
typedef typename linalg_traits<M>::const_sub_col_type const_sub_row_type;
typedef typename select_ref<abstract_null_type, typename
linalg_traits<M>::sub_col_type, PT>::ref_type sub_row_type;
linalg_traits<M>::sub_col_type, PT>::ref_type sub_row_type;
typedef typename linalg_traits<M>::const_col_iterator const_row_iterator;
typedef typename select_ref<abstract_null_type, typename
linalg_traits<M>::col_iterator, PT>::ref_type row_iterator;

48
resources/3rdparty/gmm-5.0/include/gmm/gmm_tri_solve.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_tri_solve.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_tri_solve.h
@ -44,12 +44,12 @@ namespace gmm {
template <typename TriMatrix, typename VecX>
void upper_tri_solve__(const TriMatrix& T, VecX& x, size_t k,
col_major, abstract_sparse, bool is_unit) {
col_major, abstract_sparse, bool is_unit) {
typename linalg_traits<TriMatrix>::value_type x_j;
for (int j = int(k) - 1; j >= 0; --j) {
typedef typename linalg_traits<TriMatrix>::const_sub_col_type COL;
COL c = mat_const_col(T, j);
typename linalg_traits<COL>::const_iterator
typename linalg_traits<typename org_type<COL>::t>::const_iterator
it = vect_const_begin(c), ite = vect_const_end(c);
if (!is_unit) x[j] /= c[j];
for (x_j = x[j]; it != ite ; ++it)
@ -59,12 +59,12 @@ namespace gmm {
template <typename TriMatrix, typename VecX>
void upper_tri_solve__(const TriMatrix& T, VecX& x, size_t k,
col_major, abstract_dense, bool is_unit) {
col_major, abstract_dense, bool is_unit) {
typename linalg_traits<TriMatrix>::value_type x_j;
for (int j = int(k) - 1; j >= 0; --j) {
typedef typename linalg_traits<TriMatrix>::const_sub_col_type COL;
COL c = mat_const_col(T, j);
typename linalg_traits<COL>::const_iterator
typename linalg_traits<typename org_type<COL>::t>::const_iterator
it = vect_const_begin(c), ite = it + j;
typename linalg_traits<VecX>::iterator itx = vect_begin(x);
if (!is_unit) x[j] /= c[j];
@ -74,14 +74,14 @@ namespace gmm {
template <typename TriMatrix, typename VecX>
void lower_tri_solve__(const TriMatrix& T, VecX& x, size_t k,
col_major, abstract_sparse, bool is_unit) {
col_major, abstract_sparse, bool is_unit) {
typename linalg_traits<TriMatrix>::value_type x_j;
// cout << "(lower col)The Tri Matrix = " << T << endl;
// cout << "k = " << endl;
for (int j = 0; j < int(k); ++j) {
typedef typename linalg_traits<TriMatrix>::const_sub_col_type COL;
COL c = mat_const_col(T, j);
typename linalg_traits<COL>::const_iterator
typename linalg_traits<typename org_type<COL>::t>::const_iterator
it = vect_const_begin(c), ite = vect_const_end(c);
if (!is_unit) x[j] /= c[j];
for (x_j = x[j]; it != ite ; ++it)
@ -91,12 +91,12 @@ namespace gmm {
template <typename TriMatrix, typename VecX>
void lower_tri_solve__(const TriMatrix& T, VecX& x, size_t k,
col_major, abstract_dense, bool is_unit) {
col_major, abstract_dense, bool is_unit) {
typename linalg_traits<TriMatrix>::value_type x_j;
for (int j = 0; j < int(k); ++j) {
typedef typename linalg_traits<TriMatrix>::const_sub_col_type COL;
COL c = mat_const_col(T, j);
typename linalg_traits<COL>::const_iterator
typename linalg_traits<typename org_type<COL>::t>::const_iterator
it = vect_const_begin(c) + (j+1), ite = vect_const_begin(c) + k;
typename linalg_traits<VecX>::iterator itx = vect_begin(x) + (j+1);
if (!is_unit) x[j] /= c[j];
@ -107,7 +107,7 @@ namespace gmm {
template <typename TriMatrix, typename VecX>
void upper_tri_solve__(const TriMatrix& T, VecX& x, size_t k,
row_major, abstract_sparse, bool is_unit) {
row_major, abstract_sparse, bool is_unit) {
typedef typename linalg_traits<TriMatrix>::const_sub_row_type ROW;
typename linalg_traits<TriMatrix>::value_type t;
typename linalg_traits<TriMatrix>::const_row_iterator
@ -115,7 +115,7 @@ namespace gmm {
for (int i = int(k) - 1; i >= 0; --i) {
--itr;
ROW c = linalg_traits<TriMatrix>::row(itr);
typename linalg_traits<ROW>::const_iterator
typename linalg_traits<typename org_type<ROW>::t>::const_iterator
it = vect_const_begin(c), ite = vect_const_end(c);
for (t = x[i]; it != ite; ++it)
if (int(it.index()) > i && it.index() < k) t -= (*it) * x[it.index()];
@ -125,13 +125,13 @@ namespace gmm {
template <typename TriMatrix, typename VecX>
void upper_tri_solve__(const TriMatrix& T, VecX& x, size_t k,
row_major, abstract_dense, bool is_unit) {
row_major, abstract_dense, bool is_unit) {
typename linalg_traits<TriMatrix>::value_type t;
for (int i = int(k) - 1; i >= 0; --i) {
typedef typename linalg_traits<TriMatrix>::const_sub_row_type ROW;
ROW c = mat_const_row(T, i);
typename linalg_traits<ROW>::const_iterator
typename linalg_traits<typename org_type<ROW>::t>::const_iterator
it = vect_const_begin(c) + (i + 1), ite = vect_const_begin(c) + k;
typename linalg_traits<VecX>::iterator itx = vect_begin(x) + (i+1);
@ -142,13 +142,13 @@ namespace gmm {
template <typename TriMatrix, typename VecX>
void lower_tri_solve__(const TriMatrix& T, VecX& x, size_t k,
row_major, abstract_sparse, bool is_unit) {
row_major, abstract_sparse, bool is_unit) {
typename linalg_traits<TriMatrix>::value_type t;
for (int i = 0; i < int(k); ++i) {
typedef typename linalg_traits<TriMatrix>::const_sub_row_type ROW;
ROW c = mat_const_row(T, i);
typename linalg_traits<ROW>::const_iterator
typename linalg_traits<typename org_type<ROW>::t>::const_iterator
it = vect_const_begin(c), ite = vect_const_end(c);
for (t = x[i]; it != ite; ++it)
@ -159,13 +159,13 @@ namespace gmm {
template <typename TriMatrix, typename VecX>
void lower_tri_solve__(const TriMatrix& T, VecX& x, size_t k,
row_major, abstract_dense, bool is_unit) {
row_major, abstract_dense, bool is_unit) {
typename linalg_traits<TriMatrix>::value_type t;
for (int i = 0; i < int(k); ++i) {
typedef typename linalg_traits<TriMatrix>::const_sub_row_type ROW;
ROW c = mat_const_row(T, i);
typename linalg_traits<ROW>::const_iterator
typename linalg_traits<typename org_type<ROW>::t>::const_iterator
it = vect_const_begin(c), ite = it + i;
typename linalg_traits<VecX>::iterator itx = vect_begin(x);

693
resources/3rdparty/gmm-5.0/include/gmm/gmm_vector.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_vector.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2002-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2002-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_vector.h
@author Yves Renard <Yves.Renard@insa-lyon.fr>
@ -58,28 +58,89 @@ namespace gmm {
operator T() const { return pm->r(l); }
ref_elt_vector(V *p, size_type ll) : pm(p), l(ll) {}
inline ref_elt_vector &operator =(T v)
{ (*pm).w(l,v); return *this; }
inline bool operator ==(T v) const { return ((*pm).r(l) == v); }
inline bool operator !=(T v) const { return ((*pm).r(l) != v); }
inline bool operator ==(std::complex<T> v) const
{ return ((*pm).r(l) == v); }
inline bool operator !=(std::complex<T> v) const
{ return ((*pm).r(l) != v); }
inline ref_elt_vector &operator +=(T v)
{ (*pm).w(l,(*pm).r(l) + v); return *this; }
{ (*pm).wa(l, v); return *this; }
inline ref_elt_vector &operator -=(T v)
{ (*pm).w(l,(*pm).r(l) - v); return *this; }
{ (*pm).wa(l, -v); return *this; }
inline ref_elt_vector &operator /=(T v)
{ (*pm).w(l,(*pm).r(l) / v); return *this; }
{ (*pm).w(l,(*pm).r(l) / v); return *this; }
inline ref_elt_vector &operator *=(T v)
{ (*pm).w(l,(*pm).r(l) * v); return *this; }
{ (*pm).w(l,(*pm).r(l) * v); return *this; }
inline ref_elt_vector &operator =(const ref_elt_vector &re)
{ *this = T(re); return *this; }
T operator +() { return T(*this); } // necessary for unknow reason
T operator -() { return -T(*this); } // necessary for unknow reason
T operator +(T v) { return T(*this)+ v; } // necessary for unknow reason
T operator -(T v) { return T(*this)- v; } // necessary for unknow reason
T operator *(T v) { return T(*this)* v; } // necessary for unknow reason
T operator /(T v) { return T(*this)/ v; } // necessary for unknow reason
{ *this = T(re); return *this; }
inline ref_elt_vector &operator =(T v)
{ (*pm).w(l,v); return *this; }
T operator +() { return T(*this); }
T operator -() { return -T(*this); }
T operator +(T v) { return T(*this)+ v; }
T operator -(T v) { return T(*this)- v; }
T operator *(T v) { return T(*this)* v; }
T operator /(T v) { return T(*this)/ v; }
std::complex<T> operator +(std::complex<T> v) { return T(*this)+ v; }
std::complex<T> operator -(std::complex<T> v) { return T(*this)- v; }
std::complex<T> operator *(std::complex<T> v) { return T(*this)* v; }
std::complex<T> operator /(std::complex<T> v) { return T(*this)/ v; }
};
template<typename T, typename V> class ref_elt_vector<std::complex<T>,V> {
V *pm;
size_type l;
public :
operator std::complex<T>() const { return pm->r(l); }
ref_elt_vector(V *p, size_type ll) : pm(p), l(ll) {}
inline bool operator ==(std::complex<T> v) const
{ return ((*pm).r(l) == v); }
inline bool operator !=(std::complex<T> v) const
{ return ((*pm).r(l) != v); }
inline bool operator ==(T v) const { return ((*pm).r(l) == v); }
inline bool operator !=(T v) const { return ((*pm).r(l) != v); }
inline ref_elt_vector &operator +=(std::complex<T> v)
{ (*pm).w(l,(*pm).r(l) + v); return *this; }
inline ref_elt_vector &operator -=(std::complex<T> v)
{ (*pm).w(l,(*pm).r(l) - v); return *this; }
inline ref_elt_vector &operator /=(std::complex<T> v)
{ (*pm).w(l,(*pm).r(l) / v); return *this; }
inline ref_elt_vector &operator *=(std::complex<T> v)
{ (*pm).w(l,(*pm).r(l) * v); return *this; }
inline ref_elt_vector &operator =(const ref_elt_vector &re)
{ *this = T(re); return *this; }
inline ref_elt_vector &operator =(std::complex<T> v)
{ (*pm).w(l,v); return *this; }
inline ref_elt_vector &operator =(T v)
{ (*pm).w(l,std::complex<T>(v)); return *this; }
inline ref_elt_vector &operator +=(T v)
{ (*pm).w(l,(*pm).r(l) + v); return *this; }
inline ref_elt_vector &operator -=(T v)
{ (*pm).w(l,(*pm).r(l) - v); return *this; }
inline ref_elt_vector &operator /=(T v)
{ (*pm).w(l,(*pm).r(l) / v); return *this; }
inline ref_elt_vector &operator *=(T v)
{ (*pm).w(l,(*pm).r(l) * v); return *this; }
std::complex<T> operator +() { return std::complex<T>(*this); }
std::complex<T> operator -() { return -std::complex<T>(*this); }
std::complex<T> operator +(T v) { return std::complex<T>(*this)+ v; }
std::complex<T> operator -(T v) { return std::complex<T>(*this)- v; }
std::complex<T> operator *(T v) { return std::complex<T>(*this)* v; }
std::complex<T> operator /(T v) { return std::complex<T>(*this)/ v; }
std::complex<T> operator +(std::complex<T> v)
{ return std::complex<T>(*this)+ v; }
std::complex<T> operator -(std::complex<T> v)
{ return std::complex<T>(*this)- v; }
std::complex<T> operator *(std::complex<T> v)
{ return std::complex<T>(*this)* v; }
std::complex<T> operator /(std::complex<T> v)
{ return std::complex<T>(*this)/ v; }
};
template<typename T, typename V> inline
bool operator ==(T v, const ref_elt_vector<T, V> &re) { return (v==T(re)); }
@ -98,25 +159,37 @@ namespace gmm {
T &operator /=(T &v, const ref_elt_vector<T, V> &re)
{ v /= T(re); return v; }
template<typename T, typename V> inline
T operator +(const ref_elt_vector<T, V> &re) { return T(re); }
T operator +(T v, const ref_elt_vector<T, V> &re) { return v+ T(re); }
template<typename T, typename V> inline
T operator -(const ref_elt_vector<T, V> &re) { return -T(re); }
T operator -(T v, const ref_elt_vector<T, V> &re) { return v- T(re); }
template<typename T, typename V> inline
T operator +(const ref_elt_vector<T, V> &re, T v) { return T(re)+ v; }
T operator *(T v, const ref_elt_vector<T, V> &re) { return v* T(re); }
template<typename T, typename V> inline
T operator +(T v, const ref_elt_vector<T, V> &re) { return v+ T(re); }
T operator /(T v, const ref_elt_vector<T, V> &re) { return v/ T(re); }
template<typename T, typename V> inline
T operator -(const ref_elt_vector<T, V> &re, T v) { return T(re)- v; }
std::complex<T> operator +(std::complex<T> v, const ref_elt_vector<T, V> &re)
{ return v+ T(re); }
template<typename T, typename V> inline
T operator -(T v, const ref_elt_vector<T, V> &re) { return v- T(re); }
template<typename T, typename V> inline
T operator *(const ref_elt_vector<T, V> &re, T v) { return T(re)* v; }
std::complex<T> operator -(std::complex<T> v, const ref_elt_vector<T, V> &re)
{ return v- T(re); }
template<typename T, typename V> inline
T operator *(T v, const ref_elt_vector<T, V> &re) { return v* T(re); }
std::complex<T> operator *(std::complex<T> v, const ref_elt_vector<T, V> &re)
{ return v* T(re); }
template<typename T, typename V> inline
T operator /(const ref_elt_vector<T, V> &re, T v) { return T(re)/ v; }
std::complex<T> operator /(std::complex<T> v, const ref_elt_vector<T, V> &re)
{ return v/ T(re); }
template<typename T, typename V> inline
T operator /(T v, const ref_elt_vector<T, V> &re) { return v/ T(re); }
std::complex<T> operator +(T v, const ref_elt_vector<std::complex<T>, V> &re)
{ return v+ std::complex<T>(re); }
template<typename T, typename V> inline
std::complex<T> operator -(T v, const ref_elt_vector<std::complex<T>, V> &re)
{ return v- std::complex<T>(re); }
template<typename T, typename V> inline
std::complex<T> operator *(T v, const ref_elt_vector<std::complex<T>, V> &re)
{ return v* std::complex<T>(re); }
template<typename T, typename V> inline
std::complex<T> operator /(T v, const ref_elt_vector<std::complex<T>, V> &re)
{ return v/ std::complex<T>(re); }
template<typename T, typename V> inline
typename number_traits<T>::magnitude_type
abs(const ref_elt_vector<T, V> &re) { return gmm::abs(T(re)); }
@ -136,11 +209,474 @@ namespace gmm {
typename number_traits<T>::magnitude_type
imag(const ref_elt_vector<T, V> &re) { return gmm::imag(T(re)); }
/*************************************************************************/
/* */
/* Class dsvector: sparse vector optimized for random write operations */
/* with constant complexity for read and write operations. */
/* Based on distribution sort principle. */
/* Cheap for densely populated vectors. */
/* */
/*************************************************************************/
template<typename T> class dsvector;
template<typename T> struct dsvector_iterator {
size_type i; // Current index.
T* p; // Pointer to the current position.
dsvector<T> *v; // Pointer to the vector.
typedef T value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
// typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef std::bidirectional_iterator_tag iterator_category;
typedef dsvector_iterator<T> iterator;
reference operator *() const { return *p; }
pointer operator->() const { return &(operator*()); }
iterator &operator ++() {
for (size_type k = (i & 15); k < 15; ++k)
{ ++p; ++i; if (*p != T(0)) return *this; }
v->next_pos(*(const_cast<const_pointer *>(&(p))), i);
return *this;
}
iterator operator ++(int) { iterator tmp = *this; ++(*this); return tmp; }
iterator &operator --() {
for (size_type k = (i & 15); k > 0; --k)
{ --p; --i; if (*p != T(0)) return *this; }
v->previous_pos(p, i);
return *this;
}
iterator operator --(int) { iterator tmp = *this; --(*this); return tmp; }
bool operator ==(const iterator &it) const
{ return (i == it.i && p == it.p && v == it.v); }
bool operator !=(const iterator &it) const
{ return !(it == *this); }
size_type index(void) const { return i; }
dsvector_iterator(void) : i(size_type(-1)), p(0), v(0) {}
dsvector_iterator(dsvector<T> &w) : i(size_type(-1)), p(0), v(&w) {};
};
template<typename T> struct dsvector_const_iterator {
size_type i; // Current index.
const T* p; // Pointer to the current position.
const dsvector<T> *v; // Pointer to the vector.
typedef T value_type;
typedef const value_type* pointer;
typedef const value_type& reference;
// typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef std::bidirectional_iterator_tag iterator_category;
typedef dsvector_const_iterator<T> iterator;
reference operator *() const { return *p; }
pointer operator->() const { return &(operator*()); }
iterator &operator ++() {
for (size_type k = (i & 15); k < 15; ++k)
{ ++p; ++i; if (*p != T(0)) return *this; }
v->next_pos(p, i);
return *this;
}
iterator operator ++(int) { iterator tmp = *this; ++(*this); return tmp; }
iterator &operator --() {
for (size_type k = (i & 15); k > 0; --k)
{ --p; --i; if (*p != T(0)) return *this; }
v->previous_pos(p, i);
return *this;
}
iterator operator --(int) { iterator tmp = *this; --(*this); return tmp; }
bool operator ==(const iterator &it) const
{ return (i == it.i && p == it.p && v == it.v); }
bool operator !=(const iterator &it) const
{ return !(it == *this); }
size_type index(void) const { return i; }
dsvector_const_iterator(void) : i(size_type(-1)), p(0) {}
dsvector_const_iterator(const dsvector_iterator<T> &it)
: i(it.i), p(it.p), v(it.v) {}
dsvector_const_iterator(const dsvector<T> &w)
: i(size_type(-1)), p(0), v(&w) {};
};
/**
Sparse vector built on distribution sort principle.
Read and write access have a constant complexity depending only on the
vector size.
*/
template<typename T> class dsvector {
typedef dsvector_iterator<T> iterator;
typedef dsvector_const_iterator<T> const_iterator;
typedef dsvector<T> this_type;
typedef T * pointer;
typedef const T * const_pointer;
typedef void * void_pointer;
typedef const void * const_void_pointer;
protected:
size_type n; // Potential vector size
size_type depth; // Number of row of pointer arrays
size_type mask; // Mask for the first pointer array
size_type shift; // Shift for the first pointer array
void_pointer root_ptr; // Root pointer
const T *read_access(size_type i) const {
GMM_ASSERT1(i < n, "index out of range");
size_type my_mask = mask, my_shift = shift;
void_pointer p = root_ptr;
if (!p) return 0;
for (size_type k = 0; k < depth; ++k) {
p = ((void **)(p))[(i & my_mask) >> my_shift];
if (!p) return 0;
my_mask = (my_mask >> 4);
my_shift -= 4;
}
GMM_ASSERT1(my_shift == 0, "internal error");
GMM_ASSERT1(my_mask == 15, "internal error");
return &(((const T *)(p))[i & 15]);
}
T *write_access(size_type i) {
GMM_ASSERT1(i < n, "index " << i << " out of range (size " << n << ")");
size_type my_mask = mask, my_shift = shift;
if (!root_ptr) {
if (depth) {
root_ptr = new void_pointer[16];
std::memset(root_ptr, 0, 16*sizeof(void_pointer));
} else {
root_ptr = new T[16];
for (size_type l = 0; l < 16; ++l) ((T *)(root_ptr))[l] = T(0);
}
}
void_pointer p = root_ptr;
for (size_type k = 0; k < depth; ++k) {
size_type j = (i & my_mask) >> my_shift;
void_pointer q = ((void_pointer *)(p))[j];
if (!q) {
if (k+1 != depth) {
q = new void_pointer[16];
std::memset(q, 0, 16*sizeof(void_pointer));
} else {
q = new T[16];
for (size_type l = 0; l < 16; ++l) ((T *)(q))[l] = T(0);
}
((void_pointer *)(p))[j] = q;
}
p = q;
my_mask = (my_mask >> 4);
my_shift -= 4;
}
GMM_ASSERT1(my_shift == 0, "internal error");
GMM_ASSERT1(my_mask == 15, "internal error " << my_mask);
return &(((T *)(p))[i & 15]);
}
void init(size_type n_) {
n = n_; depth = 0; shift = 0; mask = 1; if (n_) --n_;
while (n_) { n_ /= 16; ++depth; shift += 4; mask *= 16; }
mask--; if (shift) shift -= 4; if (depth) --depth;
root_ptr = 0;
}
void rec_del(void_pointer p, size_type my_depth) {
if (my_depth) {
for (size_type k = 0; k < 16; ++k)
if (((void_pointer *)(p))[k])
rec_del(((void_pointer *)(p))[k], my_depth-1);
delete[] ((void_pointer *)(p));
} else {
delete[] ((T *)(p));
}
}
void rec_clean(void_pointer p, size_type my_depth, double eps) {
if (my_depth) {
for (size_type k = 0; k < 16; ++k)
if (((void_pointer *)(p))[k])
rec_clean(((void_pointer *)(p))[k], my_depth-1, eps);
} else {
for (size_type k = 0; k < 16; ++k)
if (gmm::abs(((T *)(p))[k]) <= eps) ((T *)(p))[k] = T(0);
}
}
void rec_clean_i(void_pointer p, size_type my_depth, size_type my_mask,
size_type i, size_type base) {
if (my_depth) {
my_mask = (my_mask >> 4);
for (size_type k = 0; k < 16; ++k)
if (((void_pointer *)(p))[k] && (base + (k+1)*(mask+1)) >= i)
rec_clean_i(((void_pointer *)(p))[k], my_depth-1, my_mask,
i, base + k*(my_mask+1));
} else {
for (size_type k = 0; k < 16; ++k)
if (base+k > i) ((T *)(p))[k] = T(0);
}
}
size_type rec_nnz(void_pointer p, size_type my_depth) const {
size_type nn = 0;
if (my_depth) {
for (size_type k = 0; k < 16; ++k)
if (((void_pointer *)(p))[k])
nn += rec_nnz(((void_pointer *)(p))[k], my_depth-1);
} else {
for (size_type k = 0; k < 16; ++k)
if (((const T *)(p))[k] != T(0)) nn++;
}
return nn;
}
void copy_rec(void_pointer &p, const_void_pointer q, size_type my_depth) {
if (my_depth) {
p = new void_pointer[16];
std::memset(p, 0, 16*sizeof(void_pointer));
for (size_type l = 0; l < 16; ++l)
if (((const const_void_pointer *)(q))[l])
copy_rec(((void_pointer *)(p))[l],
((const const_void_pointer *)(q))[l], my_depth-1);
} else {
p = new T[16];
for (size_type l = 0; l < 16; ++l) ((T *)(p))[l] = ((const T *)(q))[l];
}
}
void copy(const dsvector<T> &v) {
if (root_ptr) rec_del(root_ptr, depth);
root_ptr = 0;
mask = v.mask; depth = v.depth; n = v.n; shift = v.shift;
if (v.root_ptr) copy_rec(root_ptr, v.root_ptr, depth);
}
void next_pos_rec(void_pointer p, size_type my_depth, size_type my_mask,
const_pointer &pp, size_type &i, size_type base) const {
size_type ii = i;
if (my_depth) {
my_mask = (my_mask >> 4);
for (size_type k = 0; k < 16; ++k)
if (((void_pointer *)(p))[k] && (base + (k+1)*(my_mask+1)) >= i) {
next_pos_rec(((void_pointer *)(p))[k], my_depth-1, my_mask,
pp, i, base + k*(my_mask+1));
if (i != size_type(-1)) return; else i = ii;
}
i = size_type(-1); pp = 0;
} else {
for (size_type k = 0; k < 16; ++k)
if (base+k > i && ((const_pointer)(p))[k] != T(0))
{ i = base+k; pp = &(((const_pointer)(p))[k]); return; }
i = size_type(-1); pp = 0;
}
}
void previous_pos_rec(void_pointer p, size_type my_depth, size_type my_mask,
const_pointer &pp, size_type &i,
size_type base) const {
size_type ii = i;
if (my_depth) {
my_mask = (my_mask >> 4);
for (size_type k = 15; k != size_type(-1); --k)
if (((void_pointer *)(p))[k] && ((base + k*(my_mask+1)) < i)) {
previous_pos_rec(((void_pointer *)(p))[k], my_depth-1,
my_mask, pp, i, base + k*(my_mask+1));
if (i != size_type(-1)) return; else i = ii;
}
i = size_type(-1); pp = 0;
} else {
for (size_type k = 15; k != size_type(-1); --k)
if (base+k < i && ((const_pointer)(p))[k] != T(0))
{ i = base+k; pp = &(((const_pointer)(p))[k]); return; }
i = size_type(-1); pp = 0;
}
}
public:
void clean(double eps) { if (root_ptr) rec_clean(root_ptr, depth); }
void resize(size_type n_) {
if (n_ != n) {
n = n_;
if (n_ < n) { // Depth unchanged (a choice)
if (root_ptr) rec_clean_i(root_ptr, depth, mask, n_, 0);
} else {
// may change the depth (add some levels)
size_type my_depth = 0, my_shift = 0, my_mask = 1; if (n_) --n_;
while (n_) { n_ /= 16; ++my_depth; my_shift += 4; my_mask *= 16; }
my_mask--; if (my_shift) my_shift -= 4; if (my_depth) --my_depth;
if (my_depth > depth || depth == 0) {
if (root_ptr) {
for (size_type k = depth; k < my_depth; ++k) {
void_pointer *q = new void_pointer [16];
std::memset(q, 0, 16*sizeof(void_pointer));
q[0] = root_ptr; root_ptr = q;
}
}
mask = my_mask; depth = my_depth; shift = my_shift;
}
}
}
}
void clear(void) { if (root_ptr) rec_del(root_ptr, depth); root_ptr = 0; }
void next_pos(const_pointer &pp, size_type &i) const {
if (!root_ptr || i >= n) { pp = 0, i = size_type(-1); return; }
next_pos_rec(root_ptr, depth, mask, pp, i, 0);
}
void previous_pos(const_pointer &pp, size_type &i) const {
if (!root_ptr) { pp = 0, i = size_type(-1); return; }
if (i == size_type(-1)) { i = n; }
previous_pos_rec(root_ptr, depth, mask, pp, i, 0);
}
iterator begin(void) {
iterator it(*this);
if (n && root_ptr) {
it.i = 0; it.p = const_cast<T *>(read_access(0));
if (!(it.p) || *(it.p) == T(0))
next_pos(*(const_cast<const_pointer *>(&(it.p))), it.i);
}
return it;
}
iterator end(void) { return iterator(*this); }
const_iterator begin(void) const {
const_iterator it(*this);
if (n && root_ptr) {
it.i = 0; it.p = read_access(0);
if (!(it.p) || *(it.p) == T(0)) next_pos(it.p, it.i);
}
return it;
}
const_iterator end(void) const { return const_iterator(*this); }
inline ref_elt_vector<T, dsvector<T> > operator [](size_type c)
{ return ref_elt_vector<T, dsvector<T> >(this, c); }
inline void w(size_type c, const T &e) {
if (e == T(0)) { if (read_access(c)) *(write_access(c)) = e; }
else *(write_access(c)) = e;
}
inline void wa(size_type c, const T &e)
{ if (e != T(0)) { *(write_access(c)) += e; } }
inline T r(size_type c) const
{ const T *p = read_access(c); if (p) return *p; else return T(0); }
inline T operator [](size_type c) const { return r(c); }
size_type nnz(void) const
{ if (root_ptr) return rec_nnz(root_ptr, depth); else return 0; }
size_type size(void) const { return n; }
void swap(dsvector<T> &v) {
std::swap(n, v.n); std::swap(root_ptr, v.root_ptr);
std::swap(depth, v.depth); std::swap(shift, v.shift);
std::swap(mask, v.mask);
}
/* Constructors */
dsvector(const dsvector<T> &v) { init(0); copy(v); }
dsvector<T> &operator =(const dsvector<T> &v) { copy(v); return *this; }
explicit dsvector(size_type l){ init(l); }
dsvector(void) { init(0); }
~dsvector() { if (root_ptr) rec_del(root_ptr, depth); root_ptr = 0; }
};
template <typename T> struct linalg_traits<dsvector<T>> {
typedef dsvector<T> this_type;
typedef this_type origin_type;
typedef linalg_false is_reference;
typedef abstract_vector linalg_type;
typedef T value_type;
typedef ref_elt_vector<T, dsvector<T> > reference;
typedef dsvector_iterator<T> iterator;
typedef dsvector_const_iterator<T> const_iterator;
typedef abstract_sparse storage_type;
typedef linalg_true index_sorted;
static size_type size(const this_type &v) { return v.size(); }
static iterator begin(this_type &v) { return v.begin(); }
static const_iterator begin(const this_type &v) { return v.begin(); }
static iterator end(this_type &v) { return v.end(); }
static const_iterator end(const this_type &v) { return v.end(); }
static origin_type* origin(this_type &v) { return &v; }
static const origin_type* origin(const this_type &v) { return &v; }
static void clear(origin_type* o, const iterator &, const iterator &)
{ o->clear(); }
static void do_clear(this_type &v) { v.clear(); }
static value_type access(const origin_type *o, const const_iterator &,
const const_iterator &, size_type i)
{ return (*o)[i]; }
static reference access(origin_type *o, const iterator &, const iterator &,
size_type i)
{ return (*o)[i]; }
static void resize(this_type &v, size_type n) { v.resize(n); }
};
template<typename T> std::ostream &operator <<
(std::ostream &o, const dsvector<T>& v) { gmm::write(o,v); return o; }
/******* Optimized operations for dsvector<T> ****************************/
template <typename T> inline void copy(const dsvector<T> &v1,
dsvector<T> &v2) {
GMM_ASSERT2(v1.size() == v2.size(), "dimensions mismatch");
v2 = v1;
}
template <typename T> inline void copy(const dsvector<T> &v1,
const dsvector<T> &v2) {
GMM_ASSERT2(v1.size() == v2.size(), "dimensions mismatch");
v2 = const_cast<dsvector<T> &>(v1);
}
template <typename T> inline
void copy(const dsvector<T> &v1, const simple_vector_ref<dsvector<T> *> &v2){
simple_vector_ref<dsvector<T> *>
*svr = const_cast<simple_vector_ref<dsvector<T> *> *>(&v2);
dsvector<T>
*pv = const_cast<dsvector<T> *>((v2.origin));
GMM_ASSERT2(vect_size(v1) == vect_size(v2), "dimensions mismatch");
*pv = v1; svr->begin_ = vect_begin(*pv); svr->end_ = vect_end(*pv);
}
template <typename T> inline
void copy(const simple_vector_ref<const dsvector<T> *> &v1,
dsvector<T> &v2)
{ copy(*(v1.origin), v2); }
template <typename T> inline
void copy(const simple_vector_ref<dsvector<T> *> &v1, dsvector<T> &v2)
{ copy(*(v1.origin), v2); }
template <typename T> inline
void copy(const simple_vector_ref<dsvector<T> *> &v1,
const simple_vector_ref<dsvector<T> *> &v2)
{ copy(*(v1.origin), v2); }
template <typename T> inline
void copy(const simple_vector_ref<const dsvector<T> *> &v1,
const simple_vector_ref<dsvector<T> *> &v2)
{ copy(*(v1.origin), v2); }
template <typename T>
inline size_type nnz(const dsvector<T>& l) { return l.nnz(); }
/*************************************************************************/
/* */
/* Class wsvector: sparse vector optimized for random write operations. */
/* Class wsvector: sparse vector optimized for random write operations, */
/* with log(n) complexity for read and write operations. */
/* Based on std::map */
/* */
/*************************************************************************/
@ -211,6 +747,15 @@ namespace gmm {
else base_type::operator [](c) = e;
}
inline void wa(size_type c, const T &e) {
GMM_ASSERT2(c < nbl, "out of range");
if (e != T(0)) {
iterator it = this->lower_bound(c);
if (it != this->end() && it->first == c) it->second += e;
else base_type::operator [](c) = e;
}
}
inline T r(size_type c) const {
GMM_ASSERT2(c < nbl, "out of range");
const_iterator it = this->lower_bound(c);
@ -227,7 +772,7 @@ namespace gmm {
{ std::swap(nbl, v.nbl); std::map<size_type, T>::swap(v); }
/* Constructeurs */
/* Constructors */
void init(size_type l) { nbl = l; this->clear(); }
explicit wsvector(size_type l){ init(l); }
wsvector(void) { init(0); }
@ -334,7 +879,7 @@ namespace gmm {
template<typename T> struct elt_rsvector_ {
size_type c; T e;
/* e is initialized by default to avoid some false warnings of valgrind..
/* e is initialized by default to avoid some false warnings of valgrind.
(from http://valgrind.org/docs/manual/mc-manual.html:
When memory is read into the CPU's floating point registers, the
@ -436,6 +981,7 @@ namespace gmm {
{ return ref_elt_vector<T, rsvector<T> >(this, c); }
void w(size_type c, const T &e);
void wa(size_type c, const T &e);
T r(size_type c) const;
void swap_indices(size_type i, size_type j);
@ -488,7 +1034,7 @@ namespace gmm {
iterator it = std::lower_bound(this->begin(), this->end(), ev);
if (it != this->end() && it->c == j) {
for (iterator ite = this->end() - 1; it != ite; ++it) *it = *(it+1);
base_type_::resize(nb_stored()-1);
base_resize(nb_stored()-1);
}
}
}
@ -507,21 +1053,48 @@ namespace gmm {
else {
elt_rsvector_<T> ev(c, e);
if (nb_stored() == 0) {
base_type_::resize(1,ev);
base_type_::push_back(ev);
}
else {
iterator it = std::lower_bound(this->begin(), this->end(), ev);
if (it != this->end() && it->c == c) it->e = e;
else {
size_type ind = it - this->begin();
if (this->nb_stored() - ind > 800)
size_type ind = it - this->begin(), nb = this->nb_stored();
if (nb - ind > 1100)
GMM_WARNING2("Inefficient addition of element in rsvector with "
<< this->nb_stored() - ind << " non-zero entries");
base_type_::push_back(ev);
if (ind != nb) {
it = this->begin() + ind;
iterator ite = this->end(); --ite; iterator itee = ite;
for (; ite != it; --ite) { --itee; *ite = *itee; }
*it = ev;
}
}
}
}
}
template <typename T> void rsvector<T>::wa(size_type c, const T &e) {
GMM_ASSERT2(c < nbl, "out of range");
if (e != T(0)) {
elt_rsvector_<T> ev(c, e);
if (nb_stored() == 0) {
base_type_::push_back(ev);
}
else {
iterator it = std::lower_bound(this->begin(), this->end(), ev);
if (it != this->end() && it->c == c) it->e += e;
else {
size_type ind = it - this->begin(), nb = this->nb_stored();
if (nb - ind > 1100)
GMM_WARNING2("Inefficient addition of element in rsvector with "
<< this->nb_stored() - ind << " non-zero entries");
base_type_::resize(nb_stored()+1, ev);
if (ind != this->nb_stored() - 1) {
base_type_::push_back(ev);
if (ind != nb) {
it = this->begin() + ind;
for (iterator ite = this->end() - 1; ite != it; --ite)
*ite = *(ite-1);
iterator ite = this->end(); --ite; iterator itee = ite;
for (; ite != it; --ite) { --itee; *ite = *itee; }
*it = ev;
}
}
@ -530,7 +1103,8 @@ namespace gmm {
}
template <typename T> T rsvector<T>::r(size_type c) const {
GMM_ASSERT2(c < nbl, "out of range. Index " << c << " for a length of " << nbl);
GMM_ASSERT2(c < nbl, "out of range. Index " << c
<< " for a length of " << nbl);
if (nb_stored() != 0) {
elt_rsvector_<T> ev(c);
const_iterator it = std::lower_bound(this->begin(), this->end(), ev);
@ -867,6 +1441,7 @@ namespace gmm {
{ return data.end(); }
void w(size_type c, const T &e);
void wa(size_type c, const T &e);
T r(size_type c) const {
GMM_ASSERT2(c < size_, "out of range");
if (c < shift || c >= shift + data.size()) return T(0);
@ -910,11 +1485,35 @@ namespace gmm {
shift = c;
}
else if (c >= shift + s) {
data.resize(c - shift + 1);
std::fill(data.begin() + s, data.end(), T(0));
data.resize(c - shift + 1, T(0));
// std::fill(data.begin() + s, data.end(), T(0));
}
data[c - shift] = e;
}
template<typename T> void slvector<T>::wa(size_type c, const T &e) {
GMM_ASSERT2(c < size_, "out of range");
size_type s = data.size();
if (!s) { data.resize(1, e); shift = c; return; }
else if (c < shift) {
data.resize(s + shift - c);
typename std::vector<T>::iterator it = data.begin(),it2=data.end()-1;
typename std::vector<T>::iterator it3 = it2 - shift + c;
for (; it3 >= it; --it3, --it2) *it2 = *it3;
std::fill(it, it + shift - c, T(0));
shift = c;
data[c - shift] = e;
return;
}
else if (c >= shift + s) {
data.resize(c - shift + 1, T(0));
data[c - shift] = e;
return;
// std::fill(data.begin() + s, data.end(), T(0));
}
data[c - shift] += e;
}
template <typename T> struct linalg_traits<slvector<T> > {
typedef slvector<T> this_type;

16
resources/3rdparty/gmm-5.0/include/gmm/gmm_vector_to_matrix.h → resources/3rdparty/gmm-5.2/include/gmm/gmm_vector_to_matrix.h

@ -1,11 +1,11 @@
/* -*- c++ -*- (enables emacs c++ mode) */
/*===========================================================================
Copyright (C) 2003-2015 Yves Renard
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2003-2017 Yves Renard
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, you may use this file as it is a part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this file,
@ -26,7 +26,7 @@
to be covered by the GNU Lesser General Public License. This exception
does not however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
===========================================================================*/
/**@file gmm_vector_to_matrix.h

0
resources/3rdparty/gmm-5.0/install-sh → resources/3rdparty/gmm-5.2/install-sh

0
resources/3rdparty/gmm-5.0/ltmain.sh → resources/3rdparty/gmm-5.2/ltmain.sh

30
resources/3rdparty/gmm-5.2/m4/ax_check_cxx_flag.m4

@ -0,0 +1,30 @@
dnl Copyright (C) 2004-2017 Julien Pommier
dnl
dnl This file is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU Lesser General Public License as published
dnl by the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version along with the GCC Runtime Library
dnl Exception either version 3.1 or (at your option) any later version.
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
dnl License and GCC Runtime Library Exception for more details.
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with this program; if not, write to the Free Software Foundation,
dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
AC_DEFUN([AC_CHECK_CXX_FLAG],
[AC_MSG_CHECKING([whether ${CXX} accepts $1])
echo 'int main(){}' > conftest.c
if test -z "`${CXX} $1 -o conftest conftest.c 2>&1`"; then
$2="${$2} $1"
echo "yes"
else
echo "no"
$3
fi
dnl echo "$2=${$2}"
rm -f conftest*
])

5
resources/3rdparty/gmm-5.0/m4/ax_prefix_config_h.m4 → resources/3rdparty/gmm-5.2/m4/ax_prefix_config_h.m4

@ -79,9 +79,10 @@ dnl #ifndef _testpkg_const
dnl #define _testpkg_const const
dnl #endif
dnl
dnl @version $Id: ax_prefix_config_h.m4 1867 2005-01-27 14:04:04Z pommier $
dnl @version $Id$
dnl @author Guiodo Draheim <guidod@gmx.de>
dnl
dnl @License GPLV3
AC_DEFUN([AX_PREFIX_CONFIG_H],[AC_REQUIRE([AC_CONFIG_HEADER])
AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl
AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl

0
resources/3rdparty/gmm-5.0/m4/libtool.m4 → resources/3rdparty/gmm-5.2/m4/libtool.m4

0
resources/3rdparty/gmm-5.0/m4/ltoptions.m4 → resources/3rdparty/gmm-5.2/m4/ltoptions.m4

0
resources/3rdparty/gmm-5.0/m4/ltsugar.m4 → resources/3rdparty/gmm-5.2/m4/ltsugar.m4

0
resources/3rdparty/gmm-5.0/m4/ltversion.m4 → resources/3rdparty/gmm-5.2/m4/ltversion.m4

0
resources/3rdparty/gmm-5.0/m4/lt~obsolete.m4 → resources/3rdparty/gmm-5.2/m4/lt~obsolete.m4

0
resources/3rdparty/gmm-5.0/missing → resources/3rdparty/gmm-5.2/missing

0
resources/3rdparty/gmm-5.0/test-driver → resources/3rdparty/gmm-5.2/test-driver

0
resources/3rdparty/gmm-5.0/tests/Makefile.am → resources/3rdparty/gmm-5.2/tests/Makefile.am

0
resources/3rdparty/gmm-5.0/tests/Makefile.in → resources/3rdparty/gmm-5.2/tests/Makefile.in

0
resources/3rdparty/gmm-5.0/tests/dummy.cc → resources/3rdparty/gmm-5.2/tests/dummy.cc

14
resources/3rdparty/gmm-5.0/tests/gmm_torture01_lusolve.cc → resources/3rdparty/gmm-5.2/tests/gmm_torture01_lusolve.cc

@ -1,10 +1,10 @@
/*===========================================================================
Copyright (C) 2007-2015 Yves Renard, Julien Pommier.
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2007-2017 Yves Renard, Julien Pommier.
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
===========================================================================*/
// SQUARED_MATRIX_PARAM;
// DENSE_VECTOR_PARAM;

14
resources/3rdparty/gmm-5.0/tests/gmm_torture02_baseop.cc → resources/3rdparty/gmm-5.2/tests/gmm_torture02_baseop.cc

@ -1,10 +1,10 @@
/*===========================================================================
Copyright (C) 2007-2015 Yves Renard, Julien Pommier.
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2007-2017 Yves Renard, Julien Pommier.
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
===========================================================================*/
// SQUARED_MATRIX_PARAM;
// VECTOR_PARAM;

14
resources/3rdparty/gmm-5.0/tests/gmm_torture05_mult.cc → resources/3rdparty/gmm-5.2/tests/gmm_torture05_mult.cc

@ -1,10 +1,10 @@
/*===========================================================================
Copyright (C) 2007-2015 Yves Renard, Julien Pommier.
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2007-2017 Yves Renard, Julien Pommier.
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
===========================================================================*/
// SQUARED_MATRIX_PARAM
// VECTOR_PARAM;

14
resources/3rdparty/gmm-5.0/tests/gmm_torture06_mat_mult.cc → resources/3rdparty/gmm-5.2/tests/gmm_torture06_mat_mult.cc

@ -1,10 +1,10 @@
/*===========================================================================
Copyright (C) 2007-2015 Yves Renard, Julien Pommier.
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2007-2017 Yves Renard, Julien Pommier.
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
===========================================================================*/
// RECTANGULAR_MATRIX_PARAM
// RECTANGULAR_MATRIX_PARAM;

16
resources/3rdparty/gmm-5.0/tests/gmm_torture10_qr.cc → resources/3rdparty/gmm-5.2/tests/gmm_torture10_qr.cc

@ -1,10 +1,10 @@
/*===========================================================================
Copyright (C) 2007-2015 Yves Renard, Julien Pommier.
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2007-2017 Yves Renard, Julien Pommier.
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
===========================================================================*/
// RECTANGULAR_MATRIX_PARAM
// SQUARED_MATRIX_PARAM
@ -203,7 +203,7 @@ bool test_procedure(const MAT1 &m1_, const MAT2 &m2_) {
std::complex<R> det1(gmm::lu_det(ca)), det2(1);
implicit_qr_algorithm(ca, eigc, cq);
for (size_type i = 0; i < m; ++i) det2 *= eigc[i];
if (gmm::abs(det1 - det2) > (gmm::abs(det1)+gmm::abs(det2))/R(100))
if (gmm::abs(det1 - det2) > (gmm::abs(det1)+gmm::abs(det2))/R(50))
GMM_ASSERT1(false, "Error in QR or det. det lu: " << det1
<< " det qr: " << det2);
if (print_debug)

20
resources/3rdparty/gmm-5.0/tests/gmm_torture15_sub.cc → resources/3rdparty/gmm-5.2/tests/gmm_torture15_sub.cc

@ -1,10 +1,10 @@
/*===========================================================================
Copyright (C) 2007-2015 Yves Renard, Julien Pommier.
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2007-2017 Yves Renard, Julien Pommier.
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
===========================================================================*/
// SQUARED_MATRIX_PARAM
// VECTOR_PARAM;
@ -58,7 +58,7 @@ bool test_procedure(const MAT1 &m1_, const VECT1 &v1_, const VECT2 &v2_) {
gmm::add(gmm::scaled(gmm::sub_vector(v1, gmm::sub_interval(0,n)), T(-1)),
gmm::sub_vector(v2, gmm::sub_interval(0,n)), v3);
if (!((error = gmm::vect_norm2(v3)) <= prec * R(20000) * cond))
GMM_THROW(gmm::failure_error, "Error too large: "<< error);
GMM_ASSERT1(false, "Error too large: "<< error);
}
det = gmm::abs(gmm::lu_det(gmm::sub_matrix(m1, gmm::sub_slice(0,n,1))));
@ -71,7 +71,7 @@ bool test_procedure(const MAT1 &m1_, const VECT1 &v1_, const VECT2 &v2_) {
gmm::add(gmm::scaled(gmm::sub_vector(v1, gmm::sub_slice(0,n,1)), T(-1)),
gmm::sub_vector(v2, gmm::sub_slice(0,n,1)), v3);
if (!((error = gmm::vect_norm2(v3)) <= prec * R(20000) * cond))
GMM_THROW(gmm::failure_error, "Error too large: "<< error);
GMM_ASSERT1(false, "Error too large: "<< error);
}
gmm::copy(gmm::identity_matrix(), gmm::sub_matrix(gmm::transposed(m1),
@ -88,7 +88,7 @@ bool test_procedure(const MAT1 &m1_, const VECT1 &v1_, const VECT2 &v2_) {
gmm::sub_vector(v2, gmm::sub_interval(0,n)),
gmm::scaled(v2, T(-1)), v1);
if (!((error = gmm::vect_norm2(v1)) <= prec * R(2000)))
GMM_THROW(gmm::failure_error, "Error too large: " << error);
GMM_ASSERT1(false, "Error too large: " << error);
if (nb_iter == 100) return true;
return false;

32
resources/3rdparty/gmm-5.0/tests/gmm_torture20_iterative_solvers.cc → resources/3rdparty/gmm-5.2/tests/gmm_torture20_iterative_solvers.cc

@ -1,10 +1,10 @@
/*===========================================================================
Copyright (C) 2007-2015 Yves Renard, Julien Pommier.
This file is a part of GETFEM++
Getfem++ is free software; you can redistribute it and/or modify it
Copyright (C) 2007-2017 Yves Renard, Julien Pommier.
This file is a part of GetFEM++
GetFEM++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version along with the GCC Runtime Library
@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
===========================================================================*/
// SQUARED_MATRIX_PARAM;
// DENSE_VECTOR_PARAM;
@ -163,14 +163,15 @@ bool test_procedure(const MAT1 &m1_, const VECT1 &v1_, const VECT2 &v2_) {
gmm::set_warning_level(3);
}
R det = gmm::abs(gmm::lu_det(m1)), cond = gmm::condest(m1);
R det = gmm::abs(gmm::lu_det(m1));
if (det < sqrt(prec)*R(10)) return false;
R cond = gmm::condest(m1);
if (print_debug)
cout << "condition number = " << cond << " det = " << det << endl;
if (det == R(0) && cond < R(1) / prec && cond != R(0))
GMM_ASSERT1(false, "Inconsistent condition number: " << cond);
if (sqrt(prec) * cond >= R(1)/R(100) || det < sqrt(prec)*R(10)) return false;
if (sqrt(prec) * cond >= R(1)/R(100)) return false;
++effexpe; cout << "."; cout.flush();
@ -229,7 +230,7 @@ bool test_procedure(const MAT1 &m1_, const VECT1 &v1_, const VECT2 &v2_) {
if (print_debug) cout << "\nGmres with ilutp preconditionner\n";
do_test(GMRES(), m1, v1, v2, P5b, cond);
if (sizeof(R) > 4 || m < 20) {
if (sizeof(R) > 5 || m < 15) {
if (print_debug) cout << "\nQmr with no preconditionner\n";
do_test(QMR(), m1, v1, v2, P1, cond);
@ -252,8 +253,8 @@ bool test_procedure(const MAT1 &m1_, const VECT1 &v1_, const VECT2 &v2_) {
gmm::copy(m1, m3);
gmm::add(gmm::conjugated(m1), m3);
gmm::copy(m2, m1);
gmm::cholesky_precond<MAT1> P6(m1);
gmm::choleskyt_precond<MAT1> P7(m1, 10, prec);
gmm::ildlt_precond<MAT1> P6(m1);
gmm::ildltt_precond<MAT1> P7(m1, 10, prec);
if (!is_hermitian(m1, prec*R(100)))
GMM_ASSERT1(false, "The matrix is not hermitian");
@ -291,7 +292,10 @@ bool test_procedure(const MAT1 &m1_, const VECT1 &v1_, const VECT2 &v2_) {
print_stat(P5b, "ilutp precond");
print_stat(P6, "ildlt precond");
print_stat(P7, "ildltt precond");
if (ratio_max > 0.2) GMM_ASSERT1(false, "something wrong ..");
if (sizeof(R) > 4 && ratio_max > 0.16)
GMM_ASSERT1(false, "something wrong ..");
if (sizeof(R) <= 4 && ratio_max > 0.3)
GMM_ASSERT1(false, "something wrong ..");
return true;
}

6
resources/3rdparty/gmm-5.0/tests/make_gmm_test.pl → resources/3rdparty/gmm-5.2/tests/make_gmm_test.pl

@ -1,8 +1,8 @@
# Copyright (C) 2001-2015 Yves Renard
# Copyright (C) 2001-2017 Yves Renard
#
# This file is a part of GETFEM++
# This file is a part of GetFEM++
#
# Getfem++ is free software; you can redistribute it and/or modify it
# GetFEM++ is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version along with the GCC Runtime Library
|||||||
100:0
Loading…
Cancel
Save