Categories

## I have a warning “passing argument 2 of ‘bins’ make integer from pointer without cast”, could anyone help me?

In a binary search, I have the warning I wrote in the title: #include <stdio.h> int bins(int, int, int, int);/*this function do a binary search*/ int main() { int n, low, high, v[]={0,1,2,3,4,5,6,7,8,9,10}; low=0;high=11; printf(“please enter the num you want to find\n:”); scanf(“%d”, &n); printf(“%d”, bins(n, v, low, high)); return 0; } int bins(int n, […]

Categories

## Determine if 2 segments located in 2 matrices intersect

I have two matrices stored as numpy arrays, each containing a number of segments. They look as such: ts = np.array([[ 26., 13., 40., 0.], [ 67., 17., 48., 79.], [ 8., 102., 11., 117.]]) vs = np.array([[ 237.01219512, 7.52439024, 158.50929615, 119.50398406], [ 237.01219512, 7.52439024, -113.48853868, 481.39398281], [ 158.50929615, 119.50398406, 154.50068752, 102.91663802]]) Basically each storing […]

Categories

## Classical molecular dynmaics simulation by Sci-lab

I am doing classical molecular dynamics simulation where we are using the fact that interaction between two molecules i.e in our case noble gas is determined by LJ potential curve.To solve it we are using velocity velret method to do. Below is the code and paramter done in scilab where N=32,v0=1,tf=15 My code function [x,y]=artrial(N,v0,tf) […]

Categories