This file contains hidden or 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 std.stdio; | |
import std.algorithm; | |
import dmech.geometry; | |
import dmech.rigidbody; | |
import dmech.world; | |
import dmech.shape; | |
import dmech.raycast; | |
import dlib.core.memory; | |
import dlib.math.vector; |
This file contains hidden or 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
#include "btBulletDynamicsCommon.h" | |
#include <map> | |
#include <memory> | |
int main() | |
{ | |
btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration(); | |
btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration); |
This file contains hidden or 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 | |
from matplotlib import pyplot | |
from matplotlib import rcParams | |
from mpl_toolkits.mplot3d import Axes3D | |
from matplotlib import cm | |
from math import pi | |
rcParams['font.family'] = 'serif' |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Numerics; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Burgers | |
{ |
This file contains hidden or 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
#define NOMINMAX | |
#include <amp.h> | |
#include <iostream> | |
#include <chrono> | |
#include <tuple> | |
#include <random> | |
#include <algorithm> | |
#include <numeric> |
This file contains hidden or 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
#include "stdafx.h" | |
#include <iostream> | |
#include <chrono> | |
#include <tuple> | |
#include <random> | |
#include <algorithm> | |
#include <numeric> | |
#include <functional> |
This file contains hidden or 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
open MathNet.Numerics.Distributions | |
open MathNet.Numerics.Statistics | |
let callPayoff strike price = max (price - strike) 0.0 | |
let europeanPayoff payoff assetPath = assetPath |> Seq.last |> payoff | |
let europeanCallPayoff strike assetPath = assetPath |> europeanPayoff (callPayoff strike) | |
let asianArithmeticMeanCallPayoff strike (assetPath:seq<float>) = assetPath.Mean() |> callPayoff strike |
This file contains hidden or 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 code is based on matlab code provided through the course "Monte Carlo Methods in Finance". | |
// https://iversity.org/my/courses/monte-carlo-methods-in-finance/ | |
// and Olaf Smits's Python conversion | |
// http://nbviewer.ipython.org/github/olafSmits/MonteCarloMethodsInFinance/blob/master/Week%201.ipynb?create=1 | |
open System | |
open Deedle | |
open FSharp.Charting | |
let readFrame (stock:string) = |
This file contains hidden or 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
open System | |
let callPayoff strike spot = max (spot - strike) 0.0 | |
let putPayoff strike spot = max (strike - spot) 0.0 | |
let triplewise (source: seq<_>) = | |
source | |
|> Seq.windowed 3 | |
|> Seq.map (fun triple -> (triple.[0], triple.[1], triple.[2])) |