Commit 8b316c63 authored by Philipp Trunschke's avatar Philipp Trunschke

Merge branch 'pybind11' into development

parents 6bbc5152 4a400424
*.py filter=tabspace
*.cpp filter=tabspace
.git/config
\ No newline at end of file
# Ignore everything
*
# But not these files...
!.gitignore
!*.h
!*.hpp
!*.hxx
!*.c
!*.cpp
!*.cxx
!*.mk
!Makefile
!Dockerfile
!*.sh
!*.rb
!*.py
!.config.mk.*
!*.md
!*.xml
!*.dox
!*.css
!*.js
!*.yml
# ...even if they are in subdirectories
!*/
# However we really want to ignore
lapacke/*
build/*
doc/html/*
.cache
__pycache__
*.sw[pon]
*.np[yz]
*.xrs
*.so
lapacke
build
doc/html
doc/findDoxytag
doc/parseDoxytags
doc/xerus.tagfile
doc/xerus.tags
config.mk
XerusTest
......@@ -6,11 +6,10 @@ COMPATIBILITY = -std=c++14
DEBUG_OPTIMIZATION = TRUE
ACTIVATE_CODE_COVERAGE = TRUE # Enable coverage tests
BROCKEN_CI = TRUE # Enable workaround for brocken CI runner
DEBUG += -D _GLIBCXX_ASSERTIONS # Activate GLIBCXX assertions
DEBUG += -g # Adds debug symbols
ACTIVATE_CODE_COVERAGE = TRUE # Enable coverage tests
BROCKEN_CI = TRUE # Enable workaround for brocken CI runner
DEBUG += -D _GLIBCXX_ASSERTIONS # Activate GLIBCXX assertions
DEBUG += -g # Adds debug symbols
#=================================================================================================
# External libraries
......
#=================================================================================================
# Compiler Options
#=================================================================================================
CXX = clang++-3.9
CXX = clang++
COMPATIBILITY = -std=c++11
DEBUG += -g # Adds debug symbols
DEBUG += -D XERUS_DISABLE_RUNTIME_CHECKS # Disable all runtime checks
LOGGING += -D XERUS_LOG_INFO # Information that is not linked to any unexpected behaviour but might
DEBUG += -g # Adds debug symbols
LOGGING += -D XERUS_LOG_INFO
#=================================================================================================
# External libraries
#=================================================================================================
STRICT_WARNINGS = TRUE
# Uncomment or add the appropriate blas libraries
BLAS_LIBRARIES = -lopenblas -lgfortran # Openblas, serial
# Uncomment or add the appropriate lapack libraries
LAPACK_LIBRARIES = -llapacke -llapack # Standard Lapack + Lapacke libraries
# Uncomment or add the appropriate CXSparse library
BLAS_LIBRARIES = -lopenblas -lgfortran # Openblas, serial
LAPACK_LIBRARIES = -llapacke -llapack # Standard Lapack + Lapacke libraries
SUITESPARSE = -lcholmod -lspqr
BOOST_LIBS = -lboost_filesystem
# custom include paths
# OTHER += -I /path/to/include
......@@ -6,19 +6,15 @@ COMPATIBILITY = -std=c++11
STRICT_WARNINGS = TRUE
DEBUG += -D XERUS_DISABLE_RUNTIME_CHECKS # Disable all runtime checks
DEBUG += -D XERUS_REPLACE_ALLOCATOR
DEBUG += -D XERUS_DISABLE_RUNTIME_CHECKS # Disable all runtime checks
DEBUG += -g # Adds debug symbols
LOGGING += -D XERUS_LOG_INFO # Information that is not linked to any unexpected behaviour bu
DEBUG += -g # Adds debug symbols
LOGGING += -D XERUS_LOG_INFO
#=================================================================================================
# External libraries
#=================================================================================================
BLAS_LIBRARIES = -lopenblas -lgfortran # Openblas, serial
LAPACK_LIBRARIES = -llapacke -llapack # Standard Lapack + Lapacke libraries
BLAS_LIBRARIES = -lopenblas -lgfortran # Openblas, serial
LAPACK_LIBRARIES = -llapacke -llapack # Standard Lapack + Lapacke libraries
SUITESPARSE = -lcholmod -lspqr
BOOST_LIBS = -lboost_filesystem
......@@ -3,15 +3,11 @@
#=================================================================================================
CXX = g++
COMPATIBILITY = -std=c++11
PYTHON2_CONFIG = `python2-config --cflags --ldflags`
PYTHON3_CONFIG = `python3-config --cflags --ldflags`
PYTEST2 = pytest
PYTEST3 = pytest-3
PYTEST3 = python3 -m pytest
STRICT_WARNINGS = TRUE
# DEBUG += -D XERUS_TEST_COVERAGE # Enable coverage tests
DEBUG += -g # Adds debug symbols
DEBUG += -g # Adds debug symbols
LOGGING += -D XERUS_LOG_INFO # Information that is not linked to any unexpected behaviour but might nevertheless be of interest.
#=================================================================================================
# External libraries
......@@ -21,8 +17,8 @@ LAPACK_LIBRARIES = -llapacke -llapack # Standard Lapack + La
SUITESPARSE = -lcholmod -lspqr
BOOST_LIBS = -lboost_filesystem
OTHER += -I /usr/include/python2.7/ -lboost_python -I/usr/lib64/python2.7/site-packages/numpy/core/include/ -lpython2.7 -fno-var-tracking-assignments
# OTHER += -I /usr/include/python2.7/ -lboost_python -I/usr/lib64/python2.7/site-packages/numpy/core/include/ -lpython2.7 -fno-var-tracking-assignments
BOOST_PYTHON2 = -lboost_python-py27
BOOST_PYTHON3 = -lboost_python-py35
# BOOST_PYTHON2 = -lboost_python-py27
# BOOST_PYTHON3 = -lboost_python-py35
stages:
- build_homepage
- build_gcc_nocheck
- test_gcc_nocheck
- code_coverage
- build_python2
- build_python3
- test_python2
- test_python3
- build_clang
- test_clang
- build_homepage
- build_gcc_nocheck
- test_gcc_nocheck
- build_clang
- test_clang
- code_coverage
- build_python
- test_python
job_build_homepage:
stage: build_homepage
script: "cp .gitlab-ci-configs/.config.mk.ci.cc config.mk; make -C doc doc && scp -r doc/html xerusweb:libxerus.org-443"
when: always
only:
only:
- master
allow_failure: true
job_make_gcc_nocheck:
job_build_gcc_nocheck:
stage: build_gcc_nocheck
script: "g++ --version; cp .gitlab-ci-configs/.config.mk.ci.gcc.nocheck config.mk; make XerusTest"
script: "g++ --version; cp .gitlab-ci-configs/.config.mk.ci.gcc.nocheck config.mk; make XerusTest_static"
when: always
artifacts:
expire_in: 1h30min
paths:
- XerusTest
- XerusTest_static
job_test_gcc_nocheck:
stage: test_gcc_nocheck
script: "echo $CI_COMMIT_SHA; ./XerusTest all"
script: "echo $CI_COMMIT_SHA; ./XerusTest_static all"
when: on_success
dependencies:
- job_make_gcc_nocheck
- job_build_gcc_nocheck
job_build_clang:
stage: build_clang
script: "clang++ --version; cp .gitlab-ci-configs/.config.mk.ci.clang config.mk; make XerusTest_static"
when: always
artifacts:
expire_in: 1h30min
paths:
- XerusTest_static
job_test_clang:
stage: test_clang
script: "echo $CI_COMMIT_SHA; ./XerusTest_static all"
when: on_success
dependencies:
- job_build_clang
job_code_coverage:
stage: code_coverage
script: "g++ --version; cp .gitlab-ci-configs/.config.mk.ci.cc config.mk; mkdir -p build; make test &> build/build_output.txt || { tail -n 500 build/build_output.txt && readelf -S XerusTest && objdump -s -j .cc_loc XerusTest && false; }; tail -n 500 build/build_output.txt"
when: always
script: "clang++ --version; cp .gitlab-ci-configs/.config.mk.ci.cc config.mk; mkdir -p build; make test &> build/build_output.txt || { tail -n 500 build/build_output.txt && readelf -S XerusTest_static && objdump -s -j .cc_loc XerusTest_static && false; }; tail -n 500 build/build_output.txt"
when: on_success
artifacts:
expire_in: 3h
paths:
- build/build_output.txt
job_build_python2:
stage: build_python2
script: "g++ --version; cp .gitlab-ci-configs/.config.mk.ci.gcc.python config.mk; make python2"
when: always
job_build_python3:
stage: build_python3
script: "g++ --version; cp .gitlab-ci-configs/.config.mk.ci.gcc.python config.mk; make python3"
when: always
job_test_python2:
stage: test_python2
script: "g++ --version; cp .gitlab-ci-configs/.config.mk.ci.gcc.python config.mk; make test_python2"
when: always
#job_test_python3:
# stage: test_python3
# script: "g++ --version; cp .config.mk.ci.gcc.python config.mk; make test_python3"
# when: always
job_make_clang:
stage: build_clang
script: "clang++ --version; cp .gitlab-ci-configs/.config.mk.ci.clang config.mk; make XerusTest"
job_build_python:
stage: build_python
script: "g++ --version; cp .gitlab-ci-configs/.config.mk.ci.gcc.python config.mk; make python"
when: always
variables:
GIT_SUBMODULE_STRATEGY: normal
artifacts:
expire_in: 1h30min
paths:
- XerusTest
- xerus
job_test_clang:
stage: test_clang
script: "echo $CI_COMMIT_SHA; ./XerusTest all"
job_test_python:
stage: test_python
script: 'python3 -c "import xerus; assert xerus.__version__ == \"$(cat VERSION)\""'
when: on_success
dependencies:
- job_make_clang
- job_build_python
[submodule "src/pybind11"]
path = 3rdParty/pybind11
url = https://github.com/pybind/pybind11.git
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>xerus</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
Subproject commit 25abf7efba0b2990f5a6dfb0a31bc65c0f2f4d17
This diff is collapsed.
......@@ -28,10 +28,14 @@ Test whether everything works correctly with
build (and optionally install) the library with
> make all -j4
> sudo make install
and you should be ready to use the library. For more details see <a href="https://www.libxerus.org/building_xerus/">the "Building Xerus" page in the documentation</a>.
and you should be ready to use the library.
To install the python bindings run
> make python3
> pip install .
For more details see <a href="https://www.libxerus.org/building_xerus/">the "Building Xerus" page in the documentation</a>.
# Issues #
......
This diff is collapsed.
#!/bin/bash
set -x -e
cd xerus
cat <<EOF >config.mk
CXX = ${CXX}
COMPATIBILITY = -std=c++17
COMPILE_THREADS = 8 # Number of threads to use during link time optimization.
HIGH_OPTIMIZATION = TRUE # Activates -O3 -march=native and some others
OTHER += -fopenmp
PYTHON3_CONFIG = \`python3-config --cflags --ldflags\`
LOGGING += -D XERUS_LOG_INFO # Information that is not linked to any unexpected behaviour but might nevertheless be of interest.
LOGGING += -D XERUS_LOGFILE # Use 'error.log' file instead of cerr
LOGGING += -D XERUS_LOG_ABSOLUTE_TIME # Print absolute times instead of relative to program time
XERUS_NO_FANCY_CALLSTACK = TRUE # Show simple callstacks only
BLAS_LIBRARIES = -lopenblas -lgfortran # Openblas, serial
LAPACK_LIBRARIES = -llapacke -llapack # Standard Lapack + Lapacke libraries
SUITESPARSE = -lcholmod -lspqr
BOOST_LIBS = -lboost_filesystem
OTHER += -I${PREFIX}/include -I${PREFIX}/lib/python${PY_VER}/site-packages/numpy/core/include/
OTHER += -L${PREFIX}/lib
EOF
ln -s ${PREFIX}/include/ ${PREFIX}/include/suitesparse
make python
${PYTHON} -m pip install . --no-deps -vv
# INCLUDE_PATH="${PREFIX}/include"
# mkdir -p ${INCLUDE_PATH}
# cp include/xerus.h ${INCLUDE_PATH}
# cp -r include/xerus ${INCLUDE_PATH}
# LIBRARY_PATH="${PREFIX}/lib"
# mkdir -p ${LIBRARY_PATH}
# cp build/libxerus.so ${LIBRARY_PATH}
# cp build/libxerus_misc.so ${LIBRARY_PATH}
rm config.mk
{% set name = "Xerus" %}
{% set version = "4.0.1" %}
{% set branch = "v4.0.1_conda" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
- git_url: https://github.com/libxerus/xerus.git
git_tag: {{ branch }}
folder: xerus
build:
number: 1
skip: true # [py<34 or win]
requirements:
build:
- {{ compiler('cxx') }}
- make
- pip >=18.1
host:
- python
- numpy
- openblas
- suitesparse
- lapack
- boost-cpp >=1.69.0 # boost-cpp: boost without python
- llvm-openmp # [osx]
- libgomp # [linux]
#- gdb # bfd
#- backward-cpp # option for better python-like backtraces
run:
- {{ pin_compatible('python', max_pin='x.x') }}
- {{ pin_compatible('numpy') }}
- {{ pin_compatible('openblas', max_pin='x.x') }}
- {{ pin_compatible('suitesparse', max_pin='x.x') }}
- {{ pin_compatible('lapack') }}
- {{ pin_compatible('boost-cpp', max_pin='x.x.x') }}
- {{ pin_compatible('llvm-openmp') }} # [osx]
- {{ pin_compatible('libgomp') }} # [linux]
test:
files:
- VERSION
source_files:
- xerus/src/pyTests
about:
home: https://git.hemio.de/xerus/xerus.git
license: "AGPL 3.0"
license_file: LICENSE
summary: "A c++ library for numerical calculations with higher order tensors"
description: |
The Xerus library is a general purpose library for numerical calculations with higher order tensors, Tensor-Train Decompositions / Matrix Product States and other Tensor Networks.
The focus of development was the simple usability and adaptibility to any setting that requires higher order tensors or decompositions thereof.
doc_url: https://www.libxerus.org/
dev_url: https://git.hemio.de/xerus/xerus
extra:
recipe-maintainers:
- trunschk
#!/bin/bash
set -e
VERSION=$(cat VERSION)
export PYTHONPATH=''
${PYTHON} <<EOF
print("="*80)
print("\trun_test.sh for Xerus ${VERSION}")
print("="*80)
import xerus
assert xerus.__version__ == '${VERSION}', xerus.__version__+" != ${VERSION}"
EOF
exit 0
......@@ -14,8 +14,8 @@ CXX = g++
# pytest executable(s). If you installed these system-wide you likely don't need to change anything.
PYTHON2_CONFIG = `python2-config --cflags --ldflags`
PYTHON3_CONFIG = `python3-config --cflags --ldflags`
PYTEST2 = pytest2
PYTEST3 = pytest3
PYTEST2 = python2 -m pytest
PYTEST3 = python3 -m pytest
#=================================================================================================
# C++ Version
......@@ -140,9 +140,5 @@ BOOST_LIBS = -lboost_filesystem -lboost_system
# ARPACK_LIBRARIES = -larpack
# OTHER += -DARPACK_LIBRARIES
# Uncomment or add the appropriate boost python library
BOOST_PYTHON2 = -lboost_python-py27
BOOST_PYTHON3 = -lboost_python-py35
# Custom include paths
# OTHER += -I /path/to/include
FROM phusion/baseimage:0.9.22
FROM phusion/baseimage:0.11
USER root
WORKDIR "/tmp/"
# Get Ubuntu updates
RUN apt-get -qq update && \
apt-get -y --with-new-pkgs -o Dpkg::Options::="--force-confold" upgrade
RUN apt-get update && \
apt-get upgrade -y -o Dpkg::Options::="--force-confold"
# Set locale environment
RUN apt-get -y install locales sudo && \
......@@ -14,10 +14,6 @@ ENV LC_ALL=C.UTF-8 \
LANG=C.UTF-8 \
LANGUAGE=C.UTF-8
# Turn off forwarding of syslog messages to stdout
# https://github.com/phusion/baseimage-docker/issues/186
RUN touch /etc/service/syslog-forwarder/down
# Non-Python utilities and libraries
RUN apt-get -y install \
cmake \
......@@ -32,7 +28,12 @@ RUN apt-get -y install \
libopenblas-dev \
libiberty-dev \
binutils-dev \
zlib1g-dev
zlib1g-dev \
libdpkg-perl
# Check Python versions
RUN python -c'from __future__ import print_function; import sys; version = "{0}.{1}".format(*sys.version_info); print("python2-version:", version)'
RUN python3 -c'import sys; version = "{0}.{1}".format(*sys.version_info); print("python3-version:", version)'
# Install Python2 based environment
RUN apt-get -y install \
......
#!/bin/bash
DIRNAME=$(dirname $0)
docker build "$@" -t firemarmot/base $DIRNAME/base
docker build "$@" -t firemarmot/suitesparse $DIRNAME/suitesparse
docker build "$@" -t firemarmot/xerus $DIRNAME/xerus
docker build "$@" -t firemarmot/base $DIRNAME/base && \
docker build "$@" -t firemarmot/suitesparse $DIRNAME/suitesparse && \
docker build "$@" -t firemarmot/xerus $DIRNAME/xerus && \
# docker build "$@" -t firemarmot/interactive $DIRNAME/interactive
docker build "$@" -t firemarmot/interactive_fenics $DIRNAME/interactive_fenics
FROM firemarmot/xerus AS xerus
FROM quay.io/fenicsproject/stable:2017.1.0
FROM quay.io/fenicsproject/stable:2019.1.0.r3
USER root
WORKDIR "/tmp/"
......@@ -27,8 +27,8 @@ RUN apt-get -y install \
python3-numpy
# Check Python versions
RUN python -c'import sys; raise SystemExit("{0}.{1}".format(*sys.version_info) != "2.7")'
RUN python3 -c'import sys; raise SystemExit("{0}.{1}".format(*sys.version_info) != "3.5")'
RUN python -c'from __future__ import print_function; import sys; version = "{0}.{1}".format(*sys.version_info); print("python2-version:", version)'
RUN python3 -c'import sys; version = "{0}.{1}".format(*sys.version_info); print("python3-version:", version)'
# Clean apt
RUN apt-get clean && \
......@@ -38,7 +38,7 @@ RUN apt-get clean && \
RUN mkdir -p /usr/local/lib && \
mkdir -p /usr/local/include && \
mkdir -p /usr/local/lib/python2.7/site-packages && \
mkdir -p /usr/local/lib/python3.5/site-packages
mkdir -p /usr/local/lib/python3.6/site-packages
COPY --from=xerus /usr/local/include/suitesparse /usr/local/include/suitesparse
COPY --from=xerus /usr/local/lib/suitesparse /usr/local/lib/suitesparse
......@@ -47,7 +47,7 @@ COPY --from=xerus /usr/local/include/xerus /usr/local/include
COPY --from=xerus /usr/local/lib/libxerus_misc.so /usr/local/lib
COPY --from=xerus /usr/local/lib/libxerus.so /usr/local/lib
COPY --from=xerus /usr/local/lib/python2.7/site-packages/xerus.so /usr/local/lib/python2.7/site-packages
COPY --from=xerus /usr/local/lib/python3.5/site-packages/xerus.so /usr/local/lib/python3.5/site-packages
COPY --from=xerus /usr/local/lib/python3.6/site-packages/xerus.so /usr/local/lib/python3.6/site-packages
# Install custom Python2 packages
RUN pip install cython && pip install ttpy matplotlib2tikz joblib
......@@ -57,7 +57,7 @@ USER fenics
RUN mkdir -p $(python -m site --user-site) && \
echo /usr/local/lib/python2.7/site-packages/ >$(python -m site --user-site)/xerus.pth && \
mkdir -p $(python3 -m site --user-site) && \
echo /usr/local/lib/python3.5/site-packages/ >$(python3 -m site --user-site)/xerus.pth
echo /usr/local/lib/python3.6/site-packages/ >$(python3 -m site --user-site)/xerus.pth
ENV LD_LIBRARY_PATH "/usr/local/lib/:/usr/local/lib/suitesparse:$LD_LIBRARY_PATH"
WORKDIR "/home/fenics/"
......
......@@ -3,22 +3,26 @@ USER root
WORKDIR "/tmp/"
# Check Python versions
RUN python -c'import sys; raise SystemExit("{0}.{1}".format(*sys.version_info) != "2.7")'
RUN python3 -c'import sys; raise SystemExit("{0}.{1}".format(*sys.version_info) != "3.5")'
RUN python -c'from __future__ import print_function; import sys; version = "{0}.{1}".format(*sys.version_info); print("python2-version:", version); raise SystemExit(version != "2.7")'
RUN python3 -c'import sys; version = "{0}.{1}".format(*sys.version_info); print("python3-version:", version); raise SystemExit(version != "3.6")'
# Install Xerus
RUN git clone https://git.hemio.de/xerus/xerus.git
WORKDIR "/tmp/xerus/"
RUN git checkout development && \
cp ./docker/xerus/config.mk . && \
RUN git checkout vmc && \
git pull && \
git submodule update --init --recursive
RUN cp ./docker/xerus/config.mk . && \
mkdir -p /usr/local/lib && \
mkdir -p /usr/local/include && \
mkdir -p /usr/local/lib/python2.7/site-packages && \
mkdir -p /usr/local/lib/python3.5/site-packages && \
mkdir -p /usr/local/lib/python3.6/site-packages && \
make python2 python3 -j $(cat /tmp/NCORES_1)
RUN ls /usr/local/lib/python3.6/ && \
make install -j $(cat /tmp/NCORES_1)
RUN mkdir -p $(python -m site --user-site) && \
echo /usr/local/lib/python2.7/site-packages/ >$(python -m site --user-site)/xerus.pth && \
mkdir -p $(python3 -m site --user-site) && \
echo /usr/local/lib/python3.5/site-packages/ >$(python3 -m site --user-site)/xerus.pth
echo /usr/local/lib/python3.6/site-packages/ >$(python3 -m site --user-site)/xerus.pth
ENV LD_LIBRARY_PATH "/usr/local/lib/:$LD_LIBRARY_PATH"
CXX = g++
PYTHON2_CONFIG = `python-config --cflags --ldflags`
PYTHON3_CONFIG = `python3-config --cflags --ldflags`
COMPATIBILITY = -std=c++17
COMPILE_THREADS = 8 # Number of threads to use during link time optimization.
HIGH_OPTIMIZATION = TRUE # Activates -O3 -march=native and some others
OTHER += -fopenmp
PYTHON2_CONFIG = `python-config --cflags --ldflags`
PYTHON3_CONFIG = `python3-config --cflags --ldflags`
LOGGING += -D XERUS_LOG_INFO # Information that is not linked to any unexpected behaviour but might nevertheless be of interest.
LOGGING += -D XERUS_LOGFILE # Use 'error.log' file instead of cerr
LOGGING += -D XERUS_LOG_ABSOLUTE_TIME # Print absolute times instead of relative to program time
......@@ -14,12 +15,9 @@ LOGGING += -D XERUS_LOG_ABSOLUTE_TIME # Print absolute times instead of rela
INSTALL_LIB_PATH = /usr/local/lib # Path where to install the libxerus.so shared library.
INSTALL_HEADER_PATH = /usr/local/include # Path where to install the xerus header files.
INSTALL_PYTHON2_PATH = /usr/local/lib/python2.7/site-packages
INSTALL_PYTHON3_PATH = /usr/local/lib/python3.5/site-packages
INSTALL_PYTHON3_PATH = /usr/local/lib/python3.6/site-packages
BLAS_LIBRARIES = -lopenblas -lgfortran # Openblas, serial
LAPACK_LIBRARIES = -llapacke -llapack # Standard Lapack + Lapacke libraries
SUITESPARSE = -L/usr/local/lib/suitesparse -lcholmod -lspqr
BOOST_LIBS = -lboost_filesystem
BOOST_PYTHON2 = -lboost_python-py27
BOOST_PYTHON3 = -lboost_python-py35
......@@ -50,7 +50,17 @@ namespace xerus { namespace uq {
*/
TTTensor uq_ra_adf(const std::vector<std::vector<Tensor>>& _positions, const std::vector<Tensor>& _solutions, const std::vector<size_t>& _dimensions, const double _targetEps = 1e-8, const size_t _maxItr = 0);
/**
* @brief Rank adaptive ADF to calculate the UQ solution for given measurements.
* @param _x Initial value.
* @param _positions The positions of the measurements.
* @param _solutions The measured solutions corresponding to the @a _positions.
* @param _dimensions The dimensions of the final solution tensor.
* @param _targetEps TODO describe effect
* @param _maxItr Maximal number of iterations to perform.
*/
TTTensor uq_ra_adf(const TTTensor& _x, const std::vector<std::vector<Tensor>>& _positions, const std::vector<Tensor>& _solutions, const std::vector<size_t>& _dimensions, const double _targetEps = 1e-8, const size_t _maxItr = 0);
/**
* @brief Rank adaptive ADF to calculate the UQ solution for given weighted measurements.
* @param _positions The positions of the measurements.
......@@ -63,6 +73,5 @@ namespace xerus { namespace uq {
TTTensor uq_ra_adf(const std::vector<std::vector<Tensor>>& _positions, const std::vector<Tensor>& _solutions, const std::vector<double>& _weights, const std::vector<size_t>& _dimensions, const double _targetEps = 1e-8, const size_t _maxItr = 0);
// TODO How is this different to the inplace variant? Also very confusing that it changes _x inplace AND returns it.
TTTensor uq_ra_adf_iv(TTTensor& _x, const UQMeasurementSet& _measurements, const PolynomBasis _basisType, const double _targetEps = 1e-8, const size_t _maxItr = 0);
TTTensor uq_ra_adf(const TTTensor& _x, const UQMeasurementSet& _measurements, const PolynomBasis _basisType, const double _targetEps = 1e-8, const size_t _maxItr = 0);
}}
This diff is collapsed.
......@@ -60,13 +60,13 @@ namespace xerus {
const size_t maxRank;
const bool preventZero;
SVD(internal::IndexedTensorReadOnly<Tensor>&& _input) :
SVD(internal::IndexedTensorReadOnly<Tensor>&& _input) :