Skip to content

Instantly share code, notes, and snippets.

View nariaki3551's full-sized avatar

Nariaki Tateiwa nariaki3551

  • NTT Software Innovation Center
  • Tokyo
View GitHub Profile
#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() )
#include <iostream>
#include <unistd.h> // getopt
int main(int argc, char* argv[]) {
int a = 0;
int b = 0;
bool c = false;
// first argument parsing
#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 );
#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 );
#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 );
#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 );
#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 );
#include <iostream>
#include <mpi.h>
int main( int argc, char *argv[] )
{
int size, rank;
MPI_Init( &argc, &argv );
MPI_Comm_size( MPI_COMM_WORLD, &size ); // size(プロセス数)の取得
MPI_Comm_rank( MPI_COMM_WORLD, &rank ); // 自身のrankの取得
std::cout << "This worker is " << rank << " of " << size << std::endl; // 表示
#include <iostream>
#include <vector>
#include <random>
int main()
{
std::vector<std::pair<int, int>> combinations;
combinations.push_back(std::make_pair(0, 0));
combinations.push_back(std::make_pair(0, 1));
combinations.push_back(std::make_pair(1, 0));
#include <iostream>
#include <deque>
#include <vector>
int main() {
using Value = std::vector<int> *;
std::deque<Value> list;
Value elmA(new std::vector<int>{0,1});
Value elmB(new std::vector<int>{1,2});