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
| #!/usr/bin/python | |
| from math import exp | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| def rbf_kernel(x1, x2, variance = 1): | |
| return exp(-1 * ((x1-x2) ** 2) / (2*variance)) | |
| def gram_matrix(xs): |
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
| template<class T> struct splnode { | |
| typedef splnode<T> node_t; | |
| splnode() : P(NULL) { | |
| C[0] = C[1] = NULL; | |
| pull(); | |
| } | |
| /* Add extra state here. */ |
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 <algorithm> | |
| #include <vector> | |
| #include <complex> | |
| #include <cmath> | |
| using namespace std; | |
| /* A flag used by some geometry routines to indicate exceptional circumstances. | |
| */ | |
| static bool geoerror; |
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
| struct suffix_array { | |
| suffix_array(const char* S) : N(strlen(S)) { | |
| vector<int> V; | |
| for(int i = 0; i < N; i++) V.push_back(S[i]); | |
| init(V); | |
| } | |
| suffix_array(const vector<int>& VV) : N(VV.size()) { | |
| vector<int> V(VV); | |
| init(V); |
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
| /* | |
| LANG: C++ | |
| */ | |
| #include <iostream> | |
| #include <cstdio> | |
| using namespace std; | |
| #define MAXN 512 |
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 <iostream> | |
| #include <vector> | |
| #include <cmath> | |
| #include <cstring> | |
| #include <cstdlib> | |
| #include <cstdio> | |
| #include <cassert> | |
| using namespace std; |
NewerOlder