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
# Makefile for LDAK 6.1 | |
# Compiler and flags | |
CC = gcc | |
CFLAGS = -O3 -fopenmp | |
LDFLAGS = -lblas -llapack -lm -lz | |
# Source and output files | |
SRC = ldak_nomkl.c | |
TARGET = ldak6.1 |
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 "pgenlib_read.h" | |
#include "pgenlib_write.h" | |
#ifdef __cplusplus | |
using namespace plink2; | |
#endif | |
int32_t main(int32_t argc, char** argv) | |
{ | |
PglErr reterr = kPglRetSuccess; |
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
Declaration count: 1697 | |
Pointer declaration count: 640 | |
Variables used: 477 | |
Y:/home/sjhalayka/ldak_min\dataops.c::44aReRrHiwCUC3xI::indexer | |
Y:/home/sjhalayka/ldak_min\dataops.c | |
Y:/home/sjhalayka/ldak_min\dataops.c::44aReRrHiwCUC3xI::wantpreds |
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
int read_data_fly(char* datafile, int dtype, double* data, float** probs, | |
int num_samples_use, int* keepsamps, int start, int end, | |
int* keeppreds_use, gzFile inputgz, size_t current, | |
int num_samples, int num_preds, int genskip, int genheaders, | |
int genprobs, size_t* bgen_indexes, double missingvalue, | |
double threshold, double minprob, int nonsnp, | |
int maxthreads) | |
{ | |
int thread; |
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> | |
using namespace std; | |
// C way -- make one function for each type | |
double c_function(const double x) | |
{ | |
return x; | |
} |
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 <string> | |
#include <vector> | |
#include <memory> | |
using namespace std; | |
template<class T> | |
void test_function(T ***c, const size_t size_x, const size_t size_y, const size_t size_z) | |
{ |
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 <string> | |
#include <vector> | |
#include <memory> | |
using namespace std; | |
template<class T> | |
void test_function(T ***c, const size_t size_x, const size_t size_y, const size_t size_z) | |
{ |
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 <typename size_t N> | |
double determinant_nxn(const MatrixXd& m) | |
{ | |
if (m.cols() != m.rows()) | |
{ | |
cout << "Matrix must be " << N << "x" << N << endl; | |
return 0; | |
} | |
Vector_nD<N> a_nd; |
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
double determinant(const Matrix3d& m) | |
{ | |
// https://textbooks.math.gatech.edu/ila/determinants-volumes.html | |
// https://copilot.microsoft.com/chats/qQxM5K1jer1Dc6pMtuDfD | |
Vector3d a; | |
a(0) = m(0, 0); | |
a(1) = m(0, 1); | |
a(2) = m(0, 2); |
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 <Eigen/Dense> | |
using namespace Eigen; | |
// Function to fit an ellipse using Gauss method | |
void fitEllipse(const std::vector<double>& x, const std::vector<double>& y) { | |
int n = x.size(); | |
if (n < 5) { |
NewerOlder