Skip to content

Commit

Permalink
Refer to xtensor lib in italic
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv authored and tdegeus committed Apr 7, 2022
1 parent 33cb757 commit 226e8dd
Show file tree
Hide file tree
Showing 31 changed files with 132 additions and 132 deletions.
6 changes: 3 additions & 3 deletions docs/source/adaptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
Adapting 1-D containers
=======================

`xtensor` can adapt one-dimensional containers in place, and provide them a tensor interface.
*xtensor* can adapt one-dimensional containers in place, and provide them a tensor interface.
Only random access containers can be adapted.

Adapting std::vector
--------------------

The following example shows how to bring an ``std::vector`` into the expression system of
`xtensor`:
*xtensor*:

.. code::
Expand Down Expand Up @@ -44,7 +44,7 @@ the corresponding value in ``v``:
Adapting C-style arrays
-----------------------

`xtensor` provides two ways for adapting a C-style array; the first one does not take the
*xtensor* provides two ways for adapting a C-style array; the first one does not take the
ownership of the array:

.. code::
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/iterator_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Iterators
=========

In addition to the iterators defined in the different types of expressions, ``xtensor`` provides
In addition to the iterators defined in the different types of expressions, *xtensor* provides
classes that allow to iterate over slices of an expression along a specified axis.

.. toctree::
Expand Down
14 changes: 7 additions & 7 deletions docs/source/build-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ Build and configuration
Configuration
-------------

`xtensor` can be configured via macros which must be defined *before* including
*xtensor* can be configured via macros which must be defined *before* including
any of its headers. This can be achieved the following ways:

- either define them in the CMakeLists of your project, with ``target_compile_definitions``
cmake command.
- or create a header where you define all the macros you want and then include the headers you
need. Then include this header whenever you need `xtensor` in your project.
need. Then include this header whenever you need *xtensor* in your project.

The following macros are already defined in `xtensor` but can be overwritten:
The following macros are already defined in *xtensor* but can be overwritten:

- ``XTENSOR_DEFAULT_DATA_CONTAINER(T, A)``: defines the type used as the default data container for tensors and arrays. ``T``
is the ``value_type`` of the container and ``A`` its ``allocator_type``.
Expand All @@ -35,8 +35,8 @@ The following macros are already defined in `xtensor` but can be overwritten:

The following macros are helpers for debugging, they are not defined by default:

- ``XTENSOR_ENABLE_ASSERT``: enables assertions in `xtensor`, such as bound check.
- ``XTENSOR_ENABLE_CHECK_DIMENSION``: enables the dimensions check in `xtensor`. Note that this option should not be turned
- ``XTENSOR_ENABLE_ASSERT``: enables assertions in *xtensor*, such as bound check.
- ``XTENSOR_ENABLE_CHECK_DIMENSION``: enables the dimensions check in *xtensor*. Note that this option should not be turned
on if you expect ``operator()`` to perform broadcasting.

.. _external-dependencies:
Expand All @@ -47,14 +47,14 @@ External dependencies
The last group of macros is for using external libraries to achieve maximum performance (see next section for additional
requirements):

- ``XTENSOR_USE_XSIMD``: enables SIMD acceleration in `xtensor`. This requires that you have xsimd_ installed
- ``XTENSOR_USE_XSIMD``: enables SIMD acceleration in *xtensor*. This requires that you have xsimd_ installed
on your system.
- ``XTENSOR_USE_TBB``: enables parallel assignment loop. This requires that you have tbb_ installed
on your system.
- ``XTENSOR_DISABLE_EXCEPTIONS``: disables c++ exceptions.
- ``XTENSOR_USE_OPENMP``: enables parallel assignment loop using OpenMP. This requires that OpenMP is available on your system.

Defining these macros in the CMakeLists of your project before searching for `xtensor` will trigger automatic finding
Defining these macros in the CMakeLists of your project before searching for *xtensor* will trigger automatic finding
of dependencies, so you don't have to include the ``find_package(xsimd)`` and ``find_package(TBB)`` commands in your
CMakeLists:

Expand Down
4 changes: 2 additions & 2 deletions docs/source/builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
Expression builders
===================

`xtensor` provides functions to ease the build of common N-dimensional expressions. The expressions
returned by these functions implement the laziness of `xtensor`, that is, they don't hold any value.
*xtensor* provides functions to ease the build of common N-dimensional expressions. The expressions
returned by these functions implement the laziness of *xtensor*, that is, they don't hold any value.
Values are computed upon request.

Ones and zeros
Expand Down
20 changes: 10 additions & 10 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ Other changes
`#1888 <https://github.com/xtensor-stack/xtensor/pull/1888>`_
- Fixed ``reshape`` return
`#1886 <https://github.com/xtensor-stack/xtensor/pull/1886>`_
- Enabled ``add_subdirectory`` for ``xsimd``
- Enabled ``add_subdirectory`` for *xsimd*
`#1889 <https://github.com/xtensor-stack/xtensor/pull/1889>`_
- Support ``ddof`` argument for ``xt::variance``
`#1893 <https://github.com/xtensor-stack/xtensor/pull/1893>`_
Expand Down Expand Up @@ -827,7 +827,7 @@ Other changes
`#1556 <https://github.com/xtensor-stack/xtensor/pull/1556>`_
- Fixed ``real``, ``imag``, and ``functor_view``
`#1554 <https://github.com/xtensor-stack/xtensor/pull/1554>`_
- Allows to include ``xsimd`` without defining ``XTENSOR_USE_XSIMD``
- Allows to include *xsimd* without defining ``XTENSOR_USE_XSIMD``
`#1548 <https://github.com/xtensor-stack/xtensor/pull/1548>`_
- Fixed ``argsort`` in column major
`#1547 <https://github.com/xtensor-stack/xtensor/pull/1547>`_
Expand Down Expand Up @@ -863,7 +863,7 @@ Other changes
`#1497 <https://github.com/xtensor-stack/xtensor/pull/1497>`_
- Removed unused capture
`#1499 <https://github.com/xtensor-stack/xtensor/pull/1499>`_
- Upgraded to ``xtl`` 0.6.2
- Upgraded to *xtl* 0.6.2
`#1502 <https://github.com/xtensor-stack/xtensor/pull/1502>`_
- Added missing methods in ``xshared_expression``
`#1503 <https://github.com/xtensor-stack/xtensor/pull/1503>`_
Expand Down Expand Up @@ -908,7 +908,7 @@ Breaking changes
`#1389 <https://github.com/xtensor-stack/xtensor/pull/1389>`_
- Removed deprecated type ``slice_vector``
`#1459 <https://github.com/xtensor-stack/xtensor/pull/1459>`_
- Upgraded to ``xtl`` 0.6.1
- Upgraded to *xtl* 0.6.1
`#1468 <https://github.com/xtensor-stack/xtensor/pull/1465>`_
- Added ``keep_dims`` option to reducers
`#1474 <https://github.com/xtensor-stack/xtensor/pull/1474>`_
Expand Down Expand Up @@ -1080,7 +1080,7 @@ Other changes
`#1339 <https://github.com/xtensor-stack/xtensor/pull/1339>`_.
- Prevent embiguity with `xsimd::reduce`
`#1343 <https://github.com/xtensor-stack/xtensor/pull/1343>`_.
- Require `xtl` 0.5.3
- Require *xtl* 0.5.3
`#1346 <https://github.com/xtensor-stack/xtensor/pull/1346>`_.
- Use concepts instead of SFINAE
`#1347 <https://github.com/xtensor-stack/xtensor/pull/1347>`_.
Expand Down Expand Up @@ -1330,7 +1330,7 @@ Other changes
`#1074 <https://github.com/xtensor-stack/xtensor/pull/1074>`_.
- Clean documentation for views
`#1131 <https://github.com/xtensor-stack/xtensor/pull/1131>`_.
- Build with ``xsimd`` on Windows fixed
- Build with *xsimd* on Windows fixed
`#1127 <https://github.com/xtensor-stack/xtensor/pull/1127>`_.
- Implement ``mime_bundle_repr`` for ``xmasked_view``
`#1132 <https://github.com/xtensor-stack/xtensor/pull/1132>`_.
Expand Down Expand Up @@ -2013,7 +2013,7 @@ Breaking changes
`#482 <https://github.com/xtensor-stack/xtensor/pull/482>`_.
- Change ``edge_items`` print option to ``edgeitems`` for better numpy consistency
`#489 <https://github.com/xtensor-stack/xtensor/pull/489>`_.
- xtensor now depends on ``xtl`` version `~0.3.3`
- *xtensor* now depends on *xtl* version `~0.3.3`
`#508 <https://github.com/xtensor-stack/xtensor/pull/508>`_.

New features
Expand Down Expand Up @@ -2063,13 +2063,13 @@ Other changes
Breaking changes
~~~~~~~~~~~~~~~~

- ``xtensor`` now depends on ``xtl`` version `0.2.x`
- *xtensor* now depends on *xtl* version `0.2.x`
`#421 <https://github.com/xtensor-stack/xtensor/pull/421>`_.

New features
~~~~~~~~~~~~

- ``xtensor`` has an optional dependency on ``xsimd`` for enabling simd acceleration
- *xtensor* has an optional dependency on *xsimd* for enabling simd acceleration
`#426 <https://github.com/xtensor-stack/xtensor/pull/426>`_.

- All expressions have an additional safe access function (``at``)
Expand All @@ -2082,7 +2082,7 @@ New features
correctly defined
`#446 <https://github.com/xtensor-stack/xtensor/pull/446>`_.

- expressions tags added so ``xtensor`` expression system can be extended
- expressions tags added so *xtensor* expression system can be extended
`#447 <https://github.com/xtensor-stack/xtensor/pull/447>`_.

Other changes
Expand Down
8 changes: 4 additions & 4 deletions docs/source/closure-semantics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Closure semantics
=================

The ``xtensor`` library is a tensor expression library implementing numpy-style broadcasting and universal functions but in a lazy fashion.
The *xtensor* library is a tensor expression library implementing numpy-style broadcasting and universal functions but in a lazy fashion.

If ``x`` and ``y`` are two tensor expressions with compatible shapes, the result of ``x + y`` is not a tensor but an expression that does
not hold any value. Values of ``x + y`` are computed upon access or when the result is assigned to a container such as :cpp:type:`xt::xtensor` or
Expand All @@ -19,7 +19,7 @@ In order to be able to perform the differed computation of ``x + y``, the return
copies of the members ``x`` and ``y``, depending on how arguments were passed to ``operator+``. The actual types held by the expressions
are the **closure types**.

The concept of closure type is key in the implementation of ``xtensor`` and appears in all the expressions defined in xtensor, and the utility functions and metafunctions complement the tools of the standard library for the move semantics.
The concept of closure type is key in the implementation of *xtensor* and appears in all the expressions defined in xtensor, and the utility functions and metafunctions complement the tools of the standard library for the move semantics.

Basic rules for determining closure types
-----------------------------------------
Expand Down Expand Up @@ -78,7 +78,7 @@ Using this mechanism, we were able to
Closure types and scalar wrappers
---------------------------------

A requirement for ``xtensor`` is the ability to mix scalars and tensors in tensor expressions. In order to do so,
A requirement for *xtensor* is the ability to mix scalars and tensors in tensor expressions. In order to do so,
scalar values are wrapped into the ``xscalar`` wrapper, which is a cheap 0-D tensor expression holding a single
scalar value.

Expand Down Expand Up @@ -209,7 +209,7 @@ utility to achieve this:
}
Note: writing a lambda is just sugar for writing a functor.
Also, using `auto x` as the function argument enables automatic `xsimd` acceleration.
Also, using ``auto x`` as the function argument enables automatic *xsimd* acceleration.

As the data flow through the lambda is entirely transparent to the compiler, using this construct
is generally faster than using ``xshared_expressions``. The usage of ``xshared_expression`` also
Expand Down
8 changes: 4 additions & 4 deletions docs/source/container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Arrays and tensors
Internal memory layout
----------------------

A multi-dimensional array of `xtensor` consists of a contiguous one-dimensional buffer combined with an indexing scheme that maps
A multi-dimensional array of *xtensor* consists of a contiguous one-dimensional buffer combined with an indexing scheme that maps
unsigned integers to the location of an element in the buffer. The range in which the indices can vary is specified by the
`shape` of the array.

Expand All @@ -21,7 +21,7 @@ The scheme used to map indices into a location in the buffer is a strided indexi
- the row-major layout (or C layout) is a strided index scheme where the strides grow from right to left
- the column-major layout (or Fortran layout) is a strided index scheme where the strides grow from left to right

`xtensor` provides a :cpp:enum:`xt::layout_type` enum that helps to specify the layout used by multidimensional arrays.
*xtensor* provides a :cpp:enum:`xt::layout_type` enum that helps to specify the layout used by multidimensional arrays.
This enum can be used in two ways:

- at compile time, as a template argument. The value :cpp:enumerator:`xt::layout_type::dynamic` allows specifying any
Expand Down Expand Up @@ -174,11 +174,11 @@ Instead, it has to be assigned to a temporary variable before being copied into
A typical case where this happens is when the destination container is involved in the expression and has to be resized.
This phenomenon is known as *aliasing*.

To prevent this, `xtensor` assigns the expression to a temporary variable before copying it.
To prevent this, *xtensor* assigns the expression to a temporary variable before copying it.
In the case of :cpp:type:`xt::xarray`, this results in an extra dynamic memory allocation and copy.

However, if the left-hand side is not involved in the expression being assigned, no temporary variable should be required.
`xtensor` cannot detect such cases automatically and applies the "temporary variable rule" by default.
*xtensor* cannot detect such cases automatically and applies the "temporary variable rule" by default.
A mechanism is provided to forcibly prevent usage of a temporary variable:

.. code::
Expand Down
18 changes: 9 additions & 9 deletions docs/source/dev-build-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Build and configuration
Build
-----

``xtensor`` build supports the following options:
*xtensor* build supports the following options:

- ``BUILD_TESTS``: enables the ``xtest`` and ``xbenchmark`` targets (see below).
- ``DOWNLOAD_GTEST``: downloads ``gtest`` and builds it locally instead of using a binary installation.
- ``GTEST_SRC_DIR``: indicates where to find the ``gtest`` sources instead of downloading them.
- ``XTENSOR_ENABLE_ASSERT``: activates the assertions in ``xtensor``.
- ``XTENSOR_CHECK_DIMENSION``: turns on ``XTENSOR_ENABLE_ASSERT`` and activates dimension checks in ``xtensor``.
- ``XTENSOR_ENABLE_ASSERT``: activates the assertions in *xtensor*.
- ``XTENSOR_CHECK_DIMENSION``: turns on ``XTENSOR_ENABLE_ASSERT`` and activates dimension checks in *xtensor*.
Note that the dimensions check should not be activated if you expect ``operator()`` to perform broadcasting.
- ``XTENSOR_USE_XSIMD``: enables simd acceleration in ``xtensor``. This requires that you have xsimd_ installed
- ``XTENSOR_USE_XSIMD``: enables simd acceleration in *xtensor*. This requires that you have xsimd_ installed
on your system.
- ``XTENSOR_USE_TBB``: enables parallel assignment loop. This requires that you have you have tbb_ installed
on your system.
Expand All @@ -35,7 +35,7 @@ If the ``BUILD_TESTS`` option is enabled, the following targets are available:
- xtest: builds an run the test suite.
- xbenchmark: builds and runs the benchmarks.

For instance, building the test suite of ``xtensor`` with assertions enabled:
For instance, building the test suite of *xtensor* with assertions enabled:

.. code::
Expand All @@ -44,7 +44,7 @@ For instance, building the test suite of ``xtensor`` with assertions enabled:
cmake -DBUILD_TESTS=ON -DXTENSOR_ENABLE_ASSERT=ON ../
make xtest
Building the test suite of ``xtensor`` where the sources of ``gtest`` are
Building the test suite of *xtensor* where the sources of ``gtest`` are
located in e.g. ``/usr/share/gtest``:

.. code::
Expand All @@ -59,13 +59,13 @@ located in e.g. ``/usr/share/gtest``:
Configuration
-------------

``xtensor`` can be configured via macros, which must be defined *before*
*xtensor* can be configured via macros, which must be defined *before*
including any of its header. Here is a list of available macros:

- ``XTENSOR_ENABLE_ASSERT``: enables assertions in xtensor, such as bound check.
- ``XTENSOR_ENABLE_CHECK_DIMENSION``: enables the dimensions check in ``xtensor``. Note that this option should not be turned
- ``XTENSOR_ENABLE_CHECK_DIMENSION``: enables the dimensions check in *xtensor*. Note that this option should not be turned
on if you expect ``operator()`` to perform broadcasting.
- ``XTENSOR_USE_XSIMD``: enables SIMD acceleration in ``xtensor``. This requires that you have xsimd_ installed
- ``XTENSOR_USE_XSIMD``: enables SIMD acceleration in *xtensor*. This requires that you have xsimd_ installed
on your system.
- ``XTENSOR_USE_TBB``: enables parallel assignment loop. This requires that you have you have tbb_ installed
on your system.
Expand Down
8 changes: 4 additions & 4 deletions docs/source/developer/assignment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Assignment
==========

In this section, we consider the class :cpp:type:`xt::xarray` and its semantic bases (``xcontainer_semantic`` and
``xsemantic_base``) to illustrate how the assignment works. `xtensor` provides different mechanics of
``xsemantic_base``) to illustrate how the assignment works. *xtensor* provides different mechanics of
assignment depending on the type of expression.

Extended copy semantic
Expand Down Expand Up @@ -159,7 +159,7 @@ tag:
// ...
};
`xtensor` provides specializations for ``xtensor_expression_tag`` and ``xoptional_expression_tag``.
*xtensor* provides specializations for ``xtensor_expression_tag`` and ``xoptional_expression_tag``.
When implementing a new function type whose API is unrelated to the one of ``xfunction_base``,
the ``xexpression_assigner`` should be specialized so that the assignment relies on this specific API.

Expand All @@ -172,10 +172,10 @@ during the resize phase, is the nature of the assignment: trivial or not. The as
trivial when the memory layout of the lhs and rhs are such that assignment can be done by iterating over
a 1-D sequence on both sides. In that case, two options are possible:

- if ``xtensor`` is compiled with the optional ``xsimd`` dependency, and if the layout and the
- if *xtensor* is compiled with the optional *xsimd* dependency, and if the layout and the
``value_type`` of each expression allows it, the assignment is a vectorized index-based loop
operating on the expression buffers.
- if the ``xsimd`` assignment is not possible (for any reason), an iterator-based loop operating
- if the *xsimd* assignment is not possible (for any reason), an iterator-based loop operating
on the expresion buffers is used instead.

These methods are implemented in specializations of the ``trivial_assigner`` class.
Expand Down
6 changes: 3 additions & 3 deletions docs/source/developer/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Concepts
========

`xtensor`'s core is built upon key concepts captured in interfaces that are put together in derived
*xtensor*'s core is built upon key concepts captured in interfaces that are put together in derived
classes through CRTP (`Curiously Recurring Template Pattern
<https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern>`_) and multiple inheritance.
Interfaces and classes that model expressions implement *value semantic*. CRTP and value semantic
Expand Down Expand Up @@ -89,13 +89,13 @@ you to iterate over a N-dimensional expression in row-major order or column-majo
const_reverse_iterator crend() const noexcept;
This template parameter is defaulted to ``XTENSOR_DEFAULT_TRAVERSAL`` (see :ref:`configuration-label`), so
that `xtensor` expressions can be used in generic code such as:
that *xtensor* expressions can be used in generic code such as:

.. code::
std::copy(a.cbegin(), a.cend(), b.begin());
where ``a`` and ``b`` can be arbitrary types (from `xtensor`, the STL or any external library)
where ``a`` and ``b`` can be arbitrary types (from *xtensor*, the STL or any external library)
supporting standard iteration.

``xiterable`` inherits from ``xconst_iterable`` and provides non-const counterpart of methods
Expand Down
Loading

0 comments on commit 226e8dd

Please sign in to comment.