
c
renbaifen
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
删除链表的指定位置、指定数值的结点
#if 1#include <stdio.h>#include <stdlib.h>struct Student { int num; float score; struct Student* next;};void output(struct Student* head);int main() { struct Student* head = NULL,*prep = NULL; struct Student* node,*tail = NULL; st..原创 2021-07-30 19:44:19 · 240 阅读 · 0 评论 -
atoi()函数
头文件#include <stdlib.h>int NoofRows, NoofCols, i, j,Total_threads,Noofthreads;Noofthreads=atoi(argv[1]);NoofRows=atoi(argv[2]);NoofCols=atoi(argv[3]);这样不用反复修改源文件中的线程数,矩阵规模等变量正常编译,只是执行的时...原创 2020-02-22 11:56:42 · 265 阅读 · 0 评论 -
C语言的几种不同的计时函数
clock()函数方法 clock_t time1,time2;time1 = clock(); time2 = clock();double run_time = (double)(time2-time1)/CLOCKS_PER_SEC;printf("runtime = %f\n",run_time); ...原创 2020-02-22 11:48:09 · 1175 阅读 · 0 评论 -
OpenMP实现矩阵转置
矩阵转置实际上是很简单的,但是数据类型是虚数的时候,编译器会认为实部虚部有数据依赖从而不能自动向量化,通过编译指导#pragma ivdep可以解除这种貌似的数据依赖,但是自动向量化的执行速度应该没有OpenMP快,干脆改成OpenMP并行得了。#include <stdio.h>#include <stdlib.h>#include <omp.h>...原创 2020-02-22 11:13:07 · 616 阅读 · 0 评论 -
Linux下压缩、合成、校验较大的文件
先生成MD5码,再拆分再合并,再验证转载 2020-02-08 17:42:26 · 338 阅读 · 0 评论 -
Linux输出当前系统时间
#include<time.h>#include<stdio.h>int main(){ struct tm *t; time_t tt; time(&tt); t = localtime(&tt); printf("%4d年%02d月%02d日 %02d:%02d:%02d\n", t->tm_year ...原创 2019-09-22 10:35:24 · 1743 阅读 · 0 评论 -
Linux 输出当前系统时间
#include<time.h>#include<stdio.h>int main(){ struct tm *t; time_t tt; time(&tt); t = localtime(&tt); printf("%4d年%02d月%02d日 %02d:%02d:%02d\n", t->tm_year ...2019-10-15 20:32:36 · 477 阅读 · 0 评论 -
c++ 傅里叶变换
#include <stdio.h>#include <stdlib.h>#include <stdint.h>#include <math.h>#include<iostream>#include "fftw3.h"using namespace std;#pragma comment(lib, "libfftw3-3.l...原创 2019-07-26 08:36:43 · 2064 阅读 · 0 评论 -
c语言c++用来指定输出的小数位数,实现任意长度的FFT,快速傅里叶变换
cout << setiosflags(ios::fixed) << setprecision(6) <<sum.real << "\t" << sum.imag << endl;#if 1#include <stdio.h>#include <complex.h>#include &l...原创 2019-07-25 22:32:59 · 941 阅读 · 0 评论 -
mpi测试程序
#include<stdio.h>#include<mpi.h>#include<stdlib.h>#include<time.h>int main(int argc, char* argv[]){ int myid, numprocs, namelen; char processor_name[MPI_MAX_PROC...原创 2019-07-11 11:01:30 · 2217 阅读 · 2 评论 -
安装gcc
安装gmp时,因为没有超级用户权限不能登录,不能按照:将2进行修改,,使用 ./configure --prefix=/path/to/install 设置安装路径。因为是没有root权限的,所以需要修改安装路径,安装到自己有权限的文件夹下。安装mpc过程中找不到*.la 的问题可以参考这个网站https://www.csdndoc.com/article/6665202?tdsour...原创 2019-05-17 19:02:28 · 531 阅读 · 0 评论 -
最速下降 最优化
#include <stdio.h>#include <stdlib.h>#include <malloc.h>#include <math.h>#include <string.h>#define m 2#define epsilon pow(10,-5)double norm_1(double *x);doubl...原创 2019-03-21 14:47:29 · 224 阅读 · 0 评论 -
c++字符串拷贝,将字符串a复制到字符串b中
#if 1#include<cstdio>#include<iostream>using namespace std;void copy_string(char *a,char *b){ int i=0; for(a[0] = a[0],b[0] = b[0];*a!='\0';a++,b++)//for(;*a!='\0';a++,b...原创 2019-03-10 21:11:30 · 9850 阅读 · 0 评论 -
c语言 实现二维数组的拷贝 memcpy函数的使用
#include <stdlib.h>#include <stdio.h>#include <string.h>void printarr2d(int (*a)[3],int row,int col);int main(){ int i,j; int a[2][3] = {{1,2,3},{4,5,6}}; int b[4][3...原创 2019-03-04 15:35:09 · 8165 阅读 · 0 评论 -
c语言中realloc 函数的使用
#include<stdio.h>#include<stdlib.h>int main(){ int n = 0; int i = 0; int index = 0; int insert_num = 0; int *pNumber = NULL; int *pNewArray = NULL; int *inse...原创 2019-03-04 15:17:33 · 2626 阅读 · 0 评论