#include "Functions.h"

double Sigmoid(double x,double al)
{
	double y = 1 / (1 + exp(-al * x));
	return y;
}

double DerSig(double x,double al)
{
	double y = x * (1 - x) * al;
	return y;
}

double Linear(double x,double k)
{
	return x * k;
}

double DerLin(double x,double k)
{
	return k;
}

double Abs(double x)
{
	if(x < 0)
		x *= -1;
	return x;
}

int Calc(int i,int j,int width)
{
	return i * width + j;
}

void Swap(int & x,int & y)
{
	int t = x;
	x = y;
	y = t;
}
