Skip to content

Instantly share code, notes, and snippets.

View RBTree.py
from Tree import NIL, Node, Tree
class RBNode(Node):
def __init__(self, value, color):
super().__init__(value)
self.color = color
def __str__(self):
s = f'RBNode:\n'
s += f' color: {self.color}\n'
View Tree.py
class NilNode:
def __init__(self):
self.value = None
self.parent = None
self.left = None
self.right = None
NIL = NilNode()
class Node:
View pulp_constraint.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View optget.cpp
#include <iostream>
#include <unistd.h> // getopt
int main(int argc, char* argv[])
{
int a = 0;
int b = 0;
bool c = false;
View ntl.cpp
#include <iostream>
#include <fstream>
#include <NTL/LLL.h>
int main(int argc, char **argv)
{
NTL::Mat<int> B;
std::string basisfile = "tmp.txt";
std::ifstream fin(basisfile);
if( !fin.is_open() )
View optget.cpp
#include <iostream>
#include <unistd.h> // getopt
int main(int argc, char* argv[]) {
int a = 0;
int b = 0;
bool c = false;
// first argument parsing
View mpi_progress.cpp
#include <iostream>
#include <mpi.h>
#include <vector>
#include <deque>
#include <progresscpp/ProgressBar.hpp>
int main( int argc, char *argv[] ) {
int size, rank;
MPI_Init( &argc, &argv );
MPI_Comm_size( MPI_COMM_WORLD, &size );
View mpi_progress.cpp
#include <iostream>
#include <mpi.h>
#include <vector>
#include <progresscpp/ProgressBar.hpp>
int main( int argc, char *argv[] )
{
int size, rank;
MPI_Init( &argc, &argv );
MPI_Comm_size( MPI_COMM_WORLD, &size );
View mpi_send.cpp
#include <iostream>
#include <mpi.h>
#include <vector>
int main( int argc, char *argv[] )
{
int size, rank;
MPI_Init( &argc, &argv );
MPI_Comm_size( MPI_COMM_WORLD, &size );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
View mpi_gather.cpp
#include <iostream>
#include <mpi.h>
#include <vector>
int main( int argc, char *argv[] )
{
int size, rank;
MPI_Init( &argc, &argv );
MPI_Comm_size( MPI_COMM_WORLD, &size );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );