Skip to content

Instantly share code, notes, and snippets.

@PiotrWegrzyn
PiotrWegrzyn / zadanie1.cpp
Created April 26, 2017 16:24
Systemy Op. - Zadanie nr.1 Odczytanie zawartosci pliku i zapisanie do pliku.
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <errno.h>
#include <iostream>
extern int errno;
int main (int argc, char **argv){
@PiotrWegrzyn
PiotrWegrzyn / listy.cpp
Last active April 27, 2017 09:24
Algorytmy i Struktury Danych - Implementacja listy w C++
#include <iostream>
using namespace std;
struct node {
int val;
node * next = NULL;
};
struct list {
node * head = NULL;
#include <iostream>
using namespace std;
//https://gist.github.com/Brejw15/5aed87ba877a0c8cef8b02efc582e7d4
//https://codeshare.io/algorytmyOperacjeNaListach
struct node{
int val;
node * next;
};
#include <iostream>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
//https://gist.github.com/Brejw15/1a1b8cb682577264493098ae90d7e511
//http://eduinf.waw.pl/inf/alg/001_search/0114.php
using namespace std;
/*Filename: MN03_Newton
Author: Peter_Wegrzyn
Date: 20.03.18
Kod jest dostosowany do danych z przykladu ze strony http://galaxy.agh.edu.pl/~mhojny/repozytoria/mn/InterpolacjaN.pdf
Jeżeli chce Ci sie wpisywać swoje dane to należy jedynie odkomentować zakomentowane linie oraz zakomentowac tworzenie tabeli.
*/
#include <iostream>
using namespace std;
#include <iostream>
using namespace std;
double newton(int ** &resultsTable, int * tabX, int* tabY, int k , int i) {
if (resultsTable[i][k] == NULL) {
@PiotrWegrzyn
PiotrWegrzyn / GrafikaKomputerowaKrzyweB-Skladane.cs
Last active April 23, 2018 10:19
C#;Grafika komputerowa;Krzywe B-Składane;April2018
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@PiotrWegrzyn
PiotrWegrzyn / NewtonCotesQuadrature.cpp
Created May 1, 2018 02:00
Metody numeryczne 01.05.18
#include <iostream>
using namespace std;
double compositeTrapezoidRule(double * pointsX, double *pointsY, int N){
double h = (pointsX[N - 1] - pointsX[0]) / (N - 1);
double area = 0.0;
area += pointsY[0] + pointsY[N - 1];
for (int i = 1; i < N - 1; i ++){
area += 2 * pointsY[i];
@PiotrWegrzyn
PiotrWegrzyn / JacobianAndGaussSeidel.cpp
Last active June 4, 2018 21:37
Numeryczne rozwiązywanie układu równań liniowych metodą Jacobiego.
#include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;
//matrix of constatns:
//|a0, a1, a2, a3|
//|a4, a5, a6, a7|
//|a8, a9,a10,a11|
//matrix of variables: |x0,x1,x2...xn|
@PiotrWegrzyn
PiotrWegrzyn / Jacobian.cpp
Last active June 5, 2018 12:48
Numeryczne rozwiązywanie układu równań liniowych metodą Jacobiego.
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
void metoda_Jacobiego();
bool gauss(int, double**, double*);