Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: filtering-library/fl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: stanford-iprl-lab/fl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 22, 2019

  1. Copy the full SHA
    dc34369 View commit details

Commits on Sep 23, 2020

  1. Copy the full SHA
    9ff4960 View commit details
  2. Copy the full SHA
    d4c146d View commit details
Showing with 33 additions and 20 deletions.
  1. +31 −17 CMakeLists.txt
  2. +2 −3 include/fl/distribution/gaussian.hpp
48 changes: 31 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ project(fl)
option(fl_USE_CATKIN "Use catkin build system" ON)
option(fl_USE_RANDOM_SEED "Use random seeds for number generators" ON)
set(fl_FLOATING_POINT_TYPE "double" CACHE STRING "fl::Real floating point type")
option(fl_BUILD_TESTS "Compile tests" OFF)

############################
# Flags #
@@ -49,12 +50,16 @@ include(${fl_MODULE_PATH}/definitions.cmake)
############################
# Dependencies ##
############################
find_package(Eigen REQUIRED)
include_directories(${Eigen_INCLUDE_DIRS})
add_definitions(${Eigen_DEFINITIONS})
if(NOT TARGET Eigen3::Eigen)
find_package(Eigen REQUIRED)
include_directories(${Eigen_INCLUDE_DIRS})
add_definitions(${Eigen_DEFINITIONS})
else()
get_target_property(EIGEN3_INCLUDE_DIR Eigen3::Eigen
INTERFACE_INCLUDE_DIRECTORIES)
endif()

find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})

#find_package(OpenMP)
#if(OPENMP_FOUND)
@@ -66,16 +71,16 @@ include_directories(${Boost_INCLUDE_DIRS})
############################
## catkin #
############################
if(fl_USE_CATKIN)
find_package(catkin REQUIRED)
endif(fl_USE_CATKIN)
# if(fl_USE_CATKIN)
# find_package(catkin REQUIRED)
# endif(fl_USE_CATKIN)

if(catkin_FOUND AND fl_USE_CATKIN)
set(fl_USING_CATKIN YES)
catkin_package(INCLUDE_DIRS include DEPENDS Eigen Boost)
else(catkin_FOUND AND fl_USE_CATKIN)
set(fl_USING_CATKIN NO)
endif(catkin_FOUND AND fl_USE_CATKIN)
# if(catkin_FOUND AND fl_USE_CATKIN)
# set(fl_USING_CATKIN YES)
# catkin_package(INCLUDE_DIRS include DEPENDS Eigen Boost)
# else(catkin_FOUND AND fl_USE_CATKIN)
# set(fl_USING_CATKIN NO)
# endif(catkin_FOUND AND fl_USE_CATKIN)

############################
# Documentation Generation #
@@ -111,18 +116,27 @@ include(${fl_MODULE_PATH}/doxygen.cmake)
############################
# Build #
############################
include_directories(include)
file(GLOB_RECURSE header_files include/${PROJECT_NAME}/*.hpp
include/${PROJECT_NAME}/*.h
include/ff/*.hpp
include/ff/*.h)

add_library(${PROJECT_NAME} ${header_files})

target_include_directories(${PROJECT_NAME} PUBLIC
${Boost_INCLUDE_DIRS}
include
)

add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)

############################
# Tests #
############################
enable_testing()
include(${fl_MODULE_PATH}/gtest.cmake)
add_subdirectory(test)
if(fl_BUILD_TESTS)
enable_testing()
include(${fl_MODULE_PATH}/gtest.cmake)
add_subdirectory(test)
endif()
5 changes: 2 additions & 3 deletions include/fl/distribution/gaussian.hpp
Original file line number Diff line number Diff line change
@@ -461,10 +461,9 @@ class Gaussian

if(has_full_rank())
{
const Variate dx = vector - mean();
return log_normalizer() - 0.5
* (vector - mean()).transpose()
* precision()
* (vector - mean());
* (dx.transpose() * precision() * dx)(0);
}

return -std::numeric_limits<Real>::infinity();