Skip to content

Instantly share code, notes, and snippets.

View dwatanabee's full-sized avatar
😀

dwatanabee dwatanabee

😀
View GitHub Profile
@KobayashiRui
KobayashiRui / c_sample.cpp
Last active December 31, 2022 05:10
c++でpython.hをincludeすることでpythonで作成した関数をc++側で使用することができる. 日本語でpython3.6について簡単に説明しているところが少なかったためまとめる.
#include<stdio.h>
#include<Python.h>
#include<string>
#include<iostream>
int main(){
PyObject *pName,*pModule, *pTmp, *pFunc;
char *sTmp;
int data;
@mlohry
mlohry / teststiffjfnk.cpp
Created April 24, 2015 21:30
Solving an Eigen::Matrix system type RHS with PETSc implicit timestepping + JFNK
#include <iostream>
#include <math.h>
#include <Eigen/Dense>
#include <petscts.h>
typedef struct {
// Vec solution; /* global exact solution vector */
Eigen::MatrixXd soln,rhs;
const double y0 = 1.0e-3; // epsilon in original ODE
} AppCtx;