Skip to content

Fix documentation of the tensor part #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/ublas/tensor.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@ elements. If `sizeof...(is)==0`, `tensor::operator[i]` is called.
|===
|Member function |Description

|`template<std::size_t I, class ... index_types> tensor_index operator()(indices::Index<I> p, index_types ... ps)`
|Returns a link:tensor/tensor_index.html[tensor index] instance with
|`template<std::size_t I, class ... index_types> decltype(auto) operator()(index::index_type<I> p, index_types ... ps) const`
|Returns a link:tensor/tensor_index.adoc[tensor index] instance with
index objects `(p,ps...)` for a tensor contraction where
`sizeof...(ps)+1` must be equal to `tensor::order()`.
`sizeof...(ps) + 1` must be equal to `tensor::order()`.
|===

===== vi. [#tensor_16]#Iterators#
Expand Down
2 changes: 1 addition & 1 deletion doc/ublas/tensor/tensor_expression.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

==== Description

The templated class `tensor_expression<T,E>` is required to be a public
The templated class `tensor_expression<T, E>` is required to be a public
base of all classes. There is no Tensor Expression concept defined.

==== Definition
Expand Down
23 changes: 10 additions & 13 deletions doc/ublas/tensor/tensor_index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@

[[toc]]

=== [#tensor index]#tensor_index<value_t, storage_t, array_t, N>#
=== [#tensor index]#Tensor Index#

==== Description

The template class `tensor_index` decorates the
link:../tensor.html#tensor[tensor] template class with indices for
The template class `index_type` decorates the
link:../tensor.adoc[tensor] template class with indices for
tensor contraction.

==== Example

[source, cpp]
....
#include <boost/numeric/ublas/tensor/einstein.hpp>
#include <boost/numeric/ublas/tensor.hpp>

int main () {
using namespace boost::numeric::ublas;
shape s{4,3,2};
for (auto i = 0u; i < s.size(); ++i) {
std::cout << s.at(i) << std::endl;
}
using namespace boost::numeric::ublas::index;
tensor<double> A = tensor<double>{4, 3, 2};
tensor<double> B = A(_i, _j, _) * A(_, _j, _k);
std::cout << B << '\n';
}
....

==== Definition

Defined in the header tensor/tensor_einstein.hpp.
Defined in the header tensor/index.hpp.

==== Public base classes

Expand All @@ -38,10 +38,7 @@ None.
[cols=",,",]
|===
|Parameter |Description |
|`value_t` |The type of object stored in the tensor. |
|`format_t` |Storage organization of the tensor. |
|`storage_t` |The type of the storage array of the tensor. |
|`N` |Number of indices provided. |
|`I` |Integer for einstein summation notation. |
|===

'''''
Expand Down
2 changes: 1 addition & 1 deletion include/boost/numeric/ublas/tensor/index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace boost::numeric::ublas::index {

/** @brief Proxy template class for the einstein summation notation
*
* @note index::index_type<K> for 0<=K<=16 is used in tensor::operator()
* @note index::index_type<K> for 0<=K<=26 is used in tensor::operator()
*
* @tparam I wrapped integer
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ template<class V, class L>
/** @brief Generates a tensor_core index for tensor_core contraction
*
*
* @code auto Ai = A(_i,_j,k); @endcode
* @code auto Ai = A(_i,_j,_k); @endcode
*
* @param i placeholder
* @param is zero-based indices where 0 <= is[r] < this->size(r) where 0 < r < this->rank()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class tensor_core<detail::engine_tensor_static<V,L,ns...>>
/** @brief Generates a tensor_core index for tensor_core contraction
*
*
* @code auto Ai = A(_i,_j,k); @endcode
* @code auto Ai = A(_i,_j,_k); @endcode
*
* @param i placeholder
* @param is zero-based indices where 0 <= is[r] < this->size(r) where 0 < r < this->rank()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ template<class V, class L, std::size_t N>
/** @brief Generates a tensor_core index for tensor_core contraction
*
*
* @code auto Ai = A(_i,_j,k); @endcode
* @code auto Ai = A(_i,_j,_k); @endcode
*
* @param i placeholder
* @param is zero-based indices where 0 <= is[r] < this->size(r) where 0 < r < this->rank()
Expand Down