Showing preview only (914K chars total). Download the full file or copy to clipboard to get everything.
Repository: xtensor-stack/xframe
Branch: master
Commit: 05f3addf21bc
Files: 125
Total size: 871.0 KB
Directory structure:
gitextract_7cvkifeh/
├── .appveyor.yml
├── .azure-pipelines/
│ ├── azure-pipelines-linux-clang.yml
│ ├── azure-pipelines-linux-gcc.yml
│ ├── azure-pipelines-osx.yml
│ └── unix-build.yml
├── .gitignore
├── .travis.yml
├── CMakeLists.txt
├── LICENSE
├── README.md
├── azure-pipelines.yml
├── docs/
│ ├── Doxyfile
│ ├── Makefile
│ ├── environment.yml
│ ├── make.bat
│ └── source/
│ ├── _static/
│ │ └── main_stylesheet.css
│ ├── api/
│ │ ├── axis_index.rst
│ │ ├── coordinate_index.rst
│ │ ├── variable_index.rst
│ │ ├── xaxis.rst
│ │ ├── xaxis_base.rst
│ │ ├── xaxis_default.rst
│ │ ├── xaxis_expression_leaf.rst
│ │ ├── xaxis_function.rst
│ │ ├── xaxis_variant.rst
│ │ ├── xaxis_view.rst
│ │ ├── xcoordinate.rst
│ │ ├── xcoordinate_base.rst
│ │ ├── xcoordinate_chain.rst
│ │ ├── xcoordinate_expanded.rst
│ │ ├── xcoordinate_view.rst
│ │ ├── xdimension.rst
│ │ ├── xexpand_dims_view.rst
│ │ ├── xnamed_axis.rst
│ │ └── xvariable_masked_view.rst
│ ├── computation.rst
│ ├── conf.py
│ ├── data_structure.rst
│ ├── getting_started.rst
│ ├── index.rst
│ ├── indexing.rst
│ ├── installation.rst
│ ├── xarray.rst
│ └── xframe_summary_drawio.xml
├── environment-dev.yml
├── environment.yml
├── include/
│ └── xframe/
│ ├── xaxis.hpp
│ ├── xaxis_base.hpp
│ ├── xaxis_default.hpp
│ ├── xaxis_expression_leaf.hpp
│ ├── xaxis_function.hpp
│ ├── xaxis_index_slice.hpp
│ ├── xaxis_label_slice.hpp
│ ├── xaxis_math.hpp
│ ├── xaxis_meta.hpp
│ ├── xaxis_scalar.hpp
│ ├── xaxis_variant.hpp
│ ├── xaxis_view.hpp
│ ├── xcoordinate.hpp
│ ├── xcoordinate_base.hpp
│ ├── xcoordinate_chain.hpp
│ ├── xcoordinate_expanded.hpp
│ ├── xcoordinate_system.hpp
│ ├── xcoordinate_view.hpp
│ ├── xdimension.hpp
│ ├── xdynamic_variable.hpp
│ ├── xdynamic_variable_impl.hpp
│ ├── xexpand_dims_view.hpp
│ ├── xframe_config.hpp
│ ├── xframe_expression.hpp
│ ├── xframe_trace.hpp
│ ├── xframe_utils.hpp
│ ├── xio.hpp
│ ├── xnamed_axis.hpp
│ ├── xreindex_data.hpp
│ ├── xreindex_view.hpp
│ ├── xselecting.hpp
│ ├── xsequence_view.hpp
│ ├── xvariable.hpp
│ ├── xvariable_assign.hpp
│ ├── xvariable_base.hpp
│ ├── xvariable_function.hpp
│ ├── xvariable_masked_view.hpp
│ ├── xvariable_math.hpp
│ ├── xvariable_meta.hpp
│ ├── xvariable_scalar.hpp
│ ├── xvariable_variant.hpp
│ ├── xvariable_view.hpp
│ └── xvector_variant.hpp
├── notebooks/
│ └── xframe.ipynb
├── readthedocs.yml
├── test/
│ ├── CMakeLists.txt
│ ├── copyGTest.cmake.in
│ ├── downloadGTest.cmake.in
│ ├── main.cpp
│ ├── test_fixture.hpp
│ ├── test_fixture_view.hpp
│ ├── test_xaxis.cpp
│ ├── test_xaxis_default.cpp
│ ├── test_xaxis_function.cpp
│ ├── test_xaxis_variant.cpp
│ ├── test_xaxis_view.cpp
│ ├── test_xcoordinate.cpp
│ ├── test_xcoordinate_chain.cpp
│ ├── test_xcoordinate_expanded.cpp
│ ├── test_xcoordinate_view.cpp
│ ├── test_xdimension.cpp
│ ├── test_xdynamic_variable.cpp
│ ├── test_xexpand_dims_view.cpp
│ ├── test_xframe_utils.cpp
│ ├── test_xnamed_axis.cpp
│ ├── test_xreindex_view.cpp
│ ├── test_xsequence_view.cpp
│ ├── test_xvariable.cpp
│ ├── test_xvariable_assign.cpp
│ ├── test_xvariable_function.cpp
│ ├── test_xvariable_masked_view.cpp
│ ├── test_xvariable_math.cpp
│ ├── test_xvariable_noalias.cpp
│ ├── test_xvariable_scalar.cpp
│ ├── test_xvariable_view.cpp
│ ├── test_xvariable_view_assign.cpp
│ └── test_xvector_variant.cpp
├── xframe.pc.in
└── xframeConfig.cmake.in
================================================
FILE CONTENTS
================================================
================================================
FILE: .appveyor.yml
================================================
build: false
os: Visual Studio 2015
platform:
- x64
environment:
matrix:
- MINICONDA: C:\xframe-conda
init:
- "ECHO %MINICONDA%"
- C:\"Program Files (x86)"\"Microsoft Visual Studio 14.0"\VC\vcvarsall.bat %PLATFORM%
- ps: if($env:Platform -eq "x64"){Start-FileDownload 'http://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe' C:\Miniconda.exe; echo "Done"}
- ps: if($env:Platform -eq "x86"){Start-FileDownload 'http://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86.exe' C:\Miniconda.exe; echo "Done"}
- cmd: C:\Miniconda.exe /S /D=C:\xframe-conda
- "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%MINICONDA%\\Library\\bin;%PATH%"
install:
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda env create --file environment-dev.yml
- CALL conda.bat activate xframe
- cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\LIBRARY -DDOWNLOAD_GTEST=ON .
- nmake test_xframe
- cd test
build_script:
- .\test_xframe
================================================
FILE: .azure-pipelines/azure-pipelines-linux-clang.yml
================================================
jobs:
- job: 'Linux_0'
strategy:
matrix:
clang_4:
llvm_version: '4.0'
clang_5:
llvm_version: '5.0'
clang_6:
llvm_version: '6.0'
clang_7:
llvm_version: '7'
clang_8:
llvm_version: '8'
clang_9:
llvm_version: '9'
clang_10:
llvm_version: '10'
pool:
vmImage: ubuntu-16.04
variables:
CC: clang-$(llvm_version)
CXX: clang++-$(llvm_version)
timeoutInMinutes: 360
steps:
- script: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
if [[ $(llvm_version) == '4.0' || $(llvm_version) == '5.0' ]]; then
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install gcc-4.9 clang-$(llvm_version)
else
LLVM_VERSION=$(llvm_version)
get -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-$LLVM_VERSION main"
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install clang-$(llvm_version)
fi
displayName: Install build toolchain
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- template: unix-build.yml
================================================
FILE: .azure-pipelines/azure-pipelines-linux-gcc.yml
================================================
jobs:
- job: 'Linux_1'
strategy:
matrix:
gcc_4:
gcc_version: '4.9'
gcc_5:
gcc_version: '5'
gcc_6:
gcc_version: '6'
gcc_7:
gcc_version: '7'
gcc_8:
gcc_version: '8'
gcc_9:
gcc_version: '9'
pool:
vmImage: ubuntu-16.04
variables:
CC: gcc-$(gcc_version)
CXX: g++-$(gcc_version)
timeoutInMinutes: 360
steps:
- script: |
if [[ $(gcc_version) == '4.9' || $(gcc_version) == '6' ]]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install g++-$(gcc_version)
fi
displayName: Install build toolchain
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- template: unix-build.yml
================================================
FILE: .azure-pipelines/azure-pipelines-osx.yml
================================================
jobs:
- job: 'OSX'
strategy:
matrix:
macOS_10_14:
image_name: 'macOS-10.14'
macOS_10_15:
image_name: 'macOS-10.15'
pool:
vmImage: $(image_name)
variables:
CC: clang
CXX: clang++
timeoutInMinutes: 360
steps:
- script: |
echo "Removing homebrew for Azure to avoid conflicts with conda"
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall > ~/uninstall_homebrew
chmod +x ~/uninstall_homebrew
~/uninstall_homebrew -f -q
displayName: Remove homebrew
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
sudo chown -R $USER $CONDA
displayName: Add conda to PATH
- template: unix-build.yml
================================================
FILE: .azure-pipelines/unix-build.yml
================================================
steps:
- script: |
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda env create --file environment-dev.yml
source activate xframe
- script: |
source activate xframe
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DDOWNLOAD_GTEST=ON $(Build.SourcesDirectory)
displayName: Configure xframe
workingDirectory: $(Build.BinariesDirectory)
- script: |
source activate xxframe
make -j2 test_xframe
displayName: Build xframe
workingDirectory: $(Build.BinariesDirectory)/build
- script: |
source activate xframe
cd test
./test_xframe
displayName: Test xframe
workingDirectory: $(Build.BinariesDirectory)/build/test
================================================
FILE: .gitignore
================================================
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Vim tmp files
*.swp
# Build directory
build/
# Test build artefacts
test/test_xtensor
test/CMakeCache.txt
test/Makefile
test/CMakeFiles/
test/cmake_install.cmake
# Documentation build artefacts
docs/CMakeCache.txt
docs/xml/
docs/build/
# Jupyter artefacts
.ipynb_checkpoints/
# Generated files
*.pc
================================================
FILE: .travis.yml
================================================
language: cpp
dist: xenial
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
env: COMPILER=gcc GCC=4.9
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env: COMPILER=gcc GCC=5
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env: COMPILER=gcc GCC=6
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env: COMPILER=gcc GCC=7
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-4.0
packages:
- g++-4.9
- clang-4.0
env: COMPILER=clang CLANG=4.0
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-5.0
packages:
- g++-4.9
- clang-5.0
env: COMPILER=clang CLANG=5.0
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-6.0
packages:
- clang-6.0
env: COMPILER=clang CLANG=6.0
- os: osx
osx_image: xcode8
compiler: clang
env:
global:
- MINCONDA_VERSION="latest"
- MINCONDA_LINUX="Linux-x86_64"
- MINCONDA_OSX="MacOSX-x86_64"
before_install:
- |
# Configure build variables
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ "$COMPILER" == "gcc" ]]; then
export CXX=g++-$GCC CC=gcc-$GCC;
fi
if [[ "$COMPILER" == "clang" ]]; then
export CXX=clang++-$CLANG CC=clang-$CLANG;
fi
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export CXX=clang++ CC=clang;
fi
install:
# Define the version of miniconda to download
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
MINCONDA_OS=$MINCONDA_LINUX;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
MINCONDA_OS=$MINCONDA_OSX;
fi
- wget "http://repo.continuum.io/miniconda/Miniconda3-$MINCONDA_VERSION-$MINCONDA_OS.sh" -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
# The 2 following lines are a workaround to https://github.com/conda/conda/issues/9337
- pip uninstall -y setuptools
- conda install setuptools
- conda update -q conda
- conda install cmake -c conda-forge
- conda install xtensor=0.21.4 -c conda-forge
# Testing
- mkdir build
- cd build
- cmake -DDOWNLOAD_GTEST=ON ..;
- make -j2 test_xframe
- cd test
script:
- ./test_xframe
================================================
FILE: CMakeLists.txt
================================================
############################################################################
# Copyright (c) Johan Mabille and Sylvain Corlay #
# Copyright (c) QuantStack #
# #
# Distributed under the terms of the BSD 3-Clause License. #
# #
# The full license is in the file LICENSE, distributed with this software. #
############################################################################
cmake_minimum_required(VERSION 3.1)
project(xframe)
set(XFRAME_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
# Versionning
# ===========
file(STRINGS "${XFRAME_INCLUDE_DIR}/xframe/xframe_config.hpp" xframe_version_defines
REGEX "#define XFRAME_VERSION_(MAJOR|MINOR|PATCH)")
foreach(ver ${xframe_version_defines})
if(ver MATCHES "#define XFRAME_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$")
set(XFRAME_VERSION_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}" CACHE INTERNAL "")
endif()
endforeach()
set(${PROJECT_NAME}_VERSION
${XFRAME_VERSION_MAJOR}.${XFRAME_VERSION_MINOR}.${XFRAME_VERSION_PATCH})
message(STATUS "xframe v${${PROJECT_NAME}_VERSION}")
# Dependencies
# ============
find_package(xtensor REQUIRED)
include_directories(${xtensor_INCLUDE_DIRS})
find_package(xtl REQUIRED)
include_directories(${xtl_INCLUDE_DIRS})
# Build
# =====
set(XFRAME_HEADERS
${XFRAME_INCLUDE_DIR}/xframe/xaxis.hpp
${XFRAME_INCLUDE_DIR}/xframe/xaxis_base.hpp
${XFRAME_INCLUDE_DIR}/xframe/xaxis_default.hpp
${XFRAME_INCLUDE_DIR}/xframe/xaxis_expression_leaf.hpp
${XFRAME_INCLUDE_DIR}/xframe/xaxis_function.hpp
${XFRAME_INCLUDE_DIR}/xframe/xaxis_index_slice.hpp
${XFRAME_INCLUDE_DIR}/xframe/xaxis_label_slice.hpp
${XFRAME_INCLUDE_DIR}/xframe/xaxis_math.hpp
${XFRAME_INCLUDE_DIR}/xframe/xaxis_meta.hpp
${XFRAME_INCLUDE_DIR}/xframe/xaxis_scalar.hpp
${XFRAME_INCLUDE_DIR}/xframe/xaxis_variant.hpp
${XFRAME_INCLUDE_DIR}/xframe/xaxis_view.hpp
${XFRAME_INCLUDE_DIR}/xframe/xcoordinate.hpp
${XFRAME_INCLUDE_DIR}/xframe/xcoordinate_base.hpp
${XFRAME_INCLUDE_DIR}/xframe/xcoordinate_chain.hpp
${XFRAME_INCLUDE_DIR}/xframe/xcoordinate_expanded.hpp
${XFRAME_INCLUDE_DIR}/xframe/xcoordinate_system.hpp
${XFRAME_INCLUDE_DIR}/xframe/xcoordinate_view.hpp
${XFRAME_INCLUDE_DIR}/xframe/xdimension.hpp
${XFRAME_INCLUDE_DIR}/xframe/xdynamic_variable_impl.hpp
${XFRAME_INCLUDE_DIR}/xframe/xdynamic_variable.hpp
${XFRAME_INCLUDE_DIR}/xframe/xexpand_dims_view.hpp
${XFRAME_INCLUDE_DIR}/xframe/xframe_config.hpp
${XFRAME_INCLUDE_DIR}/xframe/xframe_expression.hpp
${XFRAME_INCLUDE_DIR}/xframe/xframe_trace.hpp
${XFRAME_INCLUDE_DIR}/xframe/xframe_utils.hpp
${XFRAME_INCLUDE_DIR}/xframe/xio.hpp
${XFRAME_INCLUDE_DIR}/xframe/xnamed_axis.hpp
${XFRAME_INCLUDE_DIR}/xframe/xreindex_view.hpp
${XFRAME_INCLUDE_DIR}/xframe/xreindex_data.hpp
${XFRAME_INCLUDE_DIR}/xframe/xselecting.hpp
${XFRAME_INCLUDE_DIR}/xframe/xsequence_view.hpp
${XFRAME_INCLUDE_DIR}/xframe/xvariable.hpp
${XFRAME_INCLUDE_DIR}/xframe/xvariable_assign.hpp
${XFRAME_INCLUDE_DIR}/xframe/xvariable_base.hpp
${XFRAME_INCLUDE_DIR}/xframe/xvariable_function.hpp
${XFRAME_INCLUDE_DIR}/xframe/xvariable_masked_view.hpp
${XFRAME_INCLUDE_DIR}/xframe/xvariable_math.hpp
${XFRAME_INCLUDE_DIR}/xframe/xvariable_meta.hpp
${XFRAME_INCLUDE_DIR}/xframe/xvariable_scalar.hpp
${XFRAME_INCLUDE_DIR}/xframe/xvariable_view.hpp
${XFRAME_INCLUDE_DIR}/xframe/xvector_variant.hpp
)
OPTION(BUILD_TESTS "xframe test suite" OFF)
OPTION(DOWNLOAD_GTEST "build gtest from downloaded sources" OFF)
if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
set(BUILD_TESTS ON)
endif()
if(BUILD_TESTS)
add_subdirectory(test)
endif()
# Installation
# ============
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
install(FILES ${XFRAME_HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xframe)
set(XFRAME_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE
STRING "install path for xframeConfig.cmake")
configure_package_config_file(${PROJECT_NAME}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${XFRAME_CMAKECONFIG_INSTALL_DIR})
# xframe is header-only and does not depend on the architecture.
# Remove CMAKE_SIZEOF_VOID_P from xframeConfigVersion.cmake so that an xframeConfig.cmake
# generated for a 64 bit target can be used for 32 bit targets and vice versa.
set(_XFRAME_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
unset(CMAKE_SIZEOF_VOID_P)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${${PROJECT_NAME}_VERSION}
COMPATIBILITY AnyNewerVersion)
set(CMAKE_SIZEOF_VOID_P ${_XFRAME_CMAKE_SIZEOF_VOID_P})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${XFRAME_CMAKECONFIG_INSTALL_DIR})
configure_file(${PROJECT_NAME}.pc.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
@ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
================================================
FILE: LICENSE
================================================
BSD 3-Clause License
Copyright (c) 2017, Johan Mabille, Sylvain Corlay, Wolf Vollprecht and
Martin Renou
Copyright (c) 2017, QuantStack
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: README.md
================================================
# 
[](https://travis-ci.org/xtensor-stack/xframe)
[](https://ci.appveyor.com/project/xtensor-stack/xframe)
[](https://xframe.readthedocs.io/en/latest/?badge=latest)
[](https://mybinder.org/v2/gh/xtensor-stack/xframe/stable?filepath=notebooks%2Fxframe.ipynb)
[](https://xtensor.zulipchat.com/#narrow/channel/539553-Ask-anything)
## Introduction
**xframe is an early developer preview, and is not suitable for general usage yet. Features and implementation are subject to change.**
`xframe` is a dataframe for C++, based on [xtensor](https://github.com/xtensor-stack/xtensor) and [xtl](https://github.com/xtensor-stack/xtl).
For more information on using `xframe`, check out the reference documentation
https://xframe.readthedocs.io/
# Installation
## Package managers
We provide a package for the mamba (or conda) package manager:
```
mamba install -c conda-forge xtensor
```
## Dependencies
`xframe` depends on the [xtensor](https://github.com/xtensor-stack/xtensor) library:
| xframe | xtensor |
|----------|-----------|
| master | ^0.21.4 |
| 0.3.0 | ^0.21.4 |
| 0.2.0 | ^0.20.0 |
| 0.1.0 | ^0.19.1 |
| 0.0.2 | ^0.19.1 |
| 0.0.1 | ^0.19.1 |
## License
We use a shared copyright model that enables all contributors to maintain the
copyright on their contributions.
This software is licensed under the BSD-3-Clause license. See the [LICENSE](LICENSE) file for details.
================================================
FILE: azure-pipelines.yml
================================================
trigger:
- master
jobs:
- template: ./.azure-pipelines/azure-pipelines-linux-clang.yml
- template: ./.azure-pipelines/azure-pipelines-linux-gcc.yml
- template: ./.azure-pipelines/azure-pipelines-osx.yml
================================================
FILE: docs/Doxyfile
================================================
PROJECT_NAME = "xframe"
XML_OUTPUT = xml
INPUT = ../include
GENERATE_LATEX = NO
GENERATE_MAN = NO
GENERATE_RTF = NO
CASE_SENSE_NAMES = NO
GENERATE_HTML = NO
GENERATE_XML = YES
RECURSIVE = YES
QUIET = YES
JAVADOC_AUTOBRIEF = YES
WARN_IF_UNDOCUMENTED = NO
MACRO_EXPANSION = YES
================================================
FILE: docs/Makefile
================================================
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext api
default: html
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
clean:
rm -rf $(BUILDDIR)/*
rm -rf xml
html:
doxygen
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
doxygen
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
doxygen
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
doxygen
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
doxygen
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
doxygen
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
epub:
doxygen
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
doxygen
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
doxygen
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
doxygen
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
doxygen
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
doxygen
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
doxygen
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
doxygen
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
doxygen
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
doxygen
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
doxygen
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
doxygen
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
coverage:
doxygen
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
xml:
doxygen
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
doxygen
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
================================================
FILE: docs/environment.yml
================================================
name: xframe-docs
channels:
- QuantStack
dependencies:
- breathe
================================================
FILE: docs/make.bat
================================================
@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
set I18NSPHINXOPTS=%SPHINXOPTS% source
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. texinfo to make Texinfo files
echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
echo. xml to make Docutils-native XML files
echo. pseudoxml to make pseudoxml-XML files for display purposes
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
echo. coverage to run coverage check of the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 1>NUL 2>NUL
if errorlevel 9009 goto sphinx_python
goto sphinx_ok
:sphinx_python
set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
:sphinx_ok
if "%1" == "html" (
doxygen
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\packagename.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\packagename.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdf" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdfja" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf-ja
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "texinfo" (
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
goto end
)
if "%1" == "gettext" (
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
if "%1" == "coverage" (
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
if errorlevel 1 exit /b 1
echo.
echo.Testing of coverage in the sources finished, look at the ^
results in %BUILDDIR%/coverage/python.txt.
goto end
)
if "%1" == "xml" (
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The XML files are in %BUILDDIR%/xml.
goto end
)
if "%1" == "pseudoxml" (
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
goto end
)
:end
================================================
FILE: docs/source/_static/main_stylesheet.css
================================================
.wy-nav-content{
max-width: 1000px;
margin: auto;
}
================================================
FILE: docs/source/api/axis_index.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Axes
====
.. toctree::
xaxis_base
xaxis
xaxis_default
xaxis_function
xaxis_expression_leaf
xaxis_view
xaxis_variant
xnamed_axis
================================================
FILE: docs/source/api/coordinate_index.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Coordinates and dimensions
==========================
.. toctree::
xcoordinate_base
xcoordinate
xcoordinate_view
xcoordinate_chain
xcoordinate_expanded
xdimension
================================================
FILE: docs/source/api/variable_index.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Variables
=========
.. toctree::
xexpand_dims_view
xvariable_masked_view
================================================
FILE: docs/source/api/xaxis.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xaxis
=====
Defined in ``xframe/xaxis.hpp``
.. doxygenclass:: xf::xaxis
:project: xframe
:members:
.. doxygenfunction:: xf::axis(L, L, L)
:project: xframe
.. doxygenfunction:: xf::axis(std::initializer_list<L>)
:project: xframe
================================================
FILE: docs/source/api/xaxis_base.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xaxis_base
==========
Defined in ``xframe/xaxis_base.hpp``
.. doxygenclass:: xf::xaxis_base
:project: xframe
:members:
.. doxygenfunction:: operator==(const xaxis_base<D1>&, const xaxis_base<D2>&)
:project: xframe
.. doxygenfunction:: operator!=(const xaxis_base<D1>&, const xaxis_base<D2>&)
:project: xframe
================================================
FILE: docs/source/api/xaxis_default.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xaxis_default
=============
Defined in ``xframe/xaxis_default.hpp``
.. doxygenclass:: xf::xaxis_default
:project: xframe
:members:
.. doxygenfunction:: xf::axis(L)
:project: xframe
================================================
FILE: docs/source/api/xaxis_expression_leaf.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xaxis_expression_leaf
=====================
Defined in ``xframe/xaxis_expression_leaf.hpp``
.. doxygenclass:: xf::xaxis_expression_leaf
:project: xframe
:members:
================================================
FILE: docs/source/api/xaxis_function.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xaxis_function
==============
Defined in ``xframe/xaxis_function.hpp``
.. doxygenclass:: xf::xaxis_function
:project: xframe
:members:
================================================
FILE: docs/source/api/xaxis_variant.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xaxis_variant
=============
Defined in ``xframe/xaxis_variant.hpp``
.. doxygenclass:: xf::xaxis_variant
:project: xframe
:members:
================================================
FILE: docs/source/api/xaxis_view.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xaxis_view
==========
Defined in ``xframe/xaxis_view.hpp``
.. doxygenclass:: xf::xaxis_view
:project: xframe
:members:
.. doxygenfunction:: operator==(const xaxis_view<L, T, MT>&, const xaxis_view<L, T, MT>&)
:project: xframe
.. doxygenfunction:: operator!=(const xaxis_view<L, T, MT>&, const xaxis_view<L, T, MT>&)
:project: xframe
.. doxygenfunction:: operator==(const xaxis_view<L, T, MT>&, const xaxis_variant<L, T, MT>&)
:project: xframe
.. doxygenfunction:: operator!=(const xaxis_view<L, T, MT>&, const xaxis_variant<L, T, MT>&)
:project: xframe
.. doxygenfunction:: operator==(const xaxis_variant<L, T, MT>&, const xaxis_view<L, T, MT>&)
:project: xframe
.. doxygenfunction:: operator!=(const xaxis_variant<L, T, MT>&, const xaxis_view<L, T, MT>&)
:project: xframe
================================================
FILE: docs/source/api/xcoordinate.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xcoordinate
===========
Defined in ``xframe/xcoordinate.hpp``
.. doxygenclass:: xf::xcoordinate
:project: xframe
:members:
.. doxygenfunction:: coordinate(const std::map<K, xaxis_variant<L, S, MT>>&)
:project: xframe
.. doxygenfunction:: coordinate(std::map<K, xaxis_variant<L, S, MT>>&&)
:project: xframe
.. doxygenfunction:: coordinate(xnamed_axis<K, S, MT, L, LT>, xnamed_axis<K1, S, MT, L, LT1>...)
:project: xframe
.. doxygenfunction:: broadcast_coordinates(xcoordinate<K, L, S, MT>&, const Args&...)
:project: xframe
================================================
FILE: docs/source/api/xcoordinate_base.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xcoordinate_base
================
Defined in ``xframe/xcoordinate_base.hpp``
.. doxygenclass:: xf::xcoordinate_base
:project: xframe
:members:
.. doxygenfunction:: operator==(const xcoordinate_base<K, A1>&, const xcoordinate_base<K, A2>&)
:project: xframe
.. doxygenfunction:: operator!=(const xcoordinate_base<K, A1>&, const xcoordinate_base<K, A2>&)
:project: xframe
================================================
FILE: docs/source/api/xcoordinate_chain.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xcoordinate_chain
=================
Defined in ``xframe/xcoordinate_chain.hpp``
.. doxygenclass:: xf::xcoordinate_chain
:project: xframe
:members:
.. doxygenfunction:: reindex(const C&, const typename C::map_type&)
:project: xframe
.. doxygenfunction:: reindex(const C&, typename C::map_type&&)
:project: xframe
================================================
FILE: docs/source/api/xcoordinate_expanded.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xcoordinate_expanded
====================
Defined in ``xframe/xcoordinate_expanded.hpp``
.. doxygenclass:: xf::xcoordinate_expanded
:project: xframe
:members:
.. doxygenfunction:: expand_dims(const C&, const typename C::map_type&)
:project: xframe
.. doxygenfunction:: expand_dims(const C&, typename C::map_type&&)
:project: xframe
================================================
FILE: docs/source/api/xcoordinate_view.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xcoordinate_view
================
Defined in ``xframe/xcoordinate_view.hpp``
.. doxygenclass:: xf::xcoordinate_view
:project: xframe
:members:
.. doxygenfunction:: coordinate_view(const std::map<K, xaxis_view<L, S, MT>>&)
:project: xframe
.. doxygenfunction:: coordinate_view(std::map<K, xaxis_view<L, S, MT>>&&)
:project: xframe
================================================
FILE: docs/source/api/xdimension.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xdimension
==========
Defined in ``xframe/xdimension.hpp``
.. doxygenclass:: xf::xdimension
:project: xframe
:members:
.. doxygenfunction:: operator==(const xdimension<L, T>&, const xdimension<L, T>&)
:project: xframe
.. doxygenfunction:: operator!=(const xdimension<L, T>&, const xdimension<L, T>&)
:project: xframe
================================================
FILE: docs/source/api/xexpand_dims_view.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xexpand_dims_view
=================
Defined in ``xframe/xexpand_dims_view.hpp``
.. doxygenclass:: xf::xexpand_dims_view
:project: xframe
:members:
.. doxygenfunction:: expand_dims(E&&, std::initializer_list<K>)
:project: xframe
.. doxygenfunction:: expand_dims(E&&, std::initializer_list<std::pair<typename std::decay_t<E>::key_type, std::size_t>>)
:project: xframe
================================================
FILE: docs/source/api/xnamed_axis.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xnamed_axis
===========
Defined in ``xframe/xnamed_axis.hpp``
.. doxygenclass:: xf::xnamed_axis
:project: xframe
:members:
.. doxygenfunction:: xf::named_axis(const K&, A&&)
:project: xframe
================================================
FILE: docs/source/api/xvariable_masked_view.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
xvariable_masked_view
=====================
Defined in ``xframe/xvariable_masked_view.hpp``
.. doxygenclass:: xf::xvariable_masked_view
:project: xframe
:members:
.. doxygenfunction:: where(EV&&, EAX&&)
:project: xframe
================================================
FILE: docs/source/computation.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Computation
===========
`xframe` is actually more than a multi-dimensional data frame library; like `xtensor`_,
it is an expression engine that allows numerical computation on any object implementing
the variable or the frame interfaces.
Expressions
-----------
Assume ``x``, ``y`` and ``z`` are variables with *compatible coordinates* (we'll come back
to that later), the return type of an expression such as ``x + exp(y) * sin(z)`` is
**not a variable**. The result is a variable expression which offers the same interface
as ``xvariable`` but does not hold any value. Such expressions can be plugged into others
to build more cmoplex expressions:
.. code::
auto f = x + exp(y) * sin(z);
auto f2 = x + exp(w) * cos(f);
The expression engines avoids the evaluation of intermediate results and their storage in
temporary variables, so you can achieve the same performance as if you had written a loop.
Such a loop is quite more complicated than an array loop since labels and dimension names
are involved in the assignment mechanism.
Since a variable expression provides the same API as ``xvariable``, all the indexing and
selection operations are available:
.. code::
auto v = (x + exp(y) * sin(z)).select({{"city", "Paris"}, {"group", "a"}});
auto view = select(x + exp(y) * sin(z), {{"city", xf::keep("Paris")}, {"group", xf::drop({"b", "d", "h"})}});
Lazy evaluation
---------------
An expression such as ``x + exp(y) * sin(z)`` does not hold the result. **Values are only computed
upon access or when the expression is assigned to a variable**. this allows to operate symbolically
on very large data sets and only compute the result for the indices of interest:
.. code::
// Assuming x and y are variables each holding ~1M values
auto f = cos(x) + sin(y);
double first_res = f.locate("a", "London");
double second_res = f.locate("b", "Pekin");
// Only two values have been computed
That means if you use the same expression in two assign statements, the computation of the expression
will be done twice. Depending on the complexity of the cmoputation and the size of the data, it might
be convenient to store the result of the expression in a temporary variable:
.. code::
variable_type tmp = cos(x) + sin(y);
variable_type res1 = tmp + 2 * exp(z);
variable_type res2 = tmp - 3 * exp(w);
Broadcasting by dimension names
-------------------------------
Like `xarray`_, broadcasting in *xframe* is done according to the dimension names rather than
their positions. This way, you do not need to transpose variable or insert dimensions of length
1 to to get array operations to work, as commonly done in `xtensor`_ with ``xt::reshape`` or
``xt::newaxis``.
This can be illustrated with the following examples. First, consider two one-dimensional variable
aligned along different dimensions:
.. code::
auto v1 = variable_type(data_type({1., 2.}), {{"x", xf::axis(1, 3)}});
auto v2 = variable_type(data_type({3., 7.}), {{"y", xf::axis(2, 5)}});
We can apply mathematical operations to these variables, their dimension are expanded automatically:
.. code::
variable_type res = v1 + v2;
std::cout << res << std::endl;
// Output:
// {{ 4. 8.}
// { 5. 9.}}
// Coordinates:
// x: (1, 3, )
// y: (2, 5, )
Contrary to `xarray`_ , dimensions are not reordered to the order in which they first appeared:
.. code::
auto v3 = variable_type(data_type({{1., 2.}, {3., 4.}}),
{{"y", xf::axis({2, 5})}, {"x", xf::axis({1, 4})}});
variable_type res2 = v1 + v3;
std::cout << res2 << std::endl;
// Output:
// {{ 2. 4. }
// { 4. 6. }}
// Coordinates:
// y: (2, 5, )
// x: (1, 3, )
This allows many optimizations in the assignment mechanism.
Automatic alignment
-------------------
`xframe` enforces alignment between coordinate labels on objects involved in operations.
The default result of an operation is by the *intersection* of the coordinate labels:
.. code::
auto v4 = variable_type(data_type({1., 2., 3.}), {{"x", xf::axis({1, 3, 5})}});
auto v5 = variable_type(data_type({4., 7., 12.}), {{"x", xf::axis({1, 5, 7})}});
variable_type res3 = v4 + v5;
std::cout << res3 << std::endl;
// Output:
// { 5. 10. }
// Coordinates:
// x: (1, 5,)
Operations are slower when variables are not aligned, so it might be useful to
explicitly align variables involved in loops of performance critical code.
Operators and functions
-----------------------
`xframe` provides all the basic operators and mathematical functions:
- arithmetic operators: ``+``, ``-``, ``*``, ``/``
- logical operators: ``&&``, ``||``, ``!``
- comparison operators: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``
- basic functions: ``abs``, ``remainder``, ``fma``, ...
- exponential functions: ``exp``, ``expm1``, ``log``, ``log1p``, ...
- power functions: ``pow``, ``sqrt``, ``cbrt``, ...
- trigonometric functions: ``sin``, ``cos``, ``tan``, ...
- hyperbolic functions: ``sinh``, ``cosh``, ``tanh``, ...
- error and gamma functions: ``erf``, ``erfc``, ``tgamma``, ``lgamma``, ...
Actually, any function operating on ``xtensor`` expressions can work with
``xvariable`` expressions without any additional work; the only constraint
is to accept and return expressions:
.. code::
template <class E1, class E2>
inline auto distance(const xexpression<E1>& e1, const xexpression<E2>& e2)
{
const E1& de1 = e1.derived_cast();
const E2& de2 = e2.derived_cast();
//
return sqrt(de1 * de1 + de2 * de2);
}
This function can work with both tnesor and variable expressions, performing
broadcasting according to the rules of `xtensor` or `xframe` depending on
its argument type:
.. code::
xt::xarray<double> a1 = {1., 2. };
xt::xarray<double> a2 = {{1., 3.}, {4., 7.}};
// Broadcasting is applied according to xtensor rules,
// that is by dimension order
xt::xarray<double> ares = distance(a1, a2);
// Broadcasting is applied according to xframe rules,
// that is by dimension name
variable_type vres = distance(v1, v3);
Missing values
--------------
Contrary to `pandas`_ or `xarray`_, `xframe` does not use particular values
for representing missing values. Instead, it makes use of the dedicated type
``xtl::xoptional`` which gathers the value and a flag to specify whether the
value is missing or not:
.. code::
data_type d = {1., 2., 3. };
d(1).has_value() = false;
auto v = variable_type(d, {{"x", xf::axis({1, 3, 4})}});
std::cout << v << std::endl;
// Output:
// { 1. N/A 3. }
// Coordinates:
// x: (1, 3, 4,)
.. _pandas: https://pandas.pydata.org
.. _xarray: https://xarray.pydata.org
.. _xtensor: https://github.com/xtensor-stack/xtensor
================================================
FILE: docs/source/conf.py
================================================
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import subprocess
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
subprocess.call('cd ..; doxygen', shell=True)
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
def setup(app):
app.add_stylesheet("main_stylesheet.css")
extensions = ['breathe']
breathe_projects = { 'xframe': '../xml' }
templates_path = ['_templates']
html_static_path = ['_static']
source_suffix = '.rst'
master_doc = 'index'
project = 'xframe'
copyright = '2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht and Martin Renou'
author = 'Johan Mabille, Sylvain Corlay, Wolf Vollprecht and Martin Renou'
html_logo = 'quantstack-white.svg'
exclude_patterns = []
highlight_language = 'c++'
pygments_style = 'sphinx'
todo_include_todos = False
htmlhelp_basename = 'xframedoc'
================================================
FILE: docs/source/data_structure.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Data structures
===============
Axes
----
An axis is a mapping of labels to positions in a given dimension. It is the equivalent of
the ``index`` object from `pandas`_. `xframe` supports many types of labels, the most common
are strings, char, integers and dates. An axis is created from a list of labels, a builder
function is provided so the type of the axis can be inferred. The following example illustrates
the two main ways of creating an axis:
.. code::
using saxis_type = xf::xaxis<xf::fstring, std::size_t>;
saxis_type s1({ "a", "b", "d", "e" });
auto s2 = xf::axis({ "a", "b", "d", "e" });
// s1 and s2 are similar axes
It is also possible to create an axis given the size of the axis or the start, stop and step:
.. code::
auto s3 = xf::axis(5); // == xf::axis({ 0, 1, 2, 3, 4 });
auto s4 = xf::axis(2, 7); // == xf::axis({ 2, 3, 4, 5, 6 });
auto s5 = xf::axis(0, 10, 2); // == xf::axis({ 0, 2, 4, 6, 8 });
auto s6 = xf::axis("a", "d"); // == xf::axis({ "a", "b", "c" });
The axis API is similar to the one of a constant ``std::map`` that throws an exception when
asked a missing key:
.. code::
std::size_t i0 = s1["a"];
try
{
std::size_t i1 = s1["c"];
}
catch(std::exception& e)
{
// The exception will be catch since "c" is not a label of s1
std::cout << e.what() << std::endl;
}
``xaxis`` also provides iterators and methods to compute the union and the intersection of
axes. However a user rarely needs to manipulate the axes directly, the most common operation
is to create them and then store them in a coordinate system.
Coordinates
-----------
Coordinates are mappings of dimension names to axes. `xframe` provides different methods
to easily create them:
.. code::
using coordinate_type = xf::xcoordinate<xf::fstring>;
coordinate_type c1({{"group", xf::axis({"a", "b", "d", "e"})},
{"city", xf::axis({"London", "Paris", "Brussels"})}});
auto c2 = xf::coordinate({{"group", xf::axis({"a", "b", "d", "e"})},
{"city", xf::axis({"London", "Paris", "Brussels"})}});
// c1 and c2 are similar coordinates
.. note::
The builder function ``xf::coordinate`` converts the ``const char*``
arguments to ``fstring`` and returns a ``xcoordinate<fstring>`` object. You can modify
this behavior by specifying the key type of the coordinate as the first template parameter
of the ``coordinate`` function:
``auto c2 = xf::coordinate<std::string>({{"group", xf::axis({"a", "b", "d", "e"})}, ...});``
``xnamed_axis`` allows to store a dimension name - axis pair that you can reuse in different
coordinates objects; if you want to create a coordinate object from a named axis, all the
arguments must be named axes; fortunately, a ``xnamed_axis`` can be created in place, as
shown below:
.. code::
// This object will be used in different coordinates objects
auto a1 = xf::named_axis("igroup", xf::axis({1, 2, 4, 5})});
auto c1 = xf::coordinate<xf::fstring>(a1, xf::named_axis("city", xf::axis({"London", "Parid", "Brussels"})));
auto c2 = xf::coordinate<xf::fstring>(a1, xf::named_axis("country", xf::axis({"USA", "Japan"})));
As you can notice, coordinates objects can store axes with different label types. By default,
these types are ``int``, ``std::size_t``, ``char`` and ``xf::fstring``, you can
specify a different type list:
.. code::
using coordinate_type = xf::xcoordinate<xf::fstring, xtl::mpl::vector<int, std::string>>;
coordinate_type c({{"group", xf::axis({"a", "b", "d", "e"})},
{"city", xf::axis({"London", "Paris", "Brussels"})}});
Dimension
---------
A dimension object is the mapping of the dimension names to the dimension positions in the
data tensor. Creating a ``xdimension`` is as simple as creating an ``xcoordinate`` or an
``xaxis``:
.. code::
using dimension_type = xf::xdimension<xf::fstring>;
dimension_type dim1({"city", "group"});
auto dim2 = xf::dimension({"city", "group"});
// dim1 and dim2 are similar dimensions
``xdimension`` provides an API similar to ``xaxis`` and therefore can be considered as a
special axis. Together a dimension object and a coordinate object form a coordinate system
which maps labels and dimension names to indexes in the data tensor.
.. note::
Like ``xf::coordinate``, the builder function ``xf::dimension`` converts the ``const char*``
arguments to ``fstring`` and returns a ``xdimension<fstring>`` object. You can modify
this behavior by specifying the label type of the dimension as the first template parameter
of the ``dimension`` function:
``auto d = xf::dimension<std::string>({"city", "group"});``
Variables
---------
A variable is a data tensor with a coordinate system, that is an ``xcoordinate`` object and
an ``xdimension`` object. It is the C++ equivalent of the ``xarray.DataArray`` Python class.
``xvariable`` provides many constructors:
.. code::
using coordinate_type = xf::xcoordinate<xf::fstring>;
using dimension_type = xf::xdimension<xf::fstring>;
using variable_type = xvariable<double, coordinate_type>;
data_type d = xt::eval(xt::random::rand({3, 4}));
auto c = xf::coordinate({{"group", xf::axis({"a", "b", "d", "e"})},
{"city", xf::axis({"London", "Paris", "Brussels"})}});
auto dim = xf::dimension({"city", "group"});
variable_type v1(d, c, dim);
// Coordinates and dimension can be built in place
variable_type v2(d, xf::coordinate({{"group", xf::axis({"a", "b", "d", "e"})},
{"city", xf::axis({"London", "Paris", "Brussels"})}}),
xf::dimension({"city", "group"}));
The data parameter can be omitted, in that case the variable creates an uninitialized data tensor:
.. code::
variable_type v3(c, dim);
variable_type v4(xf::coordinate({{"group", xf::axis({"a", "b", "d", "e"})},
{"city", xf::axis({"London", "Paris", "Brussels"})}}),
xf::dimension({"city", "group"}));
A variable can also be created from a map of axes and a list of dimension names:
.. code::
variable_type::coordinate_map coord_map;
coord_map["group"] = xf::axis({"a", "b", "d", "e"});
coord_map["city"] = xf::axis({"London", "Paris", "Brussels"});
dimension_type::label_list dim_list = {"group", "city"};
variable_type v5(d, coord_map, dim_list);
variable_type v6(coord_map, dim_list);
If the dimension object is omitted, the dimension mapping is inferred from the coordinate
object. In the code below, the mapping is different from the previous defined variables,
``group`` is the name of the first dimension and ``city`` is the name of the second one:
.. code::
variable_type v7(d, {{"group", xf::axis({"a", "b", "d", "e"})},
{"city", xf::axis({"london", "Paris", "Brussels"})}});
// variable with same coordinate system but uninitialized data
variable_type v8({{"group", xf::axis({"a", "b", "d", "e"})},
{"city", xf::axis({"london", "Paris", "Brussels"})}});
`xframe` also provides builder functions, so that the type of the variable can be inferred:
.. code::
auto v10 = variable(d, c, dim);
auto v11 = variable(d, xf::coordinate({{"group", xf::axis({"a", "b", "d", "e"})},
{"city", xf::axis({"London", "Paris", "Brussels"})}}),
xf::dimension({"city", "group"}));
auto v12 = variable(c, dim);
auto v13 = variable(xf::coordinate({{"group", xf::axis({"a", "b", "d", "e"})},
{"city", xf::axis({"London", "Paris", "Brussels"})}}),
xf::dimension({"city", "group"}));
Summary
-------
.. image:: xframe_summary.png
:alt: xframe summay
.. _pandas: https://pandas.pydata.org
================================================
FILE: docs/source/getting_started.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Getting started
===============
This short guide explains how to get started with `xframe` once you have installed it with one of
the methods described in the installation section.
First example
-------------
.. code::
#include <iostream>
#include "xtensor/xrandom.hpp"
#include "xframe/xio.hpp"
#include "xframe/xvariable.hpp"
int main(int argc, char* argv[])
{
using coordinate_type = xf::xcoordinate<xf::fstring>;
using variable_type = xf::xvariable<double, coordinate_type>;
using data_type = variable_type::data_type;
// Creation of the data
data_type data = xt::eval(xt::random::rand({6, 3}, 15., 25.));
data(0, 0).has_value() = false;
data(2, 1).has_value() = false;
// Creation of coordinates and dimensions
auto time_axis = xf::axis({"2018-01-01", "2018-01-02", "2018-01-03", "2018-01-04", "2018-01-05", "2018-01-06"});
auto city_axis = xf::axis({"London", "Paris", "Brussels"});
auto coord = xf::coordinate({{"date", time_axis}, {"city", city_axis}});
auto dim = xf::dimension({"date", "city"});
// Creation of the variable
auto var = variable_type(data, coord, dim);
std::cout << var << std::endl;
return 0;
}
This example creates a variable, that is, a tensor data (here random) with labels and dimension names.
Compiling the first example
---------------------------
`xframe` is a header-only library, so there is no library to link with. The only constraint
is that the compiler must be able to find the headers of `xframe` and those of its dependencies,
that is, `xtensor` and `xtl`; this is usually done by having the directory containing the headers
in the include path. With GCC, use the ``-I`` option to achieve this. Assuming the first example
code is located in ``example.cpp``, the compilation command is:
.. code:: bash
gcc -I /path/to/headers/ example.cpp -o example
When you run the program, it produces the following output (data should be different
since it is randomly generated):
.. code::
{{ N/A, 23.3501, 24.6887},
{17.2103, 18.0817, 20.4722},
{16.8838, N/A, 24.9646},
{24.6769, 22.2584, 24.8111},
{16.0986, 22.9811, 17.9703},
{15.0478, 16.1246, 21.3976}}
Coordinates:
date: (2018-01-01, 2018-01-02, 2018-01-03, 2018-01-04, 2018-01-05, 2018-01-06, )
city: (London, Paris, Brussels)
Building with cmake
-------------------
A better alternative for building programs using `xframe` is to use `cmake`, especially if you are
developing for several platforms. Assuming the following folder structure:
.. code:: bash
first_example
|- src
| |- example.cpp
|- CMakeLists.txt
The following minimal ``CMakeLists.txt`` is enough to build the first example:
.. code:: cmake
cmake_minimum_required(VERSION 3.1)
project(first_example)
find_package(xtl REQUIRED)
find_package(xframeREQUIRED)
add_executable(first_example src/example.cpp)
target_link_libraries(first_example xtensor)
`cmake` has to know where to find the headers, this is done through the ``CMAKE_INSTALL_PREFIX``
variable. Note that ``CMAKE_INSTALL_PREFIX`` is usually the path to a folder containing the following
subfolders: ``include``, ``lib`` and ``bin``, so you don't have to pass any additional option for linking.
Examples of valid values for ``CMAKE_INSTALL_PREFIX`` on Unix platforms are ``/usr/local``, ``/opt``.
The following commands create a directory for building (avoid building in the source folder), builds
the first example with cmake and then runs the program:
.. code:: bash
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=your_prefix ..
make
./first_program
Second example: simplified variable creation
--------------------------------------------
`xframe` provides many shortcuts so coordinates and variables can be created with a concise syntax.
The following example creates the same variable as the previous one:
.. code::
#include <iostream>
#include "xtensor/xrandom.hpp"
#include "xframe/xio.hpp"
#include "xframe/xvariable.hpp"
int main(int argc, char* argv[])
{
using coordinate_type = xf::xcoordinate<xf::fstring>;
using variable_type = xf::xvariable<double, coordinate_type>;
using data_type = variable_type::data_type;
// Creation of the data
data_type data = xt::eval(xt::random::rand({6, 3}, 15., 25.));
data(0, 0).has_value() = false;
data(2, 1).has_value() = false;
// Creation of the variable
auto var = variable_type(
data,
{
{"date", xf::axis({"2018-01-01", "2018-01-02", "2018-01-03", "2018-01-04", "2018-01-05", "2018-01-06"})},
{"city", xf::axis({"London", "Paris", "Brussels"})}
}
);
std::cout << var << std::endl;
return 0;
}
When compiled and run, this produces output similar to the one of the previous example (same coordinate system
but different data due to random generation).
Third example: data access
--------------------------
`xframe` provides different ways to access data in a variable.
.. code::
#include <iostream>
#include "xtensor/xrandom.hpp"
#include "xframe/xio.hpp"
#include "xframe/xvariable.hpp"
int main(int argc, char* argv[])
{
using coordinate_type = xf::xcoordinate<xf::fstring>;
using variable_type = xf::xvariable<double, coordinate_type>;
using data_type = variable_type::data_type;
// Creation of the data
data_type data = xt::eval(xt::random::rand({6, 3}, 15., 25.));
data(0, 0).has_value() = false;
data(2, 1).has_value() = false;
// Creation of the variable
auto var = variable_type(
data,
{
{"date", xf::axis({"2018-01-01", "2018-01-02", "2018-01-03", "2018-01-04", "2018-01-05", "2018-01-06"})},
{"city", xf::axis({"London", "Paris", "Brussels"})}
}
);
// Data access
std::cout << "operator() - " << var(3, 0) << std::endl;
std::cout << "locate - " << var.locate("2018-01-04", "London") << std::endl;
std::cout << "iselect - " << var.iselect({{"date", 3}, {"city", 0}}) << std::endl;
std::cout << "select - " << var.select({{"date", "2018-01-04"}, {"city", "London"}}) << std::endl;
return 0;
}
Outputs:
.. code::
operator() - 24.6769
locate - 24.6769
iselect - 24.6769
select - 24.6769
================================================
FILE: docs/source/index.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
.. image:: xframe.svg
:alt: xframe
Multi-dimensional labeled arrays and data frame based on `xtensor`_.
Introduction
------------
`xframe` is a C++ library meant for numerical analysis with multi-dimensional
labeled array expressions (also referred as variable expressions) and data frame
expressions. It is built upon `xtensor`_ and provides similar features:
- an extensible expression system enabling **lazy broadcasting** based on dimension
names.
- an API following the idioms of the C++ standard library.
- tools to manipulate variable expressions and build upon *xframe*.
The API of `xframe` is inspired by the ones of `pandas`_ and `xarray`_.
`xframe` requires a modern C++ compiler supporting C++14. The following C++
compilers are supported:
- On Windows platforms, Visual C++ 2015 Update 2, or more recent
- On Unix platforms, gcc 4.9 or a recent version of Clang
Licensing
---------
We use a shared copyright model that enables all contributors to maintain the
copyright on their contributions.
This software is licensed under the BSD-3-Clause license. See the LICENSE file
for details.
.. toctree::
:caption: INSTALLATION
:maxdepth: 1
installation
.. toctree::
:caption: USAGE
:maxdepth: 2
getting_started
data_structure
indexing
computation
.. toctree::
:caption: API REFERENCE
:maxdepth: 2
api/axis_index
api/coordinate_index
api/variable_index
.. toctree::
:caption: MISCELLANEOUS
xarray
.. _xtensor: https://github.com/xtensor-stack/xtensor
.. _pandas: https://pandas.pydata.org
.. _xarray: https://xarray.pydata.org
================================================
FILE: docs/source/indexing.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Indexing and selecting data
===========================
In this section, we consider the following variable:
.. code::
using coordinate_type = xf::xcoordinate<xf::fstring>;
using dimension_type = xf::xdimension<xf::fstring>;
using variable_type = xf::xvariable<double, coordinate_type>;
data_type d = xt::eval(xt::random::rand({6, 3}, 15., 25.));
variable_type v(std::move(d),
{
{"group", xf::axis({"a", "b", "d", "e", "g", "h"})},
{"city", xf::axis({"London", "Paris", "Brussels"})}
});
Printing this variable in a Jupyter Notebook gives:
+-------+---------+---------+----------+
| | London | Paris | Brussels |
+=======+=========+=========+==========+
| **a** | 16.3548 | 23.3501 | 24.6887 |
+-------+---------+---------+----------+
| **b** | 17.2103 | 18.0817 | 20.4722 |
+-------+---------+---------+----------+
| **d** | 16.8838 | 24.9288 | 24.9646 |
+-------+---------+---------+----------+
| **e** | 24.6769 | 22.2584 | 24.8111 |
+-------+---------+---------+----------+
| **g** | 16.0986 | 22.9811 | 17.9703 |
+-------+---------+---------+----------+
| **h** | 15.0478 | 16.1246 | 21.3976 |
+-------+---------+---------+----------+
`xframe` provides flexible indexing methods for data selection, similar to the
ones of `xarray`_. These methods are summarized in the following table:
+------------------+--------------+---------------------------------------------------+
| Dimension lookup | Index lookup | ``xvariable`` syntax |
+==================+==============+===================================================+
| Positional | By integer | ``v(2, 1)`` |
+------------------+--------------+---------------------------------------------------+
| Positional | By label | ``v.locate("d", "Paris")`` |
+------------------+--------------+---------------------------------------------------+
| By name | By integer | ``v.iselect({{"group", 2}, {"city", 1}})`` |
+------------------+--------------+---------------------------------------------------+
| By name | By label | ``v.select({{"group", "d"}, {"city", "Paris"}})`` |
+------------------+--------------+---------------------------------------------------+
Positional indexing
-------------------
The most basic way to access elements of an ``xvariable`` is to use ``operator()``, like
you would do with an ``xtensor``:
.. code::
std::cout << v(2, 1) << std::endl;
Contrary to Python, it is not possible to have different return types for a same method
in C++. Multi selection is done with free functions that return views on the variable:,
.. code::
#include "xvariable_view.hpp"
auto view1 = xf::ilocate(v, xf::irange(0, 5, 2), xf::irange(1, 3));
std::cout << view1 << std::endl;
+-------+---------+----------+
| | Paris | Brussels |
+=======+=========+==========+
| **a** | 23.3501 | 24.6887 |
+-------+---------+----------+
| **d** | 24.9288 | 24.9646 |
+-------+---------+----------+
| **g** | 22.9811 | 17.9703 |
+-------+---------+----------+
Therefore a change in the view will reflect in the underlying variable:
.. code::
view1(0, 1) = 0.;
std::cout << v(2, 2) << std::endl;
// Outputs 0.
In the code creating the view, ``irange`` returns a range slice from `xtensor`, so any multi
selection in `xtensor` is also supported in `xframe`.
``xvariable`` also supports label-based indexing, with the ``locate`` method for single
point selection, and ``locate`` free function for multi selection:
.. code::
std::cout << v.locate("d", "Paris") << std::endl;
auto view2 = xf::locate(v, xf::range("a", "h", 2), xf::range("Paris", "Brussels"));
std::cout << view2 << std::endl;
// Same output as previous code
Be aware of the difference between ``range`` and ``irange`` parameters: for the former one,
accepting labels, the last value is *included* while for the latter one, accepting integral
indices, the las value is *excluded*.
`xframe` provides label-based slices similar to those of `xtensor`, so label-based
multi selection is really similar to positional multi selection.
Indxing with dimension names
----------------------------
With the dimension names, we do not have to rely on the dimension order. We can use them
explicitely to select data; Like positional indexing, `xframe` provides methods and
free functions depending on the kind of selection you want to do:
.. code::
// Dimension by name, index by position
std::cout << v.iselect({{"city", 1}, {"group", 2}}) << std::endl;
auto view3 = xf::iselect(v, {{"city", xf::irange(1, 3)}, {"group", xf::irange(0, 5, 2)}});
// Dimension by name, index by label
std::cout << v.select({{"city", "Paris"}, {"group", "d"}}) << std::endl;
auto view4 = xf::select(v, {{"city", xf::range("Paris", "Brussels")}, {"group", xf::range("a", "h", 2)}});
// view3 and view4 gives the same output as view2 and view1
Contrary to `xarray`_, `xframe` does not provide a selection operator accepting a map
argument.
Keeping and dropping labels
---------------------------
``drop`` and ``keep`` functions return slices that can be used to create a view with
the listed labels along the specified dimensions dropped or kept:
.. code::
auto view5 = xf::select(v, {{"city", xf::drop("London")}, {"group", xf::keep("a", "d", "g")}});
// view5 is equivalent to view4
This is different form `xarray`_ where the ``xarray.DataArray.drop`` method returns a new object.
To achieve the same with `xframe`, simply assign the view to a new ``xvariable`` object:
.. code::
variable_type v2 = view5;
Masking views
-------------
Masking views allow to select data points based on conditions expresses on labels. These conditions
can be arbitrary complicated boolean expressions. Contrary to other views which are generally a
subset of the original data, a masking view has the same shape as its underlying ``xvariable``.
Masking views are created with the ``where`` function:
.. code::
data_type d2 = {{ 1., 2., 3. },
{ 4., 5., 6. },
{ 7., 8., 9. }};
auto v3 = variable_type(
d2,
{
{"x", xf::axis(3)},
{"y", xf::axis(3)},
}
);
auto view6 = xf::where(
v3,
not_equal(v3.axis<int>("x"), 2) && v3.axis<int>("y") < 2
);
std::cout << view6 << std::endl;
In a Jupyter Notebookn, this outputs the following:
+-------+--------+--------+--------+
| | 0 | 1 | 2 |
+=======+========+========+========+
| **0** | 1 | 2 | masked |
+-------+--------+--------+--------+
| **1** | 4 | 5 | masked |
+-------+--------+--------+--------+
| **2** | masked | masked | masked |
+-------+--------+--------+--------+
When assigning to a masked view, masked values are not changed. Like other views,
a masking view is a proxy on its underlying variable, no copy is made, so changing
an unmasked value actually changes the corresponding value in the undnerlying variable.
Assigning values with indexing
------------------------------
Data selection in variables return either references or views; therefore, contrary to
`xarray`_, it is *possible* to assign values to a subset of a variable with any of the
indexing method:
.. code::
// The next four lines are equivalent, they change a single value of v:
v(2, 1) = 2.5;
v.locate("d", "Paris") = 2.5;
v.iselect({{"city", 1}, {"group", 2}}) = 2.5;
v.select({{"city", "Paris"}, {"group", "d"}}) = 2.5;
data_type d3 = {{0., 1.},
{2., 3.},
{4., 5.}};
auto v4 = variable_type(
d3,
{
{"group", xf::axis({"a", "d", "g"})},
{"city", xf::axis({"Paris", "Brussels"})}
}
);
// The next four lines are equivalent, they change a subset of v
xf::ilocate(v, xf::irange(0, 5, 2), xf::irange(1, 3)) = v4;
xf::locate(v, xf::range("a", "h", 2), xf::range("Paris", "Brussels")) = v4;
xf::iselect(v, {{"city", xf::irange(1, 3)}, {"group", xf::irange(0, 5, 2)}}) = v4;
xf::select(v, {{"city", xr::range("Paris", "Brussels")}, {"group", xf::range("a", "h", 2)}}) = v4;
Printing ``v`` after the assign gives
+-------+---------+---------+----------+
| | London | Paris | Brussels |
+=======+=========+=========+==========+
| **a** | 16.3548 | 0 | 1 |
+-------+---------+---------+----------+
| **b** | 17.2103 | 18.0817 | 20.4722 |
+-------+---------+---------+----------+
| **d** | 16.8838 | 2 | 3 |
+-------+---------+---------+----------+
| **e** | 24.6769 | 22.2584 | 24.8111 |
+-------+---------+---------+----------+
| **g** | 16.0986 | 4 | 5 |
+-------+---------+---------+----------+
| **h** | 15.0478 | 16.1246 | 21.3976 |
+-------+---------+---------+----------+
Reindexing views
----------------
Reindexing views give variables new set of coordinates to corresponding dimensions. Like other views,
no copy is involved. Asking for values corresponding to new labels not found in the original set of
coordinates returns missing values. In the next example, we reindex the ``city`` dimension:
.. code::
auto view7 = xf::reindex(v, {{"city", xf::axis({"London", "New York", "Brussels"})}});
+-------+---------+----------+----------+
| | London | New York | Brussels |
+=======+=========+==========+==========+
| **a** | 16.3548 | N/A | 24.6887 |
+-------+---------+----------+----------+
| **b** | 17.2103 | N/A | 20.4722 |
+-------+---------+----------+----------+
| **d** | 16.8838 | N/A | 24.9646 |
+-------+---------+----------+----------+
| **e** | 24.6769 | N/A | 24.8111 |
+-------+---------+----------+----------+
| **g** | 16.0986 | N/A | 17.9703 |
+-------+---------+----------+----------+
| **h** | 15.0478 | N/A | 21.3976 |
+-------+---------+----------+----------+
Like `xarray`_, `xframe` provides the useful ``reindex_like`` shortcut which allows to reindex a
variable given the set of coordinates of another variable:
.. code::
auto v5 = variable_type(
d,
{
{"group", xf::axis({"a", "b", "d", "e", "g", "h"})},
{"city", xf::axis({"London", "New York", "Brussels"})}
}
);
auto view8 = xf::reindex_like(v, v5);
// view8 is equivalent to view7
A reindexing view is a read-only view, it is not possible to change its value with indexing.
This allows memory optimizations, the view does not have to store the missing values, it can
return a proxy to a static-allocated missing value.
The ``align`` function allows to reindex many variables with more flexible options:
.. code::
auto t1 = xf::align<join::inner>(v, v5);
std::cout << std::get<0>(t1) << std::endl;
std::cout << std::get<1>(t1) << std::endl;
The last lines print the same output:
+-------+---------+----------+
| | London | Brussels |
+=======+=========+==========+
| **a** | 16.3548 | 24.6887 |
+-------+---------+----------+
| **b** | 17.2103 | 20.4722 |
+-------+---------+----------+
| **d** | 16.8838 | 24.9646 |
+-------+---------+----------+
| **e** | 24.6769 | 24.8111 |
+-------+---------+----------+
| **g** | 16.0986 | 17.9703 |
+-------+---------+----------+
| **h** | 15.0478 | 21.3976 |
+-------+---------+----------+
In the following, the variables are aligned w.r.t the union of the coordinates instead
of their intersection:
.. code::
auto t2 = xf::align<join::outer>(v, v5);
std::cout << std::get<0>(t2) << std::endl;
std::cout << std::get<1>(t2) << std::endl;
The first outuput is
+-------+---------+---------+----------+----------+
| | London | Paris | Brussels | New York |
+=======+=========+=========+==========+==========+
| **a** | 16.3548 | 23.3501 | 24.6887 | N/A |
+-------+---------+---------+----------+----------+
| **b** | 17.2103 | 18.0817 | 20.4722 | N/A |
+-------+---------+---------+----------+----------+
| **d** | 16.8838 | 24.9288 | 24.9646 | N/A |
+-------+---------+---------+----------+----------+
| **e** | 24.6769 | 22.2584 | 24.8111 | N/A |
+-------+---------+---------+----------+----------+
| **g** | 16.0986 | 22.9811 | 17.9703 | N/A |
+-------+---------+---------+----------+----------+
| **h** | 15.0478 | 16.1246 | 21.3976 | N/A |
+-------+---------+---------+----------+----------+
While the second have ``N/A`` in the ``Paris`` column.
.. _xarray: https://xarray.pydata.org
================================================
FILE: docs/source/installation.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay and Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
.. raw:: html
<style>
.rst-content .section>img {
width: 30px;
margin-bottom: 0;
margin-top: 0;
margin-right: 15px;
margin-left: 15px;
float: left;
}
</style>
Installation
============
Although ``xframe`` is a header-only library, we provide standardized means to
install it, with package managers or with cmake.
Besides the xframe headers, all these methods place the ``cmake`` project
configuration file in the right location so that third-party projects can use
cmake's ``find_package`` to locate xframe headers.
.. image:: conda.svg
Using the conda-forge package
-----------------------------
A package for xframe is available for the mamba (or conda) package manager.
.. code::
mamba install -c conda-forge xframe
.. image:: cmake.svg
From source with cmake
----------------------
You can also install ``xframe`` from source with cmake. This requires that you
have the xtensor_ library installed on your system. On Unix platforms,
from the source directory:
.. code::
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=path_to_prefix ..
make install
On Windows platforms, from the source directory:
.. code::
mkdir build
cd build
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=path_to_prefix ..
nmake
nmake install
``path_to_prefix`` is the absolute path to the folder where cmake searches for
dependencies and installs libraries. ``xframe`` installation from cmake assumes
this folder contains ``include`` and ``lib`` subfolders.
Including xframe in your project
--------------------------------
The different packages of ``xframe`` are built with cmake, so whatever the
installation mode you choose, you can add ``xframe`` to your project using cmake:
.. code::
find_package(xframe REQUIRED)
target_include_directories(your_target PUBLIC ${xframe_INCLUDE_DIRS})
target_link_libraries(your_target PUBLIC xframe)
.. _xtensor: https://github.com/xtensor-stack/xtensor
================================================
FILE: docs/source/xarray.rst
================================================
.. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht
and Martin Renou
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
From xarray to xframe
=====================
.. raw:: html
<style>
.rst-content table.docutils {
width: 100%;
table-layout: fixed;
border: none;
}
table.docutils th {
text-align: center;
}
table.docutils .line-block {
margin-left: 0;
margin-bottom: 0;
}
table.docutils code.literal {
color: initial;
}
code.docutils {
background: initial;
border: none;
}
* {
border: none;
}
.rst-content table.docutils thead {
background-color: #d0e0e0;
}
.rst-content table.docutils td {
border-bottom: none;
border-left: none;
}
.rst-content table.docutils tr:hover {
background-color: #d0e0e0;
}
.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1):hover td {
background-color: initial;
}
#linear-algebra table.docutils thead .row-odd {
background: #ffdddd;
}
#linear-algebra tr:nth-child(2n-1) td {
background: #f9f3f3;
}
#linear-algebra tr:hover {
background: #ffdddd;
}
#linear-algebra tr:nth-child(2n-1):hover td {
background-color: initial;
}
</style>
.. |_| unicode:: 0xA0
Containers
----------
+------------------------------------------------+--------------------------------------------------+
| Python 3 - xarray | C++ 14 - xframe |
+================================================+==================================================+
| | ``xr.DataArray([[1, 2], [3, 4]],`` | | ``xf::variable<double>({{1, 2}, {3, 4}},`` |
| | |_| |_| |_| ``[('x', ['a', 'b']),`` | | |_| |_| |_| ``{{"x", xf::axis({"a", "b"})},`` |
| | |_| |_| |_| |_| ``('y', [1, 4])])`` | | |_| |_| |_| |_| ``{"y", xf::axis({1, 4})}})`` |
+------------------------------------------------+--------------------------------------------------+
Indexing
--------
`xframe` returns views for multi-selection, no copy is made.
+-----------------------------------------------+-------------------------------------------------------------+
| Python 3 - xarray | C++ 14 - xframe |
+===============================================+=============================================================+
| ``da[0, 1]`` | ``v(0, 1)`` |
+-----------------------------------------------+-------------------------------------------------------------+
| ``da.loc['a', 'Paris']`` | ``v.locate("a", "Paris")`` |
+-----------------------------------------------+-------------------------------------------------------------+
| ``da.isel(city=1, group=0)`` | ``v.iselect({{"city", 1}, {"group", 0}})`` |
+-----------------------------------------------+-------------------------------------------------------------+
| ``da.sel(city='Paris', group='a')`` | ``v.select({{"city", "Paris"}, {"group", "a"}})`` |
+-----------------------------------------------+-------------------------------------------------------------+
| ``da[:, 1]`` | ``xf::ilocate(v, xf::iall(), 1)`` |
+-----------------------------------------------+-------------------------------------------------------------+
| ``da.loc[:, 'Paris']`` | ``xf::locate(v, xf::all(), "Paris")`` |
+-----------------------------------------------+-------------------------------------------------------------+
| ``da.isel(city=1)`` | ``xf::iselect(v, {{"city", 1}})`` |
+-----------------------------------------------+-------------------------------------------------------------+
| ``da.sel(city='Paris')`` | ``xf::select(v, {{"city", "Paris"}})`` |
+-----------------------------------------------+-------------------------------------------------------------+
| ``da.reindex(city=['NYC', 'Paris'])`` | ``xf::reindex(v, {{"city", xf::axis({"NYC", "Paris"})}})`` |
+-----------------------------------------------+-------------------------------------------------------------+
| ``da.reindex_like(df)`` | ``xf::reindex_like(v, v2)`` |
+-----------------------------------------------+-------------------------------------------------------------+
Logical
-------
Logical universal functions are truly lazy. ``xf::where(condition, a, b)`` does not evaluate ``a``
where ``condition`` is falsy, and it does not evaluate ``b`` where ``condition`` is truthy.
`xarray` relies on `numpy` functions, that can also operate on ``xarray.DataArray``.
+-----------------------------------------------+-----------------------------------------------+
| Python 3 - xarray | C++ 14 - xframe |
+===============================================+===============================================+
| ``xr.where(a > 5, a, b)`` | ``xf::where(a > 5, a, b)`` |
| ``xr.where(a > 5, 100, a)`` | ``xf::where(a > 5, 100, a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.any(a)`` | ``xf::any(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.all(a)`` | ``xf::all(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.logical_and(a, b)`` | ``a && b`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.logical_or(a, b)`` | ``a || b`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.isclose(a, b)`` | ``xf::isclose(a, b)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.allclose(a, b)`` | ``xf::allclose(a, b)`` |
+-----------------------------------------------+-----------------------------------------------+
Comparisons
-----------
`xarray` relies on `numpy` functions, that can also operate on ``xarray.DataArray``.
+-----------------------------------------------+-----------------------------------------------+
| Python 3 - xarray | C++ 14 - xframe |
+===============================================+===============================================+
| ``np.equal(a, b)`` | ``xf::equal(a, b)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.not_equal(a, b)`` | ``xf::not_equal(a, b)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.less(a, b)`` || ``xf::less(a, b)`` |
| || ``a < b`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.less_equal(a, b)`` || ``xf::less_equal(a, b)`` |
| || ``a <= b`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.greater(a, b)`` || ``xf::greater(a, b)`` |
| || ``a > b`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.greater_equal(a, b)`` || ``xf::greater_equal(a, b)`` |
| || ``a >= b`` |
+-----------------------------------------------+-----------------------------------------------+
Mathematical functions
----------------------
xframe universal functions are provided for a large set number of mathematical functions.
`xarray` relies on `numpy` functions, that can also operate on ``xarray.DataArray``.
**Basic functions:**
+-----------------------------------------------+-----------------------------------------------+
| Python 3 - xarray | C++ 14 - xframe |
+===============================================+===============================================+
| ``np.absolute(a)`` | ``xf::abs(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.sign(a)`` | ``xf::sign(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.remainder(a, b)`` | ``xf::remainder(a, b)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.clip(a, min, max)`` | ``xf::clip(a, min, max)`` |
+-----------------------------------------------+-----------------------------------------------+
| | ``xf::fma(a, b, c)`` |
+-----------------------------------------------+-----------------------------------------------+
**Exponential functions:**
+-----------------------------------------------+-----------------------------------------------+
| Python 3 - xarray | C++ 14 - xframe |
+===============================================+===============================================+
| ``np.exp(a)`` | ``xf::exp(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.expm1(a)`` | ``xf::expm1(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.log(a)`` | ``xf::log(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.log1p(a)`` | ``xf::log1p(a)`` |
+-----------------------------------------------+-----------------------------------------------+
**Power functions:**
+-----------------------------------------------+-----------------------------------------------+
| Python 3 - xarray | C++ 14 - xframe |
+===============================================+===============================================+
| ``np.power(a, p)`` | ``xf::pow(a, b)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.sqrt(a)`` | ``xf::sqrt(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.square(a)`` | ``xf::square(a)`` |
| | ``xf::cube(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.cbrt(a)`` | ``xf::cbrt(a)`` |
+-----------------------------------------------+-----------------------------------------------+
**Trigonometric functions:**
+-----------------------------------------------+-----------------------------------------------+
| Python 3 - xarray | C++ 14 - xframe |
+===============================================+===============================================+
| ``np.sin(a)`` | ``xf::sin(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.cos(a)`` | ``xf::cos(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.tan(a)`` | ``xf::tan(a)`` |
+-----------------------------------------------+-----------------------------------------------+
**Hyperbolic functions:**
+-----------------------------------------------+-----------------------------------------------+
| Python 3 - xarray | C++ 14 - xframe |
+===============================================+===============================================+
| ``np.sinh(a)`` | ``xf::sinh(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.cosh(a)`` | ``xf::cosh(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``np.tanh(a)`` | ``xf::tanh(a)`` |
+-----------------------------------------------+-----------------------------------------------+
**Error and gamma functions:**
+-----------------------------------------------+-----------------------------------------------+
| Python 3 - xarray | C++ 14 - xframe |
+===============================================+===============================================+
| ``scipy.special.erf(a)`` | ``xf::erf(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``scipy.special.gamma(a)`` | ``xf::tgamma(a)`` |
+-----------------------------------------------+-----------------------------------------------+
| ``scipy.special.gammaln(a)`` | ``xf::lgamma(a)`` |
+-----------------------------------------------+-----------------------------------------------+
================================================
FILE: docs/source/xframe_summary_drawio.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<mxfile modified="2019-01-22T08:40:54.529Z" host="www.draw.io" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36" etag="Ukd6bYewr-A5ItxCvbHP" version="10.1.3-4" type="google"><diagram id="cwnSat86R0DeLljoPVqK" name="Page-1">7Z3dc6M2EMD/Gs+0D70BBNg8xo5z7fTaaece2t5LhxjFpoeRC3Ji96+vMOJz1x8Xg3ACfriDBcuwP620u6zIiMzWu4+Ru1n9wjwajAzN243I/cgwdMd0xH+JZC8lumamkmXke1JWCD77/1Ep1KR063s0rpzIGQu4v6kKFywM6YJXZG4UsZfqaU8sqP7qxl1SIPi8cAMo/cP3+CqVTiytkP9I/eWK5/cnj6zd7GQpiFeux15KIjIfkVnEGE+31rsZDRLtZXpJv/dw5Gh+YREN+SVfsOa7TyR4Cb/8tFxv519+5/TnyQ+WkTbz7AZbecfyavk+U0HEtqFHk1a0EZm+rHxOP2/cRXL0RVAXshVfB2JPF5tPLOSSop6c7gb+MhQ7Uaqj6ZMfBDMWsEjIQhaK86Yxj9hXmglHBiE2cYj4vannxqvDDyctw/uVKnimEae7kkje/0fK1pRHe3GKPDqRKGRnJBmrl4KsZUvZqkw1Y+jK3rTMmy4ULjakzr9B/4bTY/3rk+71P+mx/u3O1a8D7e/cnR83hsDQMP1qmuNomjwTk6ffyMZ7oxnlO1XlI31fdxDlT1rr+kD3+v1h3tps/HA5IneAgrhRXlV1VbWyPyNdvG4FidZ8McneSfna97zkV1C0VfgNkKjbAYICI0HaImEBTVNPOCFyl0V8xZYsdIN5Ia0ppYTkH8r5XnZ/d8uZEBUtfGJsk6NzI36XeEjJb2xomMke/OTqD83S0KudISSV4+L2/yzv/JXsfLCy3ftd+eD9/hzDmG2jBT2hKuk8iutcUn7iPDs9L9HjyR4R0cDl/nPV2cMAy6/+xnxxyXlPsvRqT3Ksagvpdcov1XpJfhWv7zgmMOHAfaTBteNnyX7FqPhw+GDjqK6NiTOH42gub2UcJeetd6LSem0AYcNin/ssvA5DK8qzjNtS3hgoj+7c9SZRWH/mn9y/6moCusAJLk0Fi8CNY39x2uk6qqazQ3LZG0WUkMmuHLnro4hu1pSbTkVg6AYN2dqZhlqeAy4IIEvspD28J3DWK8GBhupRTsvgMtehN+RMoyFyoKH6wNg2ORi2vnNydlPk6g2pJgeD3vdNzqrPTq8lBxpSTY70jZzZFLl6Q6rJwShVA+iud+0XgiONrvPt68nbo33kG6LV8RGMpV5kIL1I1453mOtSrhbAIe7ADhL1P0Zia8nzO+8DIFO/NUAwoWD0GpB1a4Bg0oL0GpBza4BgPsPsDw6L3BqOvqUorKZSFKAhxa6bgQW69r/bpGRl6habb8S4jj2maMDogJuHPFtXanSZjaHoHgd0JxzAztFhoW7Giw7oTriGnaODsW7BazmgO+E0do4OxsUFL39Ad8LB7BwdjJhhSc1tYmoCx61lmAwYHxfmsxss6QS6ri0ps+xyQeaCscjzQ5dTAKzZssyHB8chBGo8l6soyzSQmnC1dZkEBl2/in/6WJiJwVBaGEMI0PVQmnlMV5fWZhI5OasuzjR0tdWZBAYDnr+mYXwoDdRCd93AiFoaJ+/mpk4MbGStHWm5IBOzWqVFhQS68g0sK7iRZQT1Cs7utQ297x7WcBqI1612qsK87pry45W7STYX2yjYTyN38TUZqM91/EJ32AKnWucnxHEO1eJ1XE0MNHVfzbzMXa6n35vTOVY4m+fHH+OFH8dvPk2eTx4NEDSzwPwEQRMh2NoCNII9m8p4FXHPQPAowXHHBE0YsrYz7ygApR0+DYEanx8sdaWgkIeJAygEFGJRakEZAFTiPX83Gk+PPP0Vv6MdebpYPUSPHyo/HRnff99Cvwjo05V+49leIR3/JnrF5PxMqWcBrZpuAR9LZt1CS2GS9D/dGAAiADGzVgsQCYtLCYnmc7vlyBdEz7atabMZZJDLG2BQixcIss5ObW7XhLFyXxfdCxgfNDJxrPHEnhCNWDZgozR+NsdA9UOq95iuZNx7NtWbvf5JdaqXEMUL8WEioBepXmxEVZp8NGH8/oZW33euviwz1u/cLUFcM7UvgLlgQek7y92SC0sdWsvdWqeqLIfc7fnMX060q8yfdarYcsjdXkAQsUG1BJGayyElCFOCmKkpTQlaMG4dQGGgEItSCwo+BdZawKQgE9cgpMn5YU9tJs6C4aI+UDrvXiim1Od385pIaKr45bA2DE5Lxch/x/uY03VjRI7krS9+GaJ9+GBBVfJpJZ9tYs+ElOazbQPxC+5v3y8wzHYHM0Cq6yoJG0a77/zZT/2FRaixZEvT1RgLjFff++IKYl4AAUv7tAcBW+b3BnIDbY9Y9TezdT9iISFnb7wvC7ET1d4XUts6TO1G0eMzVF2nQW0Ypuy4mNjFzRsa3W0iGncyyedKbxFGfZK30NBe5SQ/RoKWZzfy3ceg7Sn+rMJVrJ9ECSid4cfYw7RhhgczfOcD1xgGjz2P743xBcbUUIAvdou/PZbWwRR/wo3M/wc=</diagram></mxfile>
================================================
FILE: environment-dev.yml
================================================
name: xframe
channels:
- conda-forge
dependencies:
- cmake
- xtensor=0.21.4
================================================
FILE: environment.yml
================================================
name: xframe
channels:
- QuantStack
- conda-forge
dependencies:
- xframe=0.3.0
- xeus-cling=0.8.1
- notebook
================================================
FILE: include/xframe/xaxis.hpp
================================================
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XFRAME_XAXIS_HPP
#define XFRAME_XAXIS_HPP
#include <initializer_list>
#include <iterator>
#include <algorithm>
#include <map>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include "xtl/xiterator_base.hpp"
#include "xtensor/xbuilder.hpp"
#include "xaxis_base.hpp"
#include "xframe_utils.hpp"
namespace xf
{
template <class L, class T, class MT>
class xaxis_iterator;
template <class L, class T>
class xaxis_default;
/*********************
* map container tag *
*********************/
struct map_tag {};
struct hash_map_tag {};
template <class K, class T, class MT>
struct map_container;
template <class K, class T>
struct map_container<K, T, map_tag>
{
using type = std::map<K, T>;
};
template <class K, class T>
struct map_container<K, T, hash_map_tag>
{
using type = std::unordered_map<K, T>;
};
template <class K, class T, class MT>
using map_container_t = typename map_container<K, T, MT>::type;
/*********
* xaxis *
*********/
/**
* @class xaxis
* @brief Class modeling an axis in a coordinate system.
*
* The xaxis class is used for modeling general axes; an axis is a mapping
* of labels to positions in a given dimension. It is the equivalent of
* the \c Index object from <a href="pandas.pydata.org">pandas</a>.
*
* @tparam L the type of labels.
* @tparam T the integer type used to represent positions. Default value is
* \c std::size_t.
* @tparam MT the tag used for choosing the map type which holds the label-
* position pairs. Possible values are \c map_tag and \c hash_map_tag.
* Default value is \c hash_map_tag.
*/
template <class L, class T = std::size_t, class MT = hash_map_tag>
class xaxis : public xaxis_base<xaxis<L, T, MT>>
{
public:
using base_type = xaxis_base<xaxis>;
using self_type = xaxis<L, T, MT>;
using key_type = typename base_type::key_type;
using label_list = typename base_type::label_list;
using mapped_type = typename base_type::mapped_type;
using map_type = map_container_t<key_type, mapped_type, MT>;
using value_type = typename map_type::value_type;
using reference = typename map_type::const_reference;
using const_reference = typename map_type::const_reference;
using pointer = typename map_type::const_pointer;
using const_pointer = typename map_type::const_pointer;
using size_type = typename base_type::size_type;
using difference_type = typename base_type::difference_type;
using iterator = typename base_type::iterator;
using const_iterator = typename base_type::const_iterator;
using reverse_iterator = typename base_type::reverse_iterator;
using const_reverse_iterator = typename base_type::const_reverse_iterator;
explicit xaxis();
explicit xaxis(const label_list& labels);
explicit xaxis(label_list&& labels);
xaxis(std::initializer_list<key_type> init);
template <class L1>
explicit xaxis(xaxis_default<L1, T> axis);
template <class InputIt>
xaxis(InputIt first, InputIt last);
bool is_sorted() const noexcept;
bool contains(const key_type& key) const;
mapped_type operator[](const key_type& key) const;
template <class F>
self_type filter(const F& f) const noexcept;
template <class F>
self_type filter(const F& f, size_type size) const noexcept;
const_iterator find(const key_type& key) const;
const_iterator cbegin() const noexcept;
const_iterator cend() const noexcept;
template <class... Args>
bool merge(const Args&... axes);
template <class... Args>
bool intersect(const Args&... axes);
protected:
void populate_index();
void set_labels(const label_list& labels);
template <class Arg, class... Args>
bool merge_unsorted(bool broadcasting, const Arg& a, const Args&... axes);
bool merge_unsorted(bool broadcasting);
template <class Arg, class... Args>
bool intersect_unsorted(const Arg& al, const Args&... axes_labels);
bool intersect_unsorted();
private:
xaxis(const label_list& labels, bool is_sorted);
xaxis(label_list&& labels, bool is_sorted);
typename map_type::const_iterator find_index(const key_type& key) const;
template <class... Args>
bool merge_impl(const Args&... axes);
template <class Arg1, class... Args>
bool merge_empty(const Arg1& a, const Args&... axes);
bool merge_empty();
bool init_is_sorted() const noexcept;
template <class Arg, class... Args>
bool all_sorted(const Arg& a, const Args&... axes) const noexcept;
template <class Arg>
bool all_sorted(const Arg& a) const noexcept;
map_type m_index;
bool m_is_sorted;
friend class xaxis_iterator<L, T, MT>;
friend class xaxis_default<L, T>;
};
template <class L, class T, class MT, class... Args>
bool merge_axes(xaxis<L, T, MT>& output, const Args&... axes);
template <class L, class T, class MT, class... Args>
bool intersect_axes(xaxis<L, T, MT>& output, const Args&... axes);
/******************
* xaxis builders *
******************/
template <class T = std::size_t, class L>
xaxis<L, T> axis(L start, L stop, L step = 1) noexcept;
template <class T = std::size_t, class L>
xaxis<L, T> axis(std::initializer_list<L> init) noexcept;
template <class T = std::size_t>
xaxis<XFRAME_STRING_LABEL, T> axis(std::initializer_list<const char*> init) noexcept;
/********************
* xaxis_inner_types *
*********************/
template <class L, class T, class MT>
struct xaxis_inner_types<xaxis<L, T, MT>>
{
using key_type = L;
using mapped_type = T;
using iterator = xaxis_iterator<L, T, MT>;
};
/******************
* xaxis_iterator *
******************/
template <class L, class T, class MT>
class xaxis_iterator : public xtl::xrandom_access_iterator_base<xaxis_iterator<L, T, MT>,
typename xaxis<L, T, MT>::value_type,
typename xaxis<L, T, MT>::difference_type,
typename xaxis<L, T, MT>::const_pointer,
typename xaxis<L, T, MT>::const_reference>
{
public:
using self_type = xaxis_iterator<L, T, MT>;
using container_type = xaxis<L, T, MT>;
using label_list = typename container_type::label_list;
using label_iterator = typename label_list::const_iterator;
using value_type = typename container_type::value_type;
using reference = typename container_type::const_reference;
using pointer = typename container_type::const_pointer;
using difference_type = typename container_type::difference_type;
using iterator_category = std::random_access_iterator_tag;
xaxis_iterator() = default;
xaxis_iterator(const container_type* c, label_iterator it);
self_type& operator++();
self_type& operator--();
self_type& operator+=(difference_type n);
self_type& operator-=(difference_type n);
difference_type operator-(const self_type& rhs) const;
reference operator*() const;
pointer operator->() const;
bool equal(const self_type& rhs) const noexcept;
bool less_than(const self_type& rhs) const noexcept;
private:
const container_type* p_c;
label_iterator m_it;
};
template <class L, class T, class MT>
typename xaxis_iterator<L, T, MT>::difference_type operator-(const xaxis_iterator<L, T, MT>& lhs, const xaxis_iterator<L, T, MT>& rhs);
template <class L, class T, class MT>
bool operator==(const xaxis_iterator<L, T, MT>& lhs, const xaxis_iterator<L, T, MT>& rhs) noexcept;
template <class L, class T, class MT>
bool operator<(const xaxis_iterator<L, T, MT>& lhs, const xaxis_iterator<L, T, MT>& rhs) noexcept;
/************************
* xaxis implementation *
************************/
/**
* @name Constructors
*/
//@{
/**
* Constructs an empty axis.
*/
template <class L, class T, class MT>
inline xaxis<L, T, MT>::xaxis()
: base_type(), m_index(), m_is_sorted(true)
{
}
/**
* Constructs an axis with the given list of labels. This list
* is copied and the constructor internally checks whether it
* is sorted.
* @param labels the list of labels.
*/
template <class L, class T, class MT>
inline xaxis<L, T, MT>::xaxis(const label_list& labels)
: base_type(labels), m_index(), m_is_sorted()
{
m_is_sorted = init_is_sorted();
populate_index();
}
/**
* Constructs an axis with the given list of labels. The list is
* moved and therefore it is invalid after the axis has been
* constructed. The constructor internally checks whether the list
* is sorted.
* @param labels the list of labels.
*/
template <class L, class T, class MT>
inline xaxis<L, T, MT>::xaxis(label_list&& labels)
: base_type(std::move(labels)), m_index(), m_is_sorted()
{
m_is_sorted = init_is_sorted();
populate_index();
}
/**
* Constructs an axis with the given list of labels, and a boolean
* specifying if the labels list is sorted. This is an optimization
* that prevents the constructor to check if the labels list is sorted.
* The list is copied.
* @param labels th list of labels.
* @param is_sorted a boolean parameter indicating if the labels list
* is sorted.
*/
template <class L, class T, class MT>
inline xaxis<L, T, MT>::xaxis(const label_list& labels, bool is_sorted)
: base_type(labels), m_index(), m_is_sorted(is_sorted)
{
populate_index();
}
/**
* Constructs an axis with the given list of labels, and a boolean
* specifying if the labels list is sorted. This is an optimization
* that prevents the constructor to check if the labels list is sorted.
* The list is moved and therefore invalid after the axis has been
* constructed.
* @param labels th list of labels.
* @param is_sorted a boolean parameter indicating if the labels list
* is sorted.
*/
template <class L, class T, class MT>
inline xaxis<L, T, MT>::xaxis(label_list&& labels, bool is_sorted)
: base_type(labels), m_index(), m_is_sorted(is_sorted)
{
populate_index();
}
/**
* Constructs an axis from the given initializer list of labels. The
* constructor internally checks whether the list is sorted.
*/
template <class L, class T, class MT>
inline xaxis<L, T, MT>::xaxis(std::initializer_list<key_type> init)
: base_type(init), m_index(), m_is_sorted()
{
m_is_sorted = init_is_sorted();
populate_index();
}
/**
* Constructs an axis from a \c default_axis.
* @sa default_axis
*/
template <class L, class T, class MT>
template <class L1>
inline xaxis<L, T, MT>::xaxis(xaxis_default<L1, T> axis)
: base_type(axis.labels()), m_index(), m_is_sorted(true)
{
static_assert(std::is_same<L, L1>::value, "key_type L and key_type L1 must be the same");
populate_index();
}
/**
* Constructs an axis from the content of the range [first, last)
* @param first An iterator to the first label.
* @param last An iterator the the element following the last label.
*/
template <class L, class T, class MT>
template <class InputIt>
inline xaxis<L, T, MT>::xaxis(InputIt first, InputIt last)
: base_type(first, last), m_index(), m_is_sorted()
{
m_is_sorted = init_is_sorted();
populate_index();
}
//@}
/**
* Returns true if the labels list is sorted.
*/
template <class L, class T, class MT>
inline bool xaxis<L, T, MT>::is_sorted() const noexcept
{
return m_is_sorted;
}
/**
* @name Data
*/
//@{
/**
* Returns true if the axis contains the speficied label.
* @param key the label to search for.
*/
template <class L, class T, class MT>
inline bool xaxis<L, T, MT>::contains(const key_type& key) const
{
return m_index.count(key) != typename map_type::size_type(0);
}
/**
* Returns the position of the specified label. If this last one is
* not found, an exception is thrown.
* @param key the label to search for.
*/
template <class L, class T, class MT>
inline auto xaxis<L, T, MT>::operator[](const key_type& key) const -> mapped_type
{
return m_index.at(key);
}
//@}
/**
* @name Filters
*/
//@{
/**
* Builds an return a new axis by applying the given filter to the axis.
* @param f the filter used to select the labels to keep in the new axis.
*/
template <class L, class T, class MT>
template <class F>
inline auto xaxis<L, T, MT>::filter(const F& f) const noexcept -> self_type
{
return self_type(base_type::filter_labels(f), m_is_sorted);
}
/**
* Builds an return a new axis by applying the given filter to the axis. When
* the size of the new list of labels is known, this method allows some
* optimizations compared to the previous one.
* @param f the filter used to select the labels to keep in the new axis.
* @param size the size of the new label list.
*/
template <class L, class T, class MT>
template <class F>
inline auto xaxis<L, T, MT>::filter(const F& f, size_type size) const noexcept -> self_type
{
return self_type(base_type::filter_labels(f, size), m_is_sorted);
}
//@}
/**
* @name Iterator
*/
//@{
/**
* Returns a constant iterator to the element with label equivalent to \c key. If
* no such element is found, past-the-end iterator is returned.
* @param key the label to search for.
*/
template <class L, class T, class MT>
inline auto xaxis<L, T, MT>::find(const key_type& key) const -> const_iterator
{
auto map_iter = m_index.find(key);
return map_iter != m_index.end() ? cbegin() + map_iter->second : cend();
}
/**
* Returns a constant iterator to the first element of the axis.
* This element is a pair label - position.
*/
template <class L, class T, class MT>
inline auto xaxis<L, T, MT>::cbegin() const noexcept -> const_iterator
{
return const_iterator(this, this->labels().begin());
}
/**
* Returns a constant iterator to the element following the last element
* of the axis.
*/
template <class L, class T, class MT>
inline auto xaxis<L, T, MT>::cend() const noexcept -> const_iterator
{
return const_iterator(this, this->labels().end());
}
//@}
/**
* @name Set operations
*/
//@{
/**
* Merges all the axes arguments into this ones. After this function call,
* the axis contains all the labels from all the arguments.
* @param axes the axes to merge.
* @return true is the axis already contained all the labels.
*/
template <class L, class T, class MT>
template <class... Args>
inline bool xaxis<L, T, MT>::merge(const Args&... axes)
{
return this->empty() ? merge_empty(axes...) : merge_impl(axes...);
}
/**
* Replaces the labels with the intersection of the labels of
* the axes arguments and the labels of this axis.
* @param axes the axes to intersect.
* @return true if the intersection is equivalent to this axis.
*/
template <class L, class T, class MT>
template <class... Args>
inline bool xaxis<L, T, MT>::intersect(const Args&... axes)
{
bool res = true;
if (all_sorted(*this, axes...))
{
res = intersect_to(this->mutable_labels(), axes.labels()...);
populate_index();
}
else
{
res = intersect_unsorted(axes.labels()...);
}
return res;
}
//@}
template <class L, class T, class MT>
inline void xaxis<L, T, MT>::populate_index()
{
for(size_type i = 0; i < this->labels().size(); ++i)
{
m_index[this->labels()[i]] = T(i);
}
}
template <class L, class T, class MT>
void xaxis<L, T, MT>::set_labels(const label_list& labels)
{
this->mutable_labels() = labels;
populate_index();
}
template <class L, class T, class MT>
inline auto xaxis<L, T, MT>::find_index(const key_type& key) const -> typename map_type::const_iterator
{
return m_index.find(key);
}
template <class L, class T, class MT>
template <class... Args>
inline bool xaxis<L, T, MT>::merge_impl(const Args&... axes)
{
bool res = true;
if(all_sorted(*this, axes...))
{
res = merge_to(this->mutable_labels(), axes.labels()...);
populate_index();
}
else
{
m_is_sorted = false;
if (m_index.empty())
{
populate_index();
}
res = merge_unsorted(false, axes.labels()...);
}
return res;
}
template <class L, class T, class MT>
template <class Arg1, class... Args>
inline bool xaxis<L, T, MT>::merge_empty(const Arg1& a, const Args&... axes)
{
this->mutable_labels() = a.labels();
return merge_impl(axes...);
}
template <class L, class T, class MT>
inline bool xaxis<L, T, MT>::merge_empty()
{
return true;
}
template <class L, class T, class MT>
inline bool xaxis<L, T, MT>::init_is_sorted() const noexcept
{
return std::is_sorted(this->labels().begin(), this->labels().end());
}
template <class L, class T, class MT>
template <class Arg, class... Args>
inline bool xaxis<L, T, MT>::all_sorted(const Arg& a, const Args&... axes) const noexcept
{
return a.is_sorted() && all_sorted(axes...);
}
template <class L, class T, class MT>
template <class Arg>
inline bool xaxis<L, T, MT>::all_sorted(const Arg& a) const noexcept
{
return a.is_sorted();
}
template <class L, class T, class MT>
template <class Arg, class... Args>
inline bool xaxis<L, T, MT>::merge_unsorted(bool broadcasting, const Arg& a, const Args&... axes_labels)
{
bool res = merge_unsorted(broadcasting, axes_labels...);
auto& labels = this->mutable_labels();
auto output_iter = labels.rbegin();
auto output_end = labels.rend();
auto input_iter = a.rbegin();
auto input_end = a.rend();
while ((output_iter != output_end) && (input_iter != input_end) && (*output_iter == *input_iter))
{
++output_iter;
++input_iter;
}
if(input_iter == input_end)
{
if(output_iter != output_end)
{
res &= broadcasting;
}
}
else if(output_iter == output_end)
{
std::copy(a.begin(), a.begin() + std::distance(input_iter, input_end),
std::inserter(labels, labels.begin()));
populate_index();
res &= broadcasting;
}
else
{
while(input_iter != input_end)
{
if(!contains(*input_iter))
{
if(output_iter != labels.rbegin())
{
labels.insert(labels.begin(), *input_iter);
}
else
{
labels.push_back(*input_iter);
}
}
++input_iter;
}
populate_index();
res = false;
}
return res;
}
template <class L, class T, class MT>
inline bool xaxis<L, T, MT>::merge_unsorted(bool /*broadcasting*/)
{
return true;
}
template <class L, class T, class MT>
template <class Arg, class... Args>
inline bool xaxis<L, T, MT>::intersect_unsorted(const Arg& al, const Args&... axes_labels)
{
bool res = intersect_unsorted(axes_labels...);
auto& labels = this->mutable_labels();
auto iter = labels.begin();
auto iter_end = labels.end();
bool must_populate = false;
while (iter != iter_end)
{
auto it = std::find(al.begin(), al.end(), *iter);
if (it == al.end())
{
iter = labels.erase(iter, iter + 1);
iter_end = labels.end();
res = false;
must_populate = true;
}
else
{
if (it - al.begin() != iter - labels.begin())
{
res = false;
}
++iter;
}
}
if (must_populate)
{
populate_index();
}
return res;
}
template <class L, class T, class MT>
inline bool xaxis<L, T, MT>::intersect_unsorted()
{
return true;
}
template <class L, class T, class MT, class... Args>
inline bool merge_axes(xaxis<L, T, MT>& output, const Args&... axes)
{
return output.merge(axes...);
}
template <class L, class T, class MT, class... Args>
inline bool intersect_axes(xaxis<L, T, MT>& output, const Args&... axes)
{
return output.intersect(axes...);
}
/*********************************
* xaxis_iterator implementation *
*********************************/
template <class L, class T, class MT>
inline xaxis_iterator<L, T, MT>::xaxis_iterator(const container_type* c, label_iterator it)
: p_c(c), m_it(it)
{
}
template <class L, class T, class MT>
inline auto xaxis_iterator<L, T, MT>::operator++() -> self_type&
{
++m_it;
return *this;
}
template <class L, class T, class MT>
inline auto xaxis_iterator<L, T, MT>::operator--() -> self_type&
{
--m_it;
return *this;
}
template <class L, class T, class MT>
inline auto xaxis_iterator<L, T, MT>::operator+=(difference_type n) -> self_type&
{
m_it += n;
return *this;
}
template <class L, class T, class MT>
inline auto xaxis_iterator<L, T, MT>::operator-=(difference_type n) -> self_type&
{
m_it -= n;
return *this;
}
template <class L, class T, class MT>
inline auto xaxis_iterator<L, T, MT>::operator-(const self_type& rhs) const -> difference_type
{
return m_it - rhs.m_it;
}
template <class L, class T, class MT>
inline auto xaxis_iterator<L, T, MT>::operator*() const -> reference
{
return *(p_c->find_index(*m_it));
}
template <class L, class T, class MT>
inline auto xaxis_iterator<L, T, MT>::operator->() const -> pointer
{
return &(*(p_c->find_index(*m_it)));
}
template <class L, class T, class MT>
inline bool xaxis_iterator<L, T, MT>::equal(const self_type& rhs) const noexcept
{
return m_it == rhs.m_it;
}
template <class L, class T, class MT>
inline bool xaxis_iterator<L, T, MT>::less_than(const self_type& rhs) const noexcept
{
return m_it < rhs.m_it;
}
template <class L, class T, class MT>
inline typename xaxis_iterator<L, T, MT>::difference_type operator-(const xaxis_iterator<L, T, MT>& lhs, const xaxis_iterator<L, T, MT>& rhs)
{
return lhs.operator-(rhs);
}
template <class L, class T, class MT>
inline bool operator==(const xaxis_iterator<L, T, MT>& lhs, const xaxis_iterator<L, T, MT>& rhs) noexcept
{
return lhs.equal(rhs);
}
template <class L, class T, class MT>
inline bool operator<(const xaxis_iterator<L, T, MT>& lhs, const xaxis_iterator<L, T, MT>& rhs) noexcept
{
return lhs.less_than(rhs);
}
/********************************
* axis builders implementation *
********************************/
/**
* Returns an axis containing a range of integral labels.
* @param start the first value of the range.
* @param stop the end of the range. The range doe snot contain
* this value.
* @param step Spacing between values. Default step is \c 1.
* @tparam T the integral type used for positions. Default value
* @tparam L the type of the labels.
*/
template <class T, class L>
inline xaxis<L, T> axis(L start, L stop, L step) noexcept
{
auto range = xt::arange(start, stop, step);
return xaxis<L, T>(range.begin(), range.end());
}
/**
* Builds an returns an axis from the specified list of labels.
* @param init the list of labels.
* @tparam T the integral type used for positions. Default value
* is \c std::size_t.
* @tparam L the type of the labels.
*/
template <class T, class L>
inline xaxis<L, T> axis(std::initializer_list<L> init) noexcept
{
return xaxis<L, T>(init);
}
template <class T>
inline xaxis<XFRAME_STRING_LABEL, T> axis(std::initializer_list<const char*> init) noexcept
{
return xaxis<XFRAME_STRING_LABEL, T>(init.begin(), init.end());
}
}
#endif
================================================
FILE: include/xframe/xaxis_base.hpp
================================================
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XFRAME_XAXIS_BASE_HPP
#define XFRAME_XAXIS_BASE_HPP
#include <algorithm>
#include <iterator>
#include <vector>
namespace xf
{
template <class D>
struct xaxis_inner_types;
/**************
* xaxis_base *
**************/
/**
* @class xaxis_base
* @brief Base class for axes.
*
* The xaxis_base class defines the common interface for axes, which define the
* mapping of labels to positions in a given dimension. The axis_base class
* embeds the list of labels only, the mapping is hold by the inheriting classes.
*
* @tparam D The derived type, i.e. the inheriting class for which xaxis_base
* provides the interface.
*/
template <class D>
class xaxis_base
{
public:
using derived_type = D;
using inner_types = xaxis_inner_types<D>;
using key_type = typename inner_types::key_type;
using mapped_type = typename inner_types::mapped_type;
using label_list = std::vector<key_type>;
using size_type = typename label_list::size_type;
using difference_type = typename label_list::difference_type;
using iterator = typename inner_types::iterator;
using const_iterator = iterator;
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = reverse_iterator;
static_assert(std::is_integral<mapped_type>::value, "mapped_type T must be an integral type");
derived_type& derived_cast() & noexcept;
const derived_type& derived_cast() const & noexcept;
derived_type derived_cast() && noexcept;
const label_list& labels() const noexcept;
key_type label(size_type i) const;
bool empty() const noexcept;
size_type size() const noexcept;
const_iterator begin() const noexcept;
const_iterator end() const noexcept;
const_reverse_iterator rbegin() const noexcept;
const_reverse_iterator rend() const noexcept;
const_reverse_iterator crbegin() const noexcept;
const_reverse_iterator crend() const noexcept;
protected:
xaxis_base();
xaxis_base(const label_list& labels);
xaxis_base(label_list&& labels);
xaxis_base(std::initializer_list<key_type> init);
template <class InputIt>
xaxis_base(InputIt first, InputIt last);
~xaxis_base() = default;
xaxis_base(const xaxis_base&) = default;
xaxis_base& operator=(const xaxis_base&) = default;
xaxis_base(xaxis_base&&) = default;
xaxis_base& operator=(xaxis_base&&) = default;
label_list& mutable_labels() noexcept;
template <class F>
label_list filter_labels(const F& f) const noexcept;
template <class F>
label_list filter_labels(const F& f, size_type size) const noexcept;
label_list m_labels;
};
template <class D1, class D2>
bool operator==(const xaxis_base<D1>& lhs, const xaxis_base<D2>& rhs) noexcept;
template <class D1, class D2>
bool operator!=(const xaxis_base<D1>& lhs, const xaxis_base<D2>& rhs) noexcept;
template <class OS, class D>
OS& operator<<(OS& out, const xaxis_base<D>& axis);
/************************
* is_axis metafunction *
************************/
template <class T>
struct is_axis : std::is_base_of<xaxis_base<T>, T>
{
};
/*****************************
* xaxis_base implementation *
*****************************/
template <class D>
inline xaxis_base<D>::xaxis_base()
: m_labels()
{
}
template <class D>
inline xaxis_base<D>::xaxis_base(const label_list& labels)
: m_labels(labels)
{
}
template <class D>
inline xaxis_base<D>::xaxis_base(label_list&& labels)
: m_labels(std::move(labels))
{
}
template <class D>
inline xaxis_base<D>::xaxis_base(std::initializer_list<key_type> init)
: m_labels(init)
{
}
template <class D>
template <class InputIt>
inline xaxis_base<D>::xaxis_base(InputIt first, InputIt last)
: m_labels(first, last)
{
}
/**
* @name Downcast
*/
//@{
/**
* Casts the object to its inheriting type (i.e. D); this method
* is called when the object is an lvalue.
*/
template <class D>
inline auto xaxis_base<D>::derived_cast() & noexcept -> derived_type&
{
return *static_cast<derived_type*>(this);
}
/**
* Casts the object to its inheriting type (i.e. D); this method
* is called when the object is a constant lvalue.
*/
template <class D>
inline auto xaxis_base<D>::derived_cast() const & noexcept -> const derived_type&
{
return *static_cast<const derived_type*>(this);
}
/**
* Casts the object to its inheriting type (i.e. D); this method
* is called when the object is an rvalue.
*/
template <class D>
inline auto xaxis_base<D>::derived_cast() && noexcept -> derived_type
{
return *static_cast<derived_type*>(this);
}
//@}
/**
* @name Labels
*/
//@{
/**
* Returns the list of labels contained in the axis.
*/
template <class D>
inline auto xaxis_base<D>::labels() const noexcept -> const label_list&
{
return m_labels;
}
/**
* Return the i-th label of the axis.
* @param i the position of the label.
*/
template <class D>
inline auto xaxis_base<D>::label(size_type i) const -> key_type
{
return m_labels[i];
}
/**
* Checks if the axis has no labels.
*/
template <class D>
inline bool xaxis_base<D>::empty() const noexcept
{
return m_labels.empty();
}
/**
* Returns the number of labels in the axis.
*/
template <class D>
inline auto xaxis_base<D>::size() const noexcept -> size_type
{
return m_labels.size();
}
//@}
/**
* @name Iterators
*/
//@{
/**
* Returns a constant iterator to the first element of the axis.
* This element is a pair label - position.
*/
template <class D>
inline auto xaxis_base<D>::begin() const noexcept -> const_iterator
{
return derived_cast().cbegin();
}
/**
* Returns a constant iterator to the element following the last element
* of the axis.
*/
template <class D>
inline auto xaxis_base<D>::end() const noexcept -> const_iterator
{
return derived_cast().cend();
}
/**
* Returns a constant iterator to the first element of the reverse axis.
* This element is a pair labal - position.
*/
template <class D>
inline auto xaxis_base<D>::rbegin() const noexcept -> const_reverse_iterator
{
return crbegin();
}
/**
* Returns a constant iterator to the element following the last element
* of the reversed axis.
*/
template <class D>
inline auto xaxis_base<D>::rend() const noexcept -> const_reverse_iterator
{
return crend();
}
/**
* Returns a constant iterator to the first element of the reverse axis.
* This element is a pair labal - position.
*/
template <class D>
inline auto xaxis_base<D>::crbegin() const noexcept -> const_reverse_iterator
{
return const_reverse_iterator(derived_cast().cend());
}
/**
* Returns a constant iterator to the element following the last element
* of the reversed axis.
*/
template <class D>
inline auto xaxis_base<D>::crend() const noexcept -> const_reverse_iterator
{
return const_reverse_iterator(derived_cast().cbegin());
}
//@}
template <class D>
inline auto xaxis_base<D>::mutable_labels() noexcept -> label_list&
{
return m_labels;
}
template <class D>
template <class F>
inline auto xaxis_base<D>::filter_labels(const F& f) const noexcept -> label_list
{
label_list l;
std::copy_if(m_labels.cbegin(), m_labels.cend(), std::back_inserter(l), f);
return l;
}
template <class D>
template <class F>
inline auto xaxis_base<D>::filter_labels(const F& f, size_type size) const noexcept -> label_list
{
label_list l(size);
std::copy_if(m_labels.cbegin(), m_labels.cend(), l.begin(), f);
return l;
}
/**
* Returns true is \c lhs and \c rhs are equivalent axes, i.e. they contain the same
* label - position pairs.
* @param lhs an axis.
* @param rhs an axis.
*/
template <class D1, class D2>
inline bool operator==(const xaxis_base<D1>& lhs, const xaxis_base<D2>& rhs) noexcept
{
return lhs.labels() == rhs.labels();
}
/**
* Returns true is \c lhs and \c rhs are not equivalent axes, i.e. they contain different
* label - position pairs.
* @param lhs an axis.
* @param rhs an axis.
*/
template <class D1, class D2>
inline bool operator!=(const xaxis_base<D1>& lhs, const xaxis_base<D2>& rhs) noexcept
{
return !(lhs == rhs);
}
template <class OS, class D>
inline OS& operator<<(OS& out, const xaxis_base<D>& axis)
{
using iterator = std::ostream_iterator<typename xaxis_base<D>::key_type, typename OS::char_type, typename OS::traits_type>;
out << '(';
std::copy(axis.labels().begin(), axis.labels().end(), iterator(out, ", "));
out << ')';
return out;
}
}
#endif
================================================
FILE: include/xframe/xaxis_default.hpp
================================================
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XFRAME_XAXIS_DEFAULT_HPP
#define XFRAME_XAXIS_DEFAULT_HPP
#include <utility>
#include <vector>
#include <ostream>
#include <iterator>
#include "xtl/xiterator_base.hpp"
#include "xaxis_base.hpp"
#include "xaxis.hpp"
namespace xf
{
template <class L, class T>
class xaxis_default_iterator;
template <class L1, class T1, class MT1>
class xaxis_variant;
/*****************
* xaxis_default *
*****************/
/**
* @class xaxis_default
* @brief Default axis with integral labels.
*
* The xaxis_default class is used for modeling a default axis
* that holds a contiguous sequence of integral labels starting at 0.
*
* @tparam L the type of labels. This must be an integral type.
* @tparam T the integer type used to represent positions. Default value is
* \c std::size_t.
*/
template <class L, class T = std::size_t>
class xaxis_default : public xaxis_base<xaxis_default<L, T>>
{
public:
using base_type = xaxis_base<xaxis_default>;
using self_type = xaxis_default<L, T>;
using axis_type = xaxis<L, T>;
using key_type = typename base_type::key_type;
using label_list = typename base_type::label_list;
using mapped_type = typename base_type::mapped_type;
using value_type = std::pair<key_type, mapped_type>;
using reference = value_type&;
using const_reference = const value_type&;
using pointer = value_type*;
using const_pointer = const value_type*;
using size_type = typename base_type::size_type;
using difference_type = typename base_type::difference_type;
using iterator = typename base_type::iterator;
using const_iterator = typename base_type::const_iterator;
using reverse_iterator = typename base_type::reverse_iterator;
using const_reverse_iterator = typename base_type::const_reverse_iterator;
static_assert(std::is_integral<key_type>::value, "key_type L must be an integral type");
explicit xaxis_default(size_type size = 0);
bool is_sorted() const noexcept;
bool contains(const key_type& key) const;
mapped_type operator[](const key_type& key) const;
template <class F>
axis_type filter(const F& f) const noexcept;
template <class F>
axis_type filter(const F& f, size_type size) const noexcept;
const_iterator find(const key_type& key) const;
const_iterator cbegin() const noexcept;
const_iterator cend() const noexcept;
protected:
void populate_labels(const size_type& size = 0);
private:
template <class... Args>
bool merge(const Args&... /*axes*/);
template <class... Args>
bool intersect(const Args&... /*axes*/);
template <class L1, class T1, class MT1>
friend class xaxis_variant;
};
/*************************
* xaxis_default builder *
*************************/
template <class T = std::size_t, class L>
xaxis_default<L, T> axis(L size) noexcept;
/********************
* xaxis_inner_types *
*********************/
template <class L, class T>
struct xaxis_inner_types<xaxis_default<L, T>>
{
using key_type = L;
using mapped_type = T;
using iterator = xaxis_default_iterator<L, T>;
};
/**************************
* xaxis_default_iterator *
**************************/
template <class L, class T>
class xaxis_default_iterator : public xtl::xrandom_access_iterator_base<xaxis_default_iterator<L, T>,
typename xaxis_default<L, T>::value_type,
typename xaxis_default<L, T>::difference_type,
typename xaxis_default<L, T>::const_pointer,
typename xaxis_default<L, T>::const_reference>
{
public:
using self_type = xaxis_default_iterator<L, T>;
using container_type = xaxis_default<L, T>;
using label_list = typename container_type::label_list;
using key_type = typename container_type::key_type;
using mapped_type = typename container_type::mapped_type;
using value_type = typename container_type::value_type;
using reference = typename container_type::const_reference;
using pointer = typename container_type::const_pointer;
using difference_type = typename label_list::difference_type;
using iterator_category = std::random_access_iterator_tag;
xaxis_default_iterator() = default;
xaxis_default_iterator(mapped_type value);
self_type& operator++();
self_type& operator--();
self_type& operator+=(difference_type n);
self_type& operator-=(difference_type n);
difference_type operator-(const self_type& rhs) const;
reference operator*() const;
pointer operator->() const;
bool equal(const self_type& rhs) const noexcept;
bool less_than(const self_type& rhs) const noexcept;
private:
value_type m_value;
};
template <class L, class T>
typename xaxis_default_iterator<L, T>::difference_type operator-(const xaxis_default_iterator<L, T>& lhs, const xaxis_default_iterator<L, T>& rhs);
template <class L, class T>
bool operator==(const xaxis_default_iterator<L, T>& lhs, const xaxis_default_iterator<L, T>& rhs) noexcept;
template <class L, class T>
bool operator<(const xaxis_default_iterator<L, T>& lhs, const xaxis_default_iterator<L, T>& rhs) noexcept;
/********************************
* xaxis_default implementation *
********************************/
/**
* Constructs a default axis holding \c size integral elements.
* The labels sequence is [0, 1, ..... size - 1)
*/
template <class L, class T>
inline xaxis_default<L, T>::xaxis_default(size_type size)
: base_type()
{
populate_labels(size);
}
/**
* Returns true if the labels list is sorted.
*/
template <class L, class T>
inline bool xaxis_default<L, T>::is_sorted() const noexcept
{
return true;
}
/**
* Returns true if the axis contains the speficied label.
* @param key the label to search for.
*/
template <class L, class T>
inline bool xaxis_default<L, T>::contains(const key_type& key) const
{
return key_type(0) <= key && key < key_type(this->size());
}
/**
* Returns the position of the specified label. If this last one is
* not found, an exception is thrown.
* @param key the label to search for.
*/
template <class L, class T>
inline auto xaxis_default<L, T>::operator[](const key_type& key) const -> mapped_type
{
return mapped_type(this->labels().at(key));
}
/**
* Builds an return a new axis by applying the given filter to the axis.
* @param f the filter used to select the labels to keep in the new axis.
*/
template <class L, class T>
template <class F>
inline auto xaxis_default<L, T>::filter(const F& f) const noexcept -> axis_type
{
return axis_type(base_type::filter_labels(f), true);
}
/**
* Builds an return a new axis by applying the given filter to the axis. When
* the size of the new list of labels is known, this method allows some
* optimizations compared to the previous one.
* @param f the filter used to select the labels to keep in the new axis.
* @param size the size of the new label list.
*/
template <class L, class T>
template <class F>
inline auto xaxis_default<L, T>::filter(const F& f, size_type size) const noexcept -> axis_type
{
return axis_type(base_type::filter_labels(f, size), true);
}
/**
* Returns a constant iterator to the element with label equivalent to \c key. If
* no such element is found, past-the-end iterator is returned.
* @param key the label to search for.
*/
template <class L, class T>
inline auto xaxis_default<L, T>::find(const key_type& key) const -> const_iterator
{
return contains(key) ? const_iterator(mapped_type(key)) : cend();
}
/**
* Returns a constant iterator to the first element of the axis.
* This element is a pair label - position.
*/
template <class L, class T>
inline auto xaxis_default<L, T>::cbegin() const noexcept -> const_iterator
{
return const_iterator(mapped_type(0));
}
/**
* Returns a constant iterator to the element following the last element
* of the axis.
*/
template <class L, class T>
inline auto xaxis_default<L, T>::cend() const noexcept -> const_iterator
{
return const_iterator(mapped_type(this->size()));
}
template <class L, class T>
inline void xaxis_default<L, T>::populate_labels(const size_type& size)
{
auto& labels = this->mutable_labels();
for(size_type i = 0; i < size; ++i)
{
labels.push_back(key_type(i));
}
}
template <class L, class T>
template <class... Args>
inline bool xaxis_default<L, T>::merge(const Args&... /*axes*/)
{
throw std::runtime_error("merge forbidden for xaxis_default");
}
template <class L, class T>
template <class... Args>
inline bool xaxis_default<L, T>::intersect(const Args&... /*axes*/)
{
throw std::runtime_error("intersect forbidden for xaxis_default");
}
/****************************************
* xaxis_default builder implementation *
****************************************/
/**
* Returns a default axis that holds \c size integral
* labels.
* @param size the number of labels.
* @tparam T the integral type used for positions. Default value
* is \c std::size_t.
* @tparam L the type of the labels. This must be an integral type.
*/
template <class T, class L>
inline xaxis_default<L, T> axis(L size) noexcept
{
return xaxis_default<L, T>(size);
}
/*****************************************
* xaxis_default_iterator implementation *
*****************************************/
template <class L, class T>
inline xaxis_default_iterator<L, T>::xaxis_default_iterator(mapped_type value)
: m_value(std::make_pair(static_cast<key_type>(value), value))
{
}
template <class L, class T>
inline auto xaxis_default_iterator<L, T>::operator++() -> self_type&
{
++m_value.first;
++m_value.second;
return *this;
}
template <class L, class T>
inline auto xaxis_default_iterator<L, T>::operator--() -> self_type&
{
--m_value.first;
--m_value.second;
return *this;
}
template <class L, class T>
inline auto xaxis_default_iterator<L, T>::operator+=(difference_type n) -> self_type&
{
m_value.first = static_cast<key_type>(m_value.first + n);
m_value.second += static_cast<mapped_type>(n);
return *this;
}
template <class L, class T>
inline auto xaxis_default_iterator<L, T>::operator-=(difference_type n) -> self_type&
{
m_value.first = static_cast<key_type>(m_value.first - n);
m_value.second -= static_cast<mapped_type>(n);
return *this;
}
template <class L, class T>
inline auto xaxis_default_iterator<L, T>::operator-(const self_type& rhs) const -> difference_type
{
return m_value.first - rhs.m_value.first;
return m_value.second - rhs.m_value.second;
}
template <class L, class T>
inline auto xaxis_default_iterator<L, T>::operator*() const -> reference
{
return m_value;
}
template <class L, class T>
inline auto xaxis_default_iterator<L, T>::operator->() const -> pointer
{
return &m_value;
}
template <class L, class T>
inline bool xaxis_default_iterator<L, T>::equal(const self_type& rhs) const noexcept
{
return m_value.first == rhs.m_value.first;
}
template <class L, class T>
inline bool xaxis_default_iterator<L, T>::less_than(const self_type& rhs) const noexcept
{
return m_value.first < rhs.m_value.first;
}
template <class L, class T>
inline typename xaxis_default_iterator<L, T>::difference_type operator-(const xaxis_default_iterator<L, T>& lhs, const xaxis_default_iterator<L, T>& rhs)
{
return lhs.operator-(rhs);
}
template <class L, class T>
inline bool operator==(const xaxis_default_iterator<L, T>& lhs, const xaxis_default_iterator<L, T>& rhs) noexcept
{
return lhs.equal(rhs);
}
template <class L, class T>
inline bool operator<(const xaxis_default_iterator<L, T>& lhs, const xaxis_default_iterator<L, T>& rhs) noexcept
{
return lhs.less_than(rhs);
}
}
#endif
================================================
FILE: include/xframe/xaxis_expression_leaf.hpp
================================================
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XFRAME_XAXIS_EXPRESSION_LEAF_HPP
#define XFRAME_XAXIS_EXPRESSION_LEAF_HPP
#include "xtl/xvariant.hpp"
#include "xtl/xmeta_utils.hpp"
#include "xtensor/xoptional.hpp"
#include "xframe_config.hpp"
#include "xframe_utils.hpp"
#include "xframe_expression.hpp"
namespace xf
{
/*************************
* xaxis_expression_leaf *
*************************/
/**
* @class xaxis_expression_leaf
* @brief An subset of an expression on axis
*
* The xaxis_expression_leaf class is used with xaxis_function for creating
* an expression on xnamed_axis, e.g. `auto expr = not_equal(axis1, 2) && axis2 < 3`.
* In the example above, `axis1`, `axis2` are xnamed_axis which will be converted to
* xaxis expression leaves before stored in the xaxis_function object.
*
* @tparam CTA the named axis type.
* @sa xaxis_function
*/
template <class CTA>
class xaxis_expression_leaf : public xt::xexpression<xaxis_expression_leaf<CTA>>
{
public:
using named_axis_type = std::decay_t<CTA>;
using name_type = typename named_axis_type::name_type;
using size_type = typename named_axis_type::size_type;
using value_type = typename named_axis_type::value_type;
using reference = typename named_axis_type::reference;
using const_reference = typename named_axis_type::const_reference;
using pointer = typename named_axis_type::pointer;
using const_pointer = typename named_axis_type::const_pointer;
template <std::size_t N = dynamic()>
using selector_sequence_type = detail::xselector_sequence_t<std::pair<name_type, size_type>, N>;
using expression_tag = xaxis_expression_tag;
template <class AX>
xaxis_expression_leaf(AX&& n_axis) noexcept;
template <std::size_t N = std::numeric_limits<size_type>::max()>
const_reference operator()(const selector_sequence_type<N>& selector) const;
private:
xaxis_closure_t<CTA> m_named_axis;
};
/****************************************
* xaxis_expression_leaf implementation *
****************************************/
/**
* Builds an xaxis_expression_leaf.
* @param n_axis the xnamed_axis.
*/
template <class CTA>
template <class AX>
inline xaxis_expression_leaf<CTA>::xaxis_expression_leaf(AX&& n_axis) noexcept
: m_named_axis(std::forward<AX>(n_axis))
{
}
/**
* Returns the label from the xnamed_axis, given a selector.
* @param selector a selector_sequence_type.
*/
template <class CTA>
template <std::size_t N>
auto xaxis_expression_leaf<CTA>::operator()(const selector_sequence_type<N>& selector) const -> const_reference
{
for (const auto& sel: selector)
{
if (m_named_axis.name() == sel.first)
{
return m_named_axis.label(sel.second);
}
}
throw std::runtime_error(std::string("Missing label for axis ") + std::string(m_named_axis.name()));
}
}
#endif
================================================
FILE: include/xframe/xaxis_function.hpp
================================================
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XFRAME_XAXIS_FUNCTION_HPP
#define XFRAME_XAXIS_FUNCTION_HPP
#include "xtensor/xoptional.hpp"
#include "xtensor/xgenerator.hpp"
#include "xframe_expression.hpp"
#include "xframe_utils.hpp"
#include "xaxis_meta.hpp"
#include "xaxis_expression_leaf.hpp"
namespace xf
{
/******************
* xaxis_function *
******************/
/**
* @class xaxis_function
* @brief An expression of xaxis
*
* The xaxis_function class is used for creating an expression on named axis, e.g.
* `auto expr = not_equal(axis1, 2) && axis2 < 2`.
*
* @tparam F the function type.
* @tparam R the result type.
* @tparam CT the function argument types.
* @sa xaxis_expression_leaf
* @sa xnamed_axis
*/
template <class F, class R, class... CT>
class xaxis_function : public xt::xexpression<xaxis_function<F, R, CT...>>
{
public:
using self_type = xaxis_function<F, R, CT...>;
using functor_type = std::remove_reference_t<F>;
using value_type = R;
using reference = value_type;
using const_reference = value_type;
using pointer = value_type*;
using const_pointer = const value_type*;
using name_type = detail::common_name_type_t<std::decay_t<xaxis_expression_closure_t<CT>>...>;
using size_type = xt::common_size_type_t<std::decay_t<xaxis_expression_closure_t<CT>>...>;
template <std::size_t N = dynamic()>
using selector_sequence_type = detail::xselector_sequence_t<std::pair<name_type, size_type>, N>;
using expression_tag = xaxis_expression_tag;
template <class Func, class U = std::enable_if<!std::is_base_of<Func, self_type>::value>>
xaxis_function(Func&& f, CT... e) noexcept;
template <std::size_t N = dynamic()>
const_reference operator()(const selector_sequence_type<N>& selector) const;
private:
template <std::size_t N, std::size_t... I>
const_reference evaluate(std::index_sequence<I...>, const selector_sequence_type<N>& selector) const;
std::tuple<xaxis_expression_closure_t<CT>...> m_e;
functor_type m_f;
};
/*********************************
* xaxis_function implementation *
*********************************/
/**
* Builds an axis function.
* @param f the function to apply.
* @param e the function arguments.
*/
template <class F, class R, class... CT>
template <class Func, class>
inline xaxis_function<F, R, CT...>::xaxis_function(Func&& f, CT... e) noexcept
: m_e(detail::get_axis_closure(std::forward<CT>(e))...),
m_f(std::forward<Func>(f))
{
}
/**
* Returns an evaluation of the xaxis_function.
* Example:
* \code{.cpp}
* auto axis1 = named_axis("abs", axis(16));
* auto axis2 = named_axis("ord", axis({'a', 'c', 'i'}));
*
* auto func1 = axis1 < 5 && not_equal(axis2, 'i');
*
* // This will evaluate the xaxis_function for `axis1.label(10) == 9` and `axis2.label(1) == 'c'``
* func1({{"abs", 10}, {"ord", 1}});
* \endcode
*
* @param selector a selector_sequence_type for selecting the position
* where you want to evaluate the function.
* @return the evaluation of the xaxis_function
*/
template <class F, class R, class... CT>
template <std::size_t N>
inline auto xaxis_function<F, R, CT...>::operator()(const selector_sequence_type<N>& selector) const -> const_reference
{
return evaluate<N>(std::make_index_sequence<sizeof...(CT)>(), selector);
}
template <class F, class R, class... CT>
template <std::size_t N, std::size_t... I>
inline auto xaxis_function<F, R, CT...>::evaluate(std::index_sequence<I...>, const selector_sequence_type<N>& selector) const -> const_reference
{
#ifdef _MSC_VER
return m_f(std::get<I>(m_e).operator()<N>(selector)...);
#else
return m_f(std::get<I>(m_e).template operator()<N>(selector)...);
#endif
}
/**********************
* axis_function_mask *
**********************/
namespace detail
{
template <class AF, class DM>
class axis_function_mask_impl
{
public:
using axis_function_type = std::remove_reference_t<AF>;
using value_type = typename axis_function_type::value_type;
using name_type = typename axis_function_type::name_type;
using size_type = typename axis_function_type::size_type;
template <std::size_t N = dynamic()>
using selector_sequence_type = detail::xselector_sequence_t<std::pair<name_type, size_type>, N>;
axis_function_mask_impl(AF&& axis_function, DM&& dim_mapping)
: m_axis_function(std::forward<AF>(axis_function)),
m_dimension_mapping(std::forward<DM>(dim_mapping))
{
}
template <class... Args>
inline value_type operator()(Args... args) const
{
auto selector = make_selector(std::make_index_sequence<sizeof...(Args)>(), args...);
#ifdef _MSC_VER
return m_axis_function.operator()<sizeof...(Args)>(selector);
#else
return m_axis_function.template operator()<sizeof...(Args)>(selector);
#endif
}
template <class It>
inline value_type element(It first, It last) const
{
// TODO avoid dynamic allocation
auto selector = selector_sequence_type<dynamic()>();
std::size_t i = 0;
for (It it = first; it != last; ++it)
{
selector.push_back(std::make_pair(m_dimension_mapping.label(i++), static_cast<size_type>(*it)));
}
#ifdef _MSC_VER
return m_axis_function.operator()<dynamic()>(selector);
#else
return m_axis_function.template operator()<dynamic()>(selector);
#endif
}
private:
AF m_axis_function;
DM m_dimension_mapping;
template <class... Args, std::size_t... I>
inline selector_sequence_type<sizeof...(Args)> make_selector(std::index_sequence<I...>, Args&&... args) const
{
return {std::make_pair(m_dimension_mapping.label(I), static_cast<size_type>(args))...};
}
};
}
template <class AF, class DM, class S>
inline auto axis_function_mask(AF&& axis_function, DM&& dim_mapping, const S& shape) noexcept
{
return xt::detail::make_xgenerator(
detail::axis_function_mask_impl<AF, DM>(std::forward<AF>(axis_function), std::forward<DM>(dim_mapping)),
shape
);
}
}
#endif
================================================
FILE: include/xframe/xaxis_index_slice.hpp
================================================
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XFRAME_XAXIS_INDEX_SLICE_HPP
#define XFRAME_XAXIS_INDEX_SLICE_HPP
#include <cstddef>
#include <type_traits>
#include "xtl/xvariant.hpp"
#include "xtensor/xstorage.hpp"
#include "xtensor/xslice.hpp"
namespace xf
{
/*********************
* xaxis_index_slice *
*********************/
template <class T>
class xaxis_index_slice;
namespace detail
{
template <class T>
struct is_xaxis_index_slice : std::false_type
{
};
template <class T>
struct is_xaxis_index_slice<xaxis_index_slice<T>> : std::true_type
{
};
template <class S>
using disable_xaxis_index_slice_t = std::enable_if_t<!is_xaxis_index_slice<std::decay_t<S>>::value, void>;
}
template <class T>
class xaxis_index_slice
{
public:
using self_type = xaxis_index_slice<T>;
using size_type = T;
using storage_type = xtl::variant<xt::xrange<T>,
xt::xstepped_range<T>,
xt::xkeep_slice<T>,
xt::xdrop_slice<T>,
xt::xall<T>>;
xaxis_index_slice() = default;
template <class S, typename = detail::disable_xaxis_index_slice_t<S>>
xaxis_index_slice(S&& slice) noexcept;
size_type size() const noexcept;
bool contains(size_type i) const noexcept;
size_type operator()(size_type i) const noexcept;
size_type step_size(size_type i, size_type n = 1) const noexcept;
size_type revert_index(size_type i) const noexcept;
template <class V, class U>
V convert_storage() const;
bool operator==(const self_type& rhs) const noexcept;
bool operator!=(const self_type& rhs) const noexcept;
private:
storage_type m_slice;
};
/*********************
* Builder functions *
*********************/
template <class A>
auto irange(A start_val);
template <class A, class B>
auto irange(A start_val, B stop_val);
template <class A, class B, class C>
auto irange(A start_val, B stop_val, C step);
template <class... T>
auto ikeep(T&&... t);
template <class... T>
auto idrop(T&&... t);
auto iall() noexcept;
/************************************
* xaxis_index_slice implementation *
************************************/
template <class T>
template <class S, typename>
inline xaxis_index_slice<T>::xaxis_index_slice(S&& slice) noexcept
: m_slice(std::forward<S>(slice))
{
}
template <class T>
inline auto xaxis_index_slice<T>::size() const noexcept -> size_type
{
return xtl::visit([](auto&& arg) { return arg.size(); }, m_slice);
}
template <class T>
inline bool xaxis_index_slice<T>::contains(size_type i) const noexcept
{
return xtl::visit([i](auto&& arg) { return arg.contains(i); }, m_slice);
}
template <class T>
inline auto xaxis_index_slice<T>::operator()(size_type i) const noexcept -> size_type
{
return xtl::visit([i](auto&& arg) { return arg(i); }, m_slice);
}
template <class T>
inline auto xaxis_index_slice<T>::step_size(size_type i, size_type n) const noexcept -> size_type
{
return xtl::visit([i, n](auto&& arg) { return arg.step_size(i, n); }, m_slice);
}
template <class T>
inline auto xaxis_index_slice<T>::revert_index(size_type i) const noexcept -> size_type
{
return xtl::visit([i](auto&& arg) { return arg.revert_index(i); }, m_slice);
}
// TODO: remove this when xrange and xstepped_range has been added
// to xdynamic_slice in xtensor
namespace detail
{
template <class U, class T>
inline xt::xrange_adaptor<U, U, U> convert_range(const xt::xrange<T>& r)
{
T start = r(T(0));
T stop = start + r.size();
return xt::xrange_adaptor<U, U, U>(start, stop, T(1));
}
template <class U, class T>
inline xt::xrange_adaptor<U, U, U> convert_range(const xt::xstepped_range<T>& r)
{
T start = r(T(0));
T stop = start + r.size();
T step = r.step_size(T(0));
return xt::xrange_adaptor<U, U, U>(start, stop, step);
}
}
template <class T>
template <class V, class U>
inline V xaxis_index_slice<T>::convert_storage() const
{
return xtl::visit(
xtl::make_overload(
/*[](const xt::xrange<T>& s) -> V { return detail::convert_range<U>(s); },
[](const xt::xstepped_range<T>& s) -> V { return detail::convert_range<U>(s); },*/
[](const xt::xrange<T>& s) -> V { return xt::xrange<U>(s); },
[](const xt::xstepped_range<T>& s) -> V { return xt::xstepped_range<U>(s); },
[](const xt::xkeep_slice<T>& s) -> V { return xt::xkeep_slice<U>(s); },
[](const xt::xdrop_slice<T>& s) -> V { return xt::xdrop_slice<U>(s); },
[](const xt::xall<T>&) -> V { return xt::xall_tag(); }),
m_slice);
}
template <class T>
inline bool xaxis_index_slice<T>::operator==(const self_type& rhs) const noexcept
{
return m_slice == rhs.m_slice;
}
template <class T>
inline bool xaxis_index_slice<T>::operator!=(const self_type& rhs) const noexcept
{
return !(*this == rhs);
}
/************************************
* Builder functions implementation *
************************************/
template <class A>
inline auto irange(A start_val)
{
return xt::range(start_val);
}
template <class A, class B>
inline auto irange(A start_val, B stop_val)
{
return xt::range(start_val, stop_val);
}
template <class A, class B, class C>
inline auto irange(A start_val, B stop_val, C step)
{
return xt::range(start_val, stop_val, step);
}
template <class... T>
inline auto ikeep(T&&... t)
{
return xt::keep(std::forward<T>(t)...);
}
template <class... T>
inline auto idrop(T&&... t)
{
return xt::drop(std::forward<T>(t)...);
}
inline auto iall() noexcept
{
return xt::all();
}
}
#endif
================================================
FILE: include/xframe/xaxis_label_slice.hpp
================================================
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XFRAME_XAXIS_LABEL_SLICE_HPP
#define XFRAME_XAXIS_LABEL_SLICE_HPP
#include <cmath>
#include <xtl/xvariant.hpp>
#include "xaxis_index_slice.hpp"
#include "xframe_config.hpp"
namespace xf
{
/**************************
* xlabel_slice_variant_t *
**************************/
template <class L>
using xlabel_variant_t = xtl::mpl::cast_t<L, xtl::variant>;
/***************
* xaxis_range *
***************/
template <class L>
class xaxis_range
{
public:
using value_type = xlabel_variant_t<L>;
xaxis_range(const value_type& first, const value_type& last) noexcept;
xaxis_range(value_type&& first, value_type&& last) noexcept;
template <class A>
using index_slice_type = xt::xrange<typename A::mapped_type>;
template <class A>
index_slice_type<A> build_index_slice(const A& axis) const;
private:
value_type m_first;
value_type m_last;
};
/***********************
* xaxis_stepped_range *
***********************/
template <class L>
class xaxis_stepped_range
{
public:
using value_type = xlabel_variant_t<L>;
using size_type = std::size_t;
xaxis_stepped_range(const value_type& first, const value_type& last, size_type step) noexcept;
xaxis_stepped_range(value_type&& first, value_type&& last, size_type step) noexcept;
template <class A>
using index_slice_type = xt::xstepped_range<typename A::mapped_type>;
template <class A>
index_slice_type<A> build_index_slice(const A& axis) const;
private:
value_type m_first;
value_type m_last;
size_type m_step;
};
/*************
* xaxis_all *
*************/
class xaxis_all
{
public:
template <class A>
using index_slice_type = xt::xall<typename A::mapped_type>;
template <class A>
index_slice_type<A> build_index_slice(const A& axis) const;
};
/********************
* xaxis_keep_slice *
*******************/
template <class L>
class xaxis_keep_slice;
namespace detail
{
template <class T>
struct is_xaxis_keep_slice : std::false_type
{
};
template <class L>
struct is_xaxis_keep_slice<xaxis_keep_slice<L>>
: std::true_type
{
};
template <class T>
using disable_xaxis_keep_slice_t = std::enable_if_t<!is_xaxis_keep_slice<std::decay_t<T>>::value, void>;
template <class T>
using enable_xaxis_keep_slice_t = std::enable_if_t<is_xaxis_keep_slice<std::decay_t<T>>::value, void>;
}
template <class L>
class xaxis_keep_slice
{
public:
using value_type = xlabel_variant_t<L>;
using container_type = xt::svector<value_type>;
template <class C, typename = detail::disable_xaxis_keep_slice_t<C>>
explicit xaxis_keep_slice(C& cont);
explicit xaxis_keep_slice(container_type&& cont);
template <class A>
using index_slice_type = xt::xkeep_slice<typename A::mapped_type>;
template <class A>
index_slice_type<A> build_index_slice(const A& axis) const;
private:
container_type m_labels;
};
/********************
* xaxis_drop_slice *
********************/
template <class L>
class xaxis_drop_slice;
namespace detail
{
template <class T>
struct is_axis_drop_slice : std::false_type
{
};
template <class L>
struct is_axis_drop_slice<xaxis_drop_slice<L>>
: std::true_type
{
};
template <class T>
using disable_xaxis_drop_slice_t = std::enable_if_t<!is_axis_drop_slice<std::decay_t<T>>::value, void>;
template <class T>
using enable_xaxis_drop_slice_t = std::enable_if_t<is_axis_drop_slice<std::decay_t<T>>::value, void>;
}
template <class L>
class xaxis_drop_slice
{
public:
using value_type = xlabel_variant_t<L>;
using container_type = xt::svector<value_type>;
template <class C, typename = detail::disable_xaxis_drop_slice_t<C>>
explicit xaxis_drop_slice(C& cont);
explicit xaxis_drop_slice(container_type&& cont);
template <class A>
using index_slice_type = xt::xdrop_slice<typename A::mapped_type>;
template <class A>
index_slice_type<A> build_index_slice(const A& axis) const;
private:
container_type m_labels;
};
/***************
* xaxis_slice *
***************/
template <class L = XFRAME_DEFAULT_LABEL_LIST>
class xaxis_slice
{
public:
using squeeze_type = xlabel_variant_t<L>;
using storage_type = xtl::variant<xaxis_range<L>,
xaxis_stepped_range<L>,
xaxis_keep_slice<L>,
xaxis_drop_slice<L>,
xaxis_all,
squeeze_type>;
xaxis_slice() = default;
template <class V>
xaxis_slice(const V& slice);
template <class V>
xaxis_slice(V&& slice);
template <class A>
using index_slice_type = xaxis_index_slice<typename A::mapped_type>;
template <class A>
index_slice_type<A> build_index_slice(const A& axis) const;
const squeeze_type* get_squeeze() const noexcept;
private:
storage_type m_data;
};
template <class L = XFRAME_DEFAULT_LABEL_LIST>
xaxis_slice<L> range(const xlabel_variant_t<L>& first, const xlabel_variant_t<L>& last);
template <class L = XFRAME_DEFAULT_LABEL_LIST>
xaxis_slice<L> range(xlabel_variant_t<L>&& first, xlabel_variant_t<L>&& last);
template <class S, class L = XFRAME_DEFAULT_LABEL_LIST>
xaxis_slice<L> range(const xlabel_variant_t<L>& first, const xlabel_variant_t<L>& last, S step);
template <class S, class L = XFRAME_DEFAULT_LABEL_LIST>
xaxis_slice<L> range(xlabel_variant_t<L>&& first, xlabel_variant_t<L>&& last, S step);
xaxis_all all() noexcept;
namespace detail
{
template <class T, typename = xt::void_t<>>
struct has_size : std::false_type
{
};
template <class T>
struct has_size<T, xt::void_t<decltype(std::declval<T>().size())>>
: std::true_type
{
};
template <class T, class R>
using enable_container_t = std::enable_if_t<has_size<T>::value, R>;
template <class T, class R>
using disable_container_t = std::enable_if_t<!has_size<T>::value, R>;
}
template <class L = XFRAME_DEFAULT_LABEL_LIST, class T>
detail::enable_container_t<T, xaxis_slice<L>> keep(T&& indices);
template <class L = XFRAME_DEFAULT_LABEL_LIST, class T>
detail::disable_container_t<T, xaxis_slice<L>> keep(T index);
template <class L = XFRAME_DEFAULT_LABEL_LIST, class T0, class T1, class... Args>
xaxis_slice<L> keep(T0 t0, T1 t1, Args... args);
template <class L = XFRAME_DEFAULT_LABEL_LIST, class T>
detail::enable_container_t<T, xaxis_slice<L>> drop(T&& indices);
template <class L = XFRAME_DEFAULT_LABEL_LIST, class T>
detail::disable_container_t<T, xaxis_slice<L>> drop(T index);
template <class L = XFRAME_DEFAULT_LABEL_LIST, class T0, class T1, class... Args>
xaxis_slice<L> drop(T0 t0, T1 t1, Args... args);
/******************************
* xaxis_range implementation *
******************************/
template <class V>
inline xaxis_range<V>::xaxis_range(const value_type& first, const value_type& last) noexcept
: m_first(first), m_last(last)
{
}
template <class V>
inline xaxis_range<V>::xaxis_range(value_type&& first, value_type&& last) noexcept
: m_first(std::move(first)), m_last(std::move(last))
{
}
template <class V>
template <class A>
inline auto xaxis_range<V>::build_index_slice(const A& axis) const -> index_slice_type<A>
{
return index_slice_type<A>(axis[m_first], axis[m_last] + 1);
}
/**************************************
* xaxis_stepped_range implementation *
**************************************/
template <class V>
inline xaxis_stepped_range<V>::xaxis_stepped_range(const value_type& first, const value_type& last, size_type step) noexcept
: m_first(first), m_last(last), m_step(step)
{
}
template <class V>
inline xaxis_stepped_range<V>::xaxis_stepped_range(value_type&& first, value_type&& last, size_type step) noexcept
: m_first(std::move(first)), m_last(std::move(last)), m_step(step)
{
}
template <class V>
template <class A>
inline auto xaxis_stepped_range<V>::build_index_slice(const A& axis) const -> index_slice_type<A>
{
return index_slice_type<A>(axis[m_first], axis[m_last] + 1, m_step);
}
/****************************
* xaxis_all implementation *
****************************/
template <class A>
inline auto xaxis_all::build_index_slice(const A& axis) const -> index_slice_type<A>
{
return index_slice_type<A>(axis.size());
}
/*****************************
* xaxis_keep_implementation *
*****************************/
template <class L>
template <class C, typename>
inline xaxis_keep_slice<L>::xaxis_keep_slice(C& cont)
: m_labels(cont.begin(), cont.end())
{
}
template <class L>
inline xaxis_keep_slice<L>::xaxis_keep_slice(container_type&& cont)
: m_labels(std::move(cont))
{
}
template <class L>
template <class A>
inline auto xaxis_keep_slice<L>::build_index_slice(const A& axis) const -> index_slice_type<A>
{
using index_container_type = typename index_slice_type<A>::container_type;
index_container_type c(m_labels.size());
std::transform(m_labels.cbegin(), m_labels.cend(), c.begin(), [&axis](const auto& arg) { return axis[arg]; });
index_slice_type<A> res(std::move(c));
res.normalize(axis.size());
return res;
}
/****************************
* xaxis_drop_implemenation *
****************************/
template <class L>
template <class C, typename>
inline xaxis_drop_slice<L>::xaxis_drop_slice(C& cont)
: m_labels(cont.begin(), cont.end())
{
}
template <class L>
inline xaxis_drop_slice<L>::xaxis_drop_slice(container_type&& cont)
: m_labels(std::move(cont))
{
}
template <class L>
template <class A>
inline auto xaxis_drop_slice<L>::build_index_slice(const A& axis) const -> index_slice_type<A>
{
using index_container_type = typename index_slice_type<A>::container_type;
index_container_type c(m_labels.size());
std::transform(m_labels.cbegin(), m_labels.cend(), c.begin(), [&axis](const auto& arg) { return axis[arg]; });
index_slice_type<A> res(std::move(c));
res.normalize(axis.size());
return res;
}
/******************************
* xaxis_slice implementation *
******************************/
template <class L>
template <class V>
inline xaxis_slice<L>::xaxis_slice(const V& slice)
: m_data(slice)
{
}
template <class L>
template <class V>
inline xaxis_slice<L>::xaxis_slice(V&& slice)
: m_data(std::move(slice))
{
}
template <class L>
template <class A>
inline auto xaxis_slice<L>::build_index_slice(const A& axis) const -> index_slice_type<A>
{
return xtl::visit(
xtl::make_overload(
[&axis](const auto& arg) { return index_slice_type<A>(arg.build_index_slice(axis)); },
[&axis](const squeeze_type&) -> index_slice_type<A> { throw std::runtime_error("build_islice forbidden for squeeze"); }
),
m_data);
}
template <class L>
inline auto xaxis_slice<L>::get_squeeze() const noexcept -> const squeeze_type*
{
return xtl::get_if<squeeze_type>(&m_data);
}
/***********************************
* helper functions implementation *
***********************************/
template <class L>
inline xaxis_slice<L> range(const xlabel_variant_t<L>& first, const xlabel_variant_t<L>& last)
{
return xaxis_slice<L>(xaxis_range<L>(first, last));
}
template <class L>
inline xaxis_slice<L> range(xlabel_variant_t<L>&& first, xlabel_variant_t<L>&& last)
{
return xaxis_slice<L>(xaxis_range<L>(std::move(first), std::move(last)));
}
template <class S, class L>
inline xaxis_slice<L> range(const xlabel_variant_t<L>& first, const xlabel_variant_t<L>& last, S step)
{
return xaxis_slice<L>(xaxis_stepped_range<L>(first, last, step));
}
template <class S, class L>
inline xaxis_slice<L> range(xlabel_variant_t<L>&& first, xlabel_variant_t<L>&& last, S step)
{
return xaxis_slice<L>(xaxis_stepped_range<L>(std::move(first), std::move(last), step));
}
namespace detail
{
template <template <class> class R, class L, class T>
inline detail::enable_container_t<T, xaxis_slice<L>>
common_drop_keep(T&& indices)
{
R<L> slice(std::forward<T>(indices));
return xaxis_slice<L>(std::move(slice));
}
template <template <class> class R, class L, class T>
inline detail::disable_container_t<T, xaxis_slice<L>>
common_drop_keep(T index)
{
using slice_type = R<L>;
using container_type = typename slice_type::container_type;
using value_type = typename slice_type::value_type;
container_type tmp = { value_type(index) };
return xaxis_slice<L>(slice_type(std::move(tmp)));
}
template <template <class> class R, class L, class T0, class T1, class... Args>
inline xaxis_slice<L>
common_drop_keep(T0 t0, T1 t1, Args... args)
{
using slice_type = R<L>;
using container_type = typename slice_type::container_type;
using value_type = typename slice_type::value_type;
container_type tmp = { value_type(t0), value_type(t1), value_type(args)... };
return xaxis_slice<L>(slice_type(std::move(tmp)));
}
}
template <class L, class T>
inline detail::enable_container_t<T, xaxis_slice<L>> keep(T&& indices)
{
return detail::common_drop_keep<xaxis_keep_slice, L>(std::forward<T>(indices));
}
template <class L, class T>
inline detail::disable_container_t<T, xaxis_slice<L>> keep(T index)
{
return detail::common_drop_keep<xaxis_keep_slice, L>(index);
}
template <class L, class T0, class T1, class... Args>
inline xaxis_slice<L> keep(T0 t0, T1 t1, Args... args)
{
return detail::common_drop_keep<xaxis_keep_slice, L>(t0, t1, args...);
}
template <class L, class T>
inline detail::enable_container_t<T, xaxis_slice<L>> drop(T&& indices)
{
return detail::common_drop_keep<xaxis_drop_slice, L>(std::forward<T>(indices));
}
template <class L, class T>
inline detail::disable_container_t<T, xaxis_slice<L>> drop(T index)
{
return detail::common_drop_keep<xaxis_drop_slice, L>(index);
}
template <class L, class T0, class T1, class... Args>
inline xaxis_slice<L> drop(T0 t0, T1 t1, Args... args)
{
return detail::common_drop_keep<xaxis_drop_slice, L>(t0, t1, args...);
}
inline xaxis_all all() noexcept
{
return xaxis_all();
}
}
#endif
================================================
FILE: include/xframe/xaxis_math.hpp
================================================
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XFRAME_XAXIS_MATH_HPP
#define XFRAME_XAXIS_MATH_HPP
#include "xtensor/xmath.hpp"
#include "xframe_expression.hpp"
#include "xaxis_function.hpp"
namespace xt
{
namespace detail
{
template <class F, class... E>
struct select_xfunction_expression<xf::xaxis_expression_tag, F, E...>
{
using result_type = decltype(std::declval<F>()(std::declval<xvalue_type_t<std::decay_t<E>>>()...));
using type = xf::xaxis_function<F, result_type, E...>;
};
}
}
namespace xf
{
using xt::operator+;
using xt::operator-;
using xt::operator*;
using xt::operator/;
using xt::operator%;
using xt::operator||;
using xt::operator&&;
using xt::operator!;
using xt::operator&;
using xt::operator|;
using xt::operator^;
using xt::operator~;
using xt::operator!=;
using xt::operator<;
using xt::operator<=;
using xt::operator>;
using xt::operator>=;
using xt::equal;
using xt::not_equal;
using xt::abs;
using xt::fabs;
using xt::fmod;
using xt::remainder;
using xt::fma;
using xt::fmax;
using xt::fmin;
using xt::fdim;
using xt::maximum;
using xt::minimum;
using xt::clip;
using xt::sign;
using xt::exp;
using xt::exp2;
using xt::expm1;
using xt::log;
using xt::log10;
using xt::log2;
using xt::log1p;
using xt::pow;
using xt::sqrt;
using xt::cbrt;
using xt::hypot;
using xt::sin;
using xt::cos;
using xt::tan;
using xt::asin;
using xt::acos;
using xt::atan;
using xt::atan2;
using xt::sinh;
using xt::cosh;
using xt::tanh;
using xt::asinh;
using xt::acosh;
using xt::atanh;
using xt::erf;
using xt::erfc;
using xt::tgamma;
using xt::lgamma;
using xt::ceil;
using xt::floor;
using xt::trunc;
using xt::round;
using xt::nearbyint;
using xt::rint;
using xt::isfinite;
using xt::isinf;
using xt::isnan;
// Needs a fix in xtensor
/*using xt::isclose;
using xt::allclose;*/
using xt::where;
}
#endif
================================================
FILE: include/xframe/xaxis_meta.hpp
================================================
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XFRAME_XAXIS_META_HPP
#define XFRAME_XAXIS_META_HPP
#include "xtl/xbasic_fixed_string.hpp"
#include "xtl/xvariant.hpp"
#include "xtl/xmeta_utils.hpp"
#include "xframe_config.hpp"
#include "xaxis_scalar.hpp"
namespace xf
{
template <class K, class T, class MT, class L, class LT>
class xnamed_axis;
template <class CTA>
class xaxis_expression_leaf;
namespace detail
{
template <class... Args>
struct common_name_type;
template <class T, class... Args>
struct common_name_type<T, Args...>
{
using tmp_type = typename common_name_type<Args...>::type;
using type = typename common_name_type<T, tmp_type>::type;
};
template <class T1, class T2>
struct common_name_type<T1, xaxis_scalar<T2>>
{
using type = typename T1::name_type;
};
template <class T1, class T2>
struct common_name_type<xaxis_scalar<T1>, T2>
{
using type = typename T2::name_type;
};
template <class T1, class T2>
struct common_name_type<xaxis_scalar<T1>, xaxis_scalar<T2>>
{
using type = xaxis_scalar_name;
};
template <class T1, class T2>
struct common_name_type<T1, T2>
{
using type = std::common_type_t<typename T1::name_type, typename T2::name_type>;
};
template <class... Args>
using common_name_type_t = typename common_name_type<Args...>::type;
template <class CTA, bool val>
struct axis_closure_getter
{
static auto get_axis_closure(CTA&& axis)
{
return xaxis_expression_leaf<CTA>(std::forward<CTA>(axis));
}
};
template <class CTA>
struct axis_closure_getter<CTA, false>
{
static auto get_axis_closure(CTA&& axis)
{
return std::forward<CTA>(axis);
}
};
template <class T>
struct is_named_axis : std::false_type
{
};
template <class K, class T, class MT, class L, class LT>
struct is_named_axis<xnamed_axis<K, T, MT, L, LT>> : std::true_type
{
};
template <class CTA>
auto get_axis_closure(CTA&& axis)
{
return axis_closure_getter<CTA, is_named_axis<std::decay_t<CTA>>::value>::get_axis_closure(std::forward<CTA>(axis));
}
}
/*****************
* xaxis_closure *
*****************/
template <class CT>
str
gitextract_7cvkifeh/ ├── .appveyor.yml ├── .azure-pipelines/ │ ├── azure-pipelines-linux-clang.yml │ ├── azure-pipelines-linux-gcc.yml │ ├── azure-pipelines-osx.yml │ └── unix-build.yml ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── LICENSE ├── README.md ├── azure-pipelines.yml ├── docs/ │ ├── Doxyfile │ ├── Makefile │ ├── environment.yml │ ├── make.bat │ └── source/ │ ├── _static/ │ │ └── main_stylesheet.css │ ├── api/ │ │ ├── axis_index.rst │ │ ├── coordinate_index.rst │ │ ├── variable_index.rst │ │ ├── xaxis.rst │ │ ├── xaxis_base.rst │ │ ├── xaxis_default.rst │ │ ├── xaxis_expression_leaf.rst │ │ ├── xaxis_function.rst │ │ ├── xaxis_variant.rst │ │ ├── xaxis_view.rst │ │ ├── xcoordinate.rst │ │ ├── xcoordinate_base.rst │ │ ├── xcoordinate_chain.rst │ │ ├── xcoordinate_expanded.rst │ │ ├── xcoordinate_view.rst │ │ ├── xdimension.rst │ │ ├── xexpand_dims_view.rst │ │ ├── xnamed_axis.rst │ │ └── xvariable_masked_view.rst │ ├── computation.rst │ ├── conf.py │ ├── data_structure.rst │ ├── getting_started.rst │ ├── index.rst │ ├── indexing.rst │ ├── installation.rst │ ├── xarray.rst │ └── xframe_summary_drawio.xml ├── environment-dev.yml ├── environment.yml ├── include/ │ └── xframe/ │ ├── xaxis.hpp │ ├── xaxis_base.hpp │ ├── xaxis_default.hpp │ ├── xaxis_expression_leaf.hpp │ ├── xaxis_function.hpp │ ├── xaxis_index_slice.hpp │ ├── xaxis_label_slice.hpp │ ├── xaxis_math.hpp │ ├── xaxis_meta.hpp │ ├── xaxis_scalar.hpp │ ├── xaxis_variant.hpp │ ├── xaxis_view.hpp │ ├── xcoordinate.hpp │ ├── xcoordinate_base.hpp │ ├── xcoordinate_chain.hpp │ ├── xcoordinate_expanded.hpp │ ├── xcoordinate_system.hpp │ ├── xcoordinate_view.hpp │ ├── xdimension.hpp │ ├── xdynamic_variable.hpp │ ├── xdynamic_variable_impl.hpp │ ├── xexpand_dims_view.hpp │ ├── xframe_config.hpp │ ├── xframe_expression.hpp │ ├── xframe_trace.hpp │ ├── xframe_utils.hpp │ ├── xio.hpp │ ├── xnamed_axis.hpp │ ├── xreindex_data.hpp │ ├── xreindex_view.hpp │ ├── xselecting.hpp │ ├── xsequence_view.hpp │ ├── xvariable.hpp │ ├── xvariable_assign.hpp │ ├── xvariable_base.hpp │ ├── xvariable_function.hpp │ ├── xvariable_masked_view.hpp │ ├── xvariable_math.hpp │ ├── xvariable_meta.hpp │ ├── xvariable_scalar.hpp │ ├── xvariable_variant.hpp │ ├── xvariable_view.hpp │ └── xvector_variant.hpp ├── notebooks/ │ └── xframe.ipynb ├── readthedocs.yml ├── test/ │ ├── CMakeLists.txt │ ├── copyGTest.cmake.in │ ├── downloadGTest.cmake.in │ ├── main.cpp │ ├── test_fixture.hpp │ ├── test_fixture_view.hpp │ ├── test_xaxis.cpp │ ├── test_xaxis_default.cpp │ ├── test_xaxis_function.cpp │ ├── test_xaxis_variant.cpp │ ├── test_xaxis_view.cpp │ ├── test_xcoordinate.cpp │ ├── test_xcoordinate_chain.cpp │ ├── test_xcoordinate_expanded.cpp │ ├── test_xcoordinate_view.cpp │ ├── test_xdimension.cpp │ ├── test_xdynamic_variable.cpp │ ├── test_xexpand_dims_view.cpp │ ├── test_xframe_utils.cpp │ ├── test_xnamed_axis.cpp │ ├── test_xreindex_view.cpp │ ├── test_xsequence_view.cpp │ ├── test_xvariable.cpp │ ├── test_xvariable_assign.cpp │ ├── test_xvariable_function.cpp │ ├── test_xvariable_masked_view.cpp │ ├── test_xvariable_math.cpp │ ├── test_xvariable_noalias.cpp │ ├── test_xvariable_scalar.cpp │ ├── test_xvariable_view.cpp │ ├── test_xvariable_view_assign.cpp │ └── test_xvector_variant.cpp ├── xframe.pc.in └── xframeConfig.cmake.in
SYMBOL INDEX (962 symbols across 71 files)
FILE: docs/source/conf.py
function setup (line 18) | def setup(app):
FILE: include/xframe/xaxis.hpp
type xf (line 29) | namespace xf
class xaxis_iterator (line 32) | class xaxis_iterator
method xaxis_iterator (line 234) | xaxis_iterator() = default;
class xaxis_default (line 35) | class xaxis_default
type map_tag (line 41) | struct map_tag {}
type hash_map_tag (line 42) | struct hash_map_tag {}
type map_container (line 45) | struct map_container
type map_container<K, T, map_tag> (line 48) | struct map_container<K, T, map_tag>
type map_container<K, T, hash_map_tag> (line 54) | struct map_container<K, T, hash_map_tag>
class xaxis (line 82) | class xaxis : public xaxis_base<xaxis<L, T, MT>>
type xaxis_inner_types<xaxis<L, T, MT>> (line 203) | struct xaxis_inner_types<xaxis<L, T, MT>>
class xaxis_iterator (line 215) | class xaxis_iterator : public xtl::xrandom_access_iterator_base<xaxis_...
method xaxis_iterator (line 234) | xaxis_iterator() = default;
function merge_axes (line 707) | inline bool merge_axes(xaxis<L, T, MT>& output, const Args&... axes)
function intersect_axes (line 713) | inline bool intersect_axes(xaxis<L, T, MT>& output, const Args&... axes)
function axis (line 818) | inline xaxis<L, T> axis(L start, L stop, L step) noexcept
function axis (line 832) | inline xaxis<L, T> axis(std::initializer_list<L> init) noexcept
function axis (line 838) | inline xaxis<XFRAME_STRING_LABEL, T> axis(std::initializer_list<const ...
FILE: include/xframe/xaxis_base.hpp
type xf (line 18) | namespace xf
type xaxis_inner_types (line 22) | struct xaxis_inner_types
class xaxis_base (line 40) | class xaxis_base
method xaxis_base (line 90) | xaxis_base(const xaxis_base&) = default;
method xaxis_base (line 91) | xaxis_base& operator=(const xaxis_base&) = default;
method xaxis_base (line 93) | xaxis_base(xaxis_base&&) = default;
method xaxis_base (line 94) | xaxis_base& operator=(xaxis_base&&) = default;
type is_axis (line 121) | struct is_axis : std::is_base_of<xaxis_base<T>, T>
function OS (line 351) | inline OS& operator<<(OS& out, const xaxis_base<D>& axis)
FILE: include/xframe/xaxis_default.hpp
type xf (line 24) | namespace xf
class xaxis_default_iterator (line 27) | class xaxis_default_iterator
method xaxis_default_iterator (line 150) | xaxis_default_iterator() = default;
class xaxis_variant (line 30) | class xaxis_variant
class xaxis_default (line 48) | class xaxis_default : public xaxis_base<xaxis_default<L, T>>
type xaxis_inner_types<xaxis_default<L, T>> (line 118) | struct xaxis_inner_types<xaxis_default<L, T>>
class xaxis_default_iterator (line 130) | class xaxis_default_iterator : public xtl::xrandom_access_iterator_bas...
method xaxis_default_iterator (line 150) | xaxis_default_iterator() = default;
function axis (line 319) | inline xaxis_default<L, T> axis(L size) noexcept
FILE: include/xframe/xaxis_expression_leaf.hpp
type xf (line 23) | namespace xf
class xaxis_expression_leaf (line 42) | class xaxis_expression_leaf : public xt::xexpression<xaxis_expression_...
FILE: include/xframe/xaxis_function.hpp
type xf (line 22) | namespace xf
class xaxis_function (line 42) | class xaxis_function : public xt::xexpression<xaxis_function<F, R, CT....
type detail (line 133) | namespace detail
class axis_function_mask_impl (line 136) | class axis_function_mask_impl
method axis_function_mask_impl (line 149) | axis_function_mask_impl(AF&& axis_function, DM&& dim_mapping)
method value_type (line 156) | inline value_type operator()(Args... args) const
method value_type (line 167) | inline value_type element(It first, It last) const
method make_selector (line 189) | inline selector_sequence_type<sizeof...(Args)> make_selector(std::...
function axis_function_mask (line 197) | inline auto axis_function_mask(AF&& axis_function, DM&& dim_mapping, c...
FILE: include/xframe/xaxis_index_slice.hpp
type xf (line 20) | namespace xf
class xaxis_index_slice (line 28) | class xaxis_index_slice
method xaxis_index_slice (line 59) | xaxis_index_slice() = default;
type detail (line 30) | namespace detail
type is_xaxis_index_slice (line 33) | struct is_xaxis_index_slice : std::false_type
type is_xaxis_index_slice<xaxis_index_slice<T>> (line 38) | struct is_xaxis_index_slice<xaxis_index_slice<T>> : std::true_type
function convert_range (line 149) | inline xt::xrange_adaptor<U, U, U> convert_range(const xt::xrange<T>...
function convert_range (line 157) | inline xt::xrange_adaptor<U, U, U> convert_range(const xt::xstepped_...
class xaxis_index_slice (line 47) | class xaxis_index_slice
method xaxis_index_slice (line 59) | xaxis_index_slice() = default;
type detail (line 146) | namespace detail
type is_xaxis_index_slice (line 33) | struct is_xaxis_index_slice : std::false_type
type is_xaxis_index_slice<xaxis_index_slice<T>> (line 38) | struct is_xaxis_index_slice<xaxis_index_slice<T>> : std::true_type
function convert_range (line 149) | inline xt::xrange_adaptor<U, U, U> convert_range(const xt::xrange<T>...
function convert_range (line 157) | inline xt::xrange_adaptor<U, U, U> convert_range(const xt::xstepped_...
function V (line 168) | inline V xaxis_index_slice<T>::convert_storage() const
function irange (line 198) | inline auto irange(A start_val)
function irange (line 204) | inline auto irange(A start_val, B stop_val)
function irange (line 210) | inline auto irange(A start_val, B stop_val, C step)
function ikeep (line 216) | inline auto ikeep(T&&... t)
function idrop (line 222) | inline auto idrop(T&&... t)
function iall (line 227) | inline auto iall() noexcept
FILE: include/xframe/xaxis_label_slice.hpp
type xf (line 19) | namespace xf
class xaxis_range (line 33) | class xaxis_range
class xaxis_stepped_range (line 59) | class xaxis_stepped_range
class xaxis_all (line 86) | class xaxis_all
class xaxis_keep_slice (line 102) | class xaxis_keep_slice
type detail (line 104) | namespace detail
type is_xaxis_keep_slice (line 107) | struct is_xaxis_keep_slice : std::false_type
type is_xaxis_keep_slice<xaxis_keep_slice<L>> (line 112) | struct is_xaxis_keep_slice<xaxis_keep_slice<L>>
type is_axis_drop_slice (line 157) | struct is_axis_drop_slice : std::false_type
type is_axis_drop_slice<xaxis_drop_slice<L>> (line 162) | struct is_axis_drop_slice<xaxis_drop_slice<L>>
type has_size (line 250) | struct has_size : std::false_type
function common_drop_keep (line 466) | inline detail::enable_container_t<T, xaxis_slice<L>>
function common_drop_keep (line 474) | inline detail::disable_container_t<T, xaxis_slice<L>>
function common_drop_keep (line 485) | inline xaxis_slice<L>
class xaxis_keep_slice (line 125) | class xaxis_keep_slice
class xaxis_drop_slice (line 152) | class xaxis_drop_slice
type detail (line 154) | namespace detail
type is_xaxis_keep_slice (line 107) | struct is_xaxis_keep_slice : std::false_type
type is_xaxis_keep_slice<xaxis_keep_slice<L>> (line 112) | struct is_xaxis_keep_slice<xaxis_keep_slice<L>>
type is_axis_drop_slice (line 157) | struct is_axis_drop_slice : std::false_type
type is_axis_drop_slice<xaxis_drop_slice<L>> (line 162) | struct is_axis_drop_slice<xaxis_drop_slice<L>>
type has_size (line 250) | struct has_size : std::false_type
function common_drop_keep (line 466) | inline detail::enable_container_t<T, xaxis_slice<L>>
function common_drop_keep (line 474) | inline detail::disable_container_t<T, xaxis_slice<L>>
function common_drop_keep (line 485) | inline xaxis_slice<L>
class xaxis_drop_slice (line 175) | class xaxis_drop_slice
class xaxis_slice (line 202) | class xaxis_slice
method xaxis_slice (line 214) | xaxis_slice() = default;
type detail (line 247) | namespace detail
type is_xaxis_keep_slice (line 107) | struct is_xaxis_keep_slice : std::false_type
type is_xaxis_keep_slice<xaxis_keep_slice<L>> (line 112) | struct is_xaxis_keep_slice<xaxis_keep_slice<L>>
type is_axis_drop_slice (line 157) | struct is_axis_drop_slice : std::false_type
type is_axis_drop_slice<xaxis_drop_slice<L>> (line 162) | struct is_axis_drop_slice<xaxis_drop_slice<L>>
type has_size (line 250) | struct has_size : std::false_type
function common_drop_keep (line 466) | inline detail::enable_container_t<T, xaxis_slice<L>>
function common_drop_keep (line 474) | inline detail::disable_container_t<T, xaxis_slice<L>>
function common_drop_keep (line 485) | inline xaxis_slice<L>
function range (line 440) | inline xaxis_slice<L> range(const xlabel_variant_t<L>& first, const xl...
function range (line 446) | inline xaxis_slice<L> range(xlabel_variant_t<L>&& first, xlabel_varian...
function range (line 452) | inline xaxis_slice<L> range(const xlabel_variant_t<L>& first, const xl...
function range (line 458) | inline xaxis_slice<L> range(xlabel_variant_t<L>&& first, xlabel_varian...
type detail (line 463) | namespace detail
type is_xaxis_keep_slice (line 107) | struct is_xaxis_keep_slice : std::false_type
type is_xaxis_keep_slice<xaxis_keep_slice<L>> (line 112) | struct is_xaxis_keep_slice<xaxis_keep_slice<L>>
type is_axis_drop_slice (line 157) | struct is_axis_drop_slice : std::false_type
type is_axis_drop_slice<xaxis_drop_slice<L>> (line 162) | struct is_axis_drop_slice<xaxis_drop_slice<L>>
type has_size (line 250) | struct has_size : std::false_type
function common_drop_keep (line 466) | inline detail::enable_container_t<T, xaxis_slice<L>>
function common_drop_keep (line 474) | inline detail::disable_container_t<T, xaxis_slice<L>>
function common_drop_keep (line 485) | inline xaxis_slice<L>
function keep (line 497) | inline detail::enable_container_t<T, xaxis_slice<L>> keep(T&& indices)
function keep (line 503) | inline detail::disable_container_t<T, xaxis_slice<L>> keep(T index)
function keep (line 509) | inline xaxis_slice<L> keep(T0 t0, T1 t1, Args... args)
function drop (line 515) | inline detail::enable_container_t<T, xaxis_slice<L>> drop(T&& indices)
function drop (line 521) | inline detail::disable_container_t<T, xaxis_slice<L>> drop(T index)
function drop (line 527) | inline xaxis_slice<L> drop(T0 t0, T1 t1, Args... args)
function xaxis_all (line 532) | inline xaxis_all all() noexcept
type has_size<T, xt::void_t<decltype(std::declval<T>().size())>> (line 255) | struct has_size<T, xt::void_t<decltype(std::declval<T>().size())>>
FILE: include/xframe/xaxis_math.hpp
type xt (line 19) | namespace xt
type detail (line 21) | namespace detail
type select_xfunction_expression<xf::xaxis_expression_tag, F, E...> (line 24) | struct select_xfunction_expression<xf::xaxis_expression_tag, F, E...>
type xf (line 32) | namespace xf
FILE: include/xframe/xaxis_meta.hpp
type xf (line 21) | namespace xf
class xnamed_axis (line 24) | class xnamed_axis
class xaxis_expression_leaf (line 27) | class xaxis_expression_leaf
type detail (line 29) | namespace detail
type common_name_type (line 33) | struct common_name_type
type common_name_type<T1, xaxis_scalar<T2>> (line 43) | struct common_name_type<T1, xaxis_scalar<T2>>
type common_name_type<xaxis_scalar<T1>, T2> (line 49) | struct common_name_type<xaxis_scalar<T1>, T2>
type common_name_type<xaxis_scalar<T1>, xaxis_scalar<T2>> (line 55) | struct common_name_type<xaxis_scalar<T1>, xaxis_scalar<T2>>
type common_name_type<T1, T2> (line 61) | struct common_name_type<T1, T2>
type axis_closure_getter (line 70) | struct axis_closure_getter
method get_axis_closure (line 72) | static auto get_axis_closure(CTA&& axis)
type axis_closure_getter<CTA, false> (line 79) | struct axis_closure_getter<CTA, false>
method get_axis_closure (line 81) | static auto get_axis_closure(CTA&& axis)
type is_named_axis (line 88) | struct is_named_axis : std::false_type
type is_named_axis<xnamed_axis<K, T, MT, L, LT>> (line 93) | struct is_named_axis<xnamed_axis<K, T, MT, L, LT>> : std::true_type
function get_axis_closure (line 98) | auto get_axis_closure(CTA&& axis)
type xaxis_closure (line 109) | struct xaxis_closure
type axis_expression_closure_getter (line 122) | struct axis_expression_closure_getter
type axis_expression_closure_getter<CT, false> (line 128) | struct axis_expression_closure_getter<CT, false>
type axis_expression_closure_getter<xt::xscalar<CT>, false> (line 134) | struct axis_expression_closure_getter<xt::xscalar<CT>, false>
type xaxis_expression_closure (line 140) | struct xaxis_expression_closure
type common_name_type<T, Args...> (line 36) | struct common_name_type<T, Args...>
FILE: include/xframe/xaxis_scalar.hpp
type xf (line 23) | namespace xf
type xaxis_scalar_name (line 25) | struct xaxis_scalar_name
class xaxis_scalar (line 34) | class xaxis_scalar
FILE: include/xframe/xaxis_variant.hpp
type xf (line 22) | namespace xf
type detail (line 25) | namespace detail
type add_default_axis (line 28) | struct add_default_axis
type get_axis_variant_iterator (line 48) | struct get_axis_variant_iterator
type xaxis_variant_traits (line 60) | struct xaxis_variant_traits
class xaxis_variant_iterator (line 83) | class xaxis_variant_iterator
method xaxis_variant_iterator (line 218) | xaxis_variant_iterator() = default;
class xaxis_variant (line 105) | class xaxis_variant
method xaxis_variant (line 132) | xaxis_variant() = default;
class xaxis_variant_iterator (line 200) | class xaxis_variant_iterator : public xtl::xrandom_access_iterator_bas...
method xaxis_variant_iterator (line 218) | xaxis_variant_iterator() = default;
type xaxis_variant_adaptor (line 531) | struct xaxis_variant_adaptor
method xaxis_variant_adaptor (line 538) | xaxis_variant_adaptor(const axis_variant_type& axis)
method label_list (line 543) | inline const label_list& labels() const
method is_sorted (line 548) | inline bool is_sorted() const noexcept
function OS (line 628) | inline OS& operator<<(OS& out, const xaxis_variant<L, T, MT>& axis)
function get_labels (line 729) | auto get_labels(const xaxis_variant<L, T, MT>& axis_variant) -> const ...
type add_default_axis<xtl::variant<A...>, S> (line 31) | struct add_default_axis<xtl::variant<A...>, S>
type add_default_axis<xtl::variant<A...>, S, L1, L...> (line 37) | struct add_default_axis<xtl::variant<A...>, S, L1, L...>
type get_axis_variant_iterator<xtl::variant<A...>> (line 51) | struct get_axis_variant_iterator<xtl::variant<A...>>
type xaxis_variant_traits<S, MT, TL<L...>> (line 63) | struct xaxis_variant_traits<S, MT, TL<L...>>
FILE: include/xframe/xaxis_view.hpp
type xf (line 18) | namespace xf
class xaxis_view_iterator (line 22) | class xaxis_view_iterator
method xaxis_view_iterator (line 159) | xaxis_view_iterator() = default;
class xaxis_view (line 46) | class xaxis_view
class xaxis_view_iterator (line 140) | class xaxis_view_iterator : public xtl::xrandom_access_iterator_base<x...
method xaxis_view_iterator (line 159) | xaxis_view_iterator() = default;
function axis_type (line 218) | inline xaxis_view<L, T, MT>::operator axis_type() const
function OS (line 514) | inline OS& operator<<(OS& out, const xaxis_view<L, T, MT>& axis)
FILE: include/xframe/xcoordinate.hpp
type xf (line 19) | namespace xf
type join (line 21) | namespace join
type join_id (line 23) | enum class join_id
type outer (line 29) | struct outer
method join_id (line 31) | static constexpr join_id id() { return join_id::outer_id; }
type inner (line 34) | struct inner
method join_id (line 36) | static constexpr join_id id() { return join_id::inner_id; }
class xfull_coordinate (line 40) | class xfull_coordinate {}
type xtrivial_broadcast (line 42) | struct xtrivial_broadcast
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
class xcoordinate (line 73) | class xcoordinate : public xcoordinate_base<K, xaxis_variant<L, S, MT>>
class xcoordinate_chain (line 151) | class xcoordinate_chain
class xcoordinate_expanded (line 154) | class xcoordinate_expanded
type detail (line 156) | namespace detail
type is_coordinate_impl (line 159) | struct is_coordinate_impl : std::false_type
type is_coordinate_impl<xcoordinate<K, L, S, MT>> (line 164) | struct is_coordinate_impl<xcoordinate<K, L, S, MT>> : std::true_type
type is_coordinate_impl<xcoordinate_view<K, L, S, MT>> (line 169) | struct is_coordinate_impl<xcoordinate_view<K, L, S, MT>> : std::true...
type is_coordinate_impl<xcoordinate_chain<C>> (line 174) | struct is_coordinate_impl<xcoordinate_chain<C>> : std::true_type
type is_coordinate_impl<xcoordinate_expanded<C>> (line 179) | struct is_coordinate_impl<xcoordinate_expanded<C>> : std::true_type
type is_coordinate_map_impl (line 184) | struct is_coordinate_map_impl : std::false_type
type is_coordinate_map_impl<std::map<K, xaxis_variant<L, S, MT>>> (line 189) | struct is_coordinate_map_impl<std::map<K, xaxis_variant<L, S, MT>>>
type get_coordinate_type_impl (line 195) | struct get_coordinate_type_impl
type get_coordinate_type_impl<std::map<K, xaxis_variant<L, S, MT>>> (line 201) | struct get_coordinate_type_impl<std::map<K, xaxis_variant<L, S, MT>>>
type axis_broadcast (line 318) | struct axis_broadcast
type axis_broadcast<join::outer> (line 321) | struct axis_broadcast<join::outer>
method apply (line 324) | static bool apply(A& output, const A& input)
type axis_broadcast<join::inner> (line 331) | struct axis_broadcast<join::inner>
method apply (line 334) | static bool apply(A& output, const A& input)
type is_coordinate (line 208) | struct is_coordinate : detail::is_coordinate_impl<std::decay_t<T>>
type is_coordinate_map (line 213) | struct is_coordinate_map : detail::is_coordinate_map_impl<std::decay_t...
type enable_coordinate_map (line 218) | struct enable_coordinate_map
type get_coordinate_type (line 227) | struct get_coordinate_type : detail::get_coordinate_type_impl<std::dec...
function xtrivial_broadcast (line 238) | inline xtrivial_broadcast operator&&(const xtrivial_broadcast& lhs, co...
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
function xtrivial_broadcast (line 310) | inline xtrivial_broadcast xcoordinate<K, L, S, MT>::broadcast(const Ar...
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
type detail (line 315) | namespace detail
type is_coordinate_impl (line 159) | struct is_coordinate_impl : std::false_type
type is_coordinate_impl<xcoordinate<K, L, S, MT>> (line 164) | struct is_coordinate_impl<xcoordinate<K, L, S, MT>> : std::true_type
type is_coordinate_impl<xcoordinate_view<K, L, S, MT>> (line 169) | struct is_coordinate_impl<xcoordinate_view<K, L, S, MT>> : std::true...
type is_coordinate_impl<xcoordinate_chain<C>> (line 174) | struct is_coordinate_impl<xcoordinate_chain<C>> : std::true_type
type is_coordinate_impl<xcoordinate_expanded<C>> (line 179) | struct is_coordinate_impl<xcoordinate_expanded<C>> : std::true_type
type is_coordinate_map_impl (line 184) | struct is_coordinate_map_impl : std::false_type
type is_coordinate_map_impl<std::map<K, xaxis_variant<L, S, MT>>> (line 189) | struct is_coordinate_map_impl<std::map<K, xaxis_variant<L, S, MT>>>
type get_coordinate_type_impl (line 195) | struct get_coordinate_type_impl
type get_coordinate_type_impl<std::map<K, xaxis_variant<L, S, MT>>> (line 201) | struct get_coordinate_type_impl<std::map<K, xaxis_variant<L, S, MT>>>
type axis_broadcast (line 318) | struct axis_broadcast
type axis_broadcast<join::outer> (line 321) | struct axis_broadcast<join::outer>
method apply (line 324) | static bool apply(A& output, const A& input)
type axis_broadcast<join::inner> (line 331) | struct axis_broadcast<join::inner>
method apply (line 334) | static bool apply(A& output, const A& input)
function xtrivial_broadcast (line 343) | inline xtrivial_broadcast xcoordinate<K, L, S, MT>::broadcast_impl(con...
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
function xtrivial_broadcast (line 367) | inline xtrivial_broadcast xcoordinate<K, L, S, MT>::broadcast_impl(con...
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
function xtrivial_broadcast (line 392) | inline xtrivial_broadcast xcoordinate<K, L, S, MT>::broadcast_impl(con...
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
function xtrivial_broadcast (line 399) | inline xtrivial_broadcast xcoordinate<K, L, S, MT>::broadcast_impl()
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
function xtrivial_broadcast (line 406) | inline xtrivial_broadcast xcoordinate<K, L, S, MT>::broadcast_empty(co...
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
function xtrivial_broadcast (line 418) | inline xtrivial_broadcast xcoordinate<K, L, S, MT>::broadcast_empty(co...
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
function xtrivial_broadcast (line 430) | inline xtrivial_broadcast xcoordinate<K, L, S, MT>::broadcast_empty(co...
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
function xtrivial_broadcast (line 437) | inline xtrivial_broadcast xcoordinate<K, L, S, MT>::broadcast_empty()
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
function coordinate (line 452) | xcoordinate<K, L, S, MT> coordinate(const std::map<K, xaxis_variant<L,...
function coordinate (line 464) | xcoordinate<K, L, S, MT> coordinate(std::map<K, xaxis_variant<L, S, MT...
function coordinate (line 475) | xcoordinate<K, L, S, MT> coordinate(xnamed_axis<K, S, MT, L, LT> axis,...
function xtrivial_broadcast (line 486) | inline xtrivial_broadcast broadcast_coordinates(xcoordinate<K, L, S, M...
method xtrivial_broadcast (line 44) | xtrivial_broadcast() = default;
FILE: include/xframe/xcoordinate_base.hpp
type xf (line 20) | namespace xf
class xcoordinate_base (line 38) | class xcoordinate_base
method xcoordinate_base (line 93) | xcoordinate_base(const xcoordinate_base&) = default;
method xcoordinate_base (line 94) | xcoordinate_base& operator=(const xcoordinate_base&) = default;
method xcoordinate_base (line 96) | xcoordinate_base(xcoordinate_base&&) = default;
method xcoordinate_base (line 97) | xcoordinate_base& operator=(xcoordinate_base&&) = default;
function OS (line 333) | inline OS& operator<<(OS& out, const xcoordinate_base<K, A>& c)
FILE: include/xframe/xcoordinate_chain.hpp
type xf (line 18) | namespace xf
class xmap_chain_iterator (line 21) | class xmap_chain_iterator
class xcoordinate_chain (line 40) | class xcoordinate_chain
class xmap_chain_iterator (line 131) | class xmap_chain_iterator
function reindex (line 439) | inline xcoordinate_chain<C> reindex(const C& coordinate, const typenam...
function reindex (line 451) | inline xcoordinate_chain<C> reindex(const C& coordinate, typename C::m...
FILE: include/xframe/xcoordinate_expanded.hpp
type xf (line 20) | namespace xf
class xmap_expanded_iterator (line 23) | class xmap_expanded_iterator
class xcoordinate_expanded (line 42) | class xcoordinate_expanded
class xmap_expanded_iterator (line 129) | class xmap_expanded_iterator
function expand_dims (line 416) | inline xcoordinate_expanded<C> expand_dims(const C& coordinate, const ...
function expand_dims (line 428) | inline xcoordinate_expanded<C> expand_dims(const C& coordinate, typena...
FILE: include/xframe/xcoordinate_system.hpp
type xf (line 18) | namespace xf
class xcoordinate_system (line 26) | class xcoordinate_system
method xcoordinate_system (line 50) | xcoordinate_system() = default;
method xcoordinate_system (line 55) | xcoordinate_system(const xcoordinate_system&) = default;
method xcoordinate_system (line 56) | xcoordinate_system& operator=(const xcoordinate_system&) = default;
method xcoordinate_system (line 58) | xcoordinate_system(xcoordinate_system&&) = default;
method xcoordinate_system (line 59) | xcoordinate_system& operator=(xcoordinate_system&&) = default;
function xtrivial_broadcast (line 123) | inline xtrivial_broadcast xcoordinate_system<D>::broadcast_coordinates...
FILE: include/xframe/xcoordinate_view.hpp
type xf (line 17) | namespace xf
class xcoordinate_view (line 42) | class xcoordinate_view : public xcoordinate_base<K, xaxis_view<L, S, MT>>
class xcoordinate (line 80) | class xcoordinate
type xcoordinate_view_type (line 83) | struct xcoordinate_view_type
type xcoordinate_view_type<xcoordinate<K, L, S, MT>> (line 86) | struct xcoordinate_view_type<xcoordinate<K, L, S, MT>>
function coordinate_view (line 127) | inline xcoordinate_view<K, L, S, MT> coordinate_view(const std::map<K,...
function coordinate_view (line 139) | inline xcoordinate_view<K, L, S, MT> coordinate_view(std::map<K, xaxis...
FILE: include/xframe/xdimension.hpp
type xf (line 16) | namespace xf
class xfull_coordinate (line 18) | class xfull_coordinate
class xdimension (line 39) | class xdimension : private xaxis<L, T, map_tag>
type detail (line 133) | namespace detail
type is_dimension_impl (line 136) | struct is_dimension_impl : std::false_type
type is_dimension_impl<xdimension<L, T>> (line 141) | struct is_dimension_impl<xdimension<L, T>> : std::true_type
type is_dimension_list_impl (line 146) | struct is_dimension_list_impl : std::false_type
type is_dimension_list_impl<std::vector<L>> (line 151) | struct is_dimension_list_impl<std::vector<L>>
type is_dimension (line 158) | struct is_dimension : detail::is_dimension_impl<std::decay_t<T>>
type is_dimension_list (line 163) | struct is_dimension_list : detail::is_dimension_list_impl<std::decay_t...
function OS (line 309) | inline OS& operator<<(OS& out, const xdimension<L, T>& dim)
function broadcast_dimensions (line 319) | inline bool broadcast_dimensions(xdimension<L, T>& output, const Args&...
function dimension (line 329) | inline xdimension<L, T> dimension(std::initializer_list<L> init) noexcept
function dimension (line 335) | inline xdimension<L, T> dimension(std::initializer_list<const char*> i...
FILE: include/xframe/xdynamic_variable.hpp
type xf (line 16) | namespace xf
class xdynamic_variable (line 28) | class xdynamic_variable
function xtrivial_broadcast (line 237) | inline xtrivial_broadcast xdynamic_variable<C, DM, T>::broadcast_coord...
function make_dynamic (line 418) | inline auto make_dynamic(V&& variable)
FILE: include/xframe/xdynamic_variable_impl.hpp
type xf (line 20) | namespace xf
type detail (line 26) | namespace detail
type xdynamic_traits_impl (line 29) | struct xdynamic_traits_impl
type xdynamic_traits_impl<xtl::xoptional<T, bool>> (line 39) | struct xdynamic_traits_impl<xtl::xoptional<T, bool>>
type xdynamic_traits_impl<xtl::any> (line 45) | struct xdynamic_traits_impl<xtl::any>
type xdynamic_traits_list_impl (line 80) | struct xdynamic_traits_list_impl
type xdynamic_traits (line 66) | struct xdynamic_traits : xselector_traits<C, DM, N>
type detail (line 77) | namespace detail
type xdynamic_traits_impl (line 29) | struct xdynamic_traits_impl
type xdynamic_traits_impl<xtl::xoptional<T, bool>> (line 39) | struct xdynamic_traits_impl<xtl::xoptional<T, bool>>
type xdynamic_traits_impl<xtl::any> (line 45) | struct xdynamic_traits_impl<xtl::any>
type xdynamic_traits_list_impl (line 80) | struct xdynamic_traits_list_impl
class xdynamic_base (line 97) | class xdynamic_base
class xvariable_wrapper (line 140) | class xvariable_wrapper : public xtl::xscatter_hierarchy_generator<xdy...
method xvariable_wrapper (line 173) | xvariable_wrapper(self_type&&) = delete;
method xvariable_wrapper (line 174) | xvariable_wrapper& operator=(const self_type&) = delete;
method xvariable_wrapper (line 175) | xvariable_wrapper& operator=(self_type&&) = delete;
method xvariable_wrapper (line 243) | xvariable_wrapper() = default;
method xvariable_wrapper (line 244) | xvariable_wrapper(const self_type&) = default;
class xvariable_wrapper_impl (line 252) | class xvariable_wrapper_impl : public xvariable_wrapper<typename V::co...
method xvariable_wrapper_impl (line 267) | xvariable_wrapper_impl(self_type&&) = delete;
method xvariable_wrapper_impl (line 268) | xvariable_wrapper_impl& operator=(const self_type&) = delete;
method xvariable_wrapper_impl (line 269) | xvariable_wrapper_impl& operator=(self_type&&) = delete;
method xvariable_wrapper_impl (line 289) | xvariable_wrapper_impl(const self_type& rhs) = default;
class xdynamic_implementation (line 304) | class xdynamic_implementation : public B
method xdynamic_implementation (line 323) | xdynamic_implementation(self_type&&) = delete;
method xdynamic_implementation (line 324) | xdynamic_implementation& operator=(const self_type&) = delete;
method xdynamic_implementation (line 325) | xdynamic_implementation& operator=(self_type&&) = delete;
method xdynamic_implementation (line 354) | xdynamic_implementation(const self_type&) = default;
type detail (line 361) | namespace detail
type xdynamic_traits_impl (line 29) | struct xdynamic_traits_impl
type xdynamic_traits_impl<xtl::xoptional<T, bool>> (line 39) | struct xdynamic_traits_impl<xtl::xoptional<T, bool>>
type xdynamic_traits_impl<xtl::any> (line 45) | struct xdynamic_traits_impl<xtl::any>
type xdynamic_traits_list_impl (line 80) | struct xdynamic_traits_list_impl
class xdynamic_leaf (line 374) | class xdynamic_leaf : public detail::xdynamic_linear_hierarchy<V, T>
method xdynamic_leaf (line 387) | xdynamic_leaf(self_type&&) = delete;
method xdynamic_leaf (line 388) | xdynamic_leaf& operator=(const self_type&) = delete;
method xdynamic_leaf (line 389) | xdynamic_leaf& operator=(self_type&&) = delete;
method xdynamic_leaf (line 393) | xdynamic_leaf(const self_type&) = default;
function xtrivial_broadcast (line 588) | xtrivial_broadcast xvariable_wrapper_impl<V, T>::broadcast_coordinates...
function xtrivial_broadcast (line 594) | xtrivial_broadcast xvariable_wrapper_impl<V, T>::broadcast_coordinates...
type xdynamic_traits_impl<xtl::variant<T...>> (line 55) | struct xdynamic_traits_impl<xtl::variant<T...>>
type xdynamic_traits_list_impl<C, DM, T, std::index_sequence<I...>> (line 83) | struct xdynamic_traits_list_impl<C, DM, T, std::index_sequence<I...>>
FILE: include/xframe/xexpand_dims_view.hpp
type xf (line 27) | namespace xf
class xexpand_dims_view (line 31) | class xexpand_dims_view
type xvariable_inner_types<xexpand_dims_view<CT>> (line 34) | struct xvariable_inner_types<xexpand_dims_view<CT>>
class xexpand_dims_view (line 86) | class xexpand_dims_view : public xt::xexpression<xexpand_dims_view<CT>>,
function expand_dims_impl (line 242) | inline auto expand_dims_impl(E&& e, std::initializer_list<K> dim_names)
function expand_dims (line 261) | inline auto expand_dims(E&& e, std::initializer_list<K> dim_names)
function expand_dims (line 273) | inline auto expand_dims(E&& e, std::initializer_list<std::pair<typenam...
function expand_dims (line 279) | inline auto expand_dims(E&& e, std::initializer_list<const char*> dim_...
type xt (line 51) | namespace xt
type xcontainer_inner_types<xf::xexpand_dims_view<CT>> (line 54) | struct xcontainer_inner_types<xf::xexpand_dims_view<CT>>
type xf (line 69) | namespace xf
class xexpand_dims_view (line 31) | class xexpand_dims_view
type xvariable_inner_types<xexpand_dims_view<CT>> (line 34) | struct xvariable_inner_types<xexpand_dims_view<CT>>
class xexpand_dims_view (line 86) | class xexpand_dims_view : public xt::xexpression<xexpand_dims_view<CT>>,
function expand_dims_impl (line 242) | inline auto expand_dims_impl(E&& e, std::initializer_list<K> dim_names)
function expand_dims (line 261) | inline auto expand_dims(E&& e, std::initializer_list<K> dim_names)
function expand_dims (line 273) | inline auto expand_dims(E&& e, std::initializer_list<std::pair<typenam...
function expand_dims (line 279) | inline auto expand_dims(E&& e, std::initializer_list<const char*> dim_...
FILE: include/xframe/xframe_config.hpp
type xf (line 19) | namespace xf
FILE: include/xframe/xframe_expression.hpp
type xf (line 18) | namespace xf
type xvariable_expression_tag (line 20) | struct xvariable_expression_tag {}
type xframe_expression_tag (line 21) | struct xframe_expression_tag {}
type is_xvariable_expression (line 24) | struct is_xvariable_expression : std::is_same<xt::xexpression_tag_t<E>...
type xvariable_comparable (line 29) | struct xvariable_comparable : xtl::conjunction<is_xvariable_expression...
type xaxis_expression_tag (line 33) | struct xaxis_expression_tag {}
type is_xaxis_expression (line 36) | struct is_xaxis_expression : std::is_same<xt::xexpression_tag_t<E>, xa...
type xaxis_comparable (line 41) | struct xaxis_comparable : xtl::conjunction<is_xaxis_expression<E>...>
type xt (line 46) | namespace xt
type extension (line 48) | namespace extension
type expression_tag_and<xf::xvariable_expression_tag, xoptional_expression_tag> (line 51) | struct expression_tag_and<xf::xvariable_expression_tag, xoptional_ex...
type expression_tag_and<xoptional_expression_tag, xf::xvariable_expression_tag> (line 57) | struct expression_tag_and<xoptional_expression_tag, xf::xvariable_ex...
type expression_tag_and<xf::xvariable_expression_tag, xf::xvariable_expression_tag> (line 63) | struct expression_tag_and<xf::xvariable_expression_tag, xf::xvariabl...
FILE: include/xframe/xframe_trace.hpp
type xf (line 18) | namespace xf
FILE: include/xframe/xframe_utils.hpp
type xf (line 23) | namespace xf
function dynamic (line 25) | constexpr std::size_t dynamic()
type detail (line 40) | namespace detail
function merge_containers (line 43) | inline bool merge_containers(C0& output, const C1& input)
function merge_to_impl (line 70) | inline bool merge_to_impl(C0&)
function merge_to_impl (line 76) | inline bool merge_to_impl(C0& out, C1& in, const C&... input)
type xselector_sequence (line 84) | struct xselector_sequence
function intersect_containers (line 106) | inline bool intersect_containers(C0& output, const C1& input)
function intersect_to_impl (line 137) | inline bool intersect_to_impl(C0&)
function intersect_to_impl (line 143) | inline bool intersect_to_impl(C0& out, const C1& in, const C&... input)
function merge_to (line 94) | inline bool merge_to(CO& output, const CI&... input)
type detail (line 103) | namespace detail
function merge_containers (line 43) | inline bool merge_containers(C0& output, const C1& input)
function merge_to_impl (line 70) | inline bool merge_to_impl(C0&)
function merge_to_impl (line 76) | inline bool merge_to_impl(C0& out, C1& in, const C&... input)
type xselector_sequence (line 84) | struct xselector_sequence
function intersect_containers (line 106) | inline bool intersect_containers(C0& output, const C1& input)
function intersect_to_impl (line 137) | inline bool intersect_to_impl(C0&)
function intersect_to_impl (line 143) | inline bool intersect_to_impl(C0& out, const C1& in, const C&... input)
function intersect_to (line 152) | inline bool intersect_to(CO& output, const CI&... input)
FILE: include/xframe/xio.hpp
type xf (line 24) | namespace xf
function compute_1d_row (line 27) | void compute_1d_row(std::stringstream& out, P& printer, const T& expr,
function compute_1d_table (line 42) | void compute_1d_table(std::stringstream& out, P& printer, const T& expr,
function compute_2d_element (line 71) | void compute_2d_element(std::stringstream& out, P& printer, const T& e...
function compute_nb_rows (line 92) | std::size_t compute_nb_rows(const std::size_t& dim, const T& expr, con...
function compute_row_head (line 111) | void compute_row_head(std::stringstream& out, const T& expr,
function compute_2d_row (line 148) | void compute_2d_row(std::stringstream& out, P& printer, const T& expr,
function compute_2d_table (line 180) | void compute_2d_table(std::stringstream& out, P& printer, const T& expr,
function compute_sub_nd_table (line 239) | void compute_sub_nd_table(std::stringstream& out, P& printer, const T&...
function compute_nd_table_impl (line 299) | void compute_nd_table_impl(std::stringstream& out, P& printer, const T...
function compute_nd_table (line 351) | void compute_nd_table(std::stringstream& out, P& printer, const T& expr,
function mime_bundle_repr_impl (line 365) | nl::json mime_bundle_repr_impl(const T& expr)
class xvariable_container (line 395) | class xvariable_container
function mime_bundle_repr (line 398) | nl::json mime_bundle_repr(const xvariable_container<CCT, ECT>& expr)
class xvariable_function (line 404) | class xvariable_function
function mime_bundle_repr (line 407) | nl::json mime_bundle_repr(const xvariable_function<F, R, CT...>& expr)
class xvariable_view (line 415) | class xvariable_view
function mime_bundle_repr (line 418) | nl::json mime_bundle_repr(const xvariable_view<CT>& expr)
class xvariable_masked_view (line 424) | class xvariable_masked_view
function mime_bundle_repr (line 427) | nl::json mime_bundle_repr(const xvariable_masked_view<CTV, CTAX>& expr)
class xreindex_view (line 433) | class xreindex_view
function mime_bundle_repr (line 436) | nl::json mime_bundle_repr(const xreindex_view<E>& expr)
FILE: include/xframe/xnamed_axis.hpp
type xf (line 19) | namespace xf
class xnamed_axis (line 35) | class xnamed_axis : public xt::xexpression<xnamed_axis<K, T, MT, L, LT>>
function named_axis (line 139) | inline auto named_axis(const K& name, A&& axis)
function named_axis (line 150) | inline auto named_axis(const char* name, A&& axis)
function get_labels (line 161) | auto get_labels(const xnamed_axis<K, T, MT, L, LB>& n_axis) -> const t...
FILE: include/xframe/xreindex_data.hpp
type xf (line 18) | namespace xf
class xreindex_data (line 21) | class xreindex_data
class xreindex_data (line 39) | class xreindex_data : public xt::xexpression<xreindex_data<RV>>,
type xt (line 24) | namespace xt
type xiterable_inner_types<xf::xreindex_data<RV>> (line 27) | struct xiterable_inner_types<xf::xreindex_data<RV>>
type xf (line 36) | namespace xf
class xreindex_data (line 21) | class xreindex_data
class xreindex_data (line 39) | class xreindex_data : public xt::xexpression<xreindex_data<RV>>,
FILE: include/xframe/xreindex_view.hpp
type xf (line 20) | namespace xf
class xreindex_view (line 28) | class xreindex_view : public xt::xexpression<xreindex_view<CT>>
function xtrivial_broadcast (line 257) | inline xtrivial_broadcast xreindex_view<CT>::broadcast_coordinates(C& ...
function reindex (line 493) | inline auto reindex(E&& e, const typename std::decay_t<E>::coordinate_...
function reindex (line 500) | inline auto reindex(E&& e, typename std::decay_t<E>::coordinate_map&& ...
type detail (line 506) | namespace detail
function reindex_like_coord (line 509) | inline auto reindex_like_coord(E1&& e1, const C& coords)
function reindex_like (line 528) | inline auto reindex_like(E1&& e1, const E2& e2)
function align (line 534) | inline auto align(E1&& e1, E&&... e)
FILE: include/xframe/xselecting.hpp
type xf (line 24) | namespace xf
type detail (line 28) | namespace detail
type static_missing_impl (line 31) | struct static_missing_impl
type static_missing_impl<xtl::xoptional<const T&, const B&>> (line 34) | struct static_missing_impl<xtl::xoptional<const T&, const B&>>
method return_type (line 37) | static inline return_type get()
type static_missing_impl<xtl::xmasked_value<T, B>> (line 46) | struct static_missing_impl<xtl::xmasked_value<T, B>>
method return_type (line 49) | static inline return_type get()
function T (line 58) | T static_missing() noexcept
class xselector (line 69) | class xselector
method xselector (line 86) | xselector() = default;
class xiselector (line 103) | class xiselector
method xiselector (line 117) | xiselector() = default;
class xlocator (line 133) | class xlocator
method xlocator (line 149) | xlocator() = default;
type xselector_traits (line 165) | struct xselector_traits
FILE: include/xframe/xsequence_view.hpp
type xf (line 17) | namespace xf
class xsequence_view_iterator (line 21) | class xsequence_view_iterator
method xsequence_view_iterator (line 145) | xsequence_view_iterator() = default;
class xsequence_view (line 28) | class xsequence_view
type xsequence_view_iterator_traits (line 115) | struct xsequence_view_iterator_traits
class xsequence_view_iterator (line 129) | class xsequence_view_iterator
method xsequence_view_iterator (line 145) | xsequence_view_iterator() = default;
type detail (line 315) | namespace detail
function equal (line 320) | inline bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2)
function compare_sequence_view (line 333) | inline bool compare_sequence_view(const C1& lhs, const C2& rhs)
FILE: include/xframe/xvariable.hpp
type xf (line 20) | namespace xf
class xvariable_container (line 27) | class xvariable_container
method xvariable_container (line 74) | xvariable_container() = default;
method xvariable_container (line 94) | xvariable_container(const xvariable_container&) = default;
method xvariable_container (line 95) | xvariable_container& operator=(const xvariable_container&) = default;
method xvariable_container (line 97) | xvariable_container(xvariable_container&&) = default;
method xvariable_container (line 98) | xvariable_container& operator=(xvariable_container&&) = default;
type xvariable_inner_types<xvariable_container<CCT, ECT>> (line 30) | struct xvariable_inner_types<xvariable_container<CCT, ECT>>
class xvariable_container (line 56) | class xvariable_container : public xvariable_base<xvariable_container<...
method xvariable_container (line 74) | xvariable_container() = default;
method xvariable_container (line 94) | xvariable_container(const xvariable_container&) = default;
method xvariable_container (line 95) | xvariable_container& operator=(const xvariable_container&) = default;
method xvariable_container (line 97) | xvariable_container(xvariable_container&&) = default;
method xvariable_container (line 98) | xvariable_container& operator=(xvariable_container&&) = default;
type detail (line 126) | namespace detail
type xvariable_type1 (line 129) | struct xvariable_type1 : std::enable_if<is_coordinate_system<C, DM>:...
type xvariable_type2 (line 138) | struct xvariable_type2 : std::enable_if<is_coordinate_map<C>::value ...
type xvariable_type3 (line 147) | struct xvariable_type3 : std::enable_if<is_coordinate_system<C, DM>:...
type xvariable_type4 (line 156) | struct xvariable_type4 : std::enable_if<is_coordinate_map<C>::value ...
function variable (line 274) | inline detail::xvariable_type1_t<D, C, DM> variable(D&& data, C&& coor...
function variable (line 281) | inline detail::xvariable_type2_t<D, C, L> variable(D&& data, C&& coord...
function variable (line 293) | inline detail::xvariable_type3_t<T, C, DM> variable(C&& coord, DM&& dims)
function variable (line 300) | inline detail::xvariable_type4_t<T, C, L> variable(C&& coord_map, L&& ...
type xt (line 43) | namespace xt
type xcontainer_inner_types<xf::xvariable_container<CCT, ECT>> (line 46) | struct xcontainer_inner_types<xf::xvariable_container<CCT, ECT>>
type xf (line 53) | namespace xf
class xvariable_container (line 27) | class xvariable_container
method xvariable_container (line 74) | xvariable_container() = default;
method xvariable_container (line 94) | xvariable_container(const xvariable_container&) = default;
method xvariable_container (line 95) | xvariable_container& operator=(const xvariable_container&) = default;
method xvariable_container (line 97) | xvariable_container(xvariable_container&&) = default;
method xvariable_container (line 98) | xvariable_container& operator=(xvariable_container&&) = default;
type xvariable_inner_types<xvariable_container<CCT, ECT>> (line 30) | struct xvariable_inner_types<xvariable_container<CCT, ECT>>
class xvariable_container (line 56) | class xvariable_container : public xvariable_base<xvariable_container<...
method xvariable_container (line 74) | xvariable_container() = default;
method xvariable_container (line 94) | xvariable_container(const xvariable_container&) = default;
method xvariable_container (line 95) | xvariable_container& operator=(const xvariable_container&) = default;
method xvariable_container (line 97) | xvariable_container(xvariable_container&&) = default;
method xvariable_container (line 98) | xvariable_container& operator=(xvariable_container&&) = default;
type detail (line 126) | namespace detail
type xvariable_type1 (line 129) | struct xvariable_type1 : std::enable_if<is_coordinate_system<C, DM>:...
type xvariable_type2 (line 138) | struct xvariable_type2 : std::enable_if<is_coordinate_map<C>::value ...
type xvariable_type3 (line 147) | struct xvariable_type3 : std::enable_if<is_coordinate_system<C, DM>:...
type xvariable_type4 (line 156) | struct xvariable_type4 : std::enable_if<is_coordinate_map<C>::value ...
function variable (line 274) | inline detail::xvariable_type1_t<D, C, DM> variable(D&& data, C&& coor...
function variable (line 281) | inline detail::xvariable_type2_t<D, C, L> variable(D&& data, C&& coord...
function variable (line 293) | inline detail::xvariable_type3_t<T, C, DM> variable(C&& coord, DM&& dims)
function variable (line 300) | inline detail::xvariable_type4_t<T, C, L> variable(C&& coord_map, L&& ...
FILE: include/xframe/xvariable_assign.hpp
type xt (line 18) | namespace xt
class xexpression_assigner<xvariable_expression_tag> (line 23) | class xexpression_assigner<xvariable_expression_tag>
type detail (line 59) | namespace detail
function increment_index (line 62) | bool increment_index(const ST& shape, IT& index)
FILE: include/xframe/xvariable_base.hpp
type xf (line 20) | namespace xf
class xvariable_masked_view (line 23) | class xvariable_masked_view
type is_coordinate_system (line 28) | struct is_coordinate_system
type enable_xvariable (line 34) | struct enable_xvariable
type xvariable_inner_types (line 43) | struct xvariable_inner_types
class xvariable_base (line 46) | class xvariable_base : private xcoordinate_system<D>
method xvariable_base (line 190) | xvariable_base() = default;
method xvariable_base (line 200) | xvariable_base(const xvariable_base&) = default;
method xvariable_base (line 201) | xvariable_base& operator=(const xvariable_base&) = default;
method xvariable_base (line 203) | xvariable_base(xvariable_base&&) = default;
method xvariable_base (line 204) | xvariable_base& operator=(xvariable_base&&) = default;
FILE: include/xframe/xvariable_function.hpp
type xf (line 21) | namespace xf
type detail (line 28) | namespace detail
type xvariable_data_closure (line 31) | struct xvariable_data_closure
type first_non_scalar_impl (line 209) | struct first_non_scalar_impl
method elem_type (line 213) | static const elem_type& get(const T& t) noexcept
type first_non_scalar_impl<T, I, false> (line 220) | struct first_non_scalar_impl<T, I, false>
type first_non_scalar (line 226) | struct first_non_scalar
function get_first_non_scalar (line 232) | inline auto get_first_non_scalar(const T& t) noexcept
class xvariable_container (line 42) | class xvariable_container
class xvariable_function (line 45) | class xvariable_function : public xt::xexpression<xvariable_function<F...
function xtrivial_broadcast (line 198) | inline xtrivial_broadcast xvariable_function<F, R, CT...>::broadcast_c...
type detail (line 206) | namespace detail
type xvariable_data_closure (line 31) | struct xvariable_data_closure
type first_non_scalar_impl (line 209) | struct first_non_scalar_impl
method elem_type (line 213) | static const elem_type& get(const T& t) noexcept
type first_non_scalar_impl<T, I, false> (line 220) | struct first_non_scalar_impl<T, I, false>
type first_non_scalar (line 226) | struct first_non_scalar
function get_first_non_scalar (line 232) | inline auto get_first_non_scalar(const T& t) noexcept
FILE: include/xframe/xvariable_masked_view.hpp
type xf (line 22) | namespace xf
class xvariable_masked_view (line 30) | class xvariable_masked_view
method xvariable_masked_view (line 152) | xvariable_masked_view(const xvariable_masked_view&) = default;
type xvariable_inner_types<xvariable_masked_view<CTV, CTAX>> (line 33) | struct xvariable_inner_types<xvariable_masked_view<CTV, CTAX>>
class xvariable_masked_view (line 99) | class xvariable_masked_view : public xt::xview_semantic<xvariable_mask...
method xvariable_masked_view (line 152) | xvariable_masked_view(const xvariable_masked_view&) = default;
function where (line 289) | inline auto where(EV&& variable_expr, EAX&& axis_expr)
type xt (line 57) | namespace xt
type xcontainer_inner_types<xf::xvariable_masked_view<CTV, CTAX>> (line 60) | struct xcontainer_inner_types<xf::xvariable_masked_view<CTV, CTAX>>
type xf (line 79) | namespace xf
class xvariable_masked_view (line 30) | class xvariable_masked_view
method xvariable_masked_view (line 152) | xvariable_masked_view(const xvariable_masked_view&) = default;
type xvariable_inner_types<xvariable_masked_view<CTV, CTAX>> (line 33) | struct xvariable_inner_types<xvariable_masked_view<CTV, CTAX>>
class xvariable_masked_view (line 99) | class xvariable_masked_view : public xt::xview_semantic<xvariable_mask...
method xvariable_masked_view (line 152) | xvariable_masked_view(const xvariable_masked_view&) = default;
function where (line 289) | inline auto where(EV&& variable_expr, EAX&& axis_expr)
FILE: include/xframe/xvariable_math.hpp
type xt (line 18) | namespace xt
type detail (line 20) | namespace detail
type select_xfunction_expression<xf::xvariable_expression_tag, F, E...> (line 23) | struct select_xfunction_expression<xf::xvariable_expression_tag, F, E...>
FILE: include/xframe/xvariable_meta.hpp
type xf (line 18) | namespace xf
type xvariable_closure (line 26) | struct xvariable_closure
type xvariable_closure<xt::xscalar<CT>> (line 32) | struct xvariable_closure<xt::xscalar<CT>>
type xdecay_variable_closure (line 45) | struct xdecay_variable_closure
type detail (line 57) | namespace detail
type xcommon_coordinate_type_impl (line 60) | struct xcommon_coordinate_type_impl
type xcommon_coordinate_type_impl<C1, C2> (line 63) | struct xcommon_coordinate_type_impl<C1, C2>
type xcommon_coordinate_type_impl<C, xfull_coordinate> (line 72) | struct xcommon_coordinate_type_impl<C, xfull_coordinate>
type xcommon_coordinate_type_impl<xfull_coordinate, C> (line 81) | struct xcommon_coordinate_type_impl<xfull_coordinate, C>
type xcommon_coordinate_type_impl<xfull_coordinate, xfull_coordinate> (line 87) | struct xcommon_coordinate_type_impl<xfull_coordinate, xfull_coordinate>
type xcommon_coordinate_type_impl<C> (line 93) | struct xcommon_coordinate_type_impl<C>
type xcommon_dimension_type_impl (line 121) | struct xcommon_dimension_type_impl
type xcommon_dimension_type_impl<D1, D2> (line 124) | struct xcommon_dimension_type_impl<D1, D2>
type xcommon_dimension_type_impl<D, xfull_coordinate> (line 132) | struct xcommon_dimension_type_impl<D, xfull_coordinate>
type xcommon_dimension_type_impl<xfull_coordinate, D> (line 140) | struct xcommon_dimension_type_impl<xfull_coordinate, D>
type xcommon_dimension_type_impl<xfull_coordinate, xfull_coordinate> (line 146) | struct xcommon_dimension_type_impl<xfull_coordinate, xfull_coordinate>
type xcommon_dimension_type_impl<D> (line 152) | struct xcommon_dimension_type_impl<D>
type xcommon_coordinate_type (line 106) | struct xcommon_coordinate_type
type detail (line 118) | namespace detail
type xcommon_coordinate_type_impl (line 60) | struct xcommon_coordinate_type_impl
type xcommon_coordinate_type_impl<C1, C2> (line 63) | struct xcommon_coordinate_type_impl<C1, C2>
type xcommon_coordinate_type_impl<C, xfull_coordinate> (line 72) | struct xcommon_coordinate_type_impl<C, xfull_coordinate>
type xcommon_coordinate_type_impl<xfull_coordinate, C> (line 81) | struct xcommon_coordinate_type_impl<xfull_coordinate, C>
type xcommon_coordinate_type_impl<xfull_coordinate, xfull_coordinate> (line 87) | struct xcommon_coordinate_type_impl<xfull_coordinate, xfull_coordinate>
type xcommon_coordinate_type_impl<C> (line 93) | struct xcommon_coordinate_type_impl<C>
type xcommon_dimension_type_impl (line 121) | struct xcommon_dimension_type_impl
type xcommon_dimension_type_impl<D1, D2> (line 124) | struct xcommon_dimension_type_impl<D1, D2>
type xcommon_dimension_type_impl<D, xfull_coordinate> (line 132) | struct xcommon_dimension_type_impl<D, xfull_coordinate>
type xcommon_dimension_type_impl<xfull_coordinate, D> (line 140) | struct xcommon_dimension_type_impl<xfull_coordinate, D>
type xcommon_dimension_type_impl<xfull_coordinate, xfull_coordinate> (line 146) | struct xcommon_dimension_type_impl<xfull_coordinate, xfull_coordinate>
type xcommon_dimension_type_impl<D> (line 152) | struct xcommon_dimension_type_impl<D>
type xcommon_dimension_type (line 165) | struct xcommon_dimension_type
type xcommon_coordinate_type_impl<C1, C2, C...> (line 99) | struct xcommon_coordinate_type_impl<C1, C2, C...>
type xcommon_dimension_type_impl<D1, D2, D...> (line 158) | struct xcommon_dimension_type_impl<D1, D2, D...>
FILE: include/xframe/xvariable_scalar.hpp
type xf (line 17) | namespace xf
class xvariable_scalar (line 20) | class xvariable_scalar
type is_xvariable_scalar (line 68) | struct is_xvariable_scalar : std::false_type
type is_xvariable_scalar<xvariable_scalar<CT>> (line 73) | struct is_xvariable_scalar<xvariable_scalar<CT>> : std::true_type
function xtrivial_broadcast (line 127) | inline xtrivial_broadcast xvariable_scalar<CT>::broadcast_coordinates(...
FILE: include/xframe/xvariable_variant.hpp
type xf (line 16) | namespace xf
class xvariable_variant (line 21) | class xvariable_variant
FILE: include/xframe/xvariable_view.hpp
type xf (line 20) | namespace xf
class xvariable_view (line 28) | class xvariable_view
method xvariable_view (line 123) | xvariable_view(const xvariable_view&) = default;
type xvariable_inner_types<xvariable_view<CT>> (line 31) | struct xvariable_inner_types<xvariable_view<CT>>
class xvariable_view (line 65) | class xvariable_view : public xt::xview_semantic<xvariable_view<CT>>,
method xvariable_view (line 123) | xvariable_view(const xvariable_view&) = default;
type detail (line 809) | namespace detail
type range_adaptor_getter (line 812) | struct range_adaptor_getter
method range_adaptor_getter (line 815) | explicit range_adaptor_getter(std::size_t size)
method return_type (line 821) | return_type operator()(const T&) const
method return_type (line 827) | return_type operator()(const xt::xrange_adaptor<A, B, C>& r) const
type view_params (line 836) | struct view_params
class slice_to_view_param (line 855) | class slice_to_view_param
method slice_to_view_param (line 870) | slice_to_view_param(const E& e, param_type& param)
type locate_params_builder (line 960) | struct locate_params_builder
method fill_view_params (line 965) | inline void fill_view_params(param_type& /*param*/, const E& /*e*/)
method fill_view_params (line 970) | inline void fill_view_params(param_type& param, const E& e, SL&& s...
type ilocate_param_builder (line 994) | struct ilocate_param_builder
method fill_view_params (line 999) | inline void fill_view_params(param_type& /*param*/, const E& /*e*/)
method fill_view_params (line 1004) | inline void fill_view_params(param_type& param, const E& e, SL&& s...
function fill_view_params (line 1015) | inline void fill_view_params(V& /*param*/, E& /*e*/)
function fill_view_params (line 1020) | inline void fill_view_params(V& param, E& e, SL&& sl, S&&... slices)
function ilocate (line 1046) | inline auto ilocate(E&& e, S&&... slices)
function locate (line 1070) | inline auto locate(E&& e, S&&... slices)
function select (line 1094) | inline auto select(E&& e, std::map<typename std::decay_t<E>::key_type,...
function iselect (line 1153) | inline auto iselect(E&& e, std::map<typename std::decay_t<E>::key_type...
type xt (line 44) | namespace xt
type xcontainer_inner_types<xf::xvariable_view<CT>> (line 47) | struct xcontainer_inner_types<xf::xvariable_view<CT>>
type xf (line 61) | namespace xf
class xvariable_view (line 28) | class xvariable_view
method xvariable_view (line 123) | xvariable_view(const xvariable_view&) = default;
type xvariable_inner_types<xvariable_view<CT>> (line 31) | struct xvariable_inner_types<xvariable_view<CT>>
class xvariable_view (line 65) | class xvariable_view : public xt::xview_semantic<xvariable_view<CT>>,
method xvariable_view (line 123) | xvariable_view(const xvariable_view&) = default;
type detail (line 809) | namespace detail
type range_adaptor_getter (line 812) | struct range_adaptor_getter
method range_adaptor_getter (line 815) | explicit range_adaptor_getter(std::size_t size)
method return_type (line 821) | return_type operator()(const T&) const
method return_type (line 827) | return_type operator()(const xt::xrange_adaptor<A, B, C>& r) const
type view_params (line 836) | struct view_params
class slice_to_view_param (line 855) | class slice_to_view_param
method slice_to_view_param (line 870) | slice_to_view_param(const E& e, param_type& param)
type locate_params_builder (line 960) | struct locate_params_builder
method fill_view_params (line 965) | inline void fill_view_params(param_type& /*param*/, const E& /*e*/)
method fill_view_params (line 970) | inline void fill_view_params(param_type& param, const E& e, SL&& s...
type ilocate_param_builder (line 994) | struct ilocate_param_builder
method fill_view_params (line 999) | inline void fill_view_params(param_type& /*param*/, const E& /*e*/)
method fill_view_params (line 1004) | inline void fill_view_params(param_type& param, const E& e, SL&& s...
function fill_view_params (line 1015) | inline void fill_view_params(V& /*param*/, E& /*e*/)
function fill_view_params (line 1020) | inline void fill_view_params(V& param, E& e, SL&& sl, S&&... slices)
function ilocate (line 1046) | inline auto ilocate(E&& e, S&&... slices)
function locate (line 1070) | inline auto locate(E&& e, S&&... slices)
function select (line 1094) | inline auto select(E&& e, std::map<typename std::decay_t<E>::key_type,...
function iselect (line 1153) | inline auto iselect(E&& e, std::map<typename std::decay_t<E>::key_type...
FILE: include/xframe/xvector_variant.hpp
type xf (line 19) | namespace xf
type detail (line 23) | namespace detail
type xvector_variant_size_traits (line 26) | struct xvector_variant_size_traits
type xvector_variant_value_traits (line 33) | struct xvector_variant_value_traits
type xvector_variant_value_traits<is_const, mpl::vector<T>> (line 36) | struct xvector_variant_value_traits<is_const, mpl::vector<T>>
type xvector_variant_traits (line 60) | struct xvector_variant_traits
type xvector_variant_iterator_traits (line 87) | struct xvector_variant_iterator_traits
function T (line 402) | inline T& unwrap(T& arg)
function T (line 408) | inline const T& unwrap(const T& arg)
function T (line 414) | inline T& unwrap(xtl::xclosure_wrapper<T&>& arg)
function T (line 420) | inline const T& unwrap(const xtl::xclosure_wrapper<T&>& arg)
class xvector_variant_iterator (line 105) | class xvector_variant_iterator
method xvector_variant_iterator (line 241) | xvector_variant_iterator() = default;
class xvector_variant_base (line 108) | class xvector_variant_base
method xvector_variant_base (line 183) | xvector_variant_base(T&& v)
method xvector_variant_base (line 190) | xvector_variant_base(const self_type&) = default;
method xvector_variant_base (line 191) | xvector_variant_base(self_type&&) = default;
method self_type (line 193) | self_type& operator=(const self_type& rhs) = default;
method self_type (line 194) | self_type& operator=(self_type&& rhs) = default;
class xvector_variant_iterator (line 225) | class xvector_variant_iterator : public xtl::xrandom_access_iterator_b...
method xvector_variant_iterator (line 241) | xvector_variant_iterator() = default;
class xvector_variant (line 274) | class xvector_variant : public xvector_variant_base<detail::xvector_va...
method xvector_variant (line 284) | inline xvector_variant(OV&& v)
method xvector_variant (line 291) | xvector_variant(const self_type&) = default;
method self_type (line 292) | self_type& operator=(const self_type&) = default;
method xvector_variant (line 294) | xvector_variant(self_type&&) = default;
method self_type (line 295) | self_type& operator=(self_type&&) = default;
class xvector_variant_ref (line 318) | class xvector_variant_ref : public xvector_variant_base<detail::xvecto...
method xvector_variant_ref (line 328) | inline xvector_variant_ref(OV& v)
method xvector_variant_ref (line 335) | xvector_variant_ref(const self_type&) = default;
method self_type (line 336) | self_type& operator=(const self_type& rhs) = default;
method xvector_variant_ref (line 338) | xvector_variant_ref(self_type&&) = default;
method self_type (line 339) | self_type& operator=(self_type&&) = default;
class xvector_variant_cref (line 362) | class xvector_variant_cref : public xvector_variant_base<detail::xvect...
method xvector_variant_cref (line 372) | inline xvector_variant_cref(OV& v)
method xvector_variant_cref (line 379) | xvector_variant_cref(const self_type&) = default;
method xvector_variant_cref (line 380) | xvector_variant_cref(self_type&&) = default;
type detail (line 399) | namespace detail
type xvector_variant_size_traits (line 26) | struct xvector_variant_size_traits
type xvector_variant_value_traits (line 33) | struct xvector_variant_value_traits
type xvector_variant_value_traits<is_const, mpl::vector<T>> (line 36) | struct xvector_variant_value_traits<is_const, mpl::vector<T>>
type xvector_variant_traits (line 60) | struct xvector_variant_traits
type xvector_variant_iterator_traits (line 87) | struct xvector_variant_iterator_traits
function T (line 402) | inline T& unwrap(T& arg)
function T (line 408) | inline const T& unwrap(const T& arg)
function T (line 414) | inline T& unwrap(xtl::xclosure_wrapper<T&>& arg)
function T (line 420) | inline const T& unwrap(const xtl::xclosure_wrapper<T&>& arg)
function swap (line 747) | inline void swap(xvector_variant<V...>& lhs, xvector_variant<V...>& rhs)
function T (line 753) | inline T& xget_vector(xvector_variant<V...>& v)
function T (line 759) | inline const T& xget_vector(const xvector_variant<V...>& v)
function T (line 765) | inline T&& xget_vector(xvector_variant<V...>&& v)
function T (line 771) | inline const T&& xget_vector(const xvector_variant<V...>&& v)
function swap (line 781) | inline void swap(xvector_variant_ref<L...>& lhs, xvector_variant_ref<L...
function T (line 787) | inline T& xget_vector(xvector_variant_ref<V...>& v)
function T (line 793) | inline const T& xget_vector(const xvector_variant_ref<V...>& v)
function T (line 799) | inline T& xget_vector(xvector_variant_ref<V...>&& v)
function T (line 805) | inline const T& xget_vector(const xvector_variant_ref<V...>&& v)
function T (line 815) | const T& xget_vector(xvector_variant_cref<V...>& v)
function T (line 821) | const T& xget_vector(const xvector_variant_cref<V...>& v)
function T (line 827) | const T& xget_vector(xvector_variant_cref<V...>&& v)
function T (line 833) | const T& xget_vector(const xvector_variant_cref<V...>&& v)
type xvector_variant_value_traits<is_const, mpl::vector<T...>> (line 46) | struct xvector_variant_value_traits<is_const, mpl::vector<T...>>
FILE: test/main.cpp
function main (line 13) | int main(int argc, char* argv[])
FILE: test/test_fixture.hpp
type xf (line 20) | namespace xf
function saxis_type (line 39) | inline saxis_type make_test_saxis()
function saxis_type (line 45) | inline saxis_type make_test_saxis2()
function saxis_type (line 51) | inline saxis_type make_test_saxis3()
function iaxis_type (line 57) | inline iaxis_type make_test_iaxis()
function iaxis_type (line 63) | inline iaxis_type make_test_iaxis2()
function daxis_type (line 69) | inline daxis_type make_test_daxis()
function coordinate_type (line 80) | inline coordinate_type make_test_coordinate()
function coordinate_type (line 92) | inline coordinate_type make_test_coordinate2()
function coordinate_type (line 104) | inline coordinate_type make_test_coordinate3()
function coordinate_type (line 119) | inline coordinate_type make_test_coordinate4()
function coordinate_type (line 134) | inline coordinate_type make_merge_coordinate()
function coordinate_type (line 148) | inline coordinate_type make_merge_coordinate2()
function coordinate_type (line 161) | inline coordinate_type make_intersect_coordinate()
function coordinate_type (line 175) | inline coordinate_type make_intersect_coordinate2()
function data_type (line 194) | inline data_type make_test_data()
function data_type (line 204) | inline data_type make_test_data2()
function int_data_type (line 223) | inline int_data_type make_test_int_data()
function bool_data_type (line 236) | inline bool_data_type make_test_bool_data()
function make_masked_data (line 249) | inline auto make_masked_data(data_type& data)
function variable_type (line 268) | inline variable_type make_test_variable()
function variable_type (line 278) | inline variable_type make_test_variable2()
function variable_type (line 289) | inline variable_type make_test_variable3()
function variable_type (line 299) | inline variable_type make_test_variable4()
function int_variable_type (line 310) | inline int_variable_type make_test_int_variable()
function bool_variable_type (line 315) | inline bool_variable_type make_test_bool_variable()
function dict_type (line 327) | inline dict_type make_selector_aa()
function selector_list (line 332) | inline selector_list make_selector_list_aa()
function selector_list (line 347) | inline selector_list make_selector_list_ab()
function selector_list (line 365) | inline selector_list make_selector_list_cd()
FILE: test/test_fixture_view.hpp
type xf (line 21) | namespace xf
function saxis_type (line 38) | inline saxis_type make_test_view_saxis()
function axis_variant (line 43) | inline axis_variant make_variant_view_saxis()
function iaxis_type (line 49) | inline iaxis_type make_test_view_iaxis()
function coordinate_type (line 56) | inline coordinate_type make_test_view_coordinate()
function variable_type (line 76) | inline variable_type make_test_view_variable()
function make_masked_data (line 96) | inline auto make_masked_data()
function make_masked_data2 (line 123) | inline auto make_masked_data2()
function make_masked_data3 (line 151) | inline auto make_masked_data3()
function coordinate_view_type (line 172) | inline coordinate_view_type build_coordinate_view(const coordinate_typ...
function coordinate_view_type (line 189) | inline coordinate_view_type build_coordinate_view(const coordinate_typ...
function variable_view_type (line 216) | inline variable_view_type build_view(variable_type& v)
FILE: test/test_xaxis.cpp
type xf (line 18) | namespace xf
function TEST (line 26) | TEST(xaxis, constructors)
function TEST (line 55) | TEST(xaxis, axis)
function TEST (line 77) | TEST(xaxis, size)
function TEST (line 88) | TEST(xaxis, contains)
function TEST (line 95) | TEST(xaxis, access)
function TEST (line 107) | TEST(xaxis, iterator)
function TEST (line 139) | TEST(xaxis, find)
function TEST (line 154) | TEST(xaxis, is_sorted)
function TEST (line 166) | TEST(xaxis, merge)
function TEST (line 215) | TEST(xaxis, merge_unsorted)
function TEST (line 263) | TEST(xaxis, intersect)
function TEST (line 291) | TEST(xaxis, filter)
FILE: test/test_xaxis_default.cpp
type xf (line 18) | namespace xf
function TEST (line 24) | TEST(xaxis_default, axis)
function TEST (line 36) | TEST(xaxis_default, labels)
function TEST (line 48) | TEST(xaxis_default, size)
function TEST (line 60) | TEST(xaxis_default, is_sorted)
function TEST (line 66) | TEST(xaxis_default, contains)
function TEST (line 77) | TEST(xaxis_default, access)
function TEST (line 89) | TEST(xaxis_default, iterator)
function TEST (line 121) | TEST(xaxis_default, find)
function TEST (line 136) | TEST(xaxis_default, merge)
function TEST (line 167) | TEST(xaxis_default, filter)
function TEST (line 178) | TEST(xaxis_default, filter_size)
FILE: test/test_xaxis_function.cpp
type xf (line 20) | namespace xf
function TEST (line 22) | TEST(xaxis_function, plus_operator)
function TEST (line 32) | TEST(xaxis_function, pow_operator)
function TEST (line 44) | TEST(xaxis_function, bool_operator)
function TEST (line 69) | TEST(xaxis_function, xaxis_scalar)
function TEST (line 82) | TEST(xaxis_function, mask)
function TEST (line 108) | TEST(xaxis_function, mask_op)
FILE: test/test_xaxis_variant.cpp
type xf (line 18) | namespace xf
function TEST (line 22) | TEST(xaxis_variant, get_labels)
function TEST (line 31) | TEST(xaxis_variant, size)
function TEST (line 42) | TEST(xaxis_variant, is_sorted)
function TEST (line 48) | TEST(xaxis_variant, contains)
function TEST (line 59) | TEST(xaxis_variant, access)
FILE: test/test_xaxis_view.cpp
type xf (line 17) | namespace xf
function slice_type (line 22) | inline slice_type make_slice()
function TEST (line 27) | TEST(xaxis_view, label)
function TEST (line 35) | TEST(xaxis_view, size)
function TEST (line 47) | TEST(xaxis_view, contains)
function TEST (line 56) | TEST(xaxis_view, access)
function TEST (line 71) | TEST(xaxis_view, iterator)
function TEST (line 113) | TEST(xaxis_view, range)
function TEST (line 141) | TEST(xaxis_view, conversion)
function TEST (line 151) | TEST(xaxis_view, comparison)
FILE: test/test_xcoordinate.cpp
type xf (line 14) | namespace xf
function TEST (line 19) | TEST(xcoordinate, constructor)
function TEST (line 45) | TEST(xcoordinate, size)
function TEST (line 56) | TEST(xcoordinate, contains)
function TEST (line 63) | TEST(xcoordinate, access)
function TEST (line 81) | TEST(xcoordinate, iterator)
function TEST (line 92) | TEST(xcoordinate, find)
function TEST (line 101) | TEST(xcoordinate, key_iterator)
function TEST (line 112) | TEST(xcoordinate, merge)
function TEST (line 130) | TEST(xcoordinate, merge_axis_default)
function TEST (line 144) | TEST(xcoordinate, intersect)
function TEST (line 158) | TEST(xcoordinate, intersect_axis_default)
FILE: test/test_xcoordinate_chain.cpp
type xf (line 16) | namespace xf
function TEST (line 21) | TEST(xcoordinate_chain, constructor)
function make_coordinate_chain (line 32) | inline xcoordinate_chain<C> make_coordinate_chain(const C& c)
function TEST (line 40) | TEST(xcoordinate_chain, size)
function TEST (line 49) | TEST(xcoordinate_chain, contains)
function TEST (line 66) | TEST(xcoordinate_chain, access)
function TEST (line 88) | TEST(xcoordinate_chain, iterator)
function TEST (line 102) | TEST(xcoordinate_chain, find)
function TEST (line 113) | TEST(xcoordinate_chain, key_iterator)
function TEST (line 126) | TEST(xcoordinate_chain, comparison)
function TEST (line 142) | TEST(xcoordinate_chain, mixed_comparison)
FILE: test/test_xcoordinate_expanded.cpp
type xf (line 16) | namespace xf
function TEST (line 21) | TEST(xcoordinate_expanded, constructor)
function make_coordinate_expanded (line 32) | inline xcoordinate_expanded<C> make_coordinate_expanded(const C& c)
function TEST (line 40) | TEST(xcoordinate_expanded, size)
function TEST (line 49) | TEST(xcoordinate_expanded, contains)
function TEST (line 68) | TEST(xcoordinate_expanded, access)
function TEST (line 90) | TEST(xcoordinate_expanded, iterator)
function TEST (line 112) | TEST(xcoordinate_expanded, find)
function TEST (line 123) | TEST(xcoordinate_expanded, key_iterator)
function TEST (line 139) | TEST(xcoordinate_expanded, comparison)
function TEST (line 155) | TEST(xcoordinate_expanded, mixed_comparison)
FILE: test/test_xcoordinate_view.cpp
type xf (line 16) | namespace xf
function TEST (line 18) | TEST(xcoordinate_view, size)
function TEST (line 27) | TEST(xcoordinate_view, contains)
function TEST (line 36) | TEST(xcoordinate_view, access)
function TEST (line 60) | TEST(xcoordinate_view, iterator)
function TEST (line 73) | TEST(xcoordinate_view, key_iterator)
function TEST (line 86) | TEST(xcoordinate_view, broadcasting)
function TEST (line 114) | TEST(xcoordinate_view, comparison)
FILE: test/test_xdimension.cpp
type xf (line 15) | namespace xf
function TEST (line 20) | TEST(xdimension, broadcast)
function TEST (line 59) | TEST(xdimension, builder)
FILE: test/test_xdynamic_variable.cpp
type xf (line 15) | namespace xf
function opt_cast (line 17) | inline xtl::xoptional<double&, bool&> opt_cast(xtl::any arg)
function const_opt_cast (line 22) | inline xtl::xoptional<const double&, const bool&> const_opt_cast(xtl::...
function TEST (line 27) | TEST(xdynamic_variable, size)
function TEST (line 34) | TEST(xdynamic_variable, dimension)
function TEST (line 41) | TEST(xdynamic_variable, dimension_labels)
function TEST (line 48) | TEST(xdynamic_variable, coordinates)
function TEST (line 55) | TEST(xdynamic_variable, dimension_mapping)
function TEST (line 62) | TEST(xdynamic_variable, broadcast_coordinates)
function TEST (line 84) | TEST(xdynamic_variable, broadcast_dimensions)
function TEST (line 94) | TEST(xdynamic_variable, shape)
function TEST (line 104) | TEST(xdynamic_variable, access)
function TEST (line 130) | TEST(xdynamic_variable, element)
function TEST (line 156) | TEST(xdynamic_variable, select_inner)
function TEST (line 182) | TEST(xdynamic_variable, select_outer)
function TEST (line 214) | TEST(xdynamic_variable, iselect)
function TEST (line 240) | TEST(xdynamic_variable, locate)
function TEST (line 266) | TEST(xdynamic_variable, locate_element)
function variant_get (line 293) | inline xtl::xoptional<double&, bool&> variant_get(V& v)
function const_variant_get (line 299) | inline xtl::xoptional<const double&, const bool&> const_variant_get(V& v)
function TEST (line 304) | TEST(xdynamic_variable, make_variant)
function TEST (line 331) | TEST(xdynamic_variable, make_simple)
function TEST (line 358) | TEST(xdynamic_variable, print)
FILE: test/test_xexpand_dims_view.cpp
type xf (line 19) | namespace xf
function TEST (line 21) | TEST(xexpand_dims, ctor)
function TEST (line 30) | TEST(xexpand_dims, size)
function TEST (line 39) | TEST(xexpand_dims, dimension)
function TEST (line 48) | TEST(xexpand_dims, dimension_labels)
function TEST (line 69) | TEST(xexpand_dims, coordinates)
function TEST (line 83) | TEST(xexpand_dims, dimension_mapping)
function TEST (line 104) | TEST(xexpand_dims, shape)
function TEST (line 114) | TEST(xexpand_dims, data)
function TEST (line 147) | TEST(xexpand_dims, access)
function TEST (line 172) | TEST(xexpand_dims, element)
function TEST (line 197) | TEST(xexpand_dims, locate)
function TEST (line 222) | TEST(xexpand_dims, iselect)
function TEST (line 237) | TEST(xexpand_dims, select)
FILE: test/test_xframe_utils.cpp
type xf (line 16) | namespace xf
function TEST (line 18) | TEST(xframe_utils, merge_to)
function TEST (line 44) | TEST(xframe_utils, intersect_to)
FILE: test/test_xnamed_axis.cpp
type xf (line 16) | namespace xf
function TEST (line 18) | TEST(xnamed_axis, get_labels)
function TEST (line 29) | TEST(xnamed_axis, name)
FILE: test/test_xreindex_view.cpp
type xf (line 15) | namespace xf
function coordinate_map (line 19) | coordinate_map make_new_coordinate()
function TEST (line 26) | TEST(xreindex_view, builders)
function TEST (line 56) | TEST(xreindex_view, size)
function TEST (line 64) | TEST(xreindex_view, dimension)
function TEST (line 72) | TEST(xreindex_view, dimension_labels)
function TEST (line 81) | TEST(xreindex_view, shape)
function TEST (line 91) | TEST(xreindex_view, access)
function TEST (line 111) | TEST(xreindex_view, element)
function TEST (line 131) | TEST(xreindex_view, locate)
function TEST (line 164) | TEST(xreindex_view, locate_element)
function TEST (line 197) | TEST(xreindex_view, select_inner)
function TEST (line 235) | TEST(xreindex_view, select_outer)
function TEST (line 274) | TEST(xreindex_view, iselect)
function TEST (line 307) | TEST(xreindex_view, data)
FILE: test/test_xsequence_view.cpp
type xf (line 15) | namespace xf
class slice_test (line 17) | class slice_test
method slice_test (line 23) | slice_test() = default;
method slice_test (line 24) | slice_test(size_type min_val, size_type max_val, size_type step) noe...
method size (line 29) | std::size_t size() const noexcept { return m_size; }
method size_type (line 30) | size_type operator()(size_type i) const noexcept { return m_min + i ...
type xsequence_view_feature (line 39) | struct xsequence_view_feature
function TEST (line 55) | TEST(xsequence_view, size)
function TEST (line 61) | TEST(xsequence_view, empty)
function TEST (line 67) | TEST(xsequence_view, access)
function TEST (line 87) | TEST(xsequence_view, iterator)
function TEST (line 113) | TEST(xsequence_view, comparison)
FILE: test/test_xvariable.cpp
type xf (line 17) | namespace xf
function TEST (line 19) | TEST(xvariable, empty_data_constructor)
function TEST (line 42) | TEST(xvariable, constructor)
function TEST (line 77) | TEST(xvariable, size)
function TEST (line 86) | TEST(xvariable, axis_accessor)
function TEST (line 93) | TEST(xvariable, dimension)
function TEST (line 102) | TEST(xvariable, dimension_labels)
function TEST (line 110) | TEST(xvariable, shape)
function TEST (line 118) | TEST(xvariable, resize)
function TEST (line 134) | TEST(xvariable, access)
function TEST (line 148) | TEST(xvariable, element)
function TEST (line 162) | TEST(xvariable, select_inner)
function TEST (line 191) | TEST(xvariable, select_outer)
function TEST (line 221) | TEST(xvariable, iselect)
function TEST (line 247) | TEST(xvariable, locate)
function TEST (line 271) | TEST(xvariable, locate_element)
function TEST (line 296) | TEST(xvariable, generator)
function TEST (line 342) | TEST(xvariable, map_generator)
function TEST (line 369) | TEST(xvariable, print)
FILE: test/test_xvariable_assign.cpp
function TEST (line 391) | TEST(xvariable_assign, unsorted_labels)
function TEST (line 421) | TEST(xvariable_assign, broadcast_unsorted)
function TEST (line 451) | TEST(xvariable_assign, broadcast)
FILE: test/test_xvariable_function.cpp
type xf (line 14) | namespace xf
type xfunction_features (line 16) | struct xfunction_features
function TEST (line 30) | TEST(xvariable_function, size)
function TEST (line 43) | TEST(xvariable_function, dimension)
function TEST (line 56) | TEST(xvariable_function, dimension_labels)
function TEST (line 69) | TEST(xvariable_function, coordinates)
function TEST (line 82) | TEST(xvariable_function, dimension_mapping)
function TEST (line 95) | TEST(xvariable_function, shape)
function TEST (line 105) | TEST(xvariable_function, access)
function TEST (line 126) | TEST(xvariable_function, broadcast_coordinate)
function TEST (line 155) | TEST(xvariable_function, select_inner)
function TEST (line 178) | TEST(xvariable_function, select_outer)
function TEST (line 201) | TEST(xvariable_function, print)
FILE: test/test_xvariable_masked_view.cpp
type xf (line 17) | namespace xf
function TEST (line 19) | TEST(xvariable_masked_view, iselect)
function TEST (line 52) | TEST(xvariable_masked_view, select_inner)
function TEST (line 84) | TEST(xvariable_masked_view, select_outer)
function TEST (line 104) | TEST(xvariable_masked_view, shape)
function TEST (line 112) | TEST(xvariable_masked_view, access)
function TEST (line 138) | TEST(xvariable_masked_view, element)
function TEST (line 159) | TEST(xvariable_masked_view, locate)
function TEST (line 181) | TEST(xvariable_masked_view, locate_element)
function TEST (line 203) | TEST(xvariable_masked_view, scalar_assign)
function TEST (line 228) | TEST(xvariable_masked_view, variable_assign)
FILE: test/test_xvariable_math.cpp
type xf (line 20) | namespace xf
function TEST (line 22) | TEST(xvariable_math, plus)
function TEST (line 29) | TEST(xvariable_math, minus)
function TEST (line 36) | TEST(xvariable_math, add)
function TEST (line 49) | TEST(xvariable_math, substract)
function TEST (line 62) | TEST(xvariable_math, multiply)
function TEST (line 75) | TEST(xvariable_math, divide)
function TEST (line 88) | TEST(xvariable_math, modulus)
function TEST (line 101) | TEST(xvariable_math, logical_and)
function TEST (line 114) | TEST(xvariable_math, logical_or)
function TEST (line 127) | TEST(xvariable_math, logical_not)
function TEST (line 134) | TEST(xvariable_math, bitwise_and)
function TEST (line 147) | TEST(xvariable_math, bitwise_or)
function TEST (line 160) | TEST(xvariable_math, bitwise_xor)
function TEST (line 173) | TEST(xvariable_math, bitwise_not)
function TEST (line 180) | TEST(xvariable_math, equal)
function TEST (line 186) | TEST(xvariable_math, not_equal)
function TEST (line 192) | TEST(xvariable_math, less)
function TEST (line 199) | TEST(xvariable_math, less_equal)
function TEST (line 206) | TEST(xvariable_math, greater)
function TEST (line 213) | TEST(xvariable_math, greater_equal)
function TEST (line 220) | TEST(xvariable_math, element_wise_equal)
function TEST (line 227) | TEST(xvariable_math, element_wise_not_equal)
function TEST (line 234) | TEST(xvariable_math, abs)
function TEST (line 241) | TEST(xvariable_math, fabs)
function TEST (line 248) | TEST(xvariable_math, fmod)
function TEST (line 261) | TEST(xvariable_math, remainder)
function TEST (line 274) | TEST(xvariable_math, fma)
function TEST (line 289) | TEST(xvariable_math, fmax)
function TEST (line 302) | TEST(xvariable_math, fmin)
function TEST (line 315) | TEST(xvariable_math, fdim)
function TEST (line 328) | TEST(xvariable_math, maximum)
function TEST (line 344) | TEST(xvariable_math, minimum)
function TEST (line 360) | TEST(xvariable_math, clip)
function TEST (line 386) | TEST(xvariable_math, sign)
function TEST (line 401) | TEST(xvariable_math, exp)
function TEST (line 408) | TEST(xvariable_math, exp2)
function TEST (line 415) | TEST(xvariable_math, expm1)
function TEST (line 422) | TEST(xvariable_math, log)
function TEST (line 429) | TEST(xvariable_math, log10)
function TEST (line 436) | TEST(xvariable_math, log2)
function TEST (line 443) | TEST(xvariable_math, log1p)
function TEST (line 450) | TEST(xvariable_math, pow)
function TEST (line 463) | TEST(xvariable_math, sqrt)
function TEST (line 470) | TEST(xvariable_math, cbrt)
function TEST (line 477) | TEST(xvariable_math, hypot)
function TEST (line 490) | TEST(xvariable_math, sin)
function TEST (line 497) | TEST(xvariable_math, cos)
function TEST (line 504) | TEST(xvariable_math, tan)
function TEST (line 511) | TEST(xvariable_math, asin)
function TEST (line 518) | TEST(xvariable_math, acos)
function TEST (line 525) | TEST(xvariable_math, atan)
function TEST (line 532) | TEST(xvariable_math, atan2)
function TEST (line 539) | TEST(xvariable_math, sinh)
function TEST (line 546) | TEST(xvariable_math, cosh)
function TEST (line 553) | TEST(xvariable_math, tanh)
function TEST (line 560) | TEST(xvariable_math, asinh)
function TEST (line 567) | TEST(xvariable_math, acosh)
function TEST (line 574) | TEST(xvariable_math, atanh)
function TEST (line 581) | TEST(xvariable_math, erf)
function TEST (line 588) | TEST(xvariable_math, erfc)
function TEST (line 595) | TEST(xvariable_math, tgamma)
function TEST (line 602) | TEST(xvariable_math, lgamma)
function TEST (line 609) | TEST(xvariable_math, ceil)
function TEST (line 616) | TEST(xvariable_math, floor)
function TEST (line 623) | TEST(xvariable_math, trunc)
function TEST (line 630) | TEST(xvariable_math, round)
function TEST (line 637) | TEST(xvariable_math, nearbyint)
function TEST (line 644) | TEST(xvariable_math, rint)
function TEST (line 651) | TEST(xvariable_math, isfinite)
function TEST (line 658) | TEST(xvariable_math, isinf)
function TEST (line 665) | TEST(xvariable_math, isnan)
function TEST (line 672) | TEST(xvariable_math, where)
FILE: test/test_xvariable_scalar.cpp
type DEBUG (line 17) | struct DEBUG
FILE: test/test_xvariable_view.cpp
type xf (line 14) | namespace xf
function TEST (line 16) | TEST(xvariable_view, select_builder)
function TEST (line 24) | TEST(xvariable_view, size)
function TEST (line 31) | TEST(xvariable_view, dimension)
function TEST (line 38) | TEST(xvariable_view, dimension_labels)
function TEST (line 47) | TEST(xvariable_view, access)
function TEST (line 101) | TEST(xvariable_view, element)
function TEST (line 123) | TEST(xvariable_view, select_inner)
function TEST (line 184) | TEST(xvariable_view, select_outer)
function TEST (line 244) | TEST(xvariable_view, iselect)
function TEST (line 298) | TEST(xvariable_view, locate)
function TEST (line 352) | TEST(xvariable_view, locate_element)
function TEST (line 406) | TEST(xvariable_view, view_squeeze)
function TEST (line 481) | TEST(xvariable_view, locate_builder)
function TEST (line 497) | TEST(xvariable_view, iselect_builder)
function TEST (line 514) | TEST(xvariable_view, view_builder)
function TEST (line 530) | TEST(xvariable_view, keep_slice)
function TEST (line 547) | TEST(xvariable_view, drop_slice)
FILE: test/test_xvector_variant.cpp
type xf (line 19) | namespace xf
function TEST (line 21) | TEST(xvector_variant, types)
function TEST (line 36) | TEST(xvector_variant_ref, types)
function TEST (line 51) | TEST(xvector_variant_cref, types)
function build_vector (line 70) | std::vector<double> build_vector()
function build_svector (line 75) | xt::svector<int> build_svector()
function build_uvector (line 80) | xt::uvector<double> build_uvector()
function TEST (line 89) | TEST(xvector_variant, constructor)
function TEST (line 107) | TEST(xvector_variant, copy_constructor)
function TEST (line 125) | TEST(xvector_variant_ref, copy_constructor)
function TEST (line 143) | TEST(xvector_variant_cref, copy_constructor)
function TEST (line 161) | TEST(xvector_variant, move_constructor)
function TEST (line 182) | TEST(xvector_variant_ref, move_constructor)
function TEST (line 203) | TEST(xvector_variant_cref, move_constructor)
function TEST (line 224) | TEST(xvector_variant, assign)
function TEST (line 235) | TEST(xvector_variant_ref, assign)
function TEST (line 246) | TEST(xvector_variant, move_assign)
function TEST (line 258) | TEST(xvector_variant_ref, move_assign)
function TEST (line 274) | TEST(xvector_variant, empty)
function TEST (line 285) | TEST(xvector_variant_ref, empty)
function TEST (line 296) | TEST(xvector_variant_cref, empty)
function TEST (line 307) | TEST(xvector_variant, size)
function TEST (line 317) | TEST(xvector_variant_ref, size)
function TEST (line 328) | TEST(xvector_variant_cref, size)
function TEST (line 339) | TEST(xvector_variant, resize)
function TEST (line 348) | TEST(xvector_variant_ref, resize)
function TEST (line 358) | TEST(xvector_variant, max_size)
function TEST (line 368) | TEST(xvector_variant, capacity)
function TEST (line 378) | TEST(xvector_variant, reserve)
function TEST (line 386) | TEST(xvector_variant, shrink_to_fit)
function TEST (line 395) | TEST(xvector_variant, clear)
function TEST (line 408) | TEST(xvector_variant, access)
function TEST (line 422) | TEST(xvector_variant_ref, access)
function TEST (line 433) | TEST(xvector_variant_cref, access)
function TEST (line 442) | TEST(xvector_variant, at)
function TEST (line 458) | TEST(xvector_variant_ref, at)
function TEST (line 471) | TEST(xvector_variant_cref, at)
function TEST (line 482) | TEST(xvector_variant, front)
function TEST (line 496) | TEST(xvector_variant_ref, front)
function TEST (line 507) | TEST(xvector_variant_cref, front)
function TEST (line 516) | TEST(xvector_variant, back)
function TEST (line 530) | TEST(xvector_variant_ref, back)
function TEST (line 541) | TEST(xvector_variant_cref, back)
function TEST (line 550) | TEST(xvector_variant, data)
function TEST (line 561) | TEST(xvector_variant_ref, data)
function TEST (line 573) | TEST(xvector_variant_cref, data)
function TEST (line 582) | TEST(xvector_variant, storage)
function TEST (line 593) | TEST(xvector_variant_ref, storage)
function TEST (line 605) | TEST(xvector_variant_cref, storage)
function TEST (line 618) | TEST(xvector_variant_ref, iterator)
function TEST (line 646) | TEST(xvector_variant_ref, const_iterator)
function TEST (line 674) | TEST(xvector_variant_cref, const_iterator)
function TEST (line 706) | TEST(xvector_variant, swap)
function TEST (line 724) | TEST(xvector_variant_ref, swap)
function TEST (line 746) | TEST(xvector_variant, xget_vector)
function TEST (line 764) | TEST(xvector_variant_ref, xget_vector)
function TEST (line 783) | TEST(xvector_variant_cref, xget_vector)
Condensed preview — 125 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (934K chars).
[
{
"path": ".appveyor.yml",
"chars": 1036,
"preview": "build: false\n\nos: Visual Studio 2015\n\nplatform:\n - x64\n\nenvironment:\n matrix:\n - MINICONDA: C:\\xframe-conda\n\ninit:\n"
},
{
"path": ".azure-pipelines/azure-pipelines-linux-clang.yml",
"chars": 1404,
"preview": "jobs:\n - job: 'Linux_0'\n strategy:\n matrix:\n clang_4:\n llvm_version: '4.0'\n clang_5:\n "
},
{
"path": ".azure-pipelines/azure-pipelines-linux-gcc.yml",
"chars": 941,
"preview": "jobs:\n - job: 'Linux_1'\n strategy:\n matrix:\n gcc_4:\n gcc_version: '4.9'\n gcc_5:\n "
},
{
"path": ".azure-pipelines/azure-pipelines-osx.yml",
"chars": 790,
"preview": "jobs:\n - job: 'OSX'\n strategy:\n matrix:\n macOS_10_14:\n image_name: 'macOS-10.14'\n macOS_"
},
{
"path": ".azure-pipelines/unix-build.yml",
"chars": 777,
"preview": "steps:\n - script: |\n conda config --set always_yes yes --set changeps1 no\n conda update -q conda\n conda "
},
{
"path": ".gitignore",
"chars": 540,
"preview": "# Prerequisites\n*.d\n\n# Compiled Object files\n*.slo\n*.lo\n*.o\n*.obj\n\n# Precompiled Headers\n*.gch\n*.pch\n\n# Compiled Dynamic"
},
{
"path": ".travis.yml",
"chars": 2966,
"preview": "language: cpp\ndist: xenial\nmatrix:\n include:\n - os: linux\n addons:\n apt:\n sources:\n "
},
{
"path": "CMakeLists.txt",
"chars": 5499,
"preview": "############################################################################\n# Copyright (c) Johan Mabille and Sylvain C"
},
{
"path": "LICENSE",
"chars": 1614,
"preview": "BSD 3-Clause License\n\nCopyright (c) 2017, Johan Mabille, Sylvain Corlay, Wolf Vollprecht and\n Martin "
},
{
"path": "README.md",
"chars": 1816,
"preview": "# \n\n[](https://t"
},
{
"path": "azure-pipelines.yml",
"chars": 213,
"preview": "trigger:\n - master\n\njobs:\n - template: ./.azure-pipelines/azure-pipelines-linux-clang.yml\n - template: ./.azure-pipel"
},
{
"path": "docs/Doxyfile",
"chars": 343,
"preview": "PROJECT_NAME = \"xframe\"\nXML_OUTPUT = xml\nINPUT = ../include\nGENERATE_LATEX = NO\nGENERATE_MAN "
},
{
"path": "docs/Makefile",
"chars": 6626,
"preview": "# You can set these variables from the command line.\nSPHINXOPTS =\nSPHINXBUILD = sphinx-build\nPAPER =\nBUILDD"
},
{
"path": "docs/environment.yml",
"chars": 71,
"preview": "name: xframe-docs\n\nchannels:\n - QuantStack\n\ndependencies:\n - breathe\n"
},
{
"path": "docs/make.bat",
"chars": 7285,
"preview": "@ECHO OFF\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sphinx-build\r\n)\r\n"
},
{
"path": "docs/source/_static/main_stylesheet.css",
"chars": 60,
"preview": ".wy-nav-content{\n max-width: 1000px;\n margin: auto;\n}\n"
},
{
"path": "docs/source/api/axis_index.rst",
"chars": 383,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/coordinate_index.rst",
"chars": 412,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/variable_index.rst",
"chars": 310,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xaxis.rst",
"chars": 474,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xaxis_base.rst",
"chars": 554,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xaxis_default.rst",
"chars": 423,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xaxis_expression_leaf.rst",
"chars": 400,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xaxis_function.rst",
"chars": 372,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xaxis_variant.rst",
"chars": 369,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xaxis_view.rst",
"chars": 1034,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xcoordinate.rst",
"chars": 776,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xcoordinate_base.rst",
"chars": 614,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xcoordinate_chain.rst",
"chars": 557,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xcoordinate_expanded.rst",
"chars": 577,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xcoordinate_view.rst",
"chars": 575,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xdimension.rst",
"chars": 562,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xexpand_dims_view.rst",
"chars": 611,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xnamed_axis.rst",
"chars": 431,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/api/xvariable_masked_view.rst",
"chars": 461,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/computation.rst",
"chars": 7077,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/conf.py",
"chars": 900,
"preview": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport os\nimport subprocess\n\non_rtd = os.environ.get('READTHEDOCS', None"
},
{
"path": "docs/source/data_structure.rst",
"chars": 8216,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/getting_started.rst",
"chars": 6870,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/index.rst",
"chars": 1836,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/indexing.rst",
"chars": 12925,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/installation.rst",
"chars": 2236,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay and Wolf Vollprecht\n and Martin Renou\n\n Distributed under the t"
},
{
"path": "docs/source/xarray.rst",
"chars": 15437,
"preview": ".. Copyright (c) 2018, Johan Mabille, Sylvain Corlay, Wolf Vollprecht\n and Martin Renou\n\n Distributed under the term"
},
{
"path": "docs/source/xframe_summary_drawio.xml",
"chars": 2817,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<mxfile modified=\"2019-01-22T08:40:54.529Z\" host=\"www.draw.io\" agent=\"Mozilla/5.0"
},
{
"path": "environment-dev.yml",
"chars": 83,
"preview": "name: xframe\nchannels:\n - conda-forge\ndependencies:\n - cmake\n - xtensor=0.21.4\n\n"
},
{
"path": "environment.yml",
"chars": 119,
"preview": "name: xframe\nchannels:\n - QuantStack\n - conda-forge\ndependencies:\n - xframe=0.3.0\n - xeus-cling=0.8.1\n - notebook\n"
},
{
"path": "include/xframe/xaxis.hpp",
"chars": 26889,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xaxis_base.hpp",
"chars": 10299,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xaxis_default.hpp",
"chars": 13889,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xaxis_expression_leaf.hpp",
"chars": 3792,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xaxis_function.hpp",
"chars": 7501,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xaxis_index_slice.hpp",
"chars": 7098,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xaxis_label_slice.hpp",
"chars": 16576,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xaxis_math.hpp",
"chars": 2842,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xaxis_meta.hpp",
"chars": 4244,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xaxis_scalar.hpp",
"chars": 2290,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xaxis_variant.hpp",
"chars": 25361,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xaxis_view.hpp",
"chars": 21501,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xcoordinate.hpp",
"chars": 17587,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xcoordinate_base.hpp",
"chars": 11148,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xcoordinate_chain.hpp",
"chars": 17788,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xcoordinate_expanded.hpp",
"chars": 17809,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xcoordinate_system.hpp",
"chars": 4844,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xcoordinate_view.hpp",
"chars": 5840,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xdimension.hpp",
"chars": 10918,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xdynamic_variable.hpp",
"chars": 15060,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xdynamic_variable_impl.hpp",
"chars": 28603,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xexpand_dims_view.hpp",
"chars": 10801,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xframe_config.hpp",
"chars": 1759,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xframe_expression.hpp",
"chars": 2136,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xframe_trace.hpp",
"chars": 2264,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xframe_utils.hpp",
"chars": 5747,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xio.hpp",
"chars": 16458,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xnamed_axis.hpp",
"chars": 5695,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xreindex_data.hpp",
"chars": 7228,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xreindex_view.hpp",
"chars": 19200,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xselecting.hpp",
"chars": 9775,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xsequence_view.hpp",
"chars": 14520,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xvariable.hpp",
"chars": 11767,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xvariable_assign.hpp",
"chars": 8794,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xvariable_base.hpp",
"chars": 20566,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xvariable_function.hpp",
"chars": 12428,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xvariable_masked_view.hpp",
"chars": 12089,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xvariable_math.hpp",
"chars": 1680,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xvariable_meta.hpp",
"chars": 5614,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xvariable_scalar.hpp",
"chars": 4879,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xvariable_variant.hpp",
"chars": 2030,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xvariable_view.hpp",
"chars": 45668,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "include/xframe/xvector_variant.hpp",
"chars": 26339,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "notebooks/xframe.ipynb",
"chars": 17554,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"\"\n ]\n"
},
{
"path": "readthedocs.yml",
"chars": 38,
"preview": "conda:\n file: docs/environment.yml\n"
},
{
"path": "test/CMakeLists.txt",
"chars": 4685,
"preview": "############################################################################\n# Copyright (c) Johan Mabille and Sylvain C"
},
{
"path": "test/copyGTest.cmake.in",
"chars": 1027,
"preview": "############################################################################\n# Copyright (c) Johan Mabille and Sylvain C"
},
{
"path": "test/downloadGTest.cmake.in",
"chars": 1086,
"preview": "############################################################################\n# Copyright (c) Johan Mabille and Sylvain C"
},
{
"path": "test/main.cpp",
"chars": 830,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_fixture.hpp",
"chars": 15593,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_fixture_view.hpp",
"chars": 9852,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xaxis.cpp",
"chars": 8491,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xaxis_default.cpp",
"chars": 5295,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xaxis_function.cpp",
"chars": 4385,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xaxis_variant.cpp",
"chars": 2158,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xaxis_view.cpp",
"chars": 5465,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xcoordinate.cpp",
"chars": 5499,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xcoordinate_chain.cpp",
"chars": 4878,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xcoordinate_expanded.cpp",
"chars": 5351,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xcoordinate_view.cpp",
"chars": 4447,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xdimension.cpp",
"chars": 2320,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xdynamic_variable.cpp",
"chars": 13236,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xexpand_dims_view.cpp",
"chars": 9920,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xframe_utils.cpp",
"chars": 2168,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xnamed_axis.cpp",
"chars": 1217,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xreindex_view.cpp",
"chars": 12973,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xsequence_view.cpp",
"chars": 3999,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xvariable.cpp",
"chars": 14558,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xvariable_assign.cpp",
"chars": 15504,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xvariable_function.cpp",
"chars": 8483,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xvariable_masked_view.cpp",
"chars": 9703,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xvariable_math.cpp",
"chars": 21756,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xvariable_noalias.cpp",
"chars": 7218,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xvariable_scalar.cpp",
"chars": 3107,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xvariable_view.cpp",
"chars": 23631,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xvariable_view_assign.cpp",
"chars": 3598,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "test/test_xvector_variant.cpp",
"chars": 20866,
"preview": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corl"
},
{
"path": "xframe.pc.in",
"chars": 300,
"preview": "prefix=@CMAKE_INSTALL_PREFIX@\nlibdir=${prefix}/@CMAKE_INSTALL_LIBDIR@\nincludedir=${prefix}/include\n\nName: xframe\nDescrip"
},
{
"path": "xframeConfig.cmake.in",
"chars": 1020,
"preview": "############################################################################\n# Copyright (c) Johan Mabille and Sylvain C"
}
]
About this extraction
This page contains the full source code of the xtensor-stack/xframe GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 125 files (871.0 KB), approximately 221.0k tokens, and a symbol index with 962 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.