This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Euler's totient function phi(n). | |
* http://en.wikipedia.org/wiki/Euler%27s_totient_function | |
* | |
* This is an *EXTREMELY* fast function and uses | |
* several tricks to recurse. | |
* | |
* It assumes you have a list of primes and a fast | |
* isprime() function. Typically, you use a bitset | |
* to implement the sieve of Eratosthenes and use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%To illustrate the Rectangular Waveguide TM mode using MATLAB | |
clc; | |
close all; | |
clear all; | |
f=8e9; | |
w=2*pi*f; | |
t=1/f; | |
L=3e11/f; | |
B=2*pi/L; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<process.h> | |
int main() | |
{ | |
char p[10][5]; | |
int tot=0,wt[10], pt[10], i,n; | |
double avg=0; | |
printf("enter no of processes: "); | |
scanf("%d",&n); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
#define eps 0.000001 | |
using namespace std; | |
double a[50][50], b[50], x[50]; | |
void GAUSS(int n, double a[50][50], double b[50], double x[50], int *status) | |
{ | |
double pivot, factor, sum; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
#define DIST(x1,x2, y1, y2) (((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2))) | |
#define DIST3D(x1,x2, y1, y2, z1, z2) (((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)) + ((z1-z2)*(z1-z2))) | |
#define CLR(a) a.clear() | |
#define VCLR(a, n) for(int i=0; i<=n+3; i++) a[i].clear() | |
#define SIZE(a) a.size() | |
#define ERASE(a, b) memset(a, b, sizeof a) | |
#define PB(a, b) a.push_back(b) | |
#define PB2(a,i,b) a[i].push_back(b) | |
#define LL long long |