Stan Math Library  2.20.0
reverse mode automatic differentiation
Namespaces | Classes | Typedefs | Functions
stan Namespace Reference

Namespaces

 internal
 
 math
 Matrices and templated mathematical functions.
 

Classes

struct  contains_std_vector
 Extends std::false_type as a std::vector type cannot be a scalar primitive type. More...
 
struct  contains_std_vector< std::vector< T >, Ts... >
 Extends std::true_type when instantiated with at least 1 template parameter of type std::vector<T>. More...
 
struct  contains_std_vector< T, Ts... >
 
struct  error_index
 
struct  is_constant
 Metaprogramming struct to detect whether a given type is constant in the mathematical sense (not the C++ const sense). More...
 
struct  is_constant< Eigen::Block< T > >
 Defines a public enum named value and sets it to true if the type of the elements in the provided Eigen Block is constant, false otherwise. More...
 
struct  is_constant< Eigen::Matrix< T, R, C > >
 Defines a public enum named value and sets it to true if the type of the elements in the provided Eigen Matrix is constant, false otherwise. More...
 
struct  is_constant< std::vector< T > >
 Defines a public enum named value and sets it to true if the type of the elements in the provided std::vector is constant, false otherwise. More...
 
struct  is_fvar
 Defines a public enum named value which is defined to be false as the primitive scalar types cannot be a stan::math::fvar type. More...
 
struct  is_fvar< stan::math::fvar< T > >
 Defines a public enum named value and sets it to true(1) when instantiated with the stan::math::fvar type. More...
 
struct  is_var
 Defines a public enum named value which is defined to be false as the primitive scalar types cannot be a stan::math::var type. More...
 
struct  is_var< stan::math::var >
 Defines a public enum named value and sets it to true(1) when instantiated with the stan::math::var type. More...
 
struct  is_var_or_arithmetic_type
 Defines a public enum named value which is defined to be true (1) if the type is either var or an aritmetic type and false (0) otherwise. More...
 
struct  is_vector
 
struct  is_vector< const T >
 
struct  is_vector< Eigen::Block< T > >
 
struct  is_vector< Eigen::Matrix< T, 1, Eigen::Dynamic > >
 
struct  is_vector< Eigen::Matrix< T, Eigen::Dynamic, 1 > >
 
struct  is_vector< std::vector< T > >
 
struct  is_vector_like
 Template metaprogram indicates whether a type is vector_like. More...
 
struct  is_vector_like< const T >
 Template metaprogram indicates whether a type is vector_like. More...
 
struct  is_vector_like< Eigen::Array< T, R, C > >
 Template metaprogram indicates whether a type is vector_like. More...
 
struct  is_vector_like< Eigen::Matrix< T, R, C > >
 Template metaprogram indicates whether a type is vector_like. More...
 
struct  is_vector_like< T * >
 Template metaprogram indicates whether a type is vector_like. More...
 
struct  partials_return_type
 Template metaprogram to calculate the partial derivative type resulting from promoting all the scalar types of the template parameters. More...
 
struct  partials_return_type< T >
 
struct  partials_type
 
struct  partials_type< stan::math::fvar< T > >
 
struct  partials_type< stan::math::var >
 
struct  return_type
 Template metaprogram to calculate the base scalar return type resulting from promoting all the scalar types of the template parameters. More...
 
struct  return_type< T >
 
class  scalar_seq_view
 scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scalars. More...
 
class  scalar_seq_view< T, T >
 This specialization handles wrapping a scalar as if it were a sequence. More...
 
struct  scalar_type
 Metaprogram structure to determine the base scalar type of a template argument. More...
 
struct  scalar_type< const Eigen::Matrix< T, R, C > & >
 Template metaprogram defining the base scalar type of values stored in a referenced const Eigen matrix. More...
 
struct  scalar_type< const Eigen::Matrix< T, R, C > >
 Template metaprogram defining the base scalar type of values stored in a const Eigen matrix. More...
 
struct  scalar_type< const std::vector< T > & >
 
struct  scalar_type< const std::vector< T > >
 
struct  scalar_type< Eigen::Block< T > >
 Template metaprogram defining the base scalar type of values stored in an Eigen Block. More...
 
struct  scalar_type< Eigen::Matrix< T, R, C > & >
 Template metaprogram defining the base scalar type of values stored in a referenced Eigen matrix. More...
 
struct  scalar_type< Eigen::Matrix< T, R, C > >
 Template metaprogram defining the base scalar type of values stored in an Eigen matrix. More...
 
struct  scalar_type< std::vector< T > & >
 
struct  scalar_type< std::vector< T > >
 
struct  scalar_type< T * >
 
struct  scalar_type_pre
 Metaprogram structure to determine the type of first container of the base scalar type of a template argument. More...
 
struct  size_of_helper
 
struct  size_of_helper< T, true >
 
class  StdVectorBuilder
 StdVectorBuilder allocates type T1 values to be used as intermediate values. More...
 
class  vector_seq_view
 This class provides a low-cost wrapper for situations where you either need an Eigen Vector or RowVector or a std::vector of them and you want to be agnostic between those two options. More...
 
class  vector_seq_view< Eigen::Matrix< S, 1, Eigen::Dynamic > >
 This class provides a low-cost wrapper for situations where you either need an Eigen Vector or RowVector or a std::vector of them and you want to be agnostic between those two options. More...
 
class  vector_seq_view< Eigen::Matrix< S, Eigen::Dynamic, 1 > >
 This class provides a low-cost wrapper for situations where you either need an Eigen Vector or RowVector or a std::vector of them and you want to be agnostic between those two options. More...
 
class  vector_seq_view< std::vector< Eigen::Matrix< S, 1, Eigen::Dynamic > > >
 This class provides a low-cost wrapper for situations where you either need an Eigen Vector or RowVector or a std::vector of them and you want to be agnostic between those two options. More...
 
class  vector_seq_view< std::vector< Eigen::Matrix< S, Eigen::Dynamic, 1 > > >
 This class provides a low-cost wrapper for situations where you either need an Eigen Vector or RowVector or a std::vector of them and you want to be agnostic between those two options. More...
 
class  VectorBuilder
 VectorBuilder allocates type T1 values to be used as intermediate values. More...
 
class  VectorBuilderHelper
 VectorBuilder allocates type T1 values to be used as intermediate values. More...
 
class  VectorBuilderHelper< T1, true, false >
 
class  VectorBuilderHelper< T1, true, true >
 Template specialization for using a vector. More...
 

Typedefs

template<typename... T>
using contains_fvar = math::disjunction< is_fvar< typename scalar_type< T >::type >... >
 Extends std::true_type when instantiated with at least 1 template parameter that is a fvar. More...
 
template<typename... T>
using contains_vector = math::disjunction< is_vector< T >... >
 Metaprogram to determine if any of the provided types is a std::vector. More...
 
template<typename... T>
using is_constant_all = math::conjunction< is_constant< T >... >
 Metaprogram defining an enum value which is true if all of the type parameters are constant (i.e., primtive types) and false otherwise. More...
 
template<typename... T>
using is_var_or_arithmetic = math::conjunction< is_var_or_arithmetic_type< T >... >
 Extends std::true_type if all the provided types are either var or an arithmetic type, extends std::false_type otherwise. More...
 

Functions

template<typename T >
get (const std::vector< T > &x, size_t n)
 Returns the n-th element of the provided std::vector. More...
 
template<typename T >
size_t length (const std::vector< T > &x)
 Returns the length of the provided std::vector. More...
 
template<typename T , int R, int C>
get (const Eigen::Matrix< T, R, C > &m, size_t n)
 
template<typename T , int R, int C>
get (const Eigen::Array< T, R, C > &m, size_t n)
 
template<typename T , int R, int C>
size_t length (const Eigen::Matrix< T, R, C > &m)
 Returns the size of the provided Eigen matrix. More...
 
template<typename T , int R, int C>
size_t length_mvt (const Eigen::Matrix< T, R, C > &)
 
template<typename T , int R, int C>
size_t length_mvt (const std::vector< Eigen::Matrix< T, R, C > > &x)
 
template<typename T >
get (const T &x, size_t n)
 
template<typename T >
size_t length (const T &)
 Returns the length of primitive scalar types that are always of length 1. More...
 
template<typename T >
size_t length_mvt (const T &)
 length_mvt provides the length of a multivariate argument. More...
 
template<typename T1 , typename T2 >
size_t max_size (const T1 &x1, const T2 &x2)
 
template<typename T1 , typename T2 , typename T3 >
size_t max_size (const T1 &x1, const T2 &x2, const T3 &x3)
 
template<typename T1 , typename T2 , typename T3 , typename T4 >
size_t max_size (const T1 &x1, const T2 &x2, const T3 &x3, const T4 &x4)
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
size_t max_size (const T1 &x1, const T2 &x2, const T3 &x3, const T4 &x4, const T5 &x5)
 
template<typename T1 , typename T2 >
size_t max_size_mvt (const T1 &x1, const T2 &x2)
 
template<typename T1 , typename T2 , typename T3 >
size_t max_size_mvt (const T1 &x1, const T2 &x2, const T3 &x3)
 
template<typename T1 , typename T2 , typename T3 , typename T4 >
size_t max_size_mvt (const T1 &x1, const T2 &x2, const T3 &x3, const T4 &x4)
 
template<typename T >
size_t size_of (const T &x)
 Returns the size of the provided vector or the constant 1 if the input argument is not a vector. More...
 

Typedef Documentation

◆ contains_fvar

template<typename... T>
using stan::contains_fvar = typedef math::disjunction<is_fvar<typename scalar_type<T>::type>...>

Extends std::true_type when instantiated with at least 1 template parameter that is a fvar.

Extends std::false_type otherwise.

Template Parameters
TTypes to test

Definition at line 18 of file contains_fvar.hpp.

◆ contains_vector

template<typename... T>
using stan::contains_vector = typedef math::disjunction<is_vector<T>...>

Metaprogram to determine if any of the provided types is a std::vector.

Template Parameters
TTypes to test

Definition at line 14 of file contains_vector.hpp.

◆ is_constant_all

template<typename... T>
using stan::is_constant_all = typedef math::conjunction<is_constant<T>...>

Metaprogram defining an enum value which is true if all of the type parameters are constant (i.e., primtive types) and false otherwise.

Definition at line 38 of file is_constant.hpp.

◆ is_var_or_arithmetic

template<typename... T>
using stan::is_var_or_arithmetic = typedef math::conjunction<is_var_or_arithmetic_type<T>...>

Extends std::true_type if all the provided types are either var or an arithmetic type, extends std::false_type otherwise.

Definition at line 29 of file is_var_or_arithmetic.hpp.

Function Documentation

◆ get() [1/4]

template<typename T , int R, int C>
T stan::get ( const Eigen::Matrix< T, R, C > &  m,
size_t  n 
)
inline

Definition at line 9 of file get.hpp.

◆ get() [2/4]

template<typename T >
T stan::get ( const T &  x,
size_t  n 
)
inline

Definition at line 10 of file get.hpp.

◆ get() [3/4]

template<typename T , int R, int C>
T stan::get ( const Eigen::Array< T, R, C > &  m,
size_t  n 
)
inline

Definition at line 14 of file get.hpp.

◆ get() [4/4]

template<typename T >
T stan::get ( const std::vector< T > &  x,
size_t  n 
)
inline

Returns the n-th element of the provided std::vector.

Parameters
xinput vector
nindex of the element to return
Returns
n-th element of the input vector

Definition at line 16 of file get.hpp.

◆ length() [1/3]

template<typename T >
size_t stan::length ( const T &  )

Returns the length of primitive scalar types that are always of length 1.

Definition at line 12 of file length.hpp.

◆ length() [2/3]

template<typename T >
size_t stan::length ( const std::vector< T > &  x)

Returns the length of the provided std::vector.

Parameters
xinput vector
Template Parameters
Ttype of the elements in the vector
Returns
the length of the input vector

Definition at line 16 of file length.hpp.

◆ length() [3/3]

template<typename T , int R, int C>
size_t stan::length ( const Eigen::Matrix< T, R, C > &  m)

Returns the size of the provided Eigen matrix.

Parameters
ma const Eigen matrix
Template Parameters
Ttype of matrix.
Rnumber of rows in the input matrix.
Cnumber of columns in the input matrix.
Returns
the size of the input matrix

Definition at line 18 of file length.hpp.

◆ length_mvt() [1/3]

template<typename T , int R, int C>
size_t stan::length_mvt ( const Eigen::Matrix< T, R, C > &  )

Definition at line 12 of file length_mvt.hpp.

◆ length_mvt() [2/3]

template<typename T , int R, int C>
size_t stan::length_mvt ( const std::vector< Eigen::Matrix< T, R, C > > &  x)

Definition at line 17 of file length_mvt.hpp.

◆ length_mvt() [3/3]

template<typename T >
size_t stan::length_mvt ( const T &  )

length_mvt provides the length of a multivariate argument.

This is the default template function. For any scalar type, this will throw an std::invalid_argument exception since a scalar is not a multivariate structure.

Template Parameters
Ttype to take length of. The default template function should only match scalars.
Exceptions
std::invalid_argumentsince the type is a scalar.

Definition at line 21 of file length_mvt.hpp.

◆ max_size() [1/4]

template<typename T1 , typename T2 >
size_t stan::max_size ( const T1 &  x1,
const T2 &  x2 
)

Definition at line 9 of file max_size.hpp.

◆ max_size() [2/4]

template<typename T1 , typename T2 , typename T3 >
size_t stan::max_size ( const T1 &  x1,
const T2 &  x2,
const T3 &  x3 
)

Definition at line 16 of file max_size.hpp.

◆ max_size() [3/4]

template<typename T1 , typename T2 , typename T3 , typename T4 >
size_t stan::max_size ( const T1 &  x1,
const T2 &  x2,
const T3 &  x3,
const T4 &  x4 
)

Definition at line 24 of file max_size.hpp.

◆ max_size() [4/4]

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
size_t stan::max_size ( const T1 &  x1,
const T2 &  x2,
const T3 &  x3,
const T4 &  x4,
const T5 &  x5 
)

Definition at line 33 of file max_size.hpp.

◆ max_size_mvt() [1/3]

template<typename T1 , typename T2 >
size_t stan::max_size_mvt ( const T1 &  x1,
const T2 &  x2 
)

Definition at line 10 of file max_size_mvt.hpp.

◆ max_size_mvt() [2/3]

template<typename T1 , typename T2 , typename T3 >
size_t stan::max_size_mvt ( const T1 &  x1,
const T2 &  x2,
const T3 &  x3 
)

Definition at line 17 of file max_size_mvt.hpp.

◆ max_size_mvt() [3/3]

template<typename T1 , typename T2 , typename T3 , typename T4 >
size_t stan::max_size_mvt ( const T1 &  x1,
const T2 &  x2,
const T3 &  x3,
const T4 &  x4 
)

Definition at line 25 of file max_size_mvt.hpp.

◆ size_of()

template<typename T >
size_t stan::size_of ( const T &  x)

Returns the size of the provided vector or the constant 1 if the input argument is not a vector.

Parameters
xvalue for which to obtain the size of
Template Parameters
thetype of the input value
Returns
the size of x or 1 if not a vector

Definition at line 27 of file size_of.hpp.


     [ Stan Home Page ] © 2011–2018, Stan Development Team.