Skip to content

Instantly share code, notes, and snippets.

View krivenko's full-sized avatar

Igor Krivenko krivenko

View GitHub Profile
@krivenko
krivenko / eigen_det_benchmark.cpp
Last active August 15, 2018 19:32
Eigen3 determinant benchmark
#include <iostream>
#include <chrono>
#include <vector>
#include <Eigen/Core>
#include <Eigen/LU>
const int N = 10;
const int n_matrix = 100000;
@krivenko
krivenko / return_future.cpp
Created August 18, 2017 02:04
Return a non-default constructible value from an action
// Copyright (c) 2014 Hartmut Kaiser
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <hpx/hpx_main.hpp>
#include <hpx/include/components.hpp>
#include <hpx/include/actions.hpp>
#include <hpx/include/lcos.hpp>
#include <hpx/util/lightweight_test.hpp>
#include <vector>
#include <legion/legion.h>
using namespace Legion;
using namespace LegionRuntime::Arrays;
using namespace LegionRuntime::HighLevel;
enum {TOP_LEVEL_TASK_ID, NODE_TASK_ID};
int node_task(const Task *task, const std::vector<PhysicalRegion> &regions,
#include <legion/legion.h>
using namespace Legion;
using namespace LegionRuntime::Arrays;
using namespace LegionRuntime::HighLevel;
enum {TOP_LEVEL_TASK_ID, NODE_TASK_ID};
enum {DATA_FIELD};
void node_task(const Task *task, const std::vector<PhysicalRegion> &regions,
@krivenko
krivenko / gist:acd03ad4b1c65bc2afd5
Created July 19, 2015 12:48
boost_mt19937 test output
~/test/boost_mt19937 $ g++ -o boost_mt19937 -I../boost_1_55_0 boost_mt19937.cpp && ./boost_mt19937
Using Boost 1.55.0
Seed = 1567
boost::random::mt19937 (w/o distribution): 566192331 4108148734 1430636451 4168466441 3895687773
boost::random::mt19937 (uniform_01): 0.986307 0.846789 0.653008 0.733521 0.977796
boost::random::mt19937 (normal_distribution): -0.995594 0.413405 1.18606 -0.30239 -0.598103
~/test/boost_mt19937 $ g++ -o boost_mt19937 -I../boost_1_56_0 boost_mt19937.cpp && ./boost_mt19937
Using Boost 1.56.0
Seed = 1567
diff --git a/cmake/TRIQSConfig.cmake.in b/cmake/TRIQSConfig.cmake.in
index ac6c4c5..646e7bf 100644
--- a/cmake/TRIQSConfig.cmake.in
+++ b/cmake/TRIQSConfig.cmake.in
@@ -199,9 +199,13 @@ macro (triqs_build_f2py_module target_name modulename module_pyf_name filelist1)
ENDFOREACH(f)
# write the script that will build the f2py extension
SET(filename ${CMAKE_CURRENT_BINARY_DIR}/${filename} )
+ SET(lapacklibs "")
+ FOREACH(l ${TRIQS_LIBRARY_LAPACK})
#!/bin/env pytriqs
import numpy
from itertools import product
import pytriqs.utility.mpi as mpi
from pytriqs.archive import HDFArchive
from pytriqs.parameters.parameters import Parameters
from pytriqs.operators import *
from pytriqs.applications.impurity_solvers.cthyb_matrix import *
from pytriqs.gf.local import *
@krivenko
krivenko / Pade_test.py
Created March 27, 2012 22:36
A python script to test new GF_Bloc_ReFreq::setFromPadeOf() method.
#!/bin/env pytriqs
import numpy
from math import pi
from cmath import sqrt, log
from pytriqs.Base.GF_Local import *
from pytriqs.Base.GF_Local.Descriptors import Function
beta = 100 # Inverse temperature
L = 101 # Number of Matsubara frequencies used in the Pade approximation
@krivenko
krivenko / external-boost-module-dir.patch
Created January 13, 2012 18:06
A patch to use a user provided BOOST_MODULE_DIR in TRIQS
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d3ddc2..2d1da4b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -125,8 +125,10 @@ FILE(COPY ${TRIQS_SOURCE_DIR}/pytriqs DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ F
if(BOOST_SOURCE_DIR)
FILE(COPY ${TRIQS_SOURCE_DIR}/foreignlibs/boost DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILES_MATCHING PATTERN *.py PATTERN *.svn EXCLUDE )
else(BOOST_SOURCE_DIR)
- EXEC_PYTHON_SCRIPT ("import boost; print boost.__path__[0]" BOOST_MODULE_DIR)
- execute_process(COMMAND ln -fs ${BOOST_MODULE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/pytriqs)