template<typename T_mat, typename T_row_index, typename T_col_index>
class stan::math::indexing_< T_mat, T_row_index, T_col_index >
Represents indexing of a matrix with two matrices of indices.
indexing(mat,
col_index, row_index)[i,j] = mat[col_index[i,j], row_index[i,j]]
- Template Parameters
-
T_mat | expression type of the matrix to index |
T_row_index | expression type of the row index |
T_col_index | expression type of the column index |
Definition at line 29 of file indexing.hpp.
|
| indexing_ (T_mat &&mat, T_row_index &&row_index, T_col_index &&col_index) |
| Constructor.
|
|
auto | deep_copy () const |
| Creates a deep copy of this expression.
|
|
kernel_parts | get_kernel_parts (std::unordered_map< const void *, const char * > &generated, std::unordered_map< const void *, const char * > &generated_all, name_generator &name_gen, const std::string &row_index_name, const std::string &col_index_name, bool view_handled) const |
| Generates kernel code for this and nested expressions.
|
|
kernel_parts | get_kernel_parts_lhs (std::unordered_map< const void *, const char * > &generated, std::unordered_map< const void *, const char * > &generated_all, name_generator &name_gen, const std::string &row_index_name, const std::string &col_index_name) const |
| Generates kernel code for this expression if it appears on the left hand side of an assignment.
|
|
void | set_args (std::unordered_map< const void *, const char * > &generated, std::unordered_map< const void *, const char * > &generated_all, cl::Kernel &kernel, int &arg_num) const |
| Sets kernel arguments for this expression.
|
|
int | rows () const |
| Number of rows of a matrix that would be the result of evaluating this expression.
|
|
int | cols () const |
| Number of columns of a matrix that would be the result of evaluating this expression.
|
|
void | set_view (int bottom_diagonal, int top_diagonal, int bottom_zero_diagonal, int top_zero_diagonal) const |
| Sets the view of the underlying matrix depending on which of its parts are written to.
|
|
std::pair< int, int > | extreme_diagonals () const |
| Determine indices of extreme sub- and superdiagonals written.
|
|
void | check_assign_dimensions (int rows, int cols) const |
| Checks if desired dimensions match dimensions of the indexing.
|
|
void | add_write_event (cl::Event &e) const |
| Adds write event to indexed matrix and read event to indices.
|
|
void | get_clear_read_write_events (std::vector< cl::Event > &events) const |
| Adds all read and write events on any matrices used by nested expressions to a list and clears them from those matrices.
|
|
template<typename T_expression , typename = require_all_kernel_expressions_and_none_scalar_t<T_expression>> |
Derived & | operator= (T_expression &&rhs) |
| Evaluates an expression and assigns it to this.
|
|
const operation_cl_lhs< Derived, Scalar, Args... > & | operator= (const operation_cl_lhs< Derived, Scalar, Args... > &rhs) const |
|
kernel_parts | generate_lhs (const std::string &row_index_name, const std::string &col_index_name, const std::string &var_name_arg) const |
| Generates kernel code for this and nested expressions if this expression appears on the left hand side of an assignment.
|
|
Derived & | derived () |
| Casts the instance into its derived type.
|
|
const Derived & | derived () const |
| Casts the instance into its derived type.
|
|
template<size_t N> |
const auto & | get_arg () const |
| Returns an argument to this operation.
|
|
matrix_cl< Scalar > | eval () const |
| Evaluates the expression.
|
|
template<typename T_lhs > |
void | evaluate_into (T_lhs &lhs) const |
| Evaluates this expression into given left-hand-side expression.
|
|
template<typename T_lhs > |
std::string | get_kernel_source_for_evaluating_into (const T_lhs &lhs) const |
| Generates kernel source for evaluating this expression into given left-hand-side expression.
|
|
template<typename T_result > |
kernel_parts | get_whole_kernel_parts (std::unordered_map< const void *, const char * > &generated, std::unordered_map< const void *, const char * > &generated_all, name_generator &ng, const std::string &row_index_name, const std::string &col_index_name, const T_result &result) const |
| Generates kernel code for assigning this expression into result expression.
|
|
kernel_parts | generate (const std::string &row_index_name, const std::string &col_index_name, const bool view_handled, const std::string &var_name_arg) const |
| Generates kernel code for this expression.
|
|
void | modify_argument_indices (std::string &row_index_name, std::string &col_index_name) const |
| Does nothing.
|
|
void | add_read_event (cl::Event &e) const |
| Adds read event to any matrices used by nested expressions.
|
|
void | get_write_events (std::vector< cl::Event > &events) const |
| Adds all write events on any matrices used by nested expressions to a list.
|
|
int | size () const |
| Size of a matrix that would be the result of evaluating this expression.
|
|
int | thread_rows () const |
| Number of rows threads need to be launched for.
|
|
int | thread_cols () const |
| Number of columns threads need to be launched for.
|
|
matrix_cl_view | view () const |
| View of a matrix that would be the result of evaluating this expression.
|
|
void | get_unique_matrix_accesses (std::vector< int > &uids, std::unordered_map< const void *, int > &id_map, int &next_id) const |
| Collects data that is needed beside types to uniqly identify a kernel generator expression.
|
|