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
FROM ubuntu:20.04
ENV HOME /svp_generator
WORKDIR ${HOME}
RUN apt-get update -y
RUN apt-get install -y sudo
RUN apt-get install -y tzdata
RUN apt-get install -y build-essential
RUN apt-get install -y wget
RUN apt-get install -y libgmp3-dev
# 参考書籍: De Berg, Mark, et al. "コンピュータ・ジオメトリ 計算幾何学: アルゴリズムと応用." (2000) 第5章
from dataclasses import dataclass
from typing import List, Tuple, Generator
class Point:
def __init__(self, name: str, loc: Tuple[float], **kwargs):
assert len(loc) == 2
self.name = name
#include <iostream>
#include <vector>
#include <mpi.h>
#define DATASIZE(VariableName) std::cout << # VariableName << " " << get_datasize(VariableName) << std::endl;
int get_datasize(MPI_Datatype datatype)
{
int datasize = 0;
MPI_Type_size(datatype, &datasize);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python3
# 開発環境: macOS Mojave(10.14.2), Python(3.7)
# 参考書籍: De Berg, Mark, et al. "コンピュータ・ジオメトリ 計算幾何学: アルゴリズムと応用." (2000) 第5章
# 木の定義
class Tree:
def __init__(self, pickle_file=None):
if pickle_file is None:
self.root = None
else:
# Copyright (c) 2022 Nariaki Tateiwa
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
import numpy as np
## Function
def softmax(x):
"""
Args:
x np.array
"""
if x.ndim == 2:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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'