1.功能
用全選主元高斯消去法計算矩陣A的秩(C語言)
2.函數參數說明
double a[m][n] : 存放mxn階矩陣A的元素,返回時將被破壞
int m : 矩陣A的行數
int n : 矩陣A的列數
int rank() : 函數返回A的秩
3.文件說明
rank.c為函數程序
rank0.c為主函數程序
support vector classification machine
% soft margin
% uses "kernel.m"
%
% xtrain: (Ltrain,N) with Ltrain: number of points N: dimension
% ytrain: (Ltrain,1) containing class labels (-1 or +1)
% xrun: (Lrun,N) with Lrun: number of points N: dimension
% atrain: alpha coefficients (from svcm_train on xtrain and ytrain)
% btrain: offest coefficient (from svcm_train on xtrain and ytrain)
%
% ypred: predicted y (Lrun,1) containing class labels (-1 or +1)
% margin: (signed) separation from the separating hyperplane (Lrun,1
Implemented BFS, DFS and A*
To compile this project, use the following command:
g++ -o search main.cpp
Then you can run it:
./search
The input is loaded from a input file in.txt
Here is the format of the input file:
The first line of the input file shoud contain two chars indicate the source and destination city for breadth first and depth first algorithm.
The second line of input file shoud be an integer m indicate the number of connections for the map.
Following m lines describe the map, each line represents to one connection in this form: dist city1 city2, which means there is a connection between city1 and city2 with the distance dist.
The following input are for A*
The following line contains two chars indicate the source and destination city for A* algorithm.
Then there is an integer h indicate the number of heuristic.
The following h lines is in the form: city dist which means the straight-line distance from the city to B is dist.