Skip to content

Instantly share code, notes, and snippets.

View l-bat's full-sized avatar
🍀
🐨

Liubov Talamanova l-bat

🍀
🐨
View GitHub Profile
@l-bat
l-bat / main.cpp
Created October 1, 2017 13:45
Сиднев 2
#include <iostream>
#include <unordered_set>
#include <random>
#include <fstream>
namespace std {
template<>
class hash<S> {
public:
@l-bat
l-bat / main.cpp
Created October 2, 2017 16:39
New 02-10-17
#include <iostream>
#include <unordered_set>
#include <random>
#include <fstream>
using Key = std::pair<std::string, std::pair<float, float>>;
namespace std {
template<>
class hash<Key> {
@l-bat
l-bat / main.cpp
Created October 3, 2017 09:05
cash to hash
namespace std {
template<>
class hash<Key> {
public:
size_t operator()(const Key& s) const
{
mt19937_64 generator{random_device()()};
uniform_int_distribution<unsigned> distribution(1, 8);
unsigned i1 = static_cast<const unsigned &>(s.second.first * 1000);
@l-bat
l-bat / main.cpp
Created October 4, 2017 17:41
finalTask2
#include <iostream>
#include <unordered_set>
#include <random>
#include <fstream>
#include <iterator>
#include <algorithm>
using namespace std;
using Key = std::pair<std::string, std::pair<float, float>>;
namespace std {
@l-bat
l-bat / CMakeLists.txt
Created October 6, 2017 10:01
MPI CMake
cmake_minimum_required(VERSION 3.4)
project(Task1_Batanina)
set(CMAKE_CXX_STANDARD 11)
set(SOURCE_FILES MPI_main.cpp)
#set(SOURCE_FILES main.cpp )
add_executable(Task1_Batanina ${SOURCE_FILES})
find_package(MPI REQUIRED)
@l-bat
l-bat / MPI_main.cpp
Created October 8, 2017 05:51
Trouble with sum
#include <iostream>
#include <vector>
#include <random>
#include <mpi.h>
int main(int argc, char* argv[]) {
int row = atoi(argv[1]);
int col = atoi(argv[2]);
@l-bat
l-bat / MPI_main.cpp
Created October 8, 2017 12:27
trash_sum
#include <iostream>
#include <vector>
#include <random>
#include <mpi.h>
int main(int argc, char* argv[]) {
int row = atoi(argv[1]);
int col = atoi(argv[2]);
@l-bat
l-bat / main.cpp
Created October 18, 2017 15:26
weak_ptr
#include <iostream>
template <class T>
class my_unique_ptr
{
private:
T* ptr;
public:
my_unique_ptr()
{
@l-bat
l-bat / main.cpp
Created October 24, 2017 16:42
smart_pointers
#include <iostream>
template <class T>
class my_unique_ptr
{
private:
T* ptr;
public:
my_unique_ptr() : ptr(nullptr) {};
my_unique_ptr( const my_unique_ptr& ) = delete;
@l-bat
l-bat / main.cpp
Created November 5, 2017 09:48
MPI_2 Cжимает картинку, гистограммы одинаковые
#include <iostream>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <chrono>
#include <mpi.h>
#include <cmath>
int main(int argc, char* argv[]) {
cv::namedWindow("input");