Automatic Differentiation
 
Loading...
Searching...
No Matches
stan::math Namespace Reference

Detailed Description

Matrices and templated mathematical functions.

Templated probability distributions. All paramaterizations are based on Bayesian Data Analysis. Function gradients via reverse-mode automatic differentiation.

Namespaces

namespace  internal
 A comparator that works for any container type that has the brackets operator.
 
namespace  opencl
 
namespace  opencl_kernels
 

Classes

struct  abs_fun
 Return elementwise absolute value of the specified real-valued container. More...
 
class  accumulator
 Class to accumulate values and eventually return their sum. More...
 
class  accumulator< T, require_var_t< T > >
 Class to accumulate values and eventually return their sum. More...
 
class  acos_
 
struct  acos_fun
 Structure to wrap acos() so it can be vectorized. More...
 
class  acosh_
 
struct  acosh_fun
 Structure to wrap acosh() so it can be vectorized. More...
 
struct  ad_promotable
 If the type From can be converted to To using implicit conversions, or both From and To are possibly cv-qualified void), provides the member constant value equal to true. More...
 
class  ad_tape_observer
 TBB observer object which is a callback hook called whenever the TBB scheduler adds a new thread to the TBB managed threadpool. More...
 
class  addition_
 
class  addition_operator_
 
class  adjoint_results_cl
 Represents results that are adjoints of vars in kernel generrator expressions. More...
 
class  append_col_
 Represents appending of cols in kernel generator expressions. More...
 
struct  append_return_type
 This template metaprogram is used to compute the return type for append_array. More...
 
struct  append_return_type< Eigen::Matrix< T1, R, C >, Eigen::Matrix< T2, R, C > >
 This template metaprogram is used to compute the return type for append_array. More...
 
struct  append_return_type< int, int >
 This template metaprogram is used to compute the return type for append_array. More...
 
struct  append_return_type< std::vector< T1 >, std::vector< T2 > >
 This template metaprogram is used to compute the return type for append_array. More...
 
class  append_row_
 Represents appending of rows in kernel generator expressions. More...
 
struct  apply_scalar_unary
 Base template class for vectorization of unary scalar functions defined by a template class F to a scalar, standard library vector, or Eigen dense matrix expression template. More...
 
struct  apply_scalar_unary< F, fvar< T > >
 Template specialization to fvar for vectorizing a unary scalar function. More...
 
struct  apply_scalar_unary< F, std::vector< T > >
 Template specialization for vectorized functions applying to standard vector containers. More...
 
struct  apply_scalar_unary< F, T, require_complex_t< T > >
 Template specialization for vectorized functions applying to complex arguments. More...
 
struct  apply_scalar_unary< F, T, require_eigen_t< T > >
 Template specialization for vectorized functions applying to Eigen matrix arguments. More...
 
struct  apply_scalar_unary< F, T, require_floating_point_t< T > >
 Template specialization for vectorized functions applying to double arguments. More...
 
struct  apply_scalar_unary< F, T, require_integral_t< T > >
 Template specialization for vectorized functions applying to integer arguments. More...
 
struct  apply_scalar_unary< F, T, require_var_matrix_t< T > >
 
struct  apply_scalar_unary< F, var >
 Template specialization to var for vectorizing a unary scalar function. More...
 
struct  apply_vector_unary
 
struct  apply_vector_unary< T, require_eigen_t< T > >
 Base template class for vectorization of unary vector functions defined by applying a functor to a standard library vector, Eigen dense matrix expression template, or container of these. More...
 
struct  apply_vector_unary< T, require_std_vector_vt< is_container_or_var_matrix, T > >
 Specialization for use with nested containers (std::vectors). More...
 
struct  apply_vector_unary< T, require_std_vector_vt< is_stan_scalar, T > >
 Specialization for use with (non-nested) std::vectors. More...
 
struct  apply_vector_unary< T, require_var_matrix_t< T > >
 Specialization for use with var_value<T> types where T inherits from EigenBase. More...
 
struct  arena_allocator
 std library compatible allocator that uses AD stack. More...
 
class  arena_matrix
 Equivalent to Eigen::Matrix, except that the data is stored on AD stack. More...
 
class  arena_matrix< MatrixType, require_eigen_dense_base_t< MatrixType > >
 
class  arena_matrix< MatrixType, require_eigen_sparse_base_t< MatrixType > >
 
class  arena_matrix_cl
 A variant of matrix_cl that schedules its destructor to be called, so it can be used on the AD stack. More...
 
class  array_builder
 Structure for building up arrays in an expression (rather than in statements) using an argument-chaining add() method and a getter method array() to return the result. More...
 
class  as_column_vector_or_scalar_
 Represents as_column_vector_or_scalar of a row or column vector in kernel generator expressions. More...
 
class  asin_
 
struct  asin_fun
 Structure to wrap asin() so it can be vectorized. More...
 
class  asinh_
 
struct  asinh_fun
 Structure to wrap asinh() so it can be vectorized. More...
 
class  atan_
 
struct  atan_fun
 Structure to wrap atan() so it can be vectorized. More...
 
class  atanh_
 
struct  atanh_fun
 Structure to wrap atanh() so it can be vectorized. More...
 
struct  AutodiffStackSingleton
 This struct always provides access to the autodiff stack using the singleton pattern. More...
 
class  beta_
 
class  binary_operation
 Represents a binary operation in kernel generator expressions. More...
 
class  binomial_coefficient_log_
 
class  block_
 Represents submatrix block in kernel generator expressions. More...
 
class  broadcast_
 Represents a broadcasting operation in kernel generator expressions. More...
 
class  calc_if_
 Represents a calc_if in kernel generator expressions. More...
 
class  cast_
 Represents a typecast os scalar in kernel generator expressions. More...
 
class  cbrt_
 
struct  cbrt_fun
 Structure to wrap cbrt() so it can be vectorized. More...
 
class  ceil_
 
struct  ceil_fun
 Structure to wrap ceil() so it can be vectorized. More...
 
class  chainable_alloc
 A chainable_alloc is an object which is constructed and destructed normally but the memory lifespan is managed along with the arena allocator for the gradient calculation. More...
 
class  chainable_object
 chainable_object hold another object is useful for connecting the lifetime of a specific object to the chainable stack More...
 
class  check_cl_
 Represents a check in kernel generator expressions. More...
 
class  col_index
 Represents operation that determines column index. More...
 
class  colwise_max_
 Represents column wise max - reduction in kernel generator expressions. More...
 
class  colwise_min_
 Represents column wise min - reduction in kernel generator expressions. More...
 
class  colwise_prod_
 Represents column wise product - reduction in kernel generator expressions. More...
 
class  colwise_reduction
 Represents a column wise reduction in kernel generator expressions. More...
 
class  colwise_sum_
 Represents column wise sum - reduction in kernel generator expressions. More...
 
class  complex_base
 Base class for complex numbers. More...
 
struct  conjunction
 Extends std::true_type when instantiated with zero or more template parameters, all of which extend the std::true_type. More...
 
struct  conjunction< T, Ts... >
 
class  constant_
 Represents a matrix of single repeated value in kernel generator expressions. More...
 
class  copysign_
 
class  cos_
 
struct  cos_fun
 Structure to wrap cos() so it can be vectorized. More...
 
class  cosh_
 
struct  cosh_fun
 Structure to wrap cosh() so it can be vectorized. More...
 
struct  coupled_ode_system
 
struct  coupled_ode_system_impl
 
struct  coupled_ode_system_impl< false, F, T_y0, Args... >
 The coupled_ode_system_impl template specialization when the state or parameters are autodiff types. More...
 
struct  coupled_ode_system_impl< true, F, T_y0, Args... >
 The coupled_ode_system_impl for arithmetic arguments reduces to the regular ode system (there are no sensitivities) More...
 
class  cov_exp_quad_vari
 
class  cov_exp_quad_vari< T_x, double, T_l >
 
class  cvodes_integrator
 Integrator interface for CVODES' ODE solvers (Adams & BDF methods). More...
 
class  cvodes_integrator_adjoint_vari
 Integrator interface for CVODES' adjoint ODE solvers (Adams & BDF methods). More...
 
class  dae_system
 IDAS DAE system that contains information on residual equation functor, sensitivity residual equation functor, as well as initial conditions. More...
 
struct  deserializer
 A class to store a sequence of values which can be deserialized back into structured objects such as scalars, vectors, and matrices. More...
 
class  diagonal_
 Represents diagonal of a matrix (as column vector) in kernel generator expressions. More...
 
class  digamma_
 
struct  digamma_fun
 Structure to wrap digamma() so it can be vectorized. More...
 
struct  disjunction
 Extends std::false_type when instantiated with zero or more template parameters, all of which extend the std::false_type. More...
 
struct  disjunction< Cond, Conds... >
 
class  elt_divide_
 
class  elt_function_cl
 Represents an element-wise function in kernel generator expressions. More...
 
class  elt_modulo_
 
class  elt_multiply_
 
class  equals_
 
class  erf_
 
struct  erf_fun
 Structure to wrap erf() so it can be vectorized. More...
 
class  erfc_
 
struct  erfc_fun
 Structure to wrap the erfc() so that it can be vectorized. More...
 
class  exp2_
 
struct  exp2_fun
 Structure to wrap exp2() so it can be vectorized. More...
 
class  exp_
 
struct  exp_fun
 Structure to wrap exp() so that it can be vectorized. More...
 
class  expm1_
 
struct  expm1_fun
 Structure to wrap expm1() so that it can be vectorized. More...
 
class  expressions_cl
 Represents multiple expressions that will be calculated in same kernel. More...
 
class  fabs_
 
struct  fabs_fun
 Structure to wrap fabs() so that it can be vectorized. More...
 
class  fdim_
 
struct  FixedPointADJac
 Calculate Jacobian Jxy(Jacobian of unknown x w.r.t. More...
 
struct  FixedPointSolver
 Fixed point solver for problem of form. More...
 
struct  FixedPointSolver< KinsolFixedPointEnv< F >, fp_jac_type >
 Specialization for fixed point solver when using KINSOL. More...
 
class  floor_
 
struct  floor_fun
 Structure to wrap floor() so that it can be vectorized. More...
 
class  fmax_
 
class  fmin_
 
class  fmod_
 
struct  fvar
 This template class represents scalars used in forward-mode automatic differentiation, which consist of values and directional derivatives of the specified template type. More...
 
class  gevv_vvv_vari
 
class  greater_than_
 
class  greater_than_or_equal_
 
class  Holder
 A no-op Eigen operation. More...
 
class  holder_cl_
 Represents a no-op in kernel generator expressions. More...
 
struct  hybrj_functor_solver
 A functor with the required operators to call Eigen's algebraic solver. More...
 
class  hypot_
 
class  idas_integrator
 IDAS DAE integrator. More...
 
struct  idas_service
 For each type of Ode(with different rhs functor F and senstivity parameters), we allocate mem and workspace for idas. More...
 
struct  include_summand
 Template metaprogram to calculate whether a summand needs to be included in a proportional (log) probability calculation. More...
 
struct  include_summand< propto, T >
 true if a term with the specified propto value and subterm types should be included in a proportionality calculation. More...
 
struct  index_type
 Primary template class for the metaprogram to compute the index type of a container. More...
 
struct  index_type< T, require_eigen_t< T > >
 Template metaprogram defining typedef for the type of index for an Eigen matrix, vector, or row vector. More...
 
struct  index_type< T, require_std_vector_t< T > >
 Template metaprogram class to compute the type of index for a standard vector. More...
 
struct  index_type< T, std::enable_if_t< std::is_pointer< T >::value > >
 Specialization of index_type for pointers. More...
 
class  indexing_
 Represents indexing of a matrix with two matrices of indices. More...
 
struct  inv_cloglog_fun
 Structure to wrap inv_cloglog() so that it can be vectorized. More...
 
struct  inv_erfc_fun
 Structure to wrap the inv_erfc() function so that it can be vectorized. More...
 
struct  inv_fun
 Structure to wrap 1.0 / x so that it can be vectorized. More...
 
class  inv_logit_
 
struct  inv_logit_fun
 Structure to wrap inv_logit() so that it can be vectorized. More...
 
class  inv_Phi_
 
struct  inv_Phi_fun
 Structure to wrap inv_Phi() so it can be vectorized. More...
 
struct  inv_sqrt_fun
 Structure to wrap 1 / sqrt(x) so that it can be vectorized. More...
 
class  inv_square_
 
struct  is_tuple
 
class  isfinite_
 
class  isinf_
 
class  isnan_
 
struct  kernel_parts
 Parts of an OpenCL kernel, generated by an expression. More...
 
class  kinsol_system_data
 KINSOL algebraic system data holder. More...
 
struct  KinsolFixedPointEnv
 KINSOL algebraic system data holder that handles construction & destruction of SUNDIALS data, as well as auxiliary data that will be used for functor evaluation. More...
 
class  lbeta_
 
class  ldexp_
 
class  LDLT_factor
 LDLT_factor is a structure that holds a matrix of type T and the LDLT of its values. More...
 
class  LDLT_factor< T, require_eigen_matrix_dynamic_vt< is_var, T > >
 An LDLT_factor of an Eigen::Matrix<var, Eigen::Dynamic, Eigen::Dynamic> with alloc_in_arena = True holds a copy of the input matrix and the LDLT of its values, with all member variable allocations are done in the arena. More...
 
class  LDLT_factor< T, require_var_matrix_t< T > >
 An LDLT_factor of a var_value<Eigen::MatrixXd> holds a copy of the input var_value and the LDLT of its values. More...
 
class  LDLT_factor< T, std::enable_if_t< bool_constant< is_eigen_matrix_dynamic< T >::value &&!is_var< scalar_type_t< T > >::value >::value > >
 An LDLT_factor is a structure that holds a matrix of type T and the LDLT of its values. More...
 
class  less_than_
 
class  less_than_or_equal_
 
class  lgamma_
 
struct  lgamma_fun
 Structure to wrap lgamma() so that it can be vectorized. More...
 
class  lmultiply_
 
class  load_
 Represents an access to a matrix_cl in kernel generator expressions. More...
 
class  log10_
 
struct  log10_fun
 Structure to wrap log10() so it can be vectorized. More...
 
class  log1m_
 
class  log1m_exp_
 
struct  log1m_exp_fun
 Structure to wrap log1m_exp() so it can be vectorized. More...
 
struct  log1m_fun
 Structure to wrap log1m() so it can be vectorized. More...
 
class  log1m_inv_logit_
 
struct  log1m_inv_logit_fun
 Structure to wrap log1m_inv_logit() so it can be vectorized. More...
 
class  log1p_
 
class  log1p_exp_
 
struct  log1p_exp_fun
 Structure to wrap log1p_exp() so that it can be vectorized. More...
 
struct  log1p_fun
 Structure to wrap log1p() so it can be vectorized. More...
 
class  log2_
 
struct  log2_fun
 Structure to wrap log2() so it can be vectorized. More...
 
class  log_
 
class  log_diff_exp_
 
struct  log_fun
 Structure to wrap log() so that it can be vectorized. More...
 
class  log_inv_logit_
 
class  log_inv_logit_diff_
 
struct  log_inv_logit_fun
 Structure to wrap log_inv_logit() so it can be vectorized. More...
 
class  logical_and_
 
class  logical_negation_
 Represents a logical negation in kernel generator expressions. More...
 
class  logical_or_
 
class  logit_
 
struct  logit_fun
 Structure to wrap logit() so it can be vectorized. More...
 
class  matrix_cl
 Represents an arithmetic matrix on the OpenCL device. More...
 
class  matrix_cl_base
 Non-templated base class for matrix_cl simplifies checking if something is matrix_cl. More...
 
class  matrix_exp_action_handler
 The implementation of the work by Awad H. More...
 
class  max_2d_
 Represents two dimensional max - reduction in kernel generator expressions. More...
 
struct  max_op
 Operation for max reduction. More...
 
class  min_2d_
 Represents two dimensional min - reduction in kernel generator expressions. More...
 
struct  min_op
 Operation for min reduction. More...
 
struct  mpi_cluster
 MPI cluster holds MPI resources and must be initialized only once in any MPI program. More...
 
struct  mpi_command
 A MPI command object is used to execute code on worker nodes. More...
 
struct  mpi_distributed_apply
 MPI command template which calls the static method distributed_apply of the given class F. More...
 
class  mpi_is_in_use
 Exception thrown whenever the MPI resource is busy. More...
 
class  mpi_parallel_call
 The MPI parallel call class manages the distributed evaluation of a collection of tasks following the map - reduce - combine pattern. More...
 
class  mpi_stop_listen
 Exception used to stop workers nodes from further listening to commands send from the root. More...
 
struct  mpi_stop_worker
 MPI command used to stop childs nodes from listening for further commands. More...
 
class  multiply_log_
 
class  name_generator
 Unique name generator for variables used in generated kernels. More...
 
class  nested_rev_autodiff
 A class following the RAII idiom to start and recover nested autodiff scopes. More...
 
struct  nlo_functor
 A structure which gets passed to Eigen's dogleg algebraic solver. More...
 
class  not_equals_
 
class  op_ddv_vari
 
class  op_dv_vari
 
class  op_dvd_vari
 
class  op_dvv_vari
 
class  op_matrix_vari
 
class  op_v_vari
 
class  op_vd_vari
 
class  op_vdd_vari
 
class  op_vdv_vari
 
class  op_vector_vari
 
class  op_vv_vari
 
class  op_vvd_vari
 
class  op_vvv_vari
 
class  opencl_code_
 Represents custom code in kernel generator expressions. More...
 
class  opencl_code_output
 Represents output variable of custom code in kernel generator expressions. More...
 
class  opencl_context
 The API to access the methods and values in opencl_context_base. More...
 
class  opencl_context_base
 The opencl_context_base class represents an OpenCL context in the standard Meyers singleton design pattern. More...
 
class  operands_and_partials
 This template builds partial derivatives with respect to a set of operands. More...
 
class  operands_and_partials< Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8, fvar< Dx > >
 This class builds partial derivatives with respect to a set of operands. More...
 
class  operands_and_partials< Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8, var >
 This class builds partial derivatives with respect to a set of operands. More...
 
class  operation_cl
 Base for all kernel generator operations. More...
 
class  operation_cl_lhs
 Base for all kernel generator operations that can be used on left hand side of an expression. More...
 
class  optional_broadcast_
 Represents an optional broadcasting operation in kernel generator expressions. More...
 
struct  pass_type
 
struct  pass_type< double >
 
struct  pass_type< int >
 
class  Phi_
 
class  Phi_approx_
 
struct  Phi_approx_fun
 Structure to wrap Phi_approx() so it can be vectorized. More...
 
struct  Phi_fun
 Structure to wrap Phi() so it can be vectorized. More...
 
class  pinned_matrix
 Equivalent to Eigen::Matrix, except that the data is stored in (hopefully pinned) memory, allocated by OpenCL driver. More...
 
class  pow_
 
class  precomp_vv_vari
 
class  precomp_vvv_vari
 
class  precomputed_gradients_vari_template
 A variable implementation taking a sequence of operands and partial derivatives with respect to the operands. More...
 
class  prod_2d_
 Represents two dimensional product - reduction in kernel generator expressions. More...
 
struct  prod_op
 Operation for product reduction. More...
 
class  profile
 Profiles C++ lines where the object is in scope. More...
 
class  profile_info
 Class used for storing profiling information. More...
 
struct  promote_elements
 Struct with static function for elementwise type promotion. More...
 
struct  promote_elements< Eigen::Matrix< T, R, C >, Eigen::Matrix< S, R, C > >
 Struct with static function for elementwise type promotion. More...
 
struct  promote_elements< Eigen::Matrix< T, R, C >, Eigen::Matrix< T, R, C > >
 Struct with static function for elementwise type promotion. More...
 
struct  promote_elements< std::vector< T >, std::vector< S > >
 Struct with static function for elementwise type promotion. More...
 
struct  promote_elements< std::vector< T >, std::vector< T > >
 Struct with static function for elementwise type promotion. More...
 
struct  promote_elements< T, T >
 Struct with static function for elementwise type promotion. More...
 
struct  promote_scalar_type
 Template metaprogram to calculate a type for converting a convertible type. More...
 
struct  promote_scalar_type< std::tuple< PromotionScalars... >, std::tuple< UnPromotedTypes... > >
 
struct  promote_scalar_type< T, S, require_all_t< is_var< T >, is_var< S >, is_eigen< value_type_t< S > > > >
 Specialization for var_value when the type to convert to is a var_value. More...
 
struct  promote_scalar_type< T, S, require_all_t< std::is_arithmetic< T >, is_var< S >, is_eigen< value_type_t< S > > > >
 Specialization for var_value when the type to convert to is arithmetic. More...
 
struct  promote_scalar_type< T, S, require_eigen_dense_base_t< S > >
 Template metaprogram to calculate a type for a matrix, vector, row vector or Eigen::Array whose underlying scalar is converted from the second template parameter type to the first. More...
 
struct  promote_scalar_type< T, S, require_eigen_sparse_base_t< S > >
 
struct  promote_scalar_type< T, std::vector< S > >
 Template metaprogram to calculate a type for a container whose underlying scalar is converted from the second template parameter type to the first. More...
 
class  read_fvar_functor
 Functor for extracting the values and tangents from a matrix of fvar. More...
 
class  reduction_2d
 Represents a two dimensional reduction in kernel generator expressions. More...
 
struct  ref_type_for_opencl
 Determines appropriate type for assigning expression of given type to, so that the resulting type has directly accessible contiguous colum-major data, which is needed to copy to OpenCL device for construction of matrix_cl. More...
 
struct  ref_type_for_opencl< T, require_arena_matrix_t< T > >
 
struct  ref_type_for_opencl< T, require_not_eigen_t< T > >
 
class  results_cl
 Represents results that will be calculated in same kernel. More...
 
class  round_
 
struct  round_fun
 Structure to wrap round() so it can be vectorized. More...
 
class  row_index
 Represents operation that determines row index. More...
 
class  rowwise_max_
 Represents rowwise max reduction in kernel generator expressions. More...
 
class  rowwise_min_
 Represents rowwise min reduction in kernel generator expressions. More...
 
class  rowwise_prod_
 Represents rowwise product reduction in kernel generator expressions. More...
 
class  rowwise_reduction
 Represents a rowwise reduction in kernel generator expressions. More...
 
class  rowwise_sum_
 Represents rowwise sum reduction in kernel generator expressions. More...
 
class  rsqrt_
 
class  scalar_
 Represents a scalar in kernel generator expressions. More...
 
class  ScopedChainableStack
 The AD tape of reverse mode AD is by default stored globally within the process (or thread). More...
 
class  select_
 Represents a selection operation in kernel generator expressions. More...
 
class  seq_view
 
class  seq_view< double, std::vector< int > >
 
class  seq_view< T, Eigen::Matrix< S, 1, Eigen::Dynamic > >
 
class  seq_view< T, Eigen::Matrix< S, Eigen::Dynamic, 1 > >
 
class  seq_view< T, Eigen::Matrix< S, Eigen::Dynamic, Eigen::Dynamic > >
 
class  seq_view< T, std::vector< S > >
 
class  seq_view< T, std::vector< std::vector< T > > >
 
class  seq_view< T, std::vector< T > >
 
struct  serializer
 A structure to serialize structures to an internal stored sequence of scalars. More...
 
struct  sign_fun
 Structure to wrap sign() so it can be vectorized. More...
 
class  sin_
 
struct  sin_fun
 Structure to wrap sin() so it can be vectorized. More...
 
class  sinh_
 
struct  sinh_fun
 Structure to wrap sinh() so that it can be vectorized. More...
 
class  sqrt_
 
struct  sqrt_fun
 Structure to wrap sqrt() so that it can be vectorized. More...
 
class  square_
 
struct  square_fun
 Structure to wrap square() so that it can be vectorized. More...
 
class  stack_alloc
 An instance of this class provides a memory pool through which blocks of raw memory may be allocated and then collected simultaneously. More...
 
struct  std_normal_log_qf_fun
 Structure to wrap std_normal_log_qf() so it can be vectorized. More...
 
struct  step_fun
 Structure to wrap step() so it can be vectorized. More...
 
struct  store_type
 
struct  store_type< double >
 
struct  store_type< int >
 
class  stored_gradient_vari
 A var implementation that stores the daughter variable implementation pointers and the partial derivative with respect to the result explicitly in arrays constructed on the autodiff memory stack. More...
 
class  subtraction_
 
class  subtraction_operator_
 
class  sum_2d_
 Represents two dimensional sum - reduction in kernel generator expressions. More...
 
struct  sum_op
 Operation for sum reduction. More...
 
class  tan_
 
struct  tan_fun
 Structure to wrap tan() so that it can be vectorized. More...
 
class  tanh_
 
struct  tanh_fun
 Structure to wrap tanh() so that it can be vectorized. More...
 
class  tgamma_
 
struct  tgamma_fun
 Structure to wrap tgamma() so that it can be vectorized. More...
 
struct  to_int_fun
 Return elementwise integer value of the specified real-valued container. More...
 
class  transpose_
 Represents a transpose in kernel generator expressions. More...
 
class  trigamma_
 
struct  trigamma_fun
 Structure to wrap trigamma() so it can be vectorized. More...
 
class  trunc_
 
struct  trunc_fun
 Structure to wrap trunc() so it can be vectorized. More...
 
class  unary_minus_
 Represents an unary minus operation in kernel generator expressions. More...
 
class  unary_operation_cl
 Represents a unary operation in kernel generator expressions. More...
 
class  unsafe_chainable_object
 unsafe_chainable_object hold another object and is useful for connecting the lifetime of a specific object to the chainable stack. More...
 
class  val_adj_functor
 Functor for extracting the values and adjoints from a matrix of var or vari. More...
 
class  var_value
 
class  var_value< T, internal::require_matrix_var_value< T > >
 Independent (input) and dependent (output) variables for gradients. More...
 
class  var_value< T, require_floating_point_t< T > >
 Independent (input) and dependent (output) variables for gradients. More...
 
class  vari_base
 Abstract base class that all vari_value and it's derived classes inherit. More...
 
class  vari_cl_base
 
class  vari_value
 
class  vari_value< T, require_all_t< is_plain_type< T >, is_eigen_dense_base< T > > >
 The variable implementation for Eigen dense matrix types. More...
 
class  vari_value< T, require_eigen_sparse_base_t< T > >
 The variable implementation for Eigen sparse matrix types. More...
 
class  vari_value< T, require_matrix_cl_t< T > >
 The variable implementation for matrix_cl. More...
 
class  vari_value< T, require_t< std::is_floating_point< T > > >
 The variable implementation for floating point types. More...
 
class  vari_view
 A vari_view is used to read from a slice of a vari_value with an inner eigen type. More...
 
class  vari_view< T, require_all_t< is_eigen< T >, bool_constant<!is_plain_type< T >::value > > >
 
class  vari_view< T, require_kernel_expression_lhs_t< T > >
 
class  vari_view_eigen
 This struct is follows the CRTP for methods common to vari_view<> and vari_value<Matrix>. More...
 
class  vi_adj_functor
 Functor for extracting the varis and adjoints from a matrix of var. More...
 
class  vi_val_adj_functor
 Functor for extracting the vari*, values, and adjoints from a matrix of var. More...
 
class  vi_val_functor
 Functor for extracting the varis and values from a matrix of var. More...
 
class  welford_covar_estimator
 
class  welford_var_estimator
 

Typedefs

using size_type = Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index
 Type for sizes and indexes in an Eigen matrix with double elements.
 
using matrix_fd = Eigen::Matrix< fvar< double >, Eigen::Dynamic, Eigen::Dynamic >
 
using matrix_ffd = Eigen::Matrix< fvar< fvar< double > >, Eigen::Dynamic, Eigen::Dynamic >
 
using vector_fd = Eigen::Matrix< fvar< double >, Eigen::Dynamic, 1 >
 
using vector_ffd = Eigen::Matrix< fvar< fvar< double > >, Eigen::Dynamic, 1 >
 
using row_vector_fd = Eigen::Matrix< fvar< double >, 1, Eigen::Dynamic >
 
using row_vector_ffd = Eigen::Matrix< fvar< fvar< double > >, 1, Eigen::Dynamic >
 
using matrix_fv = Eigen::Matrix< fvar< var >, Eigen::Dynamic, Eigen::Dynamic >
 
using matrix_ffv = Eigen::Matrix< fvar< fvar< var > >, Eigen::Dynamic, Eigen::Dynamic >
 
using vector_fv = Eigen::Matrix< fvar< var >, Eigen::Dynamic, 1 >
 
using vector_ffv = Eigen::Matrix< fvar< fvar< var > >, Eigen::Dynamic, 1 >
 
using row_vector_fv = Eigen::Matrix< fvar< var >, 1, Eigen::Dynamic >
 
using row_vector_ffv = Eigen::Matrix< fvar< fvar< var > >, 1, Eigen::Dynamic >
 
template<typename T , assign_op_cl AssignOp = assign_op_cl::equals>
using as_operation_cl_t = std::conditional_t< std::is_lvalue_reference< T >::value, decltype(as_operation_cl< AssignOp >(std::declval< T >())), std::remove_reference_t< decltype(as_operation_cl< AssignOp >(std::declval< T >()))> >
 Type that results when converting any valid kernel generator expression into operation.
 
template<typename T >
using is_without_output = internal::is_without_output_impl< std::decay_t< T > >
 
template<typename T >
using is_colwise_reduction = internal::is_colwise_reduction_impl< std::decay_t< T > >
 Check whether a kernel generator expression is a colwise reduction.
 
template<typename... Types>
using common_scalar_t = typename std::common_type_t< typename std::remove_reference_t< Types >::Scalar... >
 Wrapper for std::common_type_t
 
template<typename T >
using is_reduction_2d = internal::is_reduction_2d_impl< std::decay_t< T > >
 Check whether a kernel generator expression is a colwise reduction.
 
template<typename T >
using ref_type_for_opencl_t = typename ref_type_for_opencl< T >::type
 
template<int B = 0>
using boost_policy_t = boost::math::policies::policy< boost::math::policies::overflow_error< boost::math::policies::errno_on_error >, boost::math::policies::pole_error< boost::math::policies::errno_on_error >, boost::math::policies::promote_double< false >, boost::math::policies::digits2< B > >
 Boost policy that overrides the defaults to match the built-in C++ standard library functions.
 
using matrix_d = Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >
 Type for matrix of double values.
 
using vector_d = Eigen::Matrix< double, Eigen::Dynamic, 1 >
 Type for (column) vector of double values.
 
using row_vector_d = Eigen::Matrix< double, 1, Eigen::Dynamic >
 Type for (row) vector of double values.
 
template<typename T >
using index_type_t = typename index_type< T >::type
 
template<typename T >
using require_tuple_t = require_t< is_tuple< std::decay_t< T > > >
 Require type satisfies is_tuple.
 
template<typename T >
using require_not_tuple_t = require_not_t< is_tuple< std::decay_t< T > > >
 Require type does not satisfy is_tuple.
 
template<typename... Types>
using require_all_tuple_t = require_all_t< is_tuple< std::decay_t< Types > >... >
 Require all of the types satisfy is_tuple.
 
template<typename... Types>
using require_all_not_tuple_t = require_all_not_t< is_tuple< std::decay_t< Types > >... >
 Require none of the types satisfy is_tuple.
 
template<typename Mat , int NewOptions>
using change_eigen_options_t = typename internal::change_eigen_options_impl< plain_type_t< std::decay_t< Mat > >, NewOptions >::type
 Change the options of an Eigen matrix or array.
 
template<typename T , typename S >
using promote_scalar_t = typename promote_scalar_type< std::decay_t< T >, std::decay_t< S > >::type
 
using ChainableStack = AutodiffStackSingleton< vari_base, chainable_alloc >
 
using precomputed_gradients_vari = precomputed_gradients_vari_template< std::tuple<>, std::tuple<> >
 
using profile_key = std::pair< std::string, std::thread::id >
 
using profile_map = tbb::concurrent_unordered_map< profile_key, profile_info, internal::hash_profile_key, internal::equal_profile_key >
 
using matrix_v = Eigen::Matrix< var, Eigen::Dynamic, Eigen::Dynamic >
 The type of a matrix holding var values.
 
using vector_v = Eigen::Matrix< var, Eigen::Dynamic, 1 >
 The type of a (column) vector holding var values.
 
using row_vector_v = Eigen::Matrix< var, 1, Eigen::Dynamic >
 The type of a row vector holding var values.
 
using matrix_vi = Eigen::Matrix< vari *, Eigen::Dynamic, Eigen::Dynamic >
 The type of a matrix holding vari* values.
 
using vector_vi = Eigen::Matrix< vari *, Eigen::Dynamic, 1 >
 The type of a (column) vector holding vari* values.
 
using row_vector_vi = Eigen::Matrix< vari *, 1, Eigen::Dynamic >
 The type of a row vector holding vari* values.
 
using var = var_value< double >
 
using vari = vari_value< double >
 

Enumerations

enum class  assign_op_cl {
  equals ,
  plus_equals ,
  minus_equals ,
  divide_equals ,
  multiply_equals
}
 Ops that decide the type of assignment for LHS operations. More...
 
enum class  matrix_cl_view {
  Diagonal = 0 ,
  Lower = 1 ,
  Upper = 2 ,
  Entire = 3
}
 

Functions

template<typename EigMat , require_eigen_col_vector_vt< is_fvar, EigMat > * = nullptr>
auto unit_vector_constrain (const EigMat &y)
 
template<typename EigMat , typename T , require_eigen_vt< is_fvar, EigMat > * = nullptr, require_stan_scalar_t< T > * = nullptr>
auto unit_vector_constrain (const EigMat &y, T &lp)
 
template<typename T >
fvar< T > operator+ (const fvar< T > &x1, const fvar< T > &x2)
 Return the sum of the specified forward mode addends.
 
template<typename T >
fvar< T > operator+ (double x1, const fvar< T > &x2)
 Return the sum of the specified double and forward mode addends.
 
template<typename T >
fvar< T > operator+ (const fvar< T > &x1, double x2)
 Return the sum of the specified forward mode and double addends.
 
template<typename T >
fvar< T > operator/ (const fvar< T > &x1, const fvar< T > &x2)
 Return the result of dividing the first argument by the second.
 
template<typename T , typename U , require_arithmetic_t< U > * = nullptr>
fvar< T > operator/ (const fvar< T > &x1, U x2)
 Return the result of dividing the first argument by the second.
 
template<typename T , typename U , require_arithmetic_t< U > * = nullptr>
fvar< T > operator/ (U x1, const fvar< T > &x2)
 Return the result of dividing the first argument by the second.
 
template<typename T >
std::complex< fvar< T > > operator/ (const std::complex< fvar< T > > &x1, const std::complex< fvar< T > > &x2)
 
template<typename T , typename U , require_arithmetic_t< U > * = nullptr>
std::complex< fvar< T > > operator/ (const std::complex< fvar< T > > &x1, const std::complex< U > &x2)
 
template<typename T >
std::complex< fvar< T > > operator/ (const std::complex< fvar< T > > &x1, const fvar< T > &x2)
 
template<typename T , typename U , require_arithmetic_t< U > * = nullptr>
std::complex< fvar< T > > operator/ (const std::complex< fvar< T > > &x1, U x2)
 
template<typename T , typename U , require_arithmetic_t< U > * = nullptr>
std::complex< fvar< T > > operator/ (const std::complex< U > &x1, const std::complex< fvar< T > > &x2)
 
template<typename T , typename U , require_arithmetic_t< U > * = nullptr>
std::complex< fvar< T > > operator/ (const std::complex< U > &x1, const fvar< T > &x2)
 
template<typename T >
std::complex< fvar< T > > operator/ (const fvar< T > &x1, const std::complex< fvar< T > > &x2)
 
template<typename T , typename U , typename = std::enable_if_t<std::is_arithmetic<U>::value>>
std::complex< fvar< T > > operator/ (const fvar< T > &x1, const std::complex< U > &x2)
 
template<typename T , typename U , require_arithmetic_t< U > * = nullptr>
std::complex< fvar< T > > operator/ (U x1, const std::complex< fvar< T > > &x2)
 
template<typename T >
bool operator== (const fvar< T > &x, const fvar< T > &y)
 Return true if the specified variables have equal values as defined by ==.
 
template<typename T >
bool operator== (const fvar< T > &x, double y)
 Return true if the the first variable has a value equal to the second argument as defined by by ==.
 
template<typename T >
bool operator== (double x, const fvar< T > &y)
 Return true if the the first argument is equal to the value of the second argument as defined by by ==.
 
template<typename T >
bool operator> (const fvar< T > &x, const fvar< T > &y)
 Return true if the first argument has a greater value than the second as defined by >.
 
template<typename T >
bool operator> (const fvar< T > &x, double y)
 Return true if the first argument has a greater value than the second as defined by >.
 
template<typename T >
bool operator> (double x, const fvar< T > &y)
 Return true if the first argument has a greater value than the second as defined by >.
 
template<typename T >
bool operator>= (const fvar< T > &x, const fvar< T > &y)
 Return true if the value of the first argument is greater than or equal to that of the second as defined by >=.
 
template<typename T >
bool operator>= (const fvar< T > &x, double y)
 Return true if the value of the first argument has a value greater than or equal to the second argument as defined by >=.
 
template<typename T >
bool operator>= (double x, const fvar< T > &y)
 Return true if the first argument is greater than or equal to the value of the second argument as defined by >=.
 
template<typename T >
bool operator< (const fvar< T > &x, const fvar< T > &y)
 Return true if the first argument has a value less than the value of the second argument as defined by <.
 
template<typename T >
bool operator< (double x, const fvar< T > &y)
 Return true if the first argument is less than the value of the second argument as defined by <.
 
template<typename T >
bool operator< (const fvar< T > &x, double y)
 Return true if the first argument has a value less than the second argument as defined by <.
 
template<typename T >
bool operator<= (const fvar< T > &x, const fvar< T > &y)
 Return true if the first argument has a value less than or equal to the value of the second argument as defined by <=.
 
template<typename T >
bool operator<= (const fvar< T > &x, double y)
 Return true if the first argument has a value less than or equal to the second argument as defined by <=.
 
template<typename T >
bool operator<= (double x, const fvar< T > &y)
 Return true if the first argument is less than or equal to the second argument's value as defined by <=.
 
template<typename T >
bool operator&& (const fvar< T > &x, const fvar< T > &y)
 Return the logical conjunction of the values of the two arguments as defined by &&.
 
template<typename T >
bool operator&& (const fvar< T > &x, double y)
 Return the logical conjunction of the values of the two arguments as defined by &&.
 
template<typename T >
bool operator&& (double x, const fvar< T > &y)
 Return the logical conjunction of the values of the two arguments as defined by &&.
 
template<typename T >
bool operator|| (const fvar< T > &x, const fvar< T > &y)
 Return the logical disjunction of the values of the two arguments as defined by ||.
 
template<typename T >
bool operator|| (const fvar< T > &x, double y)
 Return the logical disjunction of the values of the two arguments as defined by ||.
 
template<typename T >
bool operator|| (double x, const fvar< T > &y)
 Return the logical disjunction of the values of the two arguments as defined by ||.
 
template<typename T >
fvar< T > operator* (const fvar< T > &x, const fvar< T > &y)
 Return the product of the two arguments.
 
template<typename T >
fvar< T > operator* (double x, const fvar< T > &y)
 Return the product of the two arguments.
 
template<typename T >
fvar< T > operator* (const fvar< T > &x, double y)
 Return the product of the two arguments.
 
template<typename T >
std::complex< stan::math::fvar< T > > operator* (const std::complex< stan::math::fvar< T > > &x, const std::complex< stan::math::fvar< T > > &y)
 Return the product of the two complex fvar<T> arguments.
 
template<typename T >
std::complex< stan::math::fvar< T > > operator* (const std::complex< double > &x, const std::complex< stan::math::fvar< T > > &y)
 Return the product of std::complex<double> and std::complex<fvar<T>> arguments.
 
template<typename T >
std::complex< stan::math::fvar< T > > operator* (const std::complex< stan::math::fvar< T > > &x, const std::complex< double > &y)
 Return the product of std::complex<double> and std::complex<fvar<T>> arguments.
 
template<typename T >
bool operator!= (const fvar< T > &x, const fvar< T > &y)
 Return true if the value of the two arguments are not equal as defined by !=.
 
template<typename T >
bool operator!= (const fvar< T > &x, double y)
 Return true if the value of the first argument is not equal to the second argument as defined by !=.
 
template<typename T >
bool operator!= (double x, const fvar< T > &y)
 Return true if the first argument is not equal to the value of the second argument as defined by !=.
 
template<typename T >
fvar< T > operator- (const fvar< T > &x1, const fvar< T > &x2)
 Return the difference of the specified arguments.
 
template<typename T >
fvar< T > operator- (double x1, const fvar< T > &x2)
 Return the difference of the specified arguments.
 
template<typename T >
fvar< T > operator- (const fvar< T > &x1, double x2)
 Return the difference of the specified arguments.
 
template<typename T >
fvar< T > operator- (const fvar< T > &x)
 Return the negation of the specified argument.
 
template<typename T >
bool operator! (const fvar< T > &x)
 Return the negation of the value of the argument as defined by !.
 
template<typename T >
fvar< T > operator+ (const fvar< T > &x)
 Returns the argument.
 
template<typename T >
fvar< T > abs (const fvar< T > &x)
 
template<typename T >
fvar< T > abs (const std::complex< fvar< T > > &z)
 Return the absolute value of the complex argument.
 
template<typename T >
fvar< T > acos (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > acos (const std::complex< fvar< T > > &x)
 Return the arc cosine of the complex argument.
 
template<typename T >
fvar< T > acosh (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > acosh (const std::complex< fvar< T > > &z)
 Return the hyperbolic arc cosine of the complex argument.
 
template<typename T >
fvar< T > arg (const std::complex< fvar< T > > &z)
 Return the phase angle of the complex argument.
 
template<typename T >
fvar< T > asin (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > asin (const std::complex< fvar< T > > &z)
 Return the arc sine of the complex argument.
 
template<typename T >
fvar< T > asinh (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > asinh (const std::complex< fvar< T > > &z)
 Return the hyperbolic arcsine of the complex argument.
 
template<typename T >
fvar< T > atan (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > atan (const std::complex< fvar< T > > &z)
 Return the arc tangent of the complex argument.
 
template<typename T >
fvar< T > atan2 (const fvar< T > &x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > atan2 (double x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > atan2 (const fvar< T > &x1, double x2)
 
template<typename T >
fvar< T > atanh (const fvar< T > &x)
 Return inverse hyperbolic tangent of specified value.
 
template<typename T >
std::complex< fvar< T > > atanh (const std::complex< fvar< T > > &z)
 Return the hyperbolic arc tangent of the complex argument.
 
template<typename T >
fvar< T > bessel_first_kind (int v, const fvar< T > &z)
 
template<typename T >
fvar< T > bessel_second_kind (int v, const fvar< T > &z)
 
template<typename T >
fvar< T > beta (const fvar< T > &x1, const fvar< T > &x2)
 Return fvar with the beta function applied to the specified arguments and its gradient.
 
template<typename T >
fvar< T > beta (double x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > beta (const fvar< T > &x1, double x2)
 
template<typename T >
fvar< T > binary_log_loss (int y, const fvar< T > &y_hat)
 
template<typename T >
fvar< T > cbrt (const fvar< T > &x)
 Return cube root of specified argument.
 
template<typename T >
fvar< T > ceil (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > conj (const std::complex< fvar< T > > &z)
 Return the phase angle of the complex argument.
 
template<typename T >
fvar< T > cos (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > cos (const std::complex< fvar< T > > &z)
 Return the cosine of the complex argument.
 
template<typename T >
fvar< T > cosh (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > cosh (const std::complex< fvar< T > > &z)
 Return the hyperbolic cosine of the complex argument.
 
template<typename EigMat , require_eigen_vt< is_fvar, EigMat > * = nullptr>
value_type_t< EigMat > determinant (const EigMat &m)
 
template<typename T >
fvar< T > digamma (const fvar< T > &x)
 Return the derivative of the log gamma function at the specified argument.
 
template<typename T >
fvar< T > erf (const fvar< T > &x)
 
template<typename T >
fvar< T > erfc (const fvar< T > &x)
 
template<typename T >
fvar< T > exp (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > exp (const std::complex< fvar< T > > &z)
 Return the natural exponentiation (base e) of the specified complex number.
 
template<typename T >
fvar< T > exp2 (const fvar< T > &x)
 
template<typename T >
fvar< T > expm1 (const fvar< T > &x)
 
template<typename T >
fvar< T > fabs (const fvar< T > &x)
 
template<typename T >
fvar< T > falling_factorial (const fvar< T > &x, int n)
 Return autodiff variable with the gradient and result of the falling factorial function applied to the inputs.
 
template<typename T >
fvar< T > fdim (const fvar< T > &x, const fvar< T > &y)
 Return the positive difference of the specified values (C++11).
 
template<typename T >
fvar< T > fdim (const fvar< T > &x, double y)
 Return the positive difference of the specified values (C++11).
 
template<typename T >
fvar< T > fdim (double x, const fvar< T > &y)
 Return the positive difference of the specified values (C++11).
 
template<typename T >
fvar< T > floor (const fvar< T > &x)
 
template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr>
fvar< return_type_t< T1, T2, T3 > > fma (const fvar< T1 > &x1, const fvar< T2 > &x2, const fvar< T3 > &x3)
 The fused multiply-add operation (C99).
 
template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr>
fvar< return_type_t< T1, T2, T3 > > fma (const T1 &x1, const fvar< T2 > &x2, const fvar< T3 > &x3)
 See all-var input signature for details on the function and derivatives.
 
template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr>
fvar< return_type_t< T1, T2, T3 > > fma (const fvar< T1 > &x1, const T2 &x2, const fvar< T3 > &x3)
 See all-var input signature for details on the function and derivatives.
 
template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr>
fvar< return_type_t< T1, T2, T3 > > fma (const fvar< T1 > &x1, const fvar< T2 > &x2, const T3 &x3)
 See all-var input signature for details on the function and derivatives.
 
template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr>
fvar< return_type_t< T1, T2, T3 > > fma (const T1 &x1, const T2 &x2, const fvar< T3 > &x3)
 See all-var input signature for details on the function and derivatives.
 
template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr>
fvar< return_type_t< T1, T2, T3 > > fma (const fvar< T1 > &x1, const T2 &x2, const T3 &x3)
 See all-var input signature for details on the function and derivatives.
 
template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr>
fvar< return_type_t< T1, T2, T3 > > fma (const T1 &x1, const fvar< T2 > &x2, const T3 &x3)
 See all-var input signature for details on the function and derivatives.
 
template<typename T >
fvar< T > fmax (const fvar< T > &x1, const fvar< T > &x2)
 Return the greater of the two specified arguments.
 
template<typename T >
fvar< T > fmax (double x1, const fvar< T > &x2)
 Return the greater of the two specified arguments.
 
template<typename T >
fvar< T > fmax (const fvar< T > &x1, double x2)
 Return the greater of the two specified arguments.
 
template<typename T >
fvar< T > fmin (const fvar< T > &x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > fmin (double x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > fmin (const fvar< T > &x1, double x2)
 
template<typename T >
fvar< T > fmod (const fvar< T > &x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > fmod (const fvar< T > &x1, double x2)
 
template<typename T >
fvar< T > fmod (double x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > gamma_p (const fvar< T > &x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > gamma_p (const fvar< T > &x1, double x2)
 
template<typename T >
fvar< T > gamma_p (double x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > gamma_q (const fvar< T > &x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > gamma_q (const fvar< T > &x1, double x2)
 
template<typename T >
fvar< T > gamma_q (double x1, const fvar< T > &x2)
 
template<typename T >
void grad_inc_beta (fvar< T > &g1, fvar< T > &g2, fvar< T > a, fvar< T > b, fvar< T > z)
 Gradient of the incomplete beta function beta(a, b, z) with respect to the first two arguments.
 
template<typename Ta , typename Tz , typename FvarT = return_type_t<Ta, Tz>, require_all_stan_scalar_t< Ta, Tz > * = nullptr, require_any_fvar_t< Ta, Tz > * = nullptr>
FvarT hypergeometric_1f0 (const Ta &a, const Tz &z)
 Returns the Hypergeometric 1F0 function applied to the input arguments: \( _1F_0(a;;z) = \sum_{k=1}^{\infty}\frac{\left(a\right)_kz^k}{k!}\).
 
template<typename Ta1 , typename Ta2 , typename Tb , typename Tz , require_all_stan_scalar_t< Ta1, Ta2, Tb, Tz > * = nullptr, require_any_fvar_t< Ta1, Ta2, Tb, Tz > * = nullptr>
return_type_t< Ta1, Ta1, Tb, Tz > hypergeometric_2F1 (const Ta1 &a1, const Ta2 &a2, const Tb &b, const Tz &z)
 Returns the Gauss hypergeometric function applied to the input arguments: \(_2F_1(a_1,a_2;b;z)\).
 
template<typename Ta , typename Tb , typename Tz , typename FvarT = return_type_t<Ta, Tb, Tz>, bool grad_a = !is_constant<Ta>::value, bool grad_b = !is_constant<Tb>::value, bool grad_z = !is_constant<Tz>::value, require_all_vector_t< Ta, Tb > * = nullptr, require_fvar_t< FvarT > * = nullptr>
FvarT hypergeometric_pFq (const Ta &a, const Tb &b, const Tz &z)
 Returns the generalized hypergeometric (pFq) function applied to the input arguments.
 
template<typename T >
fvar< T > hypot (const fvar< T > &x1, const fvar< T > &x2)
 Return the length of the hypotenuse of a right triangle with opposite and adjacent side lengths given by the specified arguments (C++11).
 
template<typename T >
fvar< T > hypot (const fvar< T > &x1, double x2)
 Return the length of the hypotenuse of a right triangle with opposite and adjacent side lengths given by the specified arguments (C++11).
 
template<typename T >
fvar< T > hypot (double x1, const fvar< T > &x2)
 Return the length of the hypotenuse of a right triangle with opposite and adjacent side lengths given by the specified arguments (C++11).
 
template<typename T >
fvar< T > inc_beta (const fvar< T > &a, const fvar< T > &b, const fvar< T > &x)
 
template<typename T >
fvar< T > inc_beta (double a, const fvar< T > &b, const fvar< T > &x)
 
template<typename T >
fvar< T > inc_beta (const fvar< T > &a, double b, const fvar< T > &x)
 
template<typename T >
fvar< T > inc_beta (const fvar< T > &a, const fvar< T > &b, double x)
 
template<typename T >
fvar< T > inc_beta (double a, double b, const fvar< T > &x)
 
template<typename T >
fvar< T > inc_beta (const fvar< T > &a, double b, double x)
 
template<typename T >
fvar< T > inc_beta (double a, const fvar< T > &b, double x)
 
template<typename T >
fvar< T > inv (const fvar< T > &x)
 
template<typename T >
fvar< T > inv_cloglog (const fvar< T > &x)
 
template<typename T >
fvar< T > inv_erfc (const fvar< T > &x)
 
template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr, require_any_fvar_t< T1, T2, T3 > * = nullptr>
fvar< partials_return_t< T1, T2, T3 > > inv_inc_beta (const T1 &a, const T2 &b, const T3 &p)
 The inverse of the normalized incomplete beta function of a, b, with probability p.
 
template<typename T >
fvar< T > inv_logit (const fvar< T > &x)
 Returns the inverse logit function applied to the argument.
 
template<typename T >
fvar< T > inv_Phi (const fvar< T > &p)
 
template<typename T >
fvar< T > inv_sqrt (const fvar< T > &x)
 
template<typename T >
fvar< T > inv_square (const fvar< T > &x)
 
template<typename EigMat , require_eigen_vt< is_fvar, EigMat > * = nullptr>
Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::ColsAtCompileTime > inverse (const EigMat &m)
 Forward mode specialization of calculating the inverse of the matrix.
 
template<typename T >
int is_inf (const fvar< T > &x)
 Returns 1 if the input's value is infinite and 0 otherwise.
 
template<typename T , require_fvar_t< T > * = nullptr>
bool is_nan (T &&x)
 Returns 1 if the input's value is NaN and 0 otherwise.
 
template<typename T >
fvar< T > lambert_w0 (const fvar< T > &x)
 
template<typename T >
fvar< T > lambert_wm1 (const fvar< T > &x)
 
template<typename T >
fvar< T > lbeta (const fvar< T > &x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > lbeta (double x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > lbeta (const fvar< T > &x1, double x2)
 
template<typename T >
fvar< T > ldexp (const fvar< T > &a, int b)
 Returns the product of a (the significand) times 2 to power b (the exponent).
 
template<typename T >
fvar< T > lgamma (const fvar< T > &x)
 Return the natural logarithm of the gamma function applied to the specified argument.
 
template<typename T >
fvar< return_type_t< T, int > > lmgamma (int x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > lmultiply (const fvar< T > &x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > lmultiply (double x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > lmultiply (const fvar< T > &x1, double x2)
 
template<typename T >
fvar< T > log (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > log (const std::complex< fvar< T > > &z)
 Return the natural logarithm (base e) of the specified complex argument.
 
template<typename T >
fvar< T > log10 (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > log10 (const std::complex< fvar< T > > &z)
 Return the base 10 logarithm of the specified complex number.
 
template<typename T >
fvar< T > log1m (const fvar< T > &x)
 
template<typename T >
fvar< T > log1m_exp (const fvar< T > &x)
 Return the natural logarithm of one minus the exponentiation of the specified argument.
 
template<typename T >
fvar< T > log1m_inv_logit (const fvar< T > &x)
 Return the natural logarithm of one minus the inverse logit of the specified argument.
 
template<typename T >
fvar< T > log1p (const fvar< T > &x)
 
template<typename T >
fvar< T > log1p_exp (const fvar< T > &x)
 
template<typename T >
fvar< T > log2 (const fvar< T > &x)
 Return the base two logarithm of the specified argument.
 
template<typename EigMat , require_eigen_vt< is_fvar, EigMat > * = nullptr>
value_type_t< EigMat > log_determinant (const EigMat &m)
 Returns the log absolute determinant of the specified square matrix.
 
template<typename T >
fvar< T > log_diff_exp (const fvar< T > &x1, const fvar< T > &x2)
 
template<typename T1 , typename T2 , require_arithmetic_t< T1 > * = nullptr>
fvar< T2 > log_diff_exp (const T1 &x1, const fvar< T2 > &x2)
 
template<typename T1 , typename T2 , require_arithmetic_t< T2 > * = nullptr>
fvar< T1 > log_diff_exp (const fvar< T1 > &x1, const T2 &x2)
 
template<typename T >
fvar< T > log_falling_factorial (const fvar< T > &x, const fvar< T > &n)
 
template<typename T >
fvar< T > log_falling_factorial (double x, const fvar< T > &n)
 
template<typename T >
fvar< T > log_falling_factorial (const fvar< T > &x, double n)
 
template<typename T >
fvar< T > log_inv_logit (const fvar< T > &x)
 
template<typename T >
fvar< T > log_inv_logit_diff (const fvar< T > &x, const fvar< T > &y)
 Returns fvar with the natural logarithm of the difference of the inverse logits of the specified arguments and its gradients.
 
template<typename T >
fvar< T > log_inv_logit_diff (const fvar< T > &x, double y)
 
template<typename T >
fvar< T > log_inv_logit_diff (double x, const fvar< T > &y)
 
template<typename T_theta , typename T_lambda1 , typename T_lambda2 , int N>
void log_mix_partial_helper (const T_theta &theta, const T_lambda1 &lambda1, const T_lambda2 &lambda2, promote_args_t< T_theta, T_lambda1, T_lambda2 >(&partials_array)[N])
 
template<typename T >
fvar< T > log_mix (const fvar< T > &theta, const fvar< T > &lambda1, const fvar< T > &lambda2)
 Return the log mixture density with specified mixing proportion and log densities and its derivative at each.
 
template<typename T , typename P , require_all_arithmetic_t< P > * = nullptr>
fvar< T > log_mix (const fvar< T > &theta, const fvar< T > &lambda1, P lambda2)
 
template<typename T , typename P , require_all_arithmetic_t< P > * = nullptr>
fvar< T > log_mix (const fvar< T > &theta, P lambda1, const fvar< T > &lambda2)
 
template<typename T , typename P , require_all_arithmetic_t< P > * = nullptr>
fvar< T > log_mix (P theta, const fvar< T > &lambda1, const fvar< T > &lambda2)
 
template<typename T , typename P1 , typename P2 , require_all_arithmetic_t< P1, P2 > * = nullptr>
fvar< T > log_mix (const fvar< T > &theta, P1 lambda1, P2 lambda2)
 
template<typename T , typename P1 , typename P2 , require_all_arithmetic_t< P1, P2 > * = nullptr>
fvar< T > log_mix (P1 theta, const fvar< T > &lambda1, P2 lambda2)
 
template<typename T , typename P1 , typename P2 , require_all_arithmetic_t< P1, P2 > * = nullptr>
fvar< T > log_mix (P1 theta, P2 lambda1, const fvar< T > &lambda2)
 
template<typename T >
fvar< T > log_rising_factorial (const fvar< T > &x, const fvar< T > &n)
 
template<typename T >
fvar< T > log_rising_factorial (const fvar< T > &x, double n)
 
template<typename T >
fvar< T > log_rising_factorial (double x, const fvar< T > &n)
 
template<typename T , require_vector_st< is_fvar, T > * = nullptr>
auto log_softmax (const T &x)
 Return the log softmax of the specified vector or container of vectors.
 
template<typename T >
fvar< T > log_sum_exp (const fvar< T > &x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > log_sum_exp (double x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > log_sum_exp (const fvar< T > &x1, double x2)
 
template<typename T , require_container_st< is_fvar, T > * = nullptr>
auto log_sum_exp (const T &x)
 Return the log of the sum of the exponentiated values of the specified matrix of values.
 
template<typename T >
fvar< T > logit (const fvar< T > &x)
 
template<typename T1 , typename T2 , require_all_eigen_vt< is_fvar, T1, T2 > * = nullptr, require_vt_same< T1, T2 > * = nullptr>
Eigen::Matrix< value_type_t< T1 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > mdivide_left (const T1 &A, const T2 &b)
 
template<typename T1 , typename T2 , require_eigen_vt< std::is_arithmetic, T1 > * = nullptr, require_eigen_vt< is_fvar, T2 > * = nullptr>
Eigen::Matrix< value_type_t< T2 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > mdivide_left (const T1 &A, const T2 &b)
 
template<typename T , typename EigMat , require_eigen_vt< std::is_arithmetic, T > * = nullptr, require_eigen_vt< is_fvar, EigMat > * = nullptr>
Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, EigMat::ColsAtCompileTime > mdivide_left_ldlt (LDLT_factor< T > &A, const EigMat &b)
 Returns the solution of the system Ax=b given an LDLT_factor of A.
 
template<typename T1 , typename T2 , require_all_eigen_vt< is_fvar, T1, T2 > * = nullptr, require_vt_same< T1, T2 > * = nullptr>
Eigen::Matrix< value_type_t< T1 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > mdivide_left_tri_low (const T1 &A, const T2 &b)
 
template<typename T1 , typename T2 , require_eigen_t< T1 > * = nullptr, require_vt_same< double, T1 > * = nullptr, require_eigen_vt< is_fvar, T2 > * = nullptr>
Eigen::Matrix< value_type_t< T2 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > mdivide_left_tri_low (const T1 &A, const T2 &b)
 
template<typename T1 , typename T2 , require_eigen_vt< is_fvar, T1 > * = nullptr, require_eigen_t< T2 > * = nullptr, require_vt_same< double, T2 > * = nullptr>
Eigen::Matrix< value_type_t< T1 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > mdivide_left_tri_low (const T1 &A, const T2 &b)
 
template<typename EigMat1 , typename EigMat2 , require_all_eigen_vt< is_fvar, EigMat1, EigMat2 > * = nullptr, require_vt_same< EigMat1, EigMat2 > * = nullptr>
Eigen::Matrix< value_type_t< EigMat1 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > mdivide_right (const EigMat1 &A, const EigMat2 &b)
 
template<typename EigMat1 , typename EigMat2 , require_eigen_vt< std::is_arithmetic, EigMat1 > * = nullptr, require_eigen_vt< is_fvar, EigMat2 > * = nullptr>
Eigen::Matrix< value_type_t< EigMat2 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > mdivide_right (const EigMat1 &A, const EigMat2 &b)
 
template<typename EigMat1 , typename EigMat2 , require_all_eigen_vt< is_fvar, EigMat1, EigMat2 > * = nullptr, require_vt_same< EigMat1, EigMat2 > * = nullptr>
Eigen::Matrix< value_type_t< EigMat1 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > mdivide_right_tri_low (const EigMat1 &A, const EigMat2 &b)
 
template<typename EigMat1 , typename EigMat2 , require_eigen_vt< std::is_arithmetic, EigMat1 > * = nullptr, require_eigen_vt< is_fvar, EigMat2 > * = nullptr>
Eigen::Matrix< value_type_t< EigMat2 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > mdivide_right_tri_low (const EigMat1 &A, const EigMat2 &b)
 
template<typename T >
fvar< T > modified_bessel_first_kind (int v, const fvar< T > &z)
 
template<typename T >
fvar< T > modified_bessel_second_kind (int v, const fvar< T > &z)
 
template<typename Mat1 , typename Mat2 , require_all_eigen_vt< is_fvar, Mat1, Mat2 > * = nullptr, require_vt_same< Mat1, Mat2 > * = nullptr, require_not_eigen_row_and_col_t< Mat1, Mat2 > * = nullptr>
auto multiply (const Mat1 &m1, const Mat2 &m2)
 Return the product of the specified matrices.
 
template<typename T >
fvar< T > multiply_log (const fvar< T > &x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > multiply_log (double x1, const fvar< T > &x2)
 
template<typename T >
fvar< T > multiply_log (const fvar< T > &x1, double x2)
 
template<typename EigMat , require_eigen_vt< is_fvar, EigMat > * = nullptr>
Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::RowsAtCompileTime > multiply_lower_tri_self_transpose (const EigMat &m)
 
template<typename T >
fvar< T > norm (const std::complex< fvar< T > > &z)
 Return the squared magnitude of the complex argument.
 
template<typename Container , require_eigen_vt< is_fvar, Container > * = nullptr>
auto norm1 (const Container &x)
 Compute the L1 norm of the specified vector of values.
 
template<typename Container , require_eigen_vt< is_fvar, Container > * = nullptr>
auto norm2 (const Container &x)
 Compute the L2 norm of the specified vector of values.
 
template<typename T >
fvar< T > owens_t (const fvar< T > &x1, const fvar< T > &x2)
 Return Owen's T function applied to the specified arguments.
 
template<typename T >
fvar< T > owens_t (double x1, const fvar< T > &x2)
 Return Owen's T function applied to the specified arguments.
 
template<typename T >
fvar< T > owens_t (const fvar< T > &x1, double x2)
 Return Owen's T function applied to the specified arguments.
 
template<typename T >
fvar< T > Phi (const fvar< T > &x)
 
template<typename T >
fvar< T > Phi_approx (const fvar< T > &x)
 Return an approximation of the unit normal cumulative distribution function (CDF).
 
template<typename T >
std::complex< fvar< T > > polar (const fvar< T > &r, const fvar< T > &theta)
 Returns complex number with specified magnitude and phase angle.
 
template<typename T , typename U >
std::complex< fvar< T > > polar (const fvar< T > &r, U theta)
 Returns complex number with specified magnitude and phase angle.
 
template<typename T , typename U >
std::complex< fvar< T > > polar (U r, const fvar< T > &theta)
 Returns complex number with specified magnitude and phase angle.
 
template<typename T >
fvar< T > pow (const fvar< T > &x1, const fvar< T > &x2)
 
template<typename T , typename U , typename = require_arithmetic_t<U>>
fvar< T > pow (U x1, const fvar< T > &x2)
 
template<typename T , typename U , typename = require_arithmetic_t<U>>
fvar< T > pow (const fvar< T > &x1, U x2)
 
template<typename V >
std::complex< fvar< V > > pow (const std::complex< fvar< V > > &x, const std::complex< fvar< V > > &y)
 Return the first argument raised to the power of the second argument.
 
template<typename V , typename T , typename = require_arithmetic_t<T>>
std::complex< fvar< V > > pow (const std::complex< fvar< V > > &x, const std::complex< T > &y)
 Return the first argument raised to the power of the second argument.
 
template<typename V >
std::complex< fvar< V > > pow (const std::complex< fvar< V > > &x, const fvar< V > &y)
 Return the first argument raised to the power of the second argument.
 
template<typename V , typename T , typename = require_arithmetic_t<T>>
std::complex< fvar< V > > pow (const std::complex< fvar< V > > &x, const T &y)
 Return the first argument raised to the power of the second argument.
 
template<typename V , typename T , typename = require_arithmetic_t<T>>
std::complex< fvar< V > > pow (const std::complex< T > &x, const std::complex< fvar< V > > &y)
 Return the first argument raised to the power of the second argument.
 
template<typename V , typename T , typename = require_arithmetic_t<T>>
std::complex< fvar< V > > pow (const std::complex< T > &x, const fvar< V > &y)
 Return the first argument raised to the power of the second argument.
 
template<typename V >
std::complex< fvar< V > > pow (const fvar< V > &x, const std::complex< fvar< V > > &y)
 Return the first argument raised to the power of the second argument.
 
template<typename V , typename T , typename = require_arithmetic_t<T>>
std::complex< fvar< V > > pow (const fvar< V > &x, const std::complex< T > &y)
 Return the first argument raised to the power of the second argument.
 
template<typename T , typename V , typename = require_arithmetic_t<T>>
std::complex< fvar< V > > pow (T x, const std::complex< fvar< V > > &y)
 Return the first argument raised to the power of the second argument.
 
template<typename T >
std::complex< fvar< T > > pow (const std::complex< fvar< T > > &x, int y)
 Return the first argument raised to the power of the second argument.
 
template<typename T >
double primitive_value (const fvar< T > &v)
 Return the primitive value of the specified forward-mode autodiff variable.
 
template<typename T >
std::complex< fvar< T > > proj (const std::complex< fvar< T > > &z)
 Return the projection of the complex argument onto the Riemann sphere.
 
template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_not_eigen_col_vector_t< EigMat2 > * = nullptr, require_any_vt_fvar< EigMat1, EigMat2 > * = nullptr>
promote_scalar_t< return_type_t< EigMat1, EigMat2 >, EigMat2 > quad_form (const EigMat1 &A, const EigMat2 &B)
 Return the quadratic form \( B^T A B \).
 
template<typename EigMat , typename ColVec , require_eigen_t< EigMat > * = nullptr, require_eigen_col_vector_t< ColVec > * = nullptr, require_any_vt_fvar< EigMat, ColVec > * = nullptr>
return_type_t< EigMat, ColVec > quad_form (const EigMat &A, const ColVec &B)
 Return the quadratic form \( B^T A B \).
 
template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_not_eigen_col_vector_t< EigMat2 > * = nullptr, require_any_vt_fvar< EigMat1, EigMat2 > * = nullptr>
promote_scalar_t< return_type_t< EigMat1, EigMat2 >, EigMat2 > quad_form_sym (const EigMat1 &A, const EigMat2 &B)
 Return the quadratic form \( B^T A B \) of a symmetric matrix.
 
template<typename EigMat , typename ColVec , require_eigen_t< EigMat > * = nullptr, require_eigen_col_vector_t< ColVec > * = nullptr, require_any_vt_fvar< EigMat, ColVec > * = nullptr>
return_type_t< EigMat, ColVec > quad_form_sym (const EigMat &A, const ColVec &B)
 Return the quadratic form \( B^T A B \) of a symmetric matrix.
 
template<typename EigFvar , typename EigOut >
void read_fvar (const EigFvar &FvarMat, EigOut &ValMat, EigOut &DMat)
 Function applying the read_fvar_functor to extract the values and tangets of a given fvar matrix into separate matrices.
 
template<typename T >
fvar< T > rising_factorial (const fvar< T > &x, int n)
 Return autodiff variable with the gradient and result of the rising factorial function applied to the inputs.
 
template<typename T >
fvar< T > round (const fvar< T > &x)
 Return the closest integer to the specified argument, with halfway cases rounded away from zero.
 
template<typename T >
fvar< T > sin (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > sin (const std::complex< fvar< T > > &z)
 Return the sine of the complex argument.
 
template<typename T >
fvar< T > sinh (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > sinh (const std::complex< fvar< T > > &z)
 Return the hyperbolic sine of the complex argument.
 
template<typename ColVec , require_eigen_col_vector_vt< is_fvar, ColVec > * = nullptr>
auto softmax (const ColVec &alpha)
 
template<typename T >
fvar< T > sqrt (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > sqrt (const std::complex< fvar< T > > &z)
 Return the square root of the complex argument.
 
template<typename T >
fvar< T > square (const fvar< T > &x)
 
template<typename T >
fvar< T > sum (const std::vector< fvar< T > > &m)
 Return the sum of the entries of the specified standard vector.
 
template<typename T , require_eigen_vt< is_fvar, T > * = nullptr>
value_type_t< T > sum (const T &m)
 Return the sum of the entries of the specified matrix.
 
template<typename T >
fvar< T > tan (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > tan (const std::complex< fvar< T > > &z)
 Return the tangent of the complex argument.
 
template<typename T >
fvar< T > tanh (const fvar< T > &x)
 
template<typename T >
std::complex< fvar< T > > tanh (const std::complex< fvar< T > > &z)
 Return the hyperbolic tangent of the complex argument.
 
template<typename EigMat , require_eigen_vt< is_fvar, EigMat > * = nullptr>
Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::RowsAtCompileTime > tcrossprod (const EigMat &m)
 
template<typename T >
fvar< T > tgamma (const fvar< T > &x)
 Return the result of applying the gamma function to the specified argument.
 
template<typename T , require_stan_scalar_t< T > * = nullptr, require_not_fvar_t< T > * = nullptr>
fvar< T > to_fvar (const T &x)
 
template<typename T , require_fvar_t< scalar_type_t< T > > * = nullptr>
T && to_fvar (T &&x)
 Specialization of to_fvar for [containers of] fvars.
 
template<typename T >
std::vector< fvar< T > > to_fvar (const std::vector< T > &v)
 
template<typename T >
std::vector< fvar< T > > to_fvar (const std::vector< T > &v, const std::vector< T > &d)
 
template<typename T , require_eigen_t< T > * = nullptr, require_not_eigen_vt< is_fvar, T > * = nullptr>
promote_scalar_t< fvar< value_type_t< T > >, T > to_fvar (const T &m)
 
template<typename T1 , typename T2 , require_all_eigen_t< T1, T2 > * = nullptr, require_vt_same< T1, T2 > * = nullptr>
promote_scalar_t< fvar< value_type_t< T1 > >, T1 > to_fvar (const T1 &val, const T2 &deriv)
 
template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_any_vt_fvar< EigMat1, EigMat2 > * = nullptr>
return_type_t< EigMat1, EigMat2 > trace_quad_form (const EigMat1 &A, const EigMat2 &B)
 
template<typename T >
fvar< T > trigamma (const fvar< T > &u)
 Return the value of the trigamma function at the specified argument (i.e., the second derivative of the log Gamma function at the specified argument).
 
template<typename T >
fvar< T > trunc (const fvar< T > &x)
 Return the nearest integral value that is not larger in magnitude than the specified argument.
 
template<typename T >
value_of (const fvar< T > &v)
 Return the value of the specified variable.
 
template<typename T >
double value_of_rec (const fvar< T > &v)
 Return the value of the specified variable.
 
template<typename F , typename... TArgs, require_any_st_fvar< TArgs... > * = nullptr>
auto finite_diff (const F &func, const TArgs &... args)
 Construct an fvar<T> where the tangent is calculated by finite-differencing.
 
template<typename T , typename F >
void gradient (const F &f, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, T &fx, Eigen::Matrix< T, Eigen::Dynamic, 1 > &grad_fx)
 Calculate the value and the gradient of the specified function at the specified argument.
 
template<typename T , typename F >
void hessian (const F &f, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, T &fx, Eigen::Matrix< T, Eigen::Dynamic, 1 > &grad, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &H)
 Calculate the value, the gradient, and the Hessian, of the specified function at the specified argument in time O(N^3) time and O(N^2) space.
 
template<typename F , typename T_a , typename T_b , typename... Args, require_any_st_fvar< T_a, T_b, Args... > * = nullptr>
return_type_t< T_a, T_b, Args... > integrate_1d_impl (const F &f, const T_a &a, const T_b &b, double relative_tolerance, std::ostream *msgs, const Args &... args)
 Return the integral of f from a to b to the given relative tolerance.
 
template<typename F , typename T_a , typename T_b , typename T_theta , require_any_fvar_t< T_a, T_b, T_theta > * = nullptr>
return_type_t< T_a, T_b, T_theta > integrate_1d (const F &f, const T_a &a, const T_b &b, const std::vector< T_theta > &theta, const std::vector< double > &x_r, const std::vector< int > &x_i, std::ostream *msgs, const double relative_tolerance)
 Compute the integral of the single variable function f from a to b to within a specified relative tolerance.
 
template<typename T , typename F >
void jacobian (const F &f, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &fx, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &J)
 
template<typename T >
fvar< T > std_normal_log_qf (const fvar< T > &p)
 
template<typename T >
bool is_aligned (T *ptr, unsigned int bytes_aligned)
 Return true if the specified pointer is aligned on the number of bytes.
 
template<typename T , typename F >
void derivative (const F &f, const T &x, T &fx, T &dfx_dx)
 Return the derivative of the specified univariate function at the specified argument.
 
template<typename F >
void finite_diff_grad_hessian (const F &f, const Eigen::VectorXd &x, double &fx, Eigen::MatrixXd &hess, std::vector< Eigen::MatrixXd > &grad_hess_fx, double epsilon=1e-04)
 Calculate the value and the gradient of the hessian of the specified function at the specified argument using second-order autodiff and first-order finite difference.
 
template<typename F >
void finite_diff_grad_hessian_auto (const F &f, const Eigen::VectorXd &x, double &fx, Eigen::MatrixXd &hess, std::vector< Eigen::MatrixXd > &grad_hess_fx)
 Calculate the value, Hessian, and the gradient of the Hessian of the specified function at the specified argument using second-order autodiff and first-order finite difference.
 
template<typename F >
void grad_hessian (const F &f, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &x, double &fx, Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &H, std::vector< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > > &grad_H)
 Calculate the value, the Hessian, and the gradient of the Hessian of the specified function at the specified argument.
 
template<typename F >
void grad_tr_mat_times_hessian (const F &f, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &M, Eigen::Matrix< double, Eigen::Dynamic, 1 > &grad_tr_MH)
 
template<typename T1 , typename T2 , typename F >
void gradient_dot_vector (const F &f, const Eigen::Matrix< T1, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< T2, Eigen::Dynamic, 1 > &v, T1 &fx, T1 &grad_fx_dot_v)
 
template<typename F >
void hessian (const F &f, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &x, double &fx, Eigen::Matrix< double, Eigen::Dynamic, 1 > &grad, Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &H)
 Calculate the value, the gradient, and the Hessian, of the specified function at the specified argument in O(N^2) time and O(N^2) space.
 
template<typename F >
void hessian_times_vector (const F &f, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &v, double &fx, Eigen::Matrix< double, Eigen::Dynamic, 1 > &Hv)
 
template<typename T , typename F >
void hessian_times_vector (const F &f, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v, T &fx, Eigen::Matrix< T, Eigen::Dynamic, 1 > &Hv)
 
template<typename T , typename F >
void partial_derivative (const F &f, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, int n, T &fx, T &dfx_dxn)
 Return the partial derivative of the specified multivariate function at the specified argument.
 
template<typename T , require_st_arithmetic< T > * = nullptr>
matrix_cl< scalar_type_t< T > > to_matrix_cl (T &&src)
 Copies the source Eigen matrix, std::vector or scalar to the destination matrix that is stored on the OpenCL device.
 
template<typename T_ret , typename T , require_eigen_t< T_ret > * = nullptr, require_matrix_cl_t< T > * = nullptr, require_st_same< T_ret, T > * = nullptr>
auto from_matrix_cl (const T &src)
 Copies the source matrix that is stored on the OpenCL device to the destination Eigen matrix.
 
template<typename T_ret , typename T , require_all_kernel_expressions_t< T > * = nullptr, require_not_matrix_cl_t< T > * = nullptr>
auto from_matrix_cl (const T &src)
 Copies result of a kernel generator expression to the specified destination type.
 
template<typename T_dst , typename T , require_arithmetic_t< T > * = nullptr, require_same_t< T_dst, T > * = nullptr>
T_dst from_matrix_cl (const matrix_cl< T > &src)
 Copy A 1 by 1 source matrix from the Device to the host.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto from_matrix_cl (const T &src)
 Copies the source kernel generator expression or matrix that is stored on the OpenCL device to the destination Eigen matrix.
 
template<typename T , require_matrix_cl_t< T > * = nullptr>
auto packed_copy (const T &src)
 Packs the square flat triangular matrix on the OpenCL device and copies it to the std::vector.
 
template<matrix_cl_view matrix_view, typename Vec , typename Vec_scalar = scalar_type_t<Vec>, require_vector_vt< std::is_arithmetic, Vec > * = nullptr>
matrix_cl< Vec_scalar > packed_copy (Vec &&src, int rows)
 Copies the packed triangular matrix from the source std::vector to an OpenCL buffer and unpacks it to a flat matrix on the OpenCL device.
 
template<typename T , require_matrix_cl_t< T > * = nullptr>
plain_type_t< T > copy_cl (const T &src)
 Copies the source matrix to the destination matrix.
 
template<typename T >
void check_mat_not_size_one (const char *function, const char *name, const matrix_cl< T > &A)
 Check if the matrix_cl has a single element.
 
void check_opencl_error (const char *function, const cl::Error &e)
 Throws the domain error with specifying the OpenCL error that occurred.
 
template<typename T , typename = require_arithmetic_t<T>>
void check_symmetric (const char *function, const char *name, const matrix_cl< T > &y)
 Check if the matrix_cl is symmetric.
 
template<typename T , require_matrix_cl_t< T > * = nullptr>
void check_triangular (const char *function, const char *name, const T &A)
 Check if the matrix_cl is either upper triangular or lower triangular.
 
void indexing_rev (matrix_cl< double > &adj, const matrix_cl< int > &idx, const matrix_cl< double > &res)
 Performs reverse pass for indexing operation on the OpenCL device.
 
template<typename Ta , typename Tb , typename = require_all_kernel_expressions_and_none_scalar_t<Ta, Tb>>
auto append_row (Ta &&a, Tb &&b)
 Stack the rows of the first argument on top of the second argument.
 
template<typename Ta , typename Tb , typename = require_all_kernel_expressions_and_none_scalar_t<Ta, Tb>>
auto append_col (Ta &&a, Tb &&b)
 Stack the cols of the arguments.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
auto as_column_vector_or_scalar (T &&a)
 as_column_vector_or_scalar of a kernel generator expression.
 
template<assign_op_cl AssignOp = assign_op_cl::equals, typename T_operation , typename = std::enable_if_t<std::is_base_of< operation_cl_base, std::remove_reference_t<T_operation>>::value>>
T_operation && as_operation_cl (T_operation &&a)
 Converts any valid kernel generator expression into an operation.
 
template<assign_op_cl AssignOp = assign_op_cl::equals, typename T_scalar , typename = require_arithmetic_t<T_scalar>, require_not_same_t< T_scalar, bool > * = nullptr>
scalar_< T_scalar > as_operation_cl (const T_scalar a)
 Converts any valid kernel generator expression into an operation.
 
template<assign_op_cl AssignOp = assign_op_cl::equals>
scalar_< char > as_operation_cl (const bool a)
 Converts any valid kernel generator expression into an operation.
 
template<assign_op_cl AssignOp = assign_op_cl::equals, typename T_matrix_cl , typename = require_any_t<is_matrix_cl<T_matrix_cl>, is_arena_matrix_cl<T_matrix_cl>>>
load_< T_matrix_cl, AssignOp > as_operation_cl (T_matrix_cl &&a)
 Converts any valid kernel generator expression into an operation.
 
template<typename T >
constexpr const char * assignment_op () noexcept
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
addition_operator_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator+ (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
addition_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > add (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
subtraction_operator_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator- (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
subtraction_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > subtract (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > elt_multiply (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
elt_divide_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > elt_divide (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
elt_modulo_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator% (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
less_than_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator< (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
less_than_or_equal_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator<= (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
greater_than_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator> (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
greater_than_or_equal_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator>= (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
equals_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator== (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
not_equals_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator!= (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
logical_or_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator|| (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr>
logical_and_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator&& (T_a &&a, T_b &&b)
 
template<typename T_a , typename T_b , typename = require_arithmetic_t<T_a>, typename = require_all_kernel_expressions_t<T_b>>
elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator* (T_a a, T_b &&b)
 Multiplication of a scalar and a kernel generator expression.
 
template<typename T_a , typename T_b , typename = require_all_kernel_expressions_t<T_a>, typename = require_arithmetic_t<T_b>>
elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > operator* (T_a &&a, const T_b b)
 Multiplication of a kernel generator expression and a scalar.
 
template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
auto block_zero_based (T &&a, int start_row, int start_col, int rows, int cols)
 Block of a kernel generator expression.
 
template<bool Colwise, bool Rowwise, typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
auto broadcast (T &&a)
 Broadcast an expression in specified dimension(s).
 
template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
auto rowwise_broadcast (T &&a)
 Broadcast an expression in rowwise dimmension.
 
template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
auto colwise_broadcast (T &&a)
 Broadcast an expression in colwise dimmension.
 
template<bool Do_Calculate, typename T , require_all_kernel_expressions_t< T > * = nullptr, std::enable_if_t< Do_Calculate > * = nullptr>
calc_if_< true, as_operation_cl_t< T > > calc_if (T &&a)
 
template<bool Do_Calculate, typename T , std::enable_if_t<!Do_Calculate > * = nullptr>
calc_if_< false, scalar_< double > > calc_if (T &&a)
 
template<typename Scalar , typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
auto cast (T &&a)
 Typecast a kernel generator expression scalar.
 
template<typename Scalar , typename T , require_stan_scalar_t< T > * = nullptr>
Scalar cast (T a)
 Typecast a scalar.
 
template<typename T , typename = require_all_kernel_expressions_t<T>>
auto check_cl (const char *function, const char *var_name, T &&y, const char *must_be)
 Constructs a check on opencl matrix or expression.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto colwise_sum (T &&a)
 Column wise sum - reduction of a kernel generator expression.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto colwise_prod (T &&a)
 Column wise product - reduction of a kernel generator expression.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto colwise_max (T &&a)
 Column wise max - reduction of a kernel generator expression.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto colwise_min (T &&a)
 Column wise min - reduction of a kernel generator expression.
 
template<typename T1 , typename T2 , require_kernel_expression_lhs_t< T1 > * = nullptr, require_all_kernel_expressions_t< T2 > * = nullptr>
T1 operator+= (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_kernel_expression_lhs_t< T1 > * = nullptr, require_all_kernel_expressions_t< T2 > * = nullptr>
T1 operator-= (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_kernel_expression_lhs_t< T1 > * = nullptr, require_all_kernel_expressions_t< T2 > * = nullptr>
T1 operator*= (T1 &&a, T2 &&b)
 
template<typename T , typename = require_arithmetic_t<T>>
auto constant (const T a, int rows, int cols)
 Matrix of repeated values in kernel generator expressions.
 
template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
auto diagonal (T &&a)
 Diagonal of a kernel generator expression.
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
rsqrt_< as_operation_cl_t< T > > rsqrt (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
sqrt_< as_operation_cl_t< T > > sqrt (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
cbrt_< as_operation_cl_t< T > > cbrt (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
exp_< as_operation_cl_t< T > > exp (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
exp2_< as_operation_cl_t< T > > exp2 (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
expm1_< as_operation_cl_t< T > > expm1 (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
log_< as_operation_cl_t< T > > log (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
log2_< as_operation_cl_t< T > > log2 (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
log10_< as_operation_cl_t< T > > log10 (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
log1p_< as_operation_cl_t< T > > log1p (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
sin_< as_operation_cl_t< T > > sin (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
sinh_< as_operation_cl_t< T > > sinh (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
cos_< as_operation_cl_t< T > > cos (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
cosh_< as_operation_cl_t< T > > cosh (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
tan_< as_operation_cl_t< T > > tan (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
tanh_< as_operation_cl_t< T > > tanh (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
asin_< as_operation_cl_t< T > > asin (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
asinh_< as_operation_cl_t< T > > asinh (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
acos_< as_operation_cl_t< T > > acos (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
acosh_< as_operation_cl_t< T > > acosh (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
atan_< as_operation_cl_t< T > > atan (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
atanh_< as_operation_cl_t< T > > atanh (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
tgamma_< as_operation_cl_t< T > > tgamma (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
lgamma_< as_operation_cl_t< T > > lgamma (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
erf_< as_operation_cl_t< T > > erf (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
erfc_< as_operation_cl_t< T > > erfc (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
floor_< as_operation_cl_t< T > > floor (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
round_< as_operation_cl_t< T > > round (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
ceil_< as_operation_cl_t< T > > ceil (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
fabs_< as_operation_cl_t< T > > fabs (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
trunc_< as_operation_cl_t< T > > trunc (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
digamma_< as_operation_cl_t< T > > digamma (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
log1m_< as_operation_cl_t< T > > log1m (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
log_inv_logit_< as_operation_cl_t< T > > log_inv_logit (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
log1m_exp_< as_operation_cl_t< T > > log1m_exp (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
log1p_exp_< as_operation_cl_t< T > > log1p_exp (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
inv_square_< as_operation_cl_t< T > > inv_square (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
inv_logit_< as_operation_cl_t< T > > inv_logit (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
logit_< as_operation_cl_t< T > > logit (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
Phi_< as_operation_cl_t< T > > Phi (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
Phi_approx_< as_operation_cl_t< T > > Phi_approx (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
inv_Phi_< as_operation_cl_t< T > > inv_Phi (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
log1m_inv_logit_< as_operation_cl_t< T > > log1m_inv_logit (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
trigamma_< as_operation_cl_t< T > > trigamma (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
square_< as_operation_cl_t< T > > square (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
isfinite_< as_operation_cl_t< T > > isfinite (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
isinf_< as_operation_cl_t< T > > isinf (T &&a)
 
template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>>
isnan_< as_operation_cl_t< T > > isnan (T &&a)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
fdim_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > fdim (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
fmax_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > fmax (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
fmin_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > fmin (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
fmod_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > fmod (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
hypot_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > hypot (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
ldexp_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > ldexp (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
pow_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > pow (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
copysign_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > copysign (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
beta_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > beta (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
binomial_coefficient_log_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > binomial_coefficient_log (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
lbeta_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > lbeta (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
log_inv_logit_diff_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > log_inv_logit_diff (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
log_diff_exp_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > log_diff_exp (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
multiply_log_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > multiply_log (T1 &&a, T2 &&b)
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr>
lmultiply_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > lmultiply (T1 &&a, T2 &&b)
 
template<typename T , typename... Ptrs, require_all_kernel_expressions_t< T, Ptrs... > * = nullptr>
auto holder_cl (T &&a, Ptrs *... ptrs)
 Constructs a no-op operation that also holds pointer to some other expressions, allocated on heap.
 
template<typename T , typename... Args, require_all_kernel_expressions_t< decltype(std::declval< T >()(std::declval< Args & >()...)), Args... > * = nullptr>
auto make_holder_cl (const T &func, Args &&... args)
 Constructs an expression from given arguments using given functor.
 
template<typename T_mat , typename T_row_index , typename T_col_index , require_all_kernel_expressions_t< T_mat, T_row_index, T_col_index > * = nullptr>
auto indexing (T_mat &&mat, T_row_index &&row_index, T_col_index &&col_index)
 Index a kernel generator expression using two expressions for indices.
 
template<typename T_matrix , typename T_vector , typename = require_all_kernel_expressions_t<T_matrix, T_vector>>
auto matrix_vector_multiply (T_matrix &&matrix, T_vector &&vector)
 Multiplies a matrix and a vector on an OpenCL device.
 
template<typename... T_expressions>
expressions_cl< T_expressions... > expressions (T_expressions &&... expressions)
 Deduces types for constructing expressions_cl object.
 
template<typename... T_results>
results_cl< T_results... > results (T_results &&... results)
 Deduces types for constructing results_cl object.
 
template<const char * Code, typename... T_arguments, require_all_kernel_expressions_t< T_arguments... > * = nullptr>
auto opencl_code (std::tuple< typename std::pair< const char *, T_arguments >::first_type... > names, T_arguments &&... arguments)
 Custom code in kernel generator expressions.
 
std::ostream & operator<< (std::ostream &os, kernel_parts &parts)
 
template<bool Colwise, bool Rowwise, typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
optional_broadcast_< as_operation_cl_t< T >, Colwise, Rowwise > optional_broadcast (T &&a)
 Broadcast an expression in specified dimension(s) if the size along that dimension equals 1.
 
template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
auto rowwise_optional_broadcast (T &&a)
 Broadcast an expression in rowwise dimmension if the number of columns equals to 1.
 
template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
auto colwise_optional_broadcast (T &&a)
 Broadcast an expression in colwise dimmension if the number of rows equals to 1.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto sum_2d (T &&a)
 Two dimensional sum - reduction of a kernel generator expression.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto prod_2d (T &&a)
 Two dimensional product - reduction of a kernel generator expression.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto max_2d (T &&a)
 Two dimensional max - reduction of a kernel generator expression.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto min_2d (T &&a)
 Two dimensional min - reduction of a kernel generator expression.
 
template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
auto rowwise_sum (T &&a)
 Rowwise sum reduction of a kernel generator expression.
 
template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
auto rowwise_prod (T &&a)
 Rowwise product reduction of a kernel generator expression.
 
template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
auto rowwise_max (T &&a)
 Rowwise max reduction of a kernel generator expression.
 
template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>>
auto rowwise_min (T &&a)
 Min reduction of a kernel generator expression.
 
template<typename T_condition , typename T_then , typename T_else , require_all_kernel_expressions_t< T_condition, T_then, T_else > * = nullptr, require_any_not_arithmetic_t< T_condition, T_then, T_else > * = nullptr>
select_< as_operation_cl_t< T_condition >, as_operation_cl_t< T_then >, as_operation_cl_t< T_else > > select (T_condition &&condition, T_then &&then, T_else &&els)
 Selection operation on kernel generator expressions.
 
template<typename Arg , typename = require_all_kernel_expressions_and_none_scalar_t<Arg>>
auto transpose (Arg &&a)
 Transposes a kernel generator expression.
 
template<typename T >
std::string type_str ()
 Determines a string name of a type.
 
template<>
std::string type_str< double > ()
 
template<>
std::string type_str< int > ()
 
template<>
std::string type_str< char > ()
 
template<>
std::string type_str< bool > ()
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
logical_negation_< as_operation_cl_t< T > > operator! (T &&a)
 Logical negation of a kernel generator expression.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
unary_minus_< as_operation_cl_t< T > > operator- (T &&a)
 Unary minus of a kernel generator expression.
 
const matrix_cl_view either (const matrix_cl_view left_view, const matrix_cl_view right_view)
 Determines which parts are nonzero in any of the input views.
 
const matrix_cl_view both (const matrix_cl_view left_view, const matrix_cl_view right_view)
 Determines which parts are nonzero in both input views.
 
bool contains_nonzero (const matrix_cl_view view, const matrix_cl_view part)
 Check whether a view contains certain nonzero part.
 
const matrix_cl_view transpose (const matrix_cl_view view)
 Transposes a view - swaps lower and upper parts.
 
const matrix_cl_view invert (const matrix_cl_view view)
 Inverts a view.
 
matrix_cl_view from_eigen_uplo_type (Eigen::UpLoType eigen_type)
 Creates a view from Eigen::UpLoType.
 
int either (int left_view, int right_view)
 Determines which parts are nonzero in any of the input views.
 
int both (int left_view, int right_view)
 Determines which parts are nonzero in both input views.
 
bool contains_nonzero (int view, int part)
 Check whether a view contains certain nonzero part.
 
template<typename T , typename = require_arithmetic_t<T>>
matrix_cl< T > multiply_transpose (const matrix_cl< T > &A)
 Computes the product of a square OpenCL matrix with its transpose.
 
template<typename T_m , typename T_a , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr, require_all_kernel_expressions_t< T_a > * = nullptr>
auto add_diag (T_m &&mat, T_a &&to_add)
 Returns a Matrix with values added along the main diagonal.
 
template<typename T_x , typename T_y , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_x, T_y > * = nullptr>
auto append_array (T_x &&x, T_y &&y)
 Return the concatenation of two specified vectors in the order of the arguments.
 
template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > bernoulli_cdf (const T_n_cl &n, const T_prob_cl &theta)
 Returns the CDF of the Bernoulli distribution.
 
template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > bernoulli_lccdf (const T_n_cl &n, const T_prob_cl &theta)
 Returns the log CCDF of the Bernoulli distribution.
 
template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > bernoulli_lcdf (const T_n_cl &n, const T_prob_cl &theta)
 Returns the log CDF of the Bernoulli distribution.
 
template<bool propto, typename T_x_cl , typename T_y_cl , typename T_alpha_cl , typename T_beta_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_x_cl, T_alpha_cl, T_beta_cl > * = nullptr>
return_type_t< T_x_cl, T_alpha_cl, T_beta_cl > bernoulli_logit_glm_lpmf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta)
 Returns the log PMF of the Generalized Linear Model (GLM) with Bernoulli distribution and logit link function.
 
template<bool propto, typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > bernoulli_logit_lpmf (const T_n_cl &n, const T_prob_cl &theta)
 Returns the log PMF of the logit-parametrized Bernoulli distribution.
 
template<bool propto, typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > bernoulli_lpmf (const T_n_cl &n, const T_prob_cl &theta)
 Returns the log PMF of the Bernoulli distribution.
 
template<bool propto, typename T_n_cl , typename T_N_cl , typename T_size1_cl , typename T_size2_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_size1_cl, T_size2_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_size1_cl, T_size2_cl > * = nullptr>
return_type_t< T_n_cl, T_size1_cl, T_size2_cl > beta_binomial_lpmf (const T_n_cl &n, const T_N_cl N, const T_size1_cl &alpha, const T_size2_cl &beta)
 Returns the log PMF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters.
 
template<bool propto, typename T_y_cl , typename T_scale_succ_cl , typename T_scale_fail_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_succ_cl, T_scale_fail_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_succ_cl, T_scale_fail_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_succ_cl, T_scale_fail_cl > beta_lpdf (const T_y_cl &y, const T_scale_succ_cl &alpha, const T_scale_fail_cl &beta)
 The log of the beta density for the specified scalar(s) given the specified sample stan::math::size(s).
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_prec_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_prec_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_prec_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_prec_cl > beta_proportion_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_prec_cl &kappa)
 The log of the beta density for specified y, location, and precision: beta_proportion_lpdf(y | mu, kappa) = beta_lpdf(y | mu * kappa, (1 - mu) * kappa).
 
template<bool propto, typename T_n_cl , typename T_N_cl , typename T_x_cl , typename T_alpha_cl , typename T_beta_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_x_cl, T_alpha_cl, T_beta_cl > * = nullptr>
return_type_t< T_x_cl, T_alpha_cl, T_beta_cl > binomial_logit_glm_lpmf (const T_n_cl &n, const T_N_cl &N, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta)
 
template<bool propto, typename T_n_cl , typename T_N_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr, require_any_nonscalar_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > binomial_logit_lpmf (const T_n_cl &n, const T_N_cl N, const T_prob_cl &alpha)
 Binomial log PMF in logit parametrization.
 
template<bool propto, typename T_n_cl , typename T_N_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr, require_any_nonscalar_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > binomial_lpmf (const T_n_cl &n, const T_N_cl N, const T_prob_cl &theta)
 Returns the log PMF for the binomial distribution evaluated at the specified success, population size, and chance of success.
 
template<typename T_x , typename = require_all_kernel_expressions_and_none_scalar_t<T_x>>
auto block (T_x &&x, size_t i, size_t j, size_t nrows, size_t ncols)
 Return a nrows x ncols submatrix starting at (i-1, j-1).
 
template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta , require_all_prim_or_rev_kernel_expression_t< T_y, T_x, T_alpha, T_beta > * = nullptr>
return_type_t< T_x, T_alpha, T_beta > categorical_logit_glm_lpmf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta)
 Returns the log PMF of the Generalized Linear Model (GLM) with categorical distribution and logit (softmax) link function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > cauchy_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the cauchy cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > cauchy_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the cauchy log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > cauchy_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the cauchy cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > cauchy_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s).
 
template<bool propto, typename T_y_cl , typename T_dof_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl > * = nullptr>
return_type_t< T_y_cl, T_dof_cl > chi_square_lpdf (const T_y_cl &y, const T_dof_cl &nu)
 The log of a chi-squared density for y with the specified degrees of freedom parameter.
 
matrix_cl< double > cholesky_decompose (const matrix_cl< double > &A)
 Returns the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric matrix on the OpenCL device.
 
template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>>
auto col (T_x &&x, size_t j)
 Return the specified column of the specified kernel generator expression using start-at-1 indexing.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
int64_t cols (const T_x &x)
 Returns the number of columns in the specified kernel generator expression.
 
template<typename T_a , typename T_b , require_all_kernel_expressions_and_none_scalar_t< T_a, T_b > * = nullptr>
auto columns_dot_product (const T_a &a, const T_b &b)
 Returns the dot product of columns of the specified matrices.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
auto columns_dot_self (const T &a)
 Returns the dot product of each column of a matrix with itself.
 
template<typename T , typename L , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< L > * = nullptr>
auto lb_constrain (T &&x, L &&lb)
 Return the lower-bounded value for the specified unconstrained input and specified lower bound.
 
template<typename T , typename L , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< L > * = nullptr>
auto lb_constrain (const T &x, const L &lb, return_type_t< T, L > &lp)
 Return the lower-bounded value for the specified unconstrained input and specified lower bound.
 
template<typename T , typename L , typename U , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< L, U > * = nullptr>
matrix_cl< double > lub_constrain (const T &x, const L &lb, const U &ub)
 Return the lower and upper-bounded matrix derived by transforming the specified free matrix given the specified lower and upper bounds.
 
template<typename T , typename L , typename U , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< L, U > * = nullptr>
auto lub_constrain (const T &x, const L &lb, const U &ub, return_type_t< T, L, U > &lp)
 Return the lower and upper-bounded matrix derived by transforming the specified free matrix given the specified lower and upper bounds.
 
template<typename T , typename M , typename S , require_all_kernel_expressions_t< T, M, S > * = nullptr, require_any_not_stan_scalar_t< T, M, S > * = nullptr>
auto offset_multiplier_constrain (const T &x, const M &mu, const S &sigma)
 Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier.
 
template<typename T , typename M , typename S , require_all_kernel_expressions_t< T, M, S > * = nullptr, require_any_not_stan_scalar_t< T, M, S > * = nullptr>
auto offset_multiplier_constrain (const T &x, const M &mu, const S &sigma, double &lp)
 Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier.
 
template<typename T , typename U , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< U > * = nullptr>
auto ub_constrain (T &&x, U &&ub)
 Return the upper-bounded value for the specified unconstrained matrix and upper bound.
 
template<typename T , typename U , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< U > * = nullptr>
auto ub_constrain (const T &x, const U &ub, return_type_t< T, U > &lp)
 Return the upper-bounded value for the specified unconstrained matrix and upper bound.
 
template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr>
auto unit_vector_constrain (T_x &&x)
 Return the unit length vector corresponding to the given free vector.
 
template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr>
auto unit_vector_constrain (T_x &&x, double &lp)
 Return the unit length vector corresponding to the given free vector.
 
template<typename T_A , typename = require_all_kernel_expressions_and_none_scalar_t<T_A>>
matrix_cl< typename std::decay_t< T_A >::Scalar > crossprod (T_A &&A)
 Returns the result of pre-multiplying a matrix by its own transpose.
 
template<typename T_vec , require_all_kernel_expressions_and_none_scalar_t< T_vec > * = nullptr>
auto cumulative_sum (T_vec &&v)
 Return the cumulative sum of the specified vector.
 
template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr>
auto diag_matrix (T_x &&x)
 Return a square diagonal matrix with the specified vector of coefficients as the diagonal values.
 
template<typename T1 , typename T2 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr>
auto diag_post_multiply (const T1 &m1, const T2 &m2)
 Return the product of a matrix and the diagonal matrix formed from the vector or row_vector.
 
template<typename T1 , typename T2 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr>
auto diag_pre_multiply (const T1 &m1, const T2 &m2)
 Return the product of the diagonal matrix formed from the vector or row_vector and a matrix.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
void dims (const T_x &x, std::vector< int > &result)
 matrix_cl overload of the dims helper function in prim/fun/dims.hpp.
 
template<bool propto, typename T_prob_cl , typename T_prior_size_cl , require_all_prim_or_rev_kernel_expression_t< T_prob_cl, T_prior_size_cl > * = nullptr, require_any_not_stan_scalar_t< T_prob_cl, T_prior_size_cl > * = nullptr>
return_type_t< T_prob_cl, T_prior_size_cl > dirichlet_lpdf (const T_prob_cl &theta, const T_prior_size_cl &alpha)
 The log of the Dirichlet density for the given theta and a vector of prior sample sizes, alpha.
 
template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr>
auto distance (const T_a &a, const T_b &b)
 Returns the distance between the specified vectors.
 
template<typename T_a , typename = require_all_kernel_expressions_and_none_scalar_t<T_a>>
auto divide (T_a &&a, double d)
 Returns the elementwise division of the kernel generator expression.
 
template<typename T1 , typename T2 , typename = require_all_arithmetic_t<T1, T2>>
void divide_columns (matrix_cl< T1 > &A, const matrix_cl< T2 > &B)
 Divides each column of a matrix by a vector.
 
template<typename T1 , typename T2 , typename = require_all_arithmetic_t<T1, T2>>
void divide_columns (matrix_cl< T1 > &A, const T2 &divisor)
 Divides each column of a matrix by a scalar.
 
template<typename T_a , typename T_b , require_all_kernel_expressions_and_none_scalar_t< T_a, T_b > * = nullptr>
auto dot_product (const T_a &a, const T_b &b)
 Returns the dot product of the specified vectors.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
auto dot_self (const T &a)
 Returns squared norm of a vector or matrix.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > double_exponential_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the double exponential cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > double_exponential_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the double exponential log complementary cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > double_exponential_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the double exponential log cumulative density function.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > double_exponential_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the double exponential log probability density function.
 
matrix_cl< double > eigenvalues_sym (const matrix_cl< double > &m)
 
matrix_cl< double > eigenvectors_sym (const matrix_cl< double > &m)
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > exp_mod_normal_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda)
 Returns the double exponential cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > exp_mod_normal_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda)
 Returns the exp mod normal log complementary cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > exp_mod_normal_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda)
 Returns the exp mod normal log cumulative density function.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > exp_mod_normal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda)
 Returns the log PMF of the exp mod normal distribution.
 
template<typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_inv_scale_cl > exponential_cdf (const T_y_cl &y, const T_inv_scale_cl &beta)
 Calculates the exponential cumulative distribution function for the given y and beta.
 
template<typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_inv_scale_cl > exponential_lccdf (const T_y_cl &y, const T_inv_scale_cl &beta)
 Calculates the log exponential cumulative distribution function for the given y and beta.
 
template<typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_inv_scale_cl > exponential_lcdf (const T_y_cl &y, const T_inv_scale_cl &beta)
 Calculates the log exponential cumulative distribution function for the given y and beta.
 
template<bool propto, typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_inv_scale_cl > exponential_lpdf (const T_y_cl &y, const T_inv_scale_cl &beta)
 The log of an exponential density for y with the specified inverse scale parameter.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > frechet_cdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the frechet cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > frechet_lccdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the frechet log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > frechet_lcdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the frechet log cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > frechet_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 The log of the frechet density for the specified scalar(s) given the specified sample stan::math::size(s).
 
template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_inv_scale_cl > gamma_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_inv_scale_cl &beta)
 The log of a gamma density for y with the specified shape and inverse scale parameters.
 
template<typename T_x , typename T_sigma , require_all_prim_or_rev_kernel_expression_t< T_x > * = nullptr, require_stan_scalar_t< T_sigma > * = nullptr>
auto gp_dot_prod_cov (const T_x &x, const T_sigma sigma)
 Dot product kernel on the GPU.
 
template<typename T_x , typename T_y , typename T_sigma , require_all_prim_or_rev_kernel_expression_t< T_x, T_y > * = nullptr, require_stan_scalar_t< T_sigma > * = nullptr>
auto gp_dot_prod_cov (const T_x &x, const T_y &y, const T_sigma sigma)
 Dot product kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , typename = require_all_arithmetic_t<T1, T2, T3>>
matrix_cl< return_type_t< T1, T2, T3 > > gp_exp_quad_cov (const matrix_cl< T1 > &x, const T2 sigma, const T3 length_scale)
 Squared exponential kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename = require_all_arithmetic_t<T1, T2, T3, T4>>
matrix_cl< return_type_t< T1, T2, T3, T4 > > gp_exp_quad_cov (const matrix_cl< T1 > &x, const matrix_cl< T2 > &y, const T3 sigma, const T4 length_scale)
 Squared exponential kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , require_all_kernel_expressions_and_none_scalar_t< T1 > * = nullptr, require_all_arithmetic_t< T2, T3 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3 > > gp_exponential_cov (const T1 &x, const T2 sigma, const T3 length_scale)
 Matern exponential kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , typename T4 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr, require_all_arithmetic_t< T3, T4 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3, T4 > > gp_exponential_cov (const T1 &x, const T2 &y, const T3 sigma, const T4 length_scale)
 Matern exponential kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , require_all_kernel_expressions_and_none_scalar_t< T1 > * = nullptr, require_all_arithmetic_t< T2, T3 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3 > > gp_matern32_cov (const T1 &x, const T2 sigma, const T3 length_scale)
 Matern 3/2 kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , typename T4 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr, require_all_arithmetic_t< T3, T4 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3, T4 > > gp_matern32_cov (const T1 &x, const T2 &y, const T3 sigma, const T4 length_scale)
 Matern 3/2 kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , require_all_kernel_expressions_and_none_scalar_t< T1 > * = nullptr, require_all_arithmetic_t< T2, T3 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3 > > gp_matern52_cov (const T1 &x, const T2 sigma, const T3 length_scale)
 Matern 5/2 kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , typename T4 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr, require_all_arithmetic_t< T3, T4 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3, T4 > > gp_matern52_cov (const T1 &x, const T2 &y, const T3 sigma, const T4 length_scale)
 Matern 5/2 kernel on the GPU.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > gumbel_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta)
 Returns the gumbel cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > gumbel_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta)
 Returns the Gumbel log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > gumbel_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta)
 Returns the Gumbel log complementary cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > gumbel_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta)
 Returns the Gumbel log probability density for the given location and scale.
 
template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>>
auto head (T_x &&x, size_t n)
 Return the specified number of elements as a vector or row vector (same as input) from the front of the specified vector or row vector.
 
template<typename T_x , require_matrix_cl_t< T_x > * = nullptr>
auto identity_matrix (int K)
 Return a square identity matrix.
 
template<typename T_x , typename = require_all_kernel_expressions_and_none_scalar_t<T_x>>
auto inv (T_x &&x)
 Return the elementwise 1.0 / x of the specified argument, which may be a scalar or any Stan container of numeric scalars.
 
template<bool propto, typename T_y_cl , typename T_dof_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl > * = nullptr>
return_type_t< T_y_cl, T_dof_cl > inv_chi_square_lpdf (const T_y_cl &y, const T_dof_cl &nu)
 The log of an inverse chi-squared density for y with the specified degrees of freedom parameter.
 
template<typename T_x , typename = require_all_kernel_expressions_and_none_scalar_t<T_x>>
auto inv_cloglog (T_x &&x)
 The inverse complementary log-log function.
 
template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > inv_gamma_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &beta)
 The log of an inverse gamma density for y with the specified shape and scale parameters.
 
template<typename T_x , typename = require_all_kernel_expressions_and_none_scalar_t<T_x>>
auto inv_sqrt (T_x &&x)
 Return the elementwise 1 / sqrt(x) of the specified kernel generator expression.
 
template<typename T_theta_cl , typename T_lambda_cl , require_all_prim_or_rev_kernel_expression_t< T_theta_cl, T_lambda_cl > * = nullptr>
auto log_mix (const T_theta_cl &theta, const T_lambda_cl &lambda)
 Return the log mixture density with specified mixing proportions and log densities.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
matrix_cl< double > log_softmax (const T &a)
 Return log of the softmax of the specified vector.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
double log_sum_exp (const T &a)
 Return the log of the sum of the exponentiated values of the specified matrix of values.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > logistic_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the logistic cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > logistic_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the logistic cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > logistic_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the logistic cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > logistic_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 The log of a logistic density for y with the specified location and scale parameters.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > lognormal_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the loghormal cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > lognormal_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the lognormal log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > lognormal_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the lognormal log cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > lognormal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 The log of the lognormal density for the specified scalar(s) given the specified sample stan::math::size(s).
 
template<typename T_m , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr>
plain_type_t< T_m > matrix_power (T_m &&M, const int n)
 Returns the nth power of the specific matrix.
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr>
matrix_cl< double > mdivide_left_tri_low (const T1 &A, const T2 &b)
 Returns the solution of the system Ax=b when A is lower triangular.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
matrix_cl< double > mdivide_left_tri_low (const T &A)
 Returns the solution of the system Ax=b when A is triangular and b=I.
 
template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr>
matrix_cl< double > mdivide_right_tri_low (const T2 &b, const T1 &A)
 Returns the solution of the system Ax=b where A is a lower triangular matrix.
 
template<typename T , require_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr>
scalar_type_t< T > mean (const T &m)
 Returns the sample mean (i.e., average) of the coefficients in the specified std vector, vector, row vector, or matrix.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_covar_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_covar_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_covar_cl > multi_normal_cholesky_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_covar_cl &L)
 The log of the multivariate normal density for the given y, mu, and a Cholesky factor L of the variance matrix.
 
template<typename T1 , typename T2 , typename = require_all_kernel_expressions_and_none_scalar_t<T1, T2>>
matrix_cl< return_type_t< T1, T2 > > multiply (const T1 &A, const T2 &B)
 Computes the product of the specified matrices with the option of specifying the triangularity of either input matrices.
 
template<typename T_a , typename T_b , typename = require_all_kernel_expressions_and_none_scalar_t<T_a, T_b>>
matrix_cl< return_type_t< T_a, T_b > > operator* (const T_a &a, const T_b &b)
 Matrix multiplication of two kernel generator expressions.
 
template<typename T_a , typename T_b , require_stan_scalar_t< T_a > * = nullptr, require_all_kernel_expressions_and_none_scalar_t< T_b > * = nullptr, require_all_not_var_t< T_a, T_b > * = nullptr>
matrix_cl< return_type_t< T_a, T_b > > multiply (const T_a &a, const T_b &b)
 Matrix multiplication of a scalar and a kernel generator expressions.
 
template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr>
auto multiply_lower_tri_self_transpose (T_x &&x)
 Returns the result of multiplying the lower triangular portion of the input matrix by its own transpose.
 
template<bool propto, typename T_y_cl , typename T_x_cl , typename T_alpha_cl , typename T_beta_cl , typename T_phi_cl , require_all_prim_or_rev_kernel_expression_t< T_x_cl, T_y_cl, T_alpha_cl, T_beta_cl, T_phi_cl > * = nullptr>
return_type_t< T_x_cl, T_alpha_cl, T_beta_cl, T_phi_cl > neg_binomial_2_log_glm_lpmf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta, const T_phi_cl &phi)
 Returns the log PMF of the Generalized Linear Model (GLM) with Negative-Binomial-2 distribution and log link function.
 
template<bool propto, typename T_n_cl , typename T_log_location_cl , typename T_precision_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_log_location_cl, T_precision_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_log_location_cl, T_precision_cl > * = nullptr>
return_type_t< T_n_cl, T_log_location_cl, T_precision_cl > neg_binomial_2_log_lpmf (const T_n_cl &n, const T_log_location_cl &eta, const T_precision_cl &phi)
 The log of the log transformed negative binomial density for the specified scalars given the specified mean(s) and deviation(s).
 
template<bool propto, typename T_n_cl , typename T_location_cl , typename T_precision_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_location_cl, T_precision_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_location_cl, T_precision_cl > * = nullptr>
return_type_t< T_n_cl, T_location_cl, T_precision_cl > neg_binomial_2_lpmf (const T_n_cl &n, const T_location_cl &mu, const T_precision_cl &phi)
 The log of the negative binomial density for the specified scalars given the specified mean(s) and deviation(s).
 
template<bool propto, typename T_n_cl , typename T_shape_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_shape_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_shape_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_n_cl, T_shape_cl, T_inv_scale_cl > neg_binomial_lpmf (const T_n_cl &n, const T_shape_cl &alpha, const T_inv_scale_cl &beta)
 The log of the negative binomial density for the specified scalars given the specified mean(s) and deviation(s).
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > normal_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the normal cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_x_cl , typename T_alpha_cl , typename T_beta_cl , typename T_sigma_cl , require_all_prim_or_rev_kernel_expression_t< T_x_cl, T_y_cl, T_alpha_cl, T_beta_cl, T_sigma_cl > * = nullptr>
return_type_t< T_y_cl, T_x_cl, T_alpha_cl, T_beta_cl, T_sigma_cl > normal_id_glm_lpdf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta, const T_sigma_cl &sigma)
 Returns the log PDF of the Generalized Linear Model (GLM) with Normal distribution and id link function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > normal_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the normal log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > normal_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the normal log complementary cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > normal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s).
 
template<typename T , require_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr>
int64_t num_elements (const T &m)
 Returns the number of the elements of a matrix_cl or var_value<matrix_cl<T>>.
 
template<bool propto, typename T_y , typename T_x , typename T_beta , typename T_cuts , require_all_prim_or_rev_kernel_expression_t< T_y, T_x, T_beta, T_cuts > * = nullptr>
return_type_t< T_x, T_beta, T_cuts > ordered_logistic_glm_lpmf (const T_y &y, const T_x &x, const T_beta &beta, const T_cuts &cuts)
 Returns the log PMF of the ordinal regression Generalized Linear Model (GLM).
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_cuts_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_cuts_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_cuts_cl > ordered_logistic_lpmf (const T_y_cl &y, const T_loc_cl &lambda, const T_cuts_cl &cuts)
 Returns the (natural) log probability of the specified array of integers given the vector of continuous locations and specified cutpoints in an ordered logistic model.
 
template<typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl, T_shape_cl > pareto_cdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha)
 Returns the Pareto cumulative density function.
 
template<typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl, T_shape_cl > pareto_lccdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha)
 Returns the Pareto cumulative density function.
 
template<typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl, T_shape_cl > pareto_lcdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha)
 Returns the Pareto cumulative density function.
 
template<bool propto, typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl, T_shape_cl > pareto_lpdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha)
 The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s).
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > pareto_type_2_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha)
 Returns the pareto type 2 cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > pareto_type_2_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha)
 Returns the pareto type 2 log complementaty cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > pareto_type_2_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha)
 Returns the pareto type 2 log cumulative density function.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > pareto_type_2_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha)
 Returns the log PMF of the Pareto type 2 distribution.
 
template<bool propto, typename T_y_cl , typename T_x_cl , typename T_alpha_cl , typename T_beta_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_x_cl, T_alpha_cl, T_beta_cl > * = nullptr>
return_type_t< T_x_cl, T_alpha_cl, T_beta_cl > poisson_log_glm_lpmf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta)
 Returns the log PMF of the Generalized Linear Model (GLM) with Poisson distribution and log link function.
 
template<bool propto, typename T_n_cl , typename T_log_rate_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_log_rate_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_log_rate_cl > * = nullptr>
return_type_t< T_log_rate_cl > poisson_log_lpmf (const T_n_cl &n, const T_log_rate_cl &alpha)
 Returns the log PMF of the Poisson log distribution.
 
template<bool propto, typename T_n_cl , typename T_rate_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_rate_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_rate_cl > * = nullptr>
return_type_t< T_rate_cl > poisson_lpmf (const T_n_cl &n, const T_rate_cl &lambda)
 Returns the log PMF of the Poisson distribution.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
value_type_t< T > prod (const T &m)
 Calculates product of given kernel generator expression elements.
 
template<typename T_m , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr>
matrix_cl< double > qr_Q (T_m &&m)
 Returns the orthogonal factor of the fat QR decomposition.
 
template<typename T_m , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr>
matrix_cl< double > qr_R (T_m &&m)
 Returns the orthogonal factor of the fat QR decomposition.
 
template<typename T_m , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr>
matrix_cl< double > qr_thin_Q (T_m &&m)
 Returns the orthogonal factor of the fat QR decomposition.
 
template<typename T_m , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr>
matrix_cl< double > qr_thin_R (T_m &&m)
 Returns the orthogonal factor of the thin QR decomposition.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
int rank (const T &v, int s)
 Return the number of components of v less than v[s].
 
template<typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl > rayleigh_cdf (const T_y_cl &y, const T_scale_cl &sigma)
 Returns the Rayleigh cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl > rayleigh_lccdf (const T_y_cl &y, const T_scale_cl &sigma)
 Returns the Rayleigh log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl > rayleigh_lcdf (const T_y_cl &y, const T_scale_cl &sigma)
 Returns the Rayleigh log cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl > rayleigh_lpdf (const T_y_cl &y, const T_scale_cl &sigma)
 The log of an Rayleigh density for y with the specified scale parameter.
 
template<typename T , require_any_t< is_matrix_cl< T >, math::conjunction< is_var< T >, is_matrix_cl< value_type_t< T > > > > * = nullptr>
auto rep_array (const scalar_type_t< T > &x, int n)
 Creates a matrix_cl representing an array by replicating the input value.
 
template<typename T , require_matrix_cl_t< T > * = nullptr>
auto rep_matrix (const value_type_t< T > &x, int n, int m)
 Creates a matrix_cl by replicating the given value of arithmetic type.
 
template<typename T , require_arithmetic_t< T > * = nullptr>
auto rep_matrix (const matrix_cl< T > &x, int m)
 Creates a matrix_cl by replicating the input vector or row_vector.
 
template<typename T , require_any_t< is_matrix_cl< T >, math::conjunction< is_var< T >, is_matrix_cl< value_type_t< T > > > > * = nullptr>
auto rep_row_vector (const scalar_type_t< T > &x, int n)
 Creates a matrix_cl representing a row vector by replicating the input value.
 
template<typename T , require_any_t< is_matrix_cl< T >, math::conjunction< is_var< T >, is_matrix_cl< value_type_t< T > > > > * = nullptr>
auto rep_vector (const scalar_type_t< T > &x, int n)
 Creates a matrix_cl representing a vector by replicating the input value.
 
template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr>
auto reverse (T_x &&x)
 Return reversed view into the specified vector or row vector.
 
template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>>
auto row (T_x &&x, size_t j)
 Return the specified row of the specified kernel generator expression using start-at-1 indexing.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
int64_t rows (const T_x &x)
 Returns the number of rows in the specified kernel generator expression.
 
template<typename T_a , typename T_b , require_all_kernel_expressions_and_none_scalar_t< T_a, T_b > * = nullptr>
auto rows_dot_product (T_a &&a, T_b &&b)
 Returns the dot product of rows of the specified matrices.
 
template<typename T_a , require_all_kernel_expressions_and_none_scalar_t< T_a > * = nullptr>
auto rows_dot_self (T_a &&a)
 Returns the dot product of each row of a matrix with itself.
 
template<bool propto, typename T_y_cl , typename T_dof_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_dof_cl, T_scale_cl > scaled_inv_chi_square_lpdf (const T_y_cl &y, const T_dof_cl &nu, const T_scale_cl &s)
 The log of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
double sd (const T &a)
 Returns the unbiased sample standard deviation of the coefficients in the specified std vector, column vector, row vector, or matrix.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
auto segment (T_x &&x, size_t i, size_t n)
 Return the specified number of elements as a row/column vector starting from the specified element - 1 of the specified row/column vector.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
auto sign (const T &x)
 Returns signs of the arguments.
 
template<typename T , require_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr>
int64_t size (const T &m)
 Returns the size (number of the elements) of a matrix_cl or var_value<matrix_cl<T>>.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > skew_double_exponential_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau)
 Returns the skew double exponential cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > skew_double_exponential_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau)
 Returns the skew double exponential cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > skew_double_exponential_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau)
 Returns the skew double exponential cumulative density function.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > skew_double_exponential_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau)
 Returns the log PMF of the skew double exponential distribution.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > skew_normal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_shape_cl &alpha)
 The log of the skew normal density for the specified scalar(s) given the specified mean(s), deviation(s) and shape(s).
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
matrix_cl< double > softmax (const T &a)
 Return the softmax of the specified vector.
 
template<typename T , require_all_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr>
auto sort_asc (T &&input)
 Sort the (row)vector in ascending order.
 
template<typename T , require_all_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr>
auto sort_desc (T &&input)
 Sort the (row)vector in ascending order.
 
template<typename T_a , typename T_b , require_all_kernel_expressions_and_none_scalar_t< T_a, T_b > * = nullptr>
auto squared_distance (const T_a &a, const T_b &b)
 Returns the squared distance.
 
template<typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr>
return_type_t< T_y_cl > std_normal_cdf (const T_y_cl &y)
 Returns the standard normal cumulative distribution function.
 
template<typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr>
return_type_t< T_y_cl > std_normal_lccdf (const T_y_cl &y)
 Returns the log standard normal complementary cumulative distribution function.
 
template<typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr>
return_type_t< T_y_cl > std_normal_lcdf (const T_y_cl &y)
 Returns the log standard normal complementary cumulative distribution function.
 
template<bool propto, typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr>
return_type_t< T_y_cl > std_normal_lpdf (const T_y_cl &y)
 The log of the normal density for the specified scalar(s) given a location of 0 and a scale of 1.
 
template<bool propto, typename T_y_cl , typename T_dof_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_dof_cl, T_loc_cl, T_scale_cl > student_t_lpdf (const T_y_cl &y, const T_dof_cl &nu, const T_loc_cl &mu, const T_scale_cl &sigma)
 The log of the Student-t density for the given y, nu, mean, and scale parameter.
 
template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>>
auto sub_col (T_x &&x, size_t i, size_t j, size_t nrows)
 Return a 1 x ncols subrow starting at (i-1, j-1).
 
template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>>
auto sub_row (T_x &&x, size_t i, size_t j, size_t ncols)
 Return a 1 x ncols subrow starting at (i-1, j-1).
 
template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr>
auto symmetrize_from_lower_tri (T_x &&x)
 Return a symmetric matrix using elements from the upper triangular part of the input matrix.
 
template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr>
auto symmetrize_from_upper_tri (T_x &&x)
 Return a symmetric matrix using elements from the lower triangular part of the input matrix.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
auto tail (T_x &&x, size_t n)
 Return the specified number of elements as a vector or row vector (same as input) from the back of the specified vector or row vector.
 
template<typename T_A , typename = require_all_kernel_expressions_and_none_scalar_t<T_A>>
matrix_cl< typename std::decay_t< T_A >::Scalar > tcrossprod (T_A &&A)
 Returns the result of post-multiplying a matrix by its own transpose.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
auto to_array_1d (T_x &&x)
 Returns input matrix reshaped into a vector.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
T_x to_array_2d (T_x &&x)
 Returns input matrix converted into a nested std vector.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
T_x to_matrix (T_x &&x)
 Returns input matrix.
 
template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr>
matrix_cl< return_type_t< T_x > > to_matrix (const T_x &x, int m, int n)
 Returns a matrix representation of a vector or matrix in column-major order with the specified number of rows and columns.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
auto to_matrix (const T_x &x, int m, int n, bool col_major) -> decltype(to_matrix(x, m, n))
 Returns a matrix representation of the vector or matrix in column-major or row major order with the specified number of rows and columns.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
auto to_row_vector (T_x &&x)
 Returns input matrix reshaped into a row vector.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
auto to_vector (T_x &&x)
 Returns input matrix reshaped into a vector.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
value_type_t< T > trace (const T &m)
 Calculates trace (sum of diagonal) of given kernel generator expression.
 
template<typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr>
return_type_t< T_y_cl, T_low_cl, T_high_cl > uniform_cdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta)
 Returns the uniform cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr>
return_type_t< T_y_cl, T_low_cl, T_high_cl > uniform_lccdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta)
 Returns the log uniform complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr>
return_type_t< T_y_cl, T_low_cl, T_high_cl > uniform_lcdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta)
 Returns the log uniform cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr>
return_type_t< T_y_cl, T_low_cl, T_high_cl > uniform_lpdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta)
 The log of a uniform density for the given y, lower, and upper bound.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
double variance (const T &a)
 Return the sample variance of the var_value matrix Raise domain error if size is not greater than zero.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > weibull_cdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the weibull cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > weibull_lccdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the weibull log cumulative complementary distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > weibull_lcdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the weibull log cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > weibull_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the Weibull log probability density for the given location and scale.
 
template<bool need_Q = true>
void qr_decomposition_cl (const matrix_cl< double > &A, matrix_cl< double > &Q, matrix_cl< double > &R, int r=100)
 Calculates QR decomposition of A using the block Householder algorithm.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > acos (const var_value< T > &A)
 Returns the elementwise acos() of a var_value<matrix_cl<double>> in radians.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > acosh (const var_value< T > &A)
 Returns the elementwise acosh() of a var_value<matrix_cl<double>> in radians.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
auto add (T_a &&a, T_b &&b)
 Addition of two reverse mode matrices and/or kernel generator expressions.
 
template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr>
auto operator+ (const T_a &a, const T_b &b)
 Addition of two reverse mode matrices and/or kernel generator expressions.
 
template<typename T_m , typename T_a , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_m > * = nullptr, require_all_prim_or_rev_kernel_expression_t< T_a > * = nullptr, require_any_var_t< T_m, T_a > * = nullptr>
auto add_diag (const T_m &mat, const T_a &to_add)
 Returns a Matrix with values added along the main diagonal.
 
template<typename... T_results>
adjoint_results_cl< T_results... > adjoint_results (T_results &&... results)
 Deduces types for constructing adjoint_results_cl object.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > append_col (T_a &&a, T_b &&b)
 Return the result of appending the second argument matrix after the first argument matrix, that is, putting them side by side, with the first matrix followed by the second matrix.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > append_row (T_a &&a, T_b &&b)
 Return the result of stacking the rows of the first argument matrix on top of the second argument matrix.
 
template<typename T , require_all_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_any_var_t< T > * = nullptr>
auto as_column_vector_or_scalar (const T &m)
 Converts kernel generator expression row or column vector to a column vector.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > asin (const var_value< T > &A)
 Returns the elementwise asin() of a var_value<matrix_cl<double>> in radians.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > asinh (const var_value< T > &A)
 Returns the elementwise asinh() of a var_value<matrix_cl<double>> in radians.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > atan (const var_value< T > &A)
 Returns the elementwise atan() of a var_value<matrix_cl<double>> in radians.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > atanh (const var_value< T > &A)
 Returns the elementwise atanh() of a var_value<matrix_cl<double>> in radians.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
auto beta (T_a &&a, T_b &&b)
 Return the elementwise beta() on two input kernel generator expression.
 
template<typename T , require_all_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_any_var_t< T > * = nullptr>
auto block (const T &m, size_t i, size_t j, size_t nrows, size_t ncols)
 Return a nrows x ncols submatrix starting at (i-1, j-1).
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > cbrt (const var_value< T > &A)
 Returns the elementwise cbrt() of the input var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > ceil (const var_value< T > &A)
 Returns the elementwise ceil() of the specified variable.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > cholesky_decompose (const var_value< T > &A)
 Returns the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric reverse mode matrix on the OpenCL device.
 
template<typename T1 , typename T2 , require_any_var_t< T1, T2 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr>
var_value< matrix_cl< double > > columns_dot_product (T1 &&v1, T2 &&v2)
 Returns the dot product of columns of the specified matrices.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > columns_dot_self (const var_value< T > &v)
 Returns the dot product of each column of a matrix with itself.
 
template<typename T_x , typename T_lb , require_all_prim_or_rev_kernel_expression_t< T_x, T_lb > * = nullptr, require_any_var_t< T_x, T_lb > * = nullptr, require_any_not_stan_scalar_t< T_x, T_lb > * = nullptr>
var_value< matrix_cl< double > > lb_constrain (T_x &&x, T_lb &&lb)
 Return the lower-bounded value for the specified unconstrained input and specified lower bound.
 
template<typename T_x , typename T_lb , require_all_prim_or_rev_kernel_expression_t< T_x, T_lb > * = nullptr, require_any_var_t< T_x, T_lb > * = nullptr, require_any_not_stan_scalar_t< T_x, T_lb > * = nullptr>
var_value< matrix_cl< double > > lb_constrain (T_x &&x, T_lb &&lb, var &lp)
 Return the lower-bounded value for the specified unconstrained input and specified lower bound.
 
template<typename T_x , typename T_lb , typename T_ub , require_all_prim_or_rev_kernel_expression_t< T_x, T_lb, T_ub > * = nullptr, require_any_var_t< T_x, T_lb, T_ub > * = nullptr, require_any_not_stan_scalar_t< T_x, T_lb, T_ub > * = nullptr>
var_value< matrix_cl< double > > lub_constrain (T_x &&x, T_lb &&lb, T_ub &&ub)
 Return the bounded value for the specified unconstrained input and specified bounds.
 
template<typename T_x , typename T_lb , typename T_ub , require_all_prim_or_rev_kernel_expression_t< T_x, T_lb, T_ub > * = nullptr, require_any_var_t< T_x, T_lb, T_ub > * = nullptr, require_any_not_stan_scalar_t< T_x, T_lb, T_ub > * = nullptr>
var_value< matrix_cl< double > > lub_constrain (T_x &&x, T_lb &&lb, T_ub &&ub, var &lp)
 Return the bounded value for the specified unconstrained input and specified bounds.
 
template<typename T , typename M , typename S , require_all_prim_or_rev_kernel_expression_t< T, M, S > * = nullptr, require_any_not_stan_scalar_t< T, M, S > * = nullptr, require_any_var_t< T, M, S > * = nullptr>
var_value< matrix_cl< double > > offset_multiplier_constrain (T &&A, M &&mu, S &&sigma)
 Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier.
 
template<typename T , typename M , typename S , require_all_prim_or_rev_kernel_expression_t< T, M, S > * = nullptr, require_any_not_stan_scalar_t< T, M, S > * = nullptr, require_any_var_t< T, M, S > * = nullptr>
var_value< matrix_cl< double > > offset_multiplier_constrain (T &&A, M &&mu, S &&sigma, var &lp)
 Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier.
 
template<typename T_x , typename T_ub , require_all_prim_or_rev_kernel_expression_t< T_x, T_ub > * = nullptr, require_any_var_t< T_x, T_ub > * = nullptr, require_any_not_stan_scalar_t< T_x, T_ub > * = nullptr>
var_value< matrix_cl< double > > ub_constrain (T_x &&x, T_ub &&ub)
 Return the upper-bounded value for the specified unconstrained input and specified upper bound.
 
template<typename T_x , typename T_ub , require_all_prim_or_rev_kernel_expression_t< T_x, T_ub > * = nullptr, require_any_var_t< T_x, T_ub > * = nullptr, require_any_not_stan_scalar_t< T_x, T_ub > * = nullptr>
var_value< matrix_cl< double > > ub_constrain (T_x &&x, T_ub &&ub, var &lp)
 Return the upper-bounded value for the specified unconstrained input and specified upper bound.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > unit_vector_constrain (const var_value< T > &A)
 Return the unit length vector corresponding to the free vector y.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > unit_vector_constrain (const var_value< T > &A, var &lp)
 Return the unit length vector corresponding to the free vector y.
 
template<typename T >
var_value< matrix_cl< value_type_t< T > > > to_matrix_cl (const var_value< T > &a)
 Copies the source var containing Eigen matrices to destination var that has data stored on the OpenCL device.
 
template<typename T , require_stan_scalar_t< T > * = nullptr>
var_value< matrix_cl< value_type_t< T > > > to_matrix_cl (const std::vector< var_value< T > > &a)
 Copies the source std::vector of vars to a destination var that has data stored on the OpenCL device.
 
template<typename T , require_eigen_vt< is_var, T > * = nullptr>
var_value< matrix_cl< value_type_t< value_type_t< T > > > > to_matrix_cl (const T &src)
 Copies the source Eigen matrix of vars to the destination matrix that is stored on the OpenCL device.
 
template<typename T , require_eigen_vt< is_var, T > * = nullptr>
var_value< matrix_cl< value_type_t< value_type_t< T > > > > to_matrix_cl (const std::vector< T > &src)
 Copies the source vector of Eigen matrices of vars to the destination matrix that is stored on the OpenCL device.
 
template<typename T_dst , typename T , require_var_vt< is_eigen, T_dst > * = nullptr, require_all_kernel_expressions_t< T > * = nullptr>
T_dst from_matrix_cl (const var_value< T > &a)
 Copies the source var that has data stored on the OpenCL device to destination var containing Eigen matrix.
 
template<typename T_dst , typename T , require_std_vector_vt< is_var, T_dst > * = nullptr, require_all_stan_scalar_t< value_type_t< T_dst > > * = nullptr, require_all_kernel_expressions_t< T > * = nullptr>
T_dst from_matrix_cl (const var_value< T > &a)
 Copies the source var that has data stored on the OpenCL device to destination std::vector containing vars.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto from_matrix_cl (const var_value< T > &src)
 Copies the source var that has data stored on the OpenCL device to destination Eigen matrix containing vars.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > cos (const var_value< T > &A)
 Returns the elementwise cos() of a var_value<matrix_cl<double>> in radians.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > cosh (const var_value< T > &A)
 Returns the elementwise cosh() of a var_value<matrix_cl<double>> in radians.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > crossprod (const var_value< T > &M)
 Returns the result of pre-multiplying a matrix by its own transpose.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > cumulative_sum (const var_value< T > &A)
 Return the cumulative sum of the specified vector.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > diag_matrix (const var_value< T > &v)
 Return a square diagonal matrix with the specified vector of coefficients as the diagonal values.
 
template<typename T1 , typename T2 , require_any_var_t< T1, T2 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr>
var_value< matrix_cl< double > > diag_post_multiply (T1 &&v1, T2 &&v2)
 Return the product of a matrix and the diagonal matrix formed from the vector or row_vector.
 
template<typename T1 , typename T2 , require_any_var_t< T1, T2 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr>
var_value< matrix_cl< double > > diag_pre_multiply (T1 &&v1, T2 &&v2)
 Return the product of the diagonal matrix formed from the vector or row_vector and a matrix.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > diagonal (const var_value< T > &M)
 Return a column vector of the diagonal elements of the specified matrix.
 
var_value< matrix_cl< double > > digamma (const var_value< matrix_cl< double > > &A)
 Returns the elementwise digamma() of a var_value<matrix_cl<double>>.
 
template<typename T_a , typename T_b , require_stan_scalar_t< T_b > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > divide (T_a &&a, T_b &&b)
 Elementwise division of a kernel generator expression and a scalar.
 
template<typename T1 , typename T2 , require_any_var_t< T1, T2 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr>
var dot_product (T1 &&v1, T2 &&v2)
 Returns the dot product.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var dot_self (const var_value< T > &v)
 Returns the dot product of a vector of var with itself.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > elt_divide (T_a &&a, T_b &&b)
 Elementwise division of two reverse mode matrices and/or kernel generator expressions.
 
template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > elt_multiply (T_a &&a, T_b &&b)
 Elementwise multiplication of two reverse mode matrices and/or kernel generator expressions.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > erf (const var_value< T > &A)
 Returns the elementwise erf() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > erfc (const var_value< T > &A)
 Returns the elementwise erfc() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > exp (const var_value< T > &A)
 Returns the elementwise exp() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > exp2 (const var_value< T > &A)
 Returns the elementwise exp2() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > expm1 (const var_value< T > &A)
 Returns the elementwise expm1() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > fabs (const var_value< T > &A)
 Returns the elementwise fabs() of the input var_value<matrix_cl<double>>.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > fdim (T_a &&a, T_b &&b)
 Return the positive difference between the first variable's the value and the second's (C99, C++11).
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > floor (const var_value< T > &A)
 Returns the elementwise floor() of the input var_value<matrix_cl<double>>.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > fmax (T_a &&a, T_b &&b)
 Return the greater of the two specified arguments.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > fmin (T_a &&a, T_b &&b)
 Return the lesser of the two specified arguments.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > fmod (T_a &&a, T_b &&b)
 Return the floating point remainder after dividing the first variable by the second (cmath).
 
void grad (var &v, var_value< matrix_cl< double > > &x, Eigen::VectorXd &g)
 Propagate chain rule to calculate gradients starting from the specified variable.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > hypot (T_a &&a, T_b &&b)
 Returns the elementwise hypot() of the input.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > inv (const var_value< T > &A)
 Returns the elementwise inv() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > inv_cloglog (const var_value< T > &A)
 Returns the elementwise inv_cloglog() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > inv_logit (const var_value< T > &A)
 Returns the elementwise inv_logit() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > inv_Phi (const var_value< T > &A)
 Returns the elementwise inv_Phi() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > inv_sqrt (const var_value< T > &A)
 Returns the elementwise inv_sqrt() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > inv_square (const var_value< T > &A)
 Returns the elementwise inv_square() of a var_value<matrix_cl<double>>.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
auto lbeta (T_a &&a, T_b &&b)
 Return the elementwise lbeta() on two input kernel generator expression.
 
template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_st_integral< T_b > * = nullptr>
var_value< matrix_cl< double > > ldexp (const var_value< T_a > &a, T_b &&b)
 Returns the elementwise ldexp() of the input var_value<matrix_cl<double>> and kernel generator expression.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > lgamma (const var_value< T > &A)
 Returns the elementwise lgamma() of a var_value<matrix_cl<double>>.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > lmultiply (T_a &&a, T_b &&b)
 Returns the elementwise lmultiply() of the input.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > log (const var_value< T > &A)
 Returns the elementwise log() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > log10 (const var_value< T > &A)
 Returns the elementwise log10() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > log1m (const var_value< T > &A)
 Returns the elementwise log1m() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > log1m_exp (const var_value< T > &A)
 Returns the elementwise log1m_exp() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > log1m_inv_logit (const var_value< T > &A)
 Returns the elementwise log1m_inv_logit() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > log1p (const var_value< T > &A)
 Returns the elementwise log1p() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > log1p_exp (const var_value< T > &A)
 Returns the elementwise log1p_exp() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > log2 (const var_value< T > &A)
 Returns the elementwise log2() of a var_value<matrix_cl<double>>.
 
template<typename T_x , typename T_y , require_all_prim_or_rev_kernel_expression_t< T_x, T_y > * = nullptr, require_any_var_t< T_x, T_y > * = nullptr, require_any_not_stan_scalar_t< T_x, T_y > * = nullptr>
var_value< matrix_cl< double > > log_diff_exp (T_x &&x, T_y &&y)
 Returns the natural logarithm of the difference of the natural exponentiation of x and the natural exponentiation of y.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > log_inv_logit (const var_value< T > &A)
 Returns the elementwise log_inv_logit() of a var_value<matrix_cl<double>>.
 
template<typename T_x , typename T_y , require_all_prim_or_rev_kernel_expression_t< T_x, T_y > * = nullptr, require_any_var_t< T_x, T_y > * = nullptr, require_any_not_stan_scalar_t< T_x, T_y > * = nullptr>
var_value< matrix_cl< double > > log_inv_logit_diff (T_x &&x, T_y &&y)
 Returns the natural logarithm of the difference of the inverse logits of the specified arguments.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > log_softmax (const var_value< T > &A)
 Return log of the softmax of the specified vector.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var log_sum_exp (const var_value< T > &A)
 Return the log of the sum of the exponentiated values of the specified matrix of values.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > logit (const var_value< T > &A)
 Returns the elementwise logit() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > matrix_power (const var_value< T > &M, const int n)
 Returns the nth power of the specific matrix.
 
template<typename T1 , typename T2 , require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr, require_any_var_t< T1, T2 > * = nullptr>
var_value< matrix_cl< double > > mdivide_left_tri_low (T1 &&A, T2 &&b)
 Returns the solution of the system Ax=b when A is lower triangular.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > mdivide_left_tri_low (const var_value< T > &A)
 Returns the solution of the system Ax=b when A is triangular and b=I.
 
template<typename T1 , typename T2 , require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr, require_any_var_t< T1, T2 > * = nullptr>
var_value< matrix_cl< double > > mdivide_right_tri_low (T2 &&b, T1 &&A)
 Returns the solution of the system Ax=b when A is lower triangular.
 
template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr>
auto multiply (T_a &&A, T_b &&B)
 Matrix multiplication of two reverse mode matrices and/or kernel generator expressions.
 
template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr>
auto operator* (const T_a &A, const T_b &B)
 Matrix multiplication of two reverse mode matrices and/or kernel generator expressions.
 
template<typename T1 , typename T2 , require_stan_scalar_t< T1 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T2 > * = nullptr, require_any_var_t< T1, T2 > * = nullptr>
auto multiply (const T1 &A, T2 &&B)
 Return matrix multiplied by a scalar.
 
template<typename T1 , typename T2 , require_stan_scalar_t< T2 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T1 > * = nullptr, require_any_var_t< T1, T2 > * = nullptr>
auto multiply (const T1 &A, const T2 &B)
 Return matrix multiplied by a scalar.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > multiply_log (T_a &&a, T_b &&b)
 Returns the elementwise multiply_log() of the input.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > multiply_lower_tri_self_transpose (const var_value< T > &A)
 Returns the result of multiplying the lower triangular portion of the input matrix by its own transpose.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > operator- (const var_value< T > &M)
 Returns the unary minus of the input.
 
template<typename T , require_var_vt< is_kernel_expression_and_not_scalar, T > * = nullptr>
operator+ (T &&M)
 Returns the unary plus of the input.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > Phi (const var_value< T > &A)
 Returns the elementwise Phi() of a var_value<matrix_cl<double>>.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > Phi_approx (const var_value< T > &A)
 Returns the elementwise Phi_approx() of a var_value<matrix_cl<double>>.
 
template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr>
var_value< matrix_cl< double > > pow (T_a &&a, T_b &&b)
 Return the first argument raised to the power of the second argument.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var prod (const var_value< T > &x)
 Returns the pro