こんにちは。今回は現実逃避を兼ねて Jade の素晴らしさをお伝えしたいと思います。
[Jade][0] は JST (JavaScript Templates) の一つであり、HTML を書くための[軽量マークアップ言語][1] である [Haml][2] に影響を受けた JavaScript テンプレートエンジンでもあります。
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() |
// A simple quickref for Eigen. Add anything that's missing. | |
// Main author: Keir Mierle | |
#include <Eigen/Dense> | |
Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d. | |
Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols. | |
Matrix<double, Dynamic, Dynamic> C; // Full dynamic. Same as MatrixXd. | |
Matrix<double, 3, 3, RowMajor> E; // Row major; default is column-major. | |
Matrix3f P, Q, R; // 3x3 float matrix. |
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
def sympy2casadi(sympy_expr,sympy_var,casadi_var): | |
import casadi | |
assert casadi_var.is_vector() | |
if casadi_var.shape[1]>1: | |
casadi_var = casadi_var.T | |
casadi_var = casadi.vertsplit(casadi_var) | |
from sympy.utilities.lambdify import lambdify | |
mapping = {'ImmutableDenseMatrix': casadi.blockcat, | |
'MutableDenseMatrix': casadi.blockcat, |