Stan Math Library: stan/math/prim/mat/fun/unit_vector_free.hpp Source File

| Stan Math Library 2.10.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

unit_vector_free.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_UNIT_VECTOR_FREE_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_UNIT_VECTOR_FREE_HPP
3
4 #include <stan/math/prim/mat/fun/Eigen.hpp>
5 #include <stan/math/prim/mat/meta/index_type.hpp>
6 #include <stan/math/prim/mat/err/check_unit_vector.hpp>
7 #include <cmath>
8
9 namespace stan {
10
11 namespace math {
12
22 template <typename T>
23 Eigen::Matrix<T, Eigen::Dynamic, 1>
24 unit_vector_free(const Eigen::Matrix<T, Eigen::Dynamic, 1>& x) {
25 stan::math::check_unit_vector("stan::math::unit_vector_free",
26 "Unit vector variable", x);
27 return x;
28 }
29
30 }
31
32 }
33
34 #endif
stan
Definition: log_sum_exp.hpp:8
check_unit_vector.hpp
index_type.hpp
stan::math::unit_vector_free
Eigen::Matrix< T, Eigen::Dynamic, 1 > unit_vector_free(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x)
Transformation of a unit length vector to a "free" vector However, we are just fixing the unidentifie...
Definition: unit_vector_free.hpp:24
Eigen.hpp
stan::math::check_unit_vector
bool check_unit_vector(const char *function, const char *name, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta)
Return true if the specified vector is unit vector.
Definition: check_unit_vector.hpp:36

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