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
void decompose(float* a, float* l, float* u, int n) { | |
for (int i = 0; i < n*n; i++) { | |
l[i] = u[i] = 0; | |
} | |
for (int i = 0; i < n; i++) { | |
l[i*n+i] = 1; | |
} | |
for (int i = 0; i < n; i++) { // row index |
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
#!/bin/sh | |
# Please install non-optional dependencies noted on this site: | |
# https://wiki.osdev.org/GCC_Cross-Compiler | |
# Compiler Configuration | |
CROSS_TARGET=x86_64-elf | |
GCC_VERSION="8.1.0" # GCC version | |
BIN_VERSION="2.30" # Binutils version |
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 <stdio.h> | |
#include <stdint.h> | |
#include <math.h> | |
#include <complex.h> | |
#ifndef M_PI | |
#define M_PI (3.14159265358979323846) | |
#endif | |
/* Permutation */ |
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 <stdio.h> | |
#include <stdint.h> | |
/* | |
a mod n = r | |
a = p * q | |
p = an+x | |
q = bn+y |
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
// Windows 10 supports ANSI color code sequences, however they need to be enabled | |
// and apparently MinGW/MinGW-w64 doesn't support set the required STDOUT flag yet. This code enables ANSI VT processing | |
// on MinGW compilers however it hasn't been tested on older Windows systems yet which do not have that flag. | |
// So if you use this in production code you probably have to check if the platform is Windows 10. | |
#include <stdio.h> | |
#ifdef __MINGW32__ | |
#define NEED_COLOR_FIX | |
#endif |