Drake
Drake C++ Documentation
drake_bool.h File Reference
#include <type_traits>
#include <Eigen/Core>
#include "drake/common/double_overloads.h"
#include "drake/common/drake_throw.h"
Include dependency graph for drake_bool.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  scalar_predicate< T >
 A traits struct that describes the return type of predicates over a scalar type (named T). More...
 

Namespaces

 drake
 

Typedefs

template<typename T >
using boolean = typename scalar_predicate< T >::type
 An alias for a boolean-like value, conditioned on the scalar type T. More...
 

Functions

template<typename Derived >
Derived::Scalar all (const Eigen::DenseBase< Derived > &m)
 Checks truth for all elements in matrix m. More...
 
template<typename Derived >
boolean< typename Derived::Scalar > all_of (const Eigen::MatrixBase< Derived > &m, const std::function< boolean< typename Derived::Scalar >(const typename Derived::Scalar &)> &pred)
 Checks if unary predicate pred holds for all elements in the matrix m. More...
 
template<typename Derived >
Derived::Scalar any (const Eigen::DenseBase< Derived > &m)
 Checks truth for at least one element in matrix m. More...
 
template<typename Derived >
boolean< typename Derived::Scalar > any_of (const Eigen::MatrixBase< Derived > &m, const std::function< boolean< typename Derived::Scalar >(const typename Derived::Scalar &)> &pred)
 Checks if unary predicate pred holds for at least one element in the matrix m. More...
 
template<typename Derived >
Derived::Scalar none (const Eigen::MatrixBase< Derived > &m)
 Checks that no elements of m are true. An empty matrix returns true. More...
 
template<typename Derived >
boolean< typename Derived::Scalar > none_of (const Eigen::MatrixBase< Derived > &m, const std::function< boolean< typename Derived::Scalar >(const typename Derived::Scalar &)> &pred)
 Checks if unary predicate pred holds for no elements in the matrix m. More...
 
template<typename T , int Rows>
auto if_then_else (const boolean< T > &f_cond, const Eigen::Matrix< T, Rows, 1 > &m_then, const Eigen::Matrix< T, Rows, 1 > &m_else)
 Overloads if_then_else for Eigen vectors of m_then and m_else values with with a single f_cond condition to toggle them all at once. More...