Added Copyright information

This commit is contained in:
2018-12-10 12:05:48 -05:00
parent 070a568dca
commit c6794e1c6f
5 changed files with 751 additions and 9 deletions

View File

@@ -1,8 +1,24 @@
//myClasses/Algorithms.hpp
//Matthew Ellison
// Created: 11-8-18
//Modified: 11-8-18
//This file contains the declarations to several algoritms that I have found useful
//Modified: 12-10-18
//This file contains the declarations and implementations to several algoritms that I have found useful
/*
Copyright (C) 2018 Matthew Ellison
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef MEE_ALGORITHMS_HPP
#define MEE_ALGORITHMS_HPP
@@ -11,13 +27,15 @@
#include <cinttypes>
#include <algorithm>
#include <string>
//This library is licensed under lgplv3
//You can find more information at gmplib.org
#include <gmpxx.h> //This is necessary for the getGmpFib function for numbers larger than a normal int can hold. It can be commented out if needed
namespace mee{
//A list of functions in the file
//Also works as a declaration
//Also works as prototypes with general information
//This is a function that returns all the primes <= goalNumber and returns a vector with those prime numbers
template<class T>
std::vector<T> getPrimes(T goalNumber);
@@ -46,10 +64,10 @@ bool quickSort(std::vector<T> nums);
//This is a function that performs a search on a vector and returns the subscript of the item being searched for (-1 if not found)
template<class T>
int64_t search(std::vector<T> nums, T num);
//This function finds the minimum element in a vector
//This function finds the smallest element in a vector
template<class T>
T findMin(std::vector<T> arr);
//This function finds the maximum element in a vector
//This function finds the largest element in a vector
template<class T>
T findMax(std::vector<T> arr);
@@ -236,7 +254,7 @@ int64_t search(std::vector<T> nums, T num){
return -1;
}
//This function finds the minimum of a vector
//This function finds the smallest element in a vector
template<class T>
T findMin(std::vector<T> arr){
T min; //For the smallest element
@@ -258,7 +276,7 @@ T findMin(std::vector<T> arr){
return min;
}
//This function finds the maximum of a vector
//This function finds the largest element in a vector
template<class T>
T findMax(std::vector<T> arr){
T max; //For the largest element