📄 tools.c
字号:
/* * Some helper functions * * $Id: tools.c 1269 2007-05-09 07:49:08Z mhe $ **/#include <stdio.h>#include <stdlib.h>#include "lstm.h"#include "tools.h"int seprand(int k) { long l; int f; l = random(); f = l % k; return(f);}/* shuffle a dataset of sequences */void shuffle (int *a, int num_prot) { int i,pick; int *dd,*ss,b[500000]; for (i = 0; i < num_prot; i++) { b[i] = i; } for (i = 0; i < num_prot; i++) { int rand = seprand(num_prot-i); pick = b[rand]; a[i] = pick; // // "shift" routine here eliminates the "picked" base from b: // dd starts at the picked position: ss is one beyond that: // for( dd = b+rand , ss = dd + 1 ; *dd ; *dd++=*ss++ ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -