Skip to content

Instantly share code, notes, and snippets.

View lambday's full-sized avatar

Soumyajit De lambday

  • Meta
  • London
  • 07:37 (UTC)
View GitHub Profile
#include <DynamicInterface.hpp>
#include <CRTPInterface.hpp>
#include <benchmark/benchmark.h>
#include <memory>
unsigned long N = 10000;
//auto dynobj = std::make_unique<DynamicImplementation>();
//auto crtpobj = std::make_unique<CRTPImplementation>();
DynamicImplementation dynobj;
CRTPImplementation crtpobj;
#include <DynamicInterface.hpp>
#include <CRTPInterface.hpp>
#include <benchmark/benchmark.h>
#include <memory>
unsigned long N = 10000;
auto dynobj = std::make_unique<DynamicImplementation>();
auto crtpobj = std::make_unique<CRTPImplementation>();
void run_dynamic(DynamicInterface* obj) {
#ifndef CRTP_INTERFACE_HPP__
#define CRTP_INTERFACE_HPP__
template <typename Implementation>
class CRTPInterface {
public:
void tick(unsigned long n) {
impl().tick(n);
}
@lambday
lambday / MatrixFactory.cpp
Last active March 20, 2016 05:15
POC for generic matrix/vector factory for Shogun for GPU types
#include <iostream>
#include <memory>
#include <algorithm>
using namespace std;
namespace shogun
{
// cpu types
#include <iostream>
#include <shogun/lib/common.h>
#include <shogun/lib/SGVector.h>
#include <shogun/mathematics/Math.h>
#include <shogun/mathematics/linalg/linalg.h>
#include <hayai/hayai.hpp>
using namespace shogun;
using namespace Eigen;
#include <iostream>
#include <shogun/lib/common.h>
#include <shogun/lib/SGVector.h>
#include <shogun/mathematics/Math.h>
#include <shogun/mathematics/linalg/linalg.h>
#include <hayai/hayai.hpp>
using namespace shogun;
using namespace Eigen;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cassert>
/**
* returns -1 if all the elements are smaller than val
*/
int search_first_larger(int a[], int first, int last, int val)
#include <iostream>
#include <cstdio>
#include <string>
#include <functional>
#include <cmath>
#include <initializer_list>
/*
Format("{type} {name} = -2*{pi}*sqrt(element)*pow({weights},2)",
@lambday
lambday / lambdaop.cpp
Created April 23, 2015 14:37
Using lambdas as custom unary operators
#include <iostream>
#include <algorithm>
#include <memory>
#include <type_traits>
#include <cmath>
namespace impl
{
template <typename T>