Skip to content

Instantly share code, notes, and snippets.

-1
1
-1
1
-1
-1
1
1
1
1
1
-1
1
1
1
1
1
1
1
1
/*
* implement with DFS
*/
pNode getBest(pNode head, getNodeChildrenFunc getChildren, \
getNodeValFunc getVal, freeNodeFunc freeNode, copyNodeFunc copy, unsigned int best)
{
/* head */
pNode* childs;
unsigned num_of_childs = getChildren(head, childs);
/* node */
@lironsade
lironsade / ConvexHull.cpp
Last active September 1, 2017 19:18
ConvexHull.cpp
#include <iostream>
#include <math.h>
#include <algorithm>
#include "Point.h"
#include "PointSet.h"
static Point minPoint;
PointSet& getInput()
{
PointSet *ps = new PointSet{};
CC=g++
LDLIBS=-lm
CFLAGS= -Wextra -g -Wall -Wvla -std=c++17
TARFLAGS= -cvf
#TARARGS=README Makefile Point.h Point.cpp PointSet.h PointSet.cpp ConvexHull.cpp PointSetBinaryOperations.cpp
all: ConvexHull PointSetBinaryOperations
./PointSetBinaryOperations
tar: README Makefile Point.h Point.cpp PointSet.h PointSet.cpp ConvexHull.cpp PointSetBinaryOperations.cpp
CC=g++
LDLIBS=-lm
CFLAGS= -Wextra -Wall -Wvla -pthread -std=c++17
TARFLAGS= -cvf
TARARGS=README Makefile Point.h Point.cpp PointSet.h PointSet.cpp ConvexHull.cpp PointSetBinaryOperations.cpp
all: ConvexHull PointSetBinaryOperations
./PointSetBinaryOperations
tar: $(TARARGS)
//
// Created by liron on 9/7/17.
//
#include <memory>
#include "ShapeFactory.h"
/**
* Creates a shape of the given type and points.
//
// Created by liron on 9/11/17.
//
#ifndef EX3_MATRIX_HPP
#define EX3_MATRIX_HPP
#include <vector>
def parseDest(dest):
destTable = {
None: "000",
"M": "001",
"D": "010",
"A": "100",
"MD": "011",
"AM": "101",
"AD": "110",
"AMD": "111"
def prove_instance(proof, instance):
""" Return a proof of the given instance of the inference rule that proof
proves, via the same inference rules used by proof """
# Task 5.2.1
instantiation_map = dict()
if not instance.is_instance_of(proof.statement, instantiation_map):
return None
my_lines = []
for line in proof.lines:
my_lines.append(