-
Notifications
You must be signed in to change notification settings - Fork 5
Function Reference
njpipeorgan edited this page Aug 10, 2018
·
9 revisions
tensor<T,R>
constructorstensor<T,R>
assignment operatorstensor<T,R>::clone
tensor<T,R>::size
tensor<T,R>::dimensions
tensor<T,R>::dimension
tensor<T,R>::data
tensor<T,R>::operator==
tensor<T,R>::at
tensor<T,R>::operator()
tensor<T,R>::operator[]
tensor<T,R>
iteratorstensor<T,R>::copy_data_from
tensor<T,R>::copy_data_to
sparse_array<T,R>
constructorssparse_array<T,R>
assignment operatorssparse_array<T,R>::rank
sparse_array<T,R>::size
sparse_array<T,R>::dimensions
sparse_array<T,R>::dimension
sparse_array<T,R>::columns_pointer
sparse_array<T,R>::values_pointer
sparse_array<T,R>::row_indices_pointer
sparse_array<T,R>::operator==
sparse_array<T,R>::at
sparse_array<T,R>::operator()
sparse_array<T,R>
iteratorssparse_array<T,R>::refresh_implicit
sparse_array<T,R>::transform
sparse_array<T,R>
conversion operator
- Checks whether
Abort[]
is called from the Wolfram Kernel.
- Outputs
any
towll::global_log
, a log string stream. - For example,
wll::global_log << "some message";
.
- This is a LibraryLink function, which is loaded by the Wolfram Kernel.
- When it is called, it will return the recent exception message as a string.
- This is a LibraryLink function, which is loaded by the Wolfram Kernel.
- When it is called, it will return the log content as a string.
- This is a LibraryLink function, which is loaded by the Wolfram Kernel.
- When it is called, it will clear all log content.
- Constructs the tensor with an
std::array
as the dimensions, and an optionalmemory_type
. - The size of the dimensions array should be equal to the rank of the tensor, and second argument should be
memory_type::owned
(default) ormemory_type::manual
.
- Constructs the tensor with an initializer list of
size_t
as the dimensions, and an optionalmemory_type
. - The size of the dimensions initializer list should be equal to the rank of the tensor, and the second argument should be
memory_type::owned
(default) ormemory_type::manual
.
- Constructs the tensor with an
std::array
as the dimensions, an initializer list as initial data, and an optionalmemory_type
. - The size of the dimensions array should be equal to the rank of the tensor, and second argument should be
memory_type::owned
(default) ormemory_type::manual
.
- Constructs the tensor with an initializer list of
size_t
as the dimensions, an initializer list as initial data, and an optionalmemory_type
. - If the first argument is not a zero-length initializer list, the constructed tensor will take it as the dimensions. Otherwise, initial data will determine the dimensions of the tensor.
- The second argument should be
memory_type::owned
(default) ormemory_type::manual
.
- Constructs the tensor to be the same as another tensor of the same type.
- Constructs the tensor to be the same as another rvalue tensor of the same type.
- Constructs the tensor to be the same as another tensor with the same rank but a different value type.
- Constructs the tensor to be the same as another rvalue tensor with the same rank but a different value type.
- Copies the values from another tensor of the same type.
- The dimensions of the tensors should be identical.
- Copies the values from another movable tensor of the same type.
- The dimensions of the tensors should be identical.
- Copies the values from another tensor with the same rank but a different value type.
- The dimensions of the tensors should be identical.
- Copies the values from another movable tensor with the same rank but a different value type.
- The dimensions of the tensors should be identical.
- Gets a copy of the tensor. The copy will have the given
memory_type
, which is optional. Thememory_type
should bememory_type::owned
(default) ormemory_type::manual
.
- Returns the rank of the tensor.
- Returns the total number of elements in the tensor.
- Returns the dimensions of the tensor as an
std::array
.
- Returns the dimension of the tensor at the i-th level. The first and last level corresponds to i being equal to
0
and_rank - 1
.
- Returns a pointer pointing to the first element in the tensor.
- Returns a const pointer pointing to the first element in the tensor.
- Checks whether two tensors are equal in terms of their data.
- Returns the value at a certain position.
- The indices should be of integral types, and the number of them should be equal to the rank of the tensor.
- Returns a reference to the value at a certain position.
- The indices should be of integral types, and the number of them should be equal to the rank of the tensor.
- Is equivalent to
at(...) const
, but has undefined behavior when "out of range" happens.
- Is equivalent to
at(...)
, but has undefined behavior when "out of range" happens.
- Returns the i-th value of the tensor, as if it is a 1-dimensional array.
- Returns a reference to the i-th value of the tensor, as if it is a 1-dimensional array.
- Returns the begin and end const pointer of the tensor, as if it is a 1-dimensional array.
- Returns the begin and end pointer of the tensor, as if it is a 1-dimensional array.
- Copies the data from the input iterator, with an optional size. If the size is specified, it should be equal to the flattened size of the tensor.
- Copies the data to the output iterator, with an optional size. If the size is specified, it should be equal to the flattened size of the tensor.
- Constructs the sparse array with an
std::array
as the dimensions. The optional value will be the implicit value of the sparse array, which will be zero if not explicitly given.
- Constructs the sparse array with an initializer list of
size_t
as the dimensions. The optional value will be the implicit value of the sparse array, which will be zero if not explicitly given.
- Constructs the sparse array to be equivalent to the given tensor, and takes the optional second argument as the implicit value. The optional third argument is the explicit value density hint.
- The explicit value density hint is a real number that ranges from 0 to 1. The constructor will reserved that much space for explicit values, and expand it if not enough. If the density hint is not given, a default scheme will be applied.
- Constructs the sparse array with an
std::array
as the dimensions. The explicit values in the sparse array is given by initial data, and the optional value will be the implicit value. - The initial data is a list of rules of form
wll::pos(i0, i1, ...) = value
.
- Constructs the sparse array with an initializer list of
size_t
as the dimensions if it is not left blank. Otherwise the minimal size that can hold all explicit values will be taken. The explicit values in the sparse array is given by initial data, and the optional third argument will be the implicit value. - The initial data is a list of rules of form
wll::pos(i0, i1, ...) = value
.
- Constructs the sparse array to be the same as another sparse array of the same type.
- Constructs the tensor to be the same as another rvalue sparse array of the same type.
- Constructs the sparse array to be the same as another sparse array with the same rank but a different value type.
- Constructs the tensor to be the same as another rvalue sparse array with the same rank but a different value type.
- Copies the values from another sparse array of the same type.
- The dimensions of the sparse arrays should be identical.
- Copies the values from another movable sparse array of the same type.
- The dimensions of the tensors should be identical.
- Copies the values from another sparse array with the same rank but a different value type.
- The dimensions of the sparse arrays should be identical.
- Copies the values from another movable sparse array with the same rank but a different value type.
- The dimensions of the sparse arrays should be identical.
- Returns the rank of the sparse array.
- Returns the total number of (explicit and implicit) elements in the sparse array.
- Returns the dimensions of the sparse array as an
std::array
.
- Returns the dimension of the sparse array at the i-th level. The first and last level corresponds to i being equal to
0
and_rank - 1
.
- Returns the implicit value of the sparse array.
- Returns the pointer pointing to the first column element.
- A column element is an
std::array
with size equal to_rank - 1
when_rank > 1
or1
when_rank == 1
.
- Returns the pointer pointing to the first element in the explicit value array.
- Returns the pointer pointing to the first element in the row indices array.
- Checks whether two sparse arrays compare to equal, i.e. has the same values on the same positions.
- Returns the value at a certain position.
- The indices should be of integral types, and the number of them should be equal to the rank of the sparse array.
- Returns a reference to the value at a certain position.
- The indices should be of integral types, and the number of them should be equal to the rank of the sparse array.
- Is equivalent to
at(...) const
, but has undefined behavior when "out of range" happens.
- Is equivalent to
at(...)
, but has undefined behavior when "out of range" happens.
- Returns the begin and end const iterator of the sparse array, as if it is a 1-dimensional array.
- Returns the begin and end iterator of the sparse array, as if it is a 1-dimensional array.
- Removes any explicit value entry that has the same value as the implicit value.
- It may need to be called when one or more explicit values are set to be the implicit value.
- Transforms all elements in the sparse array by the function.
transform
accepts an optional template parameter, indicating whether the "refresh implicit" operation needs to be done (false
by default). - The transforming function are typically required to be stateless.
- Converts the sparse array to a tensor with the same value type and rank.
- Defines a LibraryLink function
wll_fn
, which handles argument passing and returning the result to the Wolfram Kernel.
- Expands to
-1
.
- If
NDEBUG
is not defined, expands to(expr)
, otherwise, does nothing.
- If
NDEBUG
is not defined, expands toassert((expr))
, otherwise, does nothing.