From 3a937d2ecb6fbc4f0488a59fdace31af2159f9b0 Mon Sep 17 00:00:00 2001 From: MitchellHansen Date: Fri, 25 Nov 2016 20:23:30 -0800 Subject: [PATCH] Added gitignore among other things --- .gitignore | 318 ++++++++++++++++++++++++++++++++ lab1/main.cpp | 71 +------ lab2/functions.hpp | 3 + lab2/iterative_local_search.hpp | 3 + lab3/functions.hpp | 3 + lab3/iterative_local_search.hpp | 2 + lab4/CMakeLists.txt | 4 +- lab4/functions.hpp | 3 + lab4/iterative_local.hpp | 2 + 9 files changed, 339 insertions(+), 70 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..758e5fd --- /dev/null +++ b/.gitignore @@ -0,0 +1,318 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates +*.vcxproj.filters + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/ + +CMakeCache.txt +CMakeFiles +CMakeScripts +Makefile +cmake_install.cmake +install_manifest.txt +CTestTestfile.cmake + + diff --git a/lab1/main.cpp b/lab1/main.cpp index 28be4d0..da8cb2e 100644 --- a/lab1/main.cpp +++ b/lab1/main.cpp @@ -1,10 +1,11 @@ +#define _USE_MATH_DEFINES +#include #include #include -#include #include #include #include "mtrand.h" - +#include std::vector c = {0.806,0.517,0.1,0.908,0.965,0.669,0.524,0.902,0.351,0.876,0.462, @@ -467,72 +468,6 @@ struct function{ }; - - void draw(){ - - int bounds = fabs(upper_bound) + fabs(lower_bound); - int window_xy = 1024; - sf::RenderWindow window(sf::VideoMode(window_xy, window_xy), "Functions"); - sf::Uint8* pixel_array = new sf::Uint8[window_xy * window_xy * 4]; - sf::Texture texture; - texture.create(window_xy, window_xy); - sf::Sprite sprite(texture); - - - double min = 9999999; - double max = 0; - - for (int i = 0; i < window_xy * window_xy * 4; i += 4) { - - std::vector position = - {static_cast(set_within(((i / 4) % window_xy) - window_xy/2, 512, -512, upper_bound, lower_bound)), - static_cast(set_within(((i / 4) / window_xy) - window_xy/2, 512, -512, upper_bound, lower_bound))}; - - auto res = static_cast(compute_defined(position)); - if (res > max) - max = res; - if (res < min) - min = res; - } - - for (int i = 0; i < window_xy * window_xy * 4; i += 4){ - - std::vector position = - {static_cast(set_within(((i / 4) % window_xy) - window_xy/2, 512, -512, upper_bound, lower_bound)), - static_cast(set_within(((i / 4) / window_xy) - window_xy/2, 512, -512, upper_bound, lower_bound))}; - - auto res = static_cast((((compute_defined(position) - min) * (16581375 - 0)) / (max - min)) + 0); - - pixel_array[i + 0] = res & 0xff; - pixel_array[i + 1] = (res>>8) & 0xff; - pixel_array[i + 2] = (res>>16) & 0xff; - pixel_array[i + 3] = 255; - - //pixel_array[i + 0] = res; - //pixel_array[i + 1] = 255; - //pixel_array[i + 2] = 255; - //pixel_array[i + 3] = 255; - - } - - texture.update(pixel_array); - - while (window.isOpen()) { - - sf::Event event; - while (window.pollEvent(event)) { - if (event.type == sf::Event::Closed) - window.close(); - } - - window.clear(); - window.draw(sprite); - window.display(); - - } - - delete pixel_array; - }; }; int main() { diff --git a/lab2/functions.hpp b/lab2/functions.hpp index 2ea66c2..93d3743 100644 --- a/lab2/functions.hpp +++ b/lab2/functions.hpp @@ -1,3 +1,6 @@ +#pragma once +#define _USE_MATH_DEFINES +#include std::vector c = {0.806,0.517,0.1,0.908,0.965,0.669,0.524,0.902,0.351,0.876,0.462, 0.491,0.463,0.741,0.352,0.869,0.813,0.811,0.0828,0.964,0.789,0.360,0.369, diff --git a/lab2/iterative_local_search.hpp b/lab2/iterative_local_search.hpp index e2b6483..2020123 100644 --- a/lab2/iterative_local_search.hpp +++ b/lab2/iterative_local_search.hpp @@ -59,7 +59,10 @@ public: global_best_solution = best_solution; } } + + return func.compute(global_best_solution); }; + }; diff --git a/lab3/functions.hpp b/lab3/functions.hpp index 6fca5ba..8ecd6fa 100644 --- a/lab3/functions.hpp +++ b/lab3/functions.hpp @@ -1,3 +1,6 @@ +#pragma once +#define _USE_MATH_DEFINES // for C++ +#include std::vector c = {0.806,0.517,0.1,0.908,0.965,0.669,0.524,0.902,0.351,0.876,0.462, 0.491,0.463,0.741,0.352,0.869,0.813,0.811,0.0828,0.964,0.789,0.360,0.369, diff --git a/lab3/iterative_local_search.hpp b/lab3/iterative_local_search.hpp index e2b6483..d115d19 100644 --- a/lab3/iterative_local_search.hpp +++ b/lab3/iterative_local_search.hpp @@ -59,6 +59,8 @@ public: global_best_solution = best_solution; } } + + return func.compute(global_best_solution); }; }; diff --git a/lab4/CMakeLists.txt b/lab4/CMakeLists.txt index 37cd886..848a073 100644 --- a/lab4/CMakeLists.txt +++ b/lab4/CMakeLists.txt @@ -1,6 +1,6 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.4.3) -project(Lab4) +add_project(Lab4) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/lab4/functions.hpp b/lab4/functions.hpp index 6fca5ba..8ecd6fa 100644 --- a/lab4/functions.hpp +++ b/lab4/functions.hpp @@ -1,3 +1,6 @@ +#pragma once +#define _USE_MATH_DEFINES // for C++ +#include std::vector c = {0.806,0.517,0.1,0.908,0.965,0.669,0.524,0.902,0.351,0.876,0.462, 0.491,0.463,0.741,0.352,0.869,0.813,0.811,0.0828,0.964,0.789,0.360,0.369, diff --git a/lab4/iterative_local.hpp b/lab4/iterative_local.hpp index d477a21..199298c 100644 --- a/lab4/iterative_local.hpp +++ b/lab4/iterative_local.hpp @@ -59,6 +59,8 @@ public: global_best_solution = best_solution; } } + + return func.compute(global_best_solution); }; };