⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sa.cpp

📁 一个模拟退火算法的改进程序
💻 CPP
字号:
// SA.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "ISA.h"

//
//码本大小和阶数
//
#define CB_SIZE 256
#define CB_ORDER 6


int main(int argc, char* argv[])
{

	float coebook_CB[CB_SIZE*CB_ORDER]={0};
	FILE *fp;
	int i;
	int j;


	//SA算法
	SA(coebook_CB);


    //存储码本训练到文件coebook_SA.txt
	fp=fopen("codebook_SA.txt","w");
	for(j = 0; j < CB_SIZE; j++)
	{
		fprintf(fp, "\n");
	    for(i = 0; i < CB_ORDER; i++)
		{
	    	fprintf(fp, "%f, ", *(coebook_CB+j*CB_ORDER+i)); 
		}		
	}
	
	fclose(fp);


	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -