This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.0) | |
project(mytest) | |
FIND_PACKAGE(CGAL REQUIRED) | |
find_package(Boost COMPONENTS thread REQUIRED) | |
ADD_EXECUTABLE(main test.cpp) | |
TARGET_LINK_LIBRARIES( | |
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.0) | |
project(mytest) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
FIND_PACKAGE(CGAL REQUIRED) | |
find_package(Boost COMPONENTS thread REQUIRED) | |
add_executable(mytest main.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.0) | |
project(mytest) | |
FIND_PACKAGE(SWIG REQUIRED) | |
INCLUDE(${SWIG_USE_FILE}) | |
if (NOT MSVC) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.0) | |
project(mytest) | |
FIND_PACKAGE(SWIG REQUIRED) | |
INCLUDE(${SWIG_USE_FILE}) | |
if (NOT MSVC) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.0) | |
project(mytest) | |
FIND_PACKAGE(SWIG REQUIRED) | |
FIND_PACKAGE(Eigen3 REQUIRED) | |
INCLUDE(${SWIG_USE_FILE}) | |
if (NOT MSVC) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef MYFOO_HPP | |
#define MYFOO_HPP | |
#include <vector> | |
double sum(const std::vector<double> & a) { | |
double sum = 0.0; | |
for (const auto & elem: a) { | |
sum += elem; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) | |
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) | |
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) | |
FIND_PACKAGE(Trilinos REQUIRED COMPONENTS Kokkos) | |
INCLUDE_DIRECTORIES( | |
SYSTEM | |
${Trilinos_INCLUDE_DIRS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This gist shows how to use numpy's FFT functions to use the discrete FFT | |
# of a uniformly-spaced data set to get what corresponds to the actual Fourier | |
# transform as you'd write it down mathematically. | |
# In particular, the functio uniform_dft returns the corresponding frequencies | |
# in terms of the coordinate units. | |
def uniform_dft(interval_length, data): | |
"""Discrete Fourier Transform of real-valued data, interpreted for a uniform series | |
over an interval of a given length, including starting and end point. | |
The function returns the frequencies in units of the coordinate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import perfplot | |
import numpy | |
def setup(n): | |
a = numpy.random.rand(n, 3) | |
b = numpy.ascontiguousarray(a.T) | |
return a, b | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
import perfplot | |
def setup(n): | |
pts = numpy.random.rand(3, n, 2) | |
e = numpy.array([ | |
pts[2] - pts[1], | |
pts[0] - pts[2], | |
pts[1] - pts[0], |
OlderNewer