Value-filled owning container creation.
More...
Go to the source code of this file.
Value-filled owning container creation.
Definition in file Creation.hpp.
◆ full() [1/3]
Creates a tensor filled with a specified value.
- Template Parameters
-
| T | Supported element dtype, including bool. |
- Parameters
-
| shape | Shape of the resulting tensor. |
| value | Value copied into every element. |
- Returns
- Owning tensor with
shape filled with value.
- Exceptions
-
- Complexity
- O(shape.elements() + shape.rank()).
Definition at line 124 of file Creation.hpp.
◆ full() [2/3]
Creates a matrix filled with a specified value.
- Template Parameters
-
| T | Supported element dtype, including bool. |
- Parameters
-
| rows | Number of result rows. |
| cols | Number of result columns. |
| value | Value copied into every element. |
- Returns
- Owning matrix of shape
{rows, cols} filled with value.
- Exceptions
-
- Complexity
- O(rows * cols).
Definition at line 158 of file Creation.hpp.
◆ full() [3/3]
Creates a vector filled with a specified value.
- Template Parameters
-
| T | Supported element dtype, including bool. |
- Parameters
-
| size | Number of elements in the resulting vector. |
| value | Value copied into every element. |
- Returns
- Owning rank-one vector containing
size copies of value.
- Exceptions
-
| std::bad_alloc | If result allocation fails. |
- Complexity
- O(size).
Definition at line 140 of file Creation.hpp.
◆ identity()
Creates a square identity matrix.
Off-diagonal elements are initialized to T{} and each diagonal element is assigned T{1}.
- Template Parameters
-
| T | Supported element dtype, including bool. |
- Parameters
-
| size | Number of rows and columns. |
- Returns
- Owning matrix of shape
{size, size} containing the identity.
- Exceptions
-
- Complexity
- O(size * size).
Definition at line 178 of file Creation.hpp.
◆ ones() [1/3]
Creates a tensor filled with multiplicative identity values.
- Template Parameters
-
| T | Supported element dtype, including bool. |
- Parameters
-
| shape | Shape of the resulting tensor. |
- Returns
- Owning tensor with
shape whose elements equal T{1}.
- Exceptions
-
- Complexity
- O(shape.elements() + shape.rank()).
Definition at line 75 of file Creation.hpp.
◆ ones() [2/3]
Creates a matrix filled with multiplicative identity values.
- Template Parameters
-
| T | Supported element dtype, including bool. |
- Parameters
-
| rows | Number of result rows. |
| cols | Number of result columns. |
- Returns
- Owning matrix of shape
{rows, cols} filled with T{1}.
- Exceptions
-
- Complexity
- O(rows * cols).
Definition at line 107 of file Creation.hpp.
◆ ones() [3/3]
Creates a vector filled with multiplicative identity values.
- Template Parameters
-
| T | Supported element dtype, including bool. |
- Parameters
-
| size | Number of elements in the resulting vector. |
- Returns
- Owning rank-one vector containing
size copies of T{1}.
- Exceptions
-
| std::bad_alloc | If result allocation fails. |
- Complexity
- O(size).
Definition at line 90 of file Creation.hpp.
◆ zeros() [1/3]
Creates a tensor filled with additive identity values.
- Template Parameters
-
| T | Supported element dtype, including bool. |
- Parameters
-
| shape | Shape of the resulting tensor. |
- Returns
- Owning tensor with
shape whose elements equal T{}.
- Exceptions
-
- Complexity
- O(shape.elements() + shape.rank()).
Definition at line 27 of file Creation.hpp.
◆ zeros() [2/3]
Creates a matrix filled with additive identity values.
- Template Parameters
-
| T | Supported element dtype, including bool. |
- Parameters
-
| rows | Number of result rows. |
| cols | Number of result columns. |
- Returns
- Owning matrix of shape
{rows, cols} filled with T{}.
- Exceptions
-
- Complexity
- O(rows * cols).
Definition at line 59 of file Creation.hpp.
◆ zeros() [3/3]
Creates a vector filled with additive identity values.
- Template Parameters
-
| T | Supported element dtype, including bool. |
- Parameters
-
| size | Number of elements in the resulting vector. |
- Returns
- Owning rank-one vector containing
size copies of T{}.
- Exceptions
-
| std::bad_alloc | If result allocation fails. |
- Complexity
- O(size).
Definition at line 42 of file Creation.hpp.