-
KMEANS
This directory contains code implementing the K-means algorithm. Source code
may be found in KMEANS.CPP. Sample data isfound in KM2.DAT. The KMEANS
program accepts input consisting of vectors and calculates the given
number of cluster centers using the K-means algorithm. Output is
directed to the screen.
Usage for KMEANS is:
KMEANS SOURCEFILE <enter>
The format of the source file is:
NPat - Number of patterns (int)
SizeVect - Size of vector (int)
NClust - Number of cluster centers(int)
vect[1,1] ... vect[1,SizeVect] - vector 1 (real)
vect[2,1] ... vect[2,SizeVect] - vector 2 (real)
. .
. .
. .
vect[NPat,1] ... vect[NClust,SizeVector] - vector N (real)
To compile:
ICC KMEANS.CPP <enter>
(This directory contains code implementing the K-means algorithm. Source code
may be found in KMEANS.CPP. Sample data isfound in KM2.DAT. The KMEANS
program accepts input consisting of vectors and calculates the given
number of cluster centers using the K-means algorithm. Output is
directed to the screen.
Usage for KMEANS is:
KMEANS SOURCEFILE <enter>
The format of the source file is:
NPat - Number of patterns (int)
SizeVect - Size of vector (int)
NClust - Number of cluster centers(int)
vect[1,1] ... vect[1,SizeVect] - vector 1 (real)
vect[2,1] ... vect[2,SizeVect] - vector 2 (real)
. .
. .
. .
vect[NPat,1] ... vect[NClust,SizeVector]- vector N (real)
To compile:
ICC KMEANS.CPP <enter>
)
- 2013-01-05 23:11:23下载
- 积分:1
-
最优化作业C++源代码
用C++编的一些最优化作业中的程序,有Newton法,DFP法,共轭梯度法,单纯形法,内点法,外点法,内外点法,都能使用,我已经全部调试过了(C compile some of the most optimized operating procedures, Newton, DFP, conjugate gradient method, the simplex method, interior point method, the points outside the law, outside point method can use, I have all over Debugging)
- 2021-03-29 10:49:11下载
- 积分:1
-
11087 统计逆序对
说明: Description
设a[0…n-1]是一个包含n个数的数组,若在ia[j],则称(i, j)为a数组的一个逆序对(inversion)。
比如 有5个逆序对。请采用类似“合并排序算法”的分治思路以O(nlogn)的效率来实现逆序对的统计。
一个n个元素序列的逆序对个数由三部分构成:
(1)它的左半部分逆序对的个数,(2)加上右半部分逆序对的个数,(3)再加上左半部分元素大于右半部分元素的数量。
其中前两部分(1)和(2)由递归来实现。要保证算法最后效率O(nlogn),第三部分(3)应该如何实现?
此题请勿采用O(n^2)的简单枚举算法来实现。
并思考如下问题:
(1)怎样的数组含有最多的逆序对?最多的又是多少个呢?
(2)插入排序的运行时间和数组中逆序对的个数有关系吗?什么关系?
输入格式
第一行:n,表示接下来要输入n个元素,n不超过10000。
第二行:n个元素序列。
输出格式
逆序对的个数。
输入样例
5
2 3 8 6 1
输出样例
5(Set a[0... N-1] is a n array containing n numbers. If there is a [i] > a [j] i n the case of I < j, then (i, j) is a n inversion pair of a array.
For example, has five reverse pairs. Please use the idea of "merge sorting algorithm" to achieve the statistics of inverse pairs with O (nlogn) efficiency.
The number of inverse pairs of a sequence of n elements consists of three parts:
(1) The number of reverse pairs in the left half, (2) the number of reverse pairs in the right half, (3) the number of elements in the left half is greater than that in the right half.
The first two parts (1) and (2) are implemented by recursion. To ensure the final efficiency of the algorithm O (nlogn), how should the third part (3) be implemented?
Do not use O (n ^ 2) simple enumeration algorithm to solve this problem.)
- 2019-01-07 23:52:06下载
- 积分:1
-
mfix-2010.tar
多相流cfd程序,用fortran实现,有多流体和dem计算功能,当然还有其它更多功能(MFiX is a general-purpose computer code developed at the National Energy Technology Laboratory (NETL) for describing the hydrodynamics, heat transfer and chemical reactions in fluid-solids systems. It has been used for describing bubbling and circulating fluidized beds and spouted beds. MFiX calculations give transient data on the three-dimensional distribution of pressure, velocity, temperature, and species mass fractions. MFiX code is based on a generally accepted set of multiphase flow equations. The code is used as a "test-stand" for testing and developing multiphase flow constitutive equations.)
- 2020-09-15 21:07:56下载
- 积分:1
-
gauss-seidel
二维热传导扩散方程的高斯-赛德尔迭代方法。(A two-dimensional thermal diffusion problem using Gauss-Seidel iteration method.)
- 2021-01-18 14:28:44下载
- 积分:1
-
buitei
已经调试成功.内含m文件,可直接运行,迭代自组织数据分析,仿真图是速度、距离、幅度三维图像。( Has been successful debugging. M contains files can be directly run, Iterative self-organizing data analysis, FIG simulation speed, distance, amplitude three-dimensional image.)
- 2016-09-17 11:32:28下载
- 积分:1
-
cal
程序提示用户输入两个数,然后它将输出这两个数字的和、差、积、商、以及余数,分十进制和十六进制两种格式
(The program prompts the user to enter two numbers, then it will be the output of these two numbers and difference, product, quotient, and the remainder, and decimal and hexadecimal two formats)
- 2012-12-23 20:43:57下载
- 积分:1
-
corr_fast
快速计算相关系数的c代码,比较适用于统计学(Very efficient implementations for calculating correlation efficients )
- 2015-10-23 06:37:24下载
- 积分:1
-
RNX2GTEX
说明: 将GNSS RINEX数据转换为电离层总电子含量(GTEX格式)(Convert GNSS RINEX data to Ionospheric Total Electron Content (GTEX format))
- 2020-10-08 12:12:21下载
- 积分:1
-
cpp
说明: 你输入一个长方体的长和宽以及高,就可以输出他的面积(input height,width,length,output volume)
- 2010-04-11 21:19:10下载
- 积分:1