Commit 5f32ac2d authored by Helene Rimbert's avatar Helene Rimbert
Browse files

initial commit

parent 1fb01e23
StatsLib: A C++ Library of Statistical Distribution Functions
Copyright 2011-2018 Keith O'Hara
This product includes software developed by Keith O'Hara (http://www.kthohr.com)
\ No newline at end of file
This diff is collapsed.
/*################################################################################
##
## Copyright (C) 2011-2018 Keith O'Hara
##
## This file is part of the StatsLib C++ library.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
################################################################################*/
/*
* pdf of the Bernoulli distribution
*/
#ifndef _statslib_dbern_HPP
#define _statslib_dbern_HPP
//
// single input
template<typename T>
statslib_constexpr T dbern(const uint_t x, const T prob_par, const bool log_form = false);
template<typename T = double>
statslib_constexpr T dbern(const uint_t x);
//
// matrix/vector input
template<typename Ta, typename Tb, typename Tc = Tb>
void dbern_int(const Ta* __stats_pointer_settings__ vals_in, const Tb prob_par, const bool log_form,
Tc* __stats_pointer_settings__ vals_out, const uint_t num_elem);
#ifdef STATS_USE_ARMA
template<typename Ta, typename Tb, typename Tc = Tb>
ArmaMat<Tc> dbern(const ArmaMat<Ta>& X, const Tb prob_par, const bool log_form = false);
#endif
#ifdef STATS_USE_BLAZE
template<typename Ta, typename Tb, typename Tc = Tb, bool To = blaze::columnMajor>
BlazeMat<Tc,To> dbern(const BlazeMat<Ta,To>& X, const Tb prob_par, const bool log_form = false);
#endif
#ifdef STATS_USE_EIGEN
template<typename Ta, typename Tb, typename Tc = Tb, int iTr = Eigen::Dynamic, int iTc = Eigen::Dynamic>
EigMat<Tc,iTr,iTc> dbern(const EigMat<Ta,iTr,iTc>& X, const Tb prob_par, const bool log_form = false);
#endif
//
// include implementation files
#include "dbern.ipp"
#endif
This diff is collapsed.
/*################################################################################
##
## Copyright (C) 2011-2018 Keith O'Hara
##
## This file is part of the StatsLib C++ library.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
################################################################################*/
/*
* pdf of the Beta distribution
*/
#ifndef _statslib_dbeta_HPP
#define _statslib_dbeta_HPP
//
// single input
template<typename T>
statslib_constexpr T dbeta(const T x, const T a_par, const T b_par, const bool log_form = false);
//
// matrix/vector input
template<typename Ta, typename Tb, typename Tc = Tb>
void dbeta_int(const Ta* __stats_pointer_settings__ vals_in, const Tb a_par, const Tb b_par, const bool log_form,
Tc* __stats_pointer_settings__ vals_out, const uint_t num_elem);
#ifdef STATS_USE_ARMA
template<typename Ta, typename Tb, typename Tc = Tb>
ArmaMat<Tc> dbeta(const ArmaMat<Ta>& X, const Tb a_par, const Tb b_par, const bool log_form = false);
#endif
#ifdef STATS_USE_BLAZE
template<typename Ta, typename Tb, typename Tc = Tb, bool To = blaze::columnMajor>
BlazeMat<Tc,To> dbeta(const BlazeMat<Ta,To>& X, const Tb a_par, const Tb b_par, const bool log_form = false);
#endif
#ifdef STATS_USE_EIGEN
template<typename Ta, typename Tb, typename Tc = Tb, int iTr = Eigen::Dynamic, int iTc = Eigen::Dynamic>
EigMat<Tc,iTr,iTc> dbeta(const EigMat<Ta,iTr,iTc>& X, const Tb a_par, const Tb b_par, const bool log_form = false);
#endif
//
// include implementation files
#include "dbeta.ipp"
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment