Skip to content

Commit 764d002

Browse files
committed
added libsvm
1 parent 96cc27c commit 764d002

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+20090
-0
lines changed

libsvm/COPYRIGHT

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Copyright (c) 2000-2013 Chih-Chung Chang and Chih-Jen Lin
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions
7+
are met:
8+
9+
1. Redistributions of source code must retain the above copyright
10+
notice, this list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright
13+
notice, this list of conditions and the following disclaimer in the
14+
documentation and/or other materials provided with the distribution.
15+
16+
3. Neither name of copyright holders nor the names of its contributors
17+
may be used to endorse or promote products derived from this software
18+
without specific prior written permission.
19+
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22+
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
25+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

libsvm/FAQ.html

Lines changed: 1940 additions & 0 deletions
Large diffs are not rendered by default.

libsvm/Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
CXX ?= g++
2+
CFLAGS = -Wall -Wconversion -O3 -fPIC
3+
SHVER = 2
4+
OS = $(shell uname)
5+
6+
all: svm-train svm-predict svm-scale
7+
8+
lib: svm.o
9+
if [ "$(OS)" = "Darwin" ]; then \
10+
SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,libsvm.so.$(SHVER)"; \
11+
else \
12+
SHARED_LIB_FLAG="-shared -Wl,-soname,libsvm.so.$(SHVER)"; \
13+
fi; \
14+
$(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER)
15+
16+
svm-predict: svm-predict.c svm.o
17+
$(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm
18+
svm-train: svm-train.c svm.o
19+
$(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm
20+
svm-scale: svm-scale.c
21+
$(CXX) $(CFLAGS) svm-scale.c -o svm-scale
22+
svm.o: svm.cpp svm.h
23+
$(CXX) $(CFLAGS) -c svm.cpp
24+
clean:
25+
rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER)

libsvm/Makefile.win

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#You must ensure nmake.exe, cl.exe, link.exe are in system path.
2+
#VCVARS32.bat
3+
#Under dosbox prompt
4+
#nmake -f Makefile.win
5+
6+
##########################################
7+
CXX = cl.exe
8+
CFLAGS = -nologo -O2 -EHsc -I. -D __WIN32__ -D _CRT_SECURE_NO_DEPRECATE
9+
TARGET = windows
10+
11+
all: $(TARGET)\svm-train.exe $(TARGET)\svm-predict.exe $(TARGET)\svm-scale.exe $(TARGET)\svm-toy.exe lib
12+
13+
$(TARGET)\svm-predict.exe: svm.h svm-predict.c svm.obj
14+
$(CXX) $(CFLAGS) svm-predict.c svm.obj -Fe$(TARGET)\svm-predict.exe
15+
16+
$(TARGET)\svm-train.exe: svm.h svm-train.c svm.obj
17+
$(CXX) $(CFLAGS) svm-train.c svm.obj -Fe$(TARGET)\svm-train.exe
18+
19+
$(TARGET)\svm-scale.exe: svm.h svm-scale.c
20+
$(CXX) $(CFLAGS) svm-scale.c -Fe$(TARGET)\svm-scale.exe
21+
22+
$(TARGET)\svm-toy.exe: svm.h svm.obj svm-toy\windows\svm-toy.cpp
23+
$(CXX) $(CFLAGS) svm-toy\windows\svm-toy.cpp svm.obj user32.lib gdi32.lib comdlg32.lib -Fe$(TARGET)\svm-toy.exe
24+
25+
svm.obj: svm.cpp svm.h
26+
$(CXX) $(CFLAGS) -c svm.cpp
27+
28+
lib: svm.cpp svm.h svm.def
29+
$(CXX) $(CFLAGS) -LD svm.cpp -Fe$(TARGET)\libsvm -link -DEF:svm.def
30+
31+
clean:
32+
-erase /Q *.obj $(TARGET)\.
33+

0 commit comments

Comments
 (0)