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
int testfgets(char *fastqFile) { | |
clock_t start, end; | |
double cpu_time_used; | |
char *line = malloc(sizeof(char) * MAXLINELEN); | |
start = clock(); | |
FILE *ptr; | |
if ((ptr = fopen(fastqFile, "r")) == NULL) { | |
printf("no such file as %s \n", fastqFile); | |
return 0; |
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
#define C_SHIFT 1 //01 | |
#define G_SHIFT 2 //10 | |
#define T_SHIFT 3 //11 | |
/** | |
* | |
* @param readString: The DNA sequence to be encoded | |
* @param stringLength : The number of characters in the DNA sequence | |
* @return uint8_t type array of bits | |
*/ | |
uint8_t *bitEncode(char *readString, int stringLength) { |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <time.h> | |
#define n 2048 | |
double A[n][n]; | |
double B[n][n]; | |
double C[n][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
import java.util.Random; | |
public class MatrixMultiplication { | |
static int n = 2048; | |
static double[][] A = new double[n][n]; | |
static double[][] B = new double[n][n]; | |
static double[][] C = new double[n][n]; | |
public static void main(String[] args) { | |
//populate the matrices with random values between 0.0 and 1.0 |
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
import random | |
import time | |
n = 2048 | |
#populate the matrices with random values between 0.0 and 1.0 | |
A = [[random.random() for row in range(n)] for col in range(n)] | |
B = [[random.random() for row in range(n)] for col in range(n)] | |
C = [[0 for row in range(n)] for col in range(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
//courtesy of MIT Open Courseware (https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-172-performance-engineering-of-software-systems-fall-2018/lecture-slides/MIT6_172F18_lec2.pdf) | |
#include <math.h> | |
void orrery (){ | |
const double radius = 6371000.0; | |
const double diameter = 2 * radius; | |
const double circumference = M_PI * diameter; | |
const double cross_area = M_PI * radius * radius; | |
const double surface_area = circumference * diameter; | |
} |
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
//courtesy: MIT Open Courseware (https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-172-performance-engineering-of-software-systems-fall-2018/lecture-slides/MIT6_172F18_lec2.pdf) | |
#include <stdbool.h> | |
#include <math.h> | |
typedef struct{ | |
double x; //x-coordinate | |
double y; //y-coordinate | |
double z; //z-coordinate | |
double r; // radius of the ball | |
} ball_t; |
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
//courtesy: MIT Open Courseware (https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-172-performance-engineering-of-software-systems-fall-2018/lecture-slides/MIT6_172F18_lec2.pdf) | |
#include <stdbool.h> | |
#include <math.h> | |
typedef struct{ | |
double x; //x-coordinate | |
double y; //y-coordinate | |
double z; //z-coordinate | |
double r; // radius of the ball | |
} ball_t; |
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
void full_adder(int a, int b, int c, int *sum, int *carry) { | |
if (a == 0) { | |
if (b == 0) { | |
if (c == 0) { | |
*carry = 0; | |
*sum = 0; | |
} else { | |
*carry = 0; | |
*sum = 1; | |
} |
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
void full_adder(int a, int b, int c, int *sum, int *carry) { | |
int test = ((a == 1) << 2 | (b == 1) << 1 | (c == 1)); | |
switch (test) { | |
case 0: | |
*carry = 0; | |
*sum = 0; | |
break; | |
case 1: | |
*carry = 0; |
OlderNewer