├── src ├── lapack │ ├── precomp.c │ ├── f77_aloc.c │ ├── pow_ii.c │ ├── pow_ri.c │ ├── pow_di.c │ ├── s_cmp.c │ ├── s_copy.c │ ├── s_cat.c │ ├── dlamch_custom.c │ ├── slapy2.c │ ├── slaisnan.c │ ├── dlapy2.c │ ├── dlaisnan.c │ ├── drot.c │ ├── srot.c │ ├── isamax.c │ ├── idamax.c │ ├── sscal.c │ ├── xerbla.c │ ├── dscal.c │ ├── dnrm2.c │ ├── snrm2.c │ ├── slabad.c │ ├── dlabad.c │ ├── ilaslc.c │ ├── ilaslr.c │ ├── iladlc.c │ ├── iladlr.c │ ├── scopy.c │ ├── dcopy.c │ ├── saxpy.c │ ├── daxpy.c │ ├── dasum.c │ ├── sasum.c │ ├── sdot.c │ ├── sswap.c │ ├── dswap.c │ ├── ddot.c │ ├── slassq.c │ ├── dlassq.c │ ├── slamrg.c │ ├── slacpy.c │ ├── dlamrg.c │ ├── slamch_custom.c │ ├── dlacpy.c │ ├── spotri.c │ ├── dpotri.c │ └── slasdt.c ├── zlib │ ├── inffast.h │ ├── gzclose.c │ ├── uncompr.c │ ├── compress.c │ └── inftrees.h └── opencv │ ├── calib3d │ ├── precomp.hpp │ └── _modelest.h │ ├── objdetect │ └── precomp.hpp │ ├── contrib │ └── precomp.hpp │ └── imgproc │ └── _geom.h ├── include ├── opencv │ ├── cxmisc.h │ ├── cvwimage.h │ ├── ml.h │ ├── cxeigen.hpp │ ├── highgui.h │ ├── cvaux.hpp │ ├── cv.hpp │ ├── cxcore.hpp │ ├── cxcore.h │ ├── cvaux.h │ └── cv.h ├── cblas.h ├── mm_malloc.h └── opencv2 │ ├── core │ └── version.hpp │ ├── flann │ ├── timer.h │ ├── logger.h │ ├── all_indices.h │ ├── object_factory.h │ ├── sampling.h │ ├── ground_truth.h │ ├── nn_index.h │ ├── matrix.h │ └── linear_index.h │ └── opencv.hpp ├── .gitignore ├── flash ├── MyClass.as ├── test_cv.cpp ├── lrint.cpp └── camlib.cpp └── README /src/lapack/precomp.c: -------------------------------------------------------------------------------- 1 | #include "clapack.h" 2 | -------------------------------------------------------------------------------- /include/opencv/cxmisc.h: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCV_OLD_CXMISC_H__ 2 | #define __OPENCV_OLD_CXMISC_H__ 3 | 4 | #include "opencv2/core/internal.hpp" 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.swc 3 | *.swf 4 | src/opencv/calib3d/log/ 5 | src/opencv/contrib/log/ 6 | src/opencv/core/log/ 7 | src/opencv/imgproc/log/ 8 | src/opencv/objdetect/log/ 9 | src/zlib/log/ 10 | -------------------------------------------------------------------------------- /src/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /src/lapack/f77_aloc.c: -------------------------------------------------------------------------------- 1 | #include "clapack.h" 2 | #undef abs 3 | #undef min 4 | #undef max 5 | #include "stdio.h" 6 | 7 | static integer memfailure = 3; 8 | 9 | #include "stdlib.h" 10 | 11 | char* F77_aloc(integer Len, char *whence) 12 | { 13 | char *rv; 14 | unsigned int uLen = (unsigned int) Len; /* for K&R C */ 15 | 16 | if (!(rv = (char*)malloc(uLen))) { 17 | fprintf(stderr, "malloc(%u) failure in %s\n", 18 | uLen, whence); 19 | exit_(&memfailure); 20 | } 21 | return rv; 22 | } 23 | -------------------------------------------------------------------------------- /flash/MyClass.as: -------------------------------------------------------------------------------- 1 | package 2 | { 3 | import flash.display.Sprite; 4 | 5 | import cmodule.cvtest.CLibInit; 6 | 7 | public class MyClass extends Sprite 8 | { 9 | //C library loader 10 | private var lib:Object; 11 | 12 | //WebCam constructor and entry point 13 | public function MyClass():void 14 | { 15 | trace("Loading C++ library") 16 | var loader:CLibInit = new CLibInit(); 17 | lib = loader.init(); 18 | trace("Testing OpenCV interaction"); 19 | trace(lib.test()); 20 | trace("OK"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/lapack/pow_ii.c: -------------------------------------------------------------------------------- 1 | #include "clapack.h" 2 | 3 | integer pow_ii(integer *ap, integer *bp) 4 | { 5 | integer pow, x, n; 6 | unsigned long u; 7 | 8 | x = *ap; 9 | n = *bp; 10 | 11 | if (n <= 0) { 12 | if (n == 0 || x == 1) 13 | return 1; 14 | return x != -1 ? 0 : (n & 1) ? -1 : 1; 15 | } 16 | u = n; 17 | for(pow = 1; ; ) 18 | { 19 | if(u & 01) 20 | pow *= x; 21 | if(u >>= 1) 22 | x *= x; 23 | else 24 | break; 25 | } 26 | return(pow); 27 | } 28 | -------------------------------------------------------------------------------- /src/lapack/pow_ri.c: -------------------------------------------------------------------------------- 1 | #include "clapack.h" 2 | 3 | double pow_ri(real *ap, integer *bp) 4 | { 5 | double pow, x; 6 | integer n; 7 | unsigned long u; 8 | 9 | pow = 1; 10 | x = *ap; 11 | n = *bp; 12 | 13 | if(n != 0) 14 | { 15 | if(n < 0) 16 | { 17 | n = -n; 18 | x = 1/x; 19 | } 20 | for(u = n; ; ) 21 | { 22 | if(u & 01) 23 | pow *= x; 24 | if(u >>= 1) 25 | x *= x; 26 | else 27 | break; 28 | } 29 | } 30 | return(pow); 31 | } 32 | -------------------------------------------------------------------------------- /src/lapack/pow_di.c: -------------------------------------------------------------------------------- 1 | #include "clapack.h" 2 | 3 | double pow_di(doublereal *ap, integer *bp) 4 | { 5 | double pow, x; 6 | integer n; 7 | unsigned long u; 8 | 9 | pow = 1; 10 | x = *ap; 11 | n = *bp; 12 | 13 | if(n != 0) 14 | { 15 | if(n < 0) 16 | { 17 | n = -n; 18 | x = 1/x; 19 | } 20 | for(u = n; ; ) 21 | { 22 | if(u & 01) 23 | pow *= x; 24 | if(u >>= 1) 25 | x *= x; 26 | else 27 | break; 28 | } 29 | } 30 | return(pow); 31 | } 32 | -------------------------------------------------------------------------------- /flash/test_cv.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "AS3.h" 4 | #include "lrint.cpp" 5 | 6 | int testCV() 7 | { 8 | cv::Mat a(3,3,CV_8UC1,cv::Scalar(1.0)); 9 | cv::Mat b(3,3,CV_8UC1,cv::Scalar(2.0)); 10 | cv::Mat c; 11 | c=a+b; 12 | return (int)c.at(0,0); 13 | } 14 | 15 | static AS3_Val test(void* self, AS3_Val args) 16 | { 17 | int res = testCV(); 18 | return AS3_Int(res); 19 | } 20 | 21 | int main() 22 | { 23 | AS3_Val testMethod = AS3_Function(NULL,test); 24 | AS3_Val result = AS3_Object("test: AS3ValType",testMethod); 25 | AS3_Release(testMethod); 26 | 27 | AS3_LibInit(result); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /src/lapack/s_cmp.c: -------------------------------------------------------------------------------- 1 | #include "clapack.h" 2 | 3 | /* compare two strings */ 4 | 5 | integer s_cmp(char *a0, char *b0, ftnlen la, ftnlen lb) 6 | { 7 | register unsigned char *a, *aend, *b, *bend; 8 | a = (unsigned char *)a0; 9 | b = (unsigned char *)b0; 10 | aend = a + la; 11 | bend = b + lb; 12 | 13 | if(la <= lb) 14 | { 15 | while(a < aend) 16 | if(*a != *b) 17 | return( *a - *b ); 18 | else 19 | { ++a; ++b; } 20 | 21 | while(b < bend) 22 | if(*b != ' ') 23 | return( ' ' - *b ); 24 | else ++b; 25 | } 26 | 27 | else 28 | { 29 | while(b < bend) 30 | if(*a == *b) 31 | { ++a; ++b; } 32 | else 33 | return( *a - *b ); 34 | while(a < aend) 35 | if(*a != ' ') 36 | return(*a - ' '); 37 | else ++a; 38 | } 39 | return(0); 40 | } 41 | -------------------------------------------------------------------------------- /src/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /src/lapack/s_copy.c: -------------------------------------------------------------------------------- 1 | /* Unless compiled with -DNO_OVERWRITE, this variant of s_copy allows the 2 | * target of an assignment to appear on its right-hand side (contrary 3 | * to the Fortran 77 Standard, but in accordance with Fortran 90), 4 | * as in a(2:5) = a(4:7) . 5 | */ 6 | 7 | #include "clapack.h" 8 | 9 | /* assign strings: a = b */ 10 | 11 | void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb) 12 | { 13 | register char *aend, *bend; 14 | 15 | aend = a + la; 16 | 17 | if(la <= lb) 18 | if (a <= b || a >= b + la) 19 | while(a < aend) 20 | *a++ = *b++; 21 | else 22 | for(b += la; a < aend; ) 23 | *--aend = *--b; 24 | else { 25 | bend = b + lb; 26 | if (a <= b || a >= bend) 27 | while(b < bend) 28 | *a++ = *b++; 29 | else { 30 | a += lb; 31 | while(b < bend) 32 | *--a = *--bend; 33 | a += lb; 34 | } 35 | while(a < aend) 36 | *a++ = ' '; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /flash/lrint.cpp: -------------------------------------------------------------------------------- 1 | //lrint hack implementation for 2 | 3 | extern long int lrintf(float f) 4 | { 5 | /* Implements the default IEEE 754-1985 rounding mode */ 6 | long * fp = (long *)&f; 7 | int sign = (*fp) >> 31; 8 | int exponent = 23 + 0x7f - (((*fp) >> 23) & 0xff); 9 | unsigned int fraction = ((*fp) & 0x7fffff) | 0x800000; 10 | long result = fraction >> exponent; 11 | -- exponent; 12 | if (fraction & (1 << exponent)) { // fraction >= 0.5 13 | if (!(fraction & ~(-1 << exponent))) // fraction == 0.5 14 | if (!(result & 1)) // result is even 15 | return sign ? -result : result; 16 | ++ result; 17 | } 18 | return sign ? -result : result; 19 | } 20 | 21 | extern long int lrint(double d) 22 | { 23 | return lrintf((float)d); 24 | } 25 | 26 | extern long int lrintl(long double ld) 27 | { 28 | return lrint((double)ld); 29 | } 30 | 31 | extern long long int llrint(double x) 32 | { 33 | return (long long int) lrint(x); 34 | } 35 | 36 | extern long long int llrintf(float x) 37 | { 38 | return (long long int) lrintf(x); 39 | } 40 | 41 | extern long long int llrintl(long double x) 42 | { 43 | return (long long int) lrintl(x); 44 | } 45 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Build command for sources of camera interaction (will be a makefile later, also uses -DOSX hack for MacOSX compilation and may require additional raindancing to compile under other platforms): 2 | C++ sources (opencv) 3 | alc-on; rm -rdf log ; rm -f *.o; mkdir log ; for src in *.cpp ; do g++ -I$repo_root/include -DOSX -c -Wall -O3 -o ${PWD##*/}_`basename $src .cpp`.o $src 2> `basename $src .cpp`.log ; done ; mv -v *.log ./log ; alc-off; for f in ./log/*.log ; do grep 'error' $f ; done | cat | sort -u > ./log/errors.log ; less ./log/errors.log 4 | 5 | C sources (zlib, lapack) 6 | alc-on; rm -rdf log ; rm -f *.o; mkdir log ; for src in *.c ; do gcc -I$repo_root/include -DOSX -c -Wall -O3 -o ${PWD##*/}_`basename $src .c`.o $src 2> `basename $src .c`.log ; done ; mv -v *.log ./log ; alc-off; for f in ./log/*.log ; do grep 'error' $f ; done | cat | sort -u > ./log/errors.log ; less ./log/errors.log 7 | 8 | Build-run workflow: 9 | 1. Build all sources 10 | 2. Copy all .o's into $repo_root/flash (to be linked against main wrapper) 11 | 2.1. Currently you have to REMOVE core_system.o as it uses some assembly that would not translate into bytecode. 12 | 3. Build wrapper swc library: 13 | rm *achacks* *.swc ; alc-on; g++ -swc -Wall -O3 -DOSX -I../include -o camlib.swc *.o camlib.cpp ; alc-off; 14 | 4. Build swf: 15 | rm *.swf ; alc-on; mxmlc -target-player=10.0.0 -library-path+=camlib.swc WebCam.as; alc-off; 16 | -------------------------------------------------------------------------------- /src/lapack/s_cat.c: -------------------------------------------------------------------------------- 1 | /* Unless compiled with -DNO_OVERWRITE, this variant of s_cat allows the 2 | * target of a concatenation to appear on its right-hand side (contrary 3 | * to the Fortran 77 Standard, but in accordance with Fortran 90). 4 | */ 5 | 6 | #include "clapack.h" 7 | #include "stdio.h" 8 | #undef abs 9 | #undef min 10 | #undef max 11 | #include "stdlib.h" 12 | #include "string.h" 13 | 14 | void s_cat(char *lp, char *rpp[], ftnint rnp[], ftnint *np, ftnlen ll) 15 | { 16 | ftnlen i, nc; 17 | char *rp; 18 | ftnlen n = *np; 19 | ftnlen L, m; 20 | char *lp0, *lp1; 21 | 22 | lp0 = 0; 23 | lp1 = lp; 24 | L = ll; 25 | i = 0; 26 | while(i < n) { 27 | rp = rpp[i]; 28 | m = rnp[i++]; 29 | if (rp >= lp1 || rp + m <= lp) { 30 | if ((L -= m) <= 0) { 31 | n = i; 32 | break; 33 | } 34 | lp1 += m; 35 | continue; 36 | } 37 | lp0 = lp; 38 | lp = lp1 = F77_aloc(L = ll, "s_cat"); 39 | break; 40 | } 41 | lp1 = lp; 42 | for(i = 0 ; i < n ; ++i) { 43 | nc = ll; 44 | if(rnp[i] < nc) 45 | nc = rnp[i]; 46 | ll -= nc; 47 | rp = rpp[i]; 48 | while(--nc >= 0) 49 | *lp++ = *rp++; 50 | } 51 | while(--ll >= 0) 52 | *lp++ = ' '; 53 | if (lp0) { 54 | memcpy(lp0, lp1, L); 55 | free(lp1); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/lapack/dlamch_custom.c: -------------------------------------------------------------------------------- 1 | #include "clapack.h" 2 | #include 3 | #include 4 | 5 | /* *********************************************************************** */ 6 | 7 | doublereal dlamc3_(doublereal *a, doublereal *b) 8 | { 9 | /* System generated locals */ 10 | doublereal ret_val; 11 | 12 | 13 | /* -- LAPACK auxiliary routine (version 3.1) -- */ 14 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 15 | /* November 2006 */ 16 | 17 | /* .. Scalar Arguments .. */ 18 | /* .. */ 19 | 20 | /* Purpose */ 21 | /* ======= */ 22 | 23 | /* DLAMC3 is intended to force A and B to be stored prior to doing */ 24 | /* the addition of A and B , for use in situations where optimizers */ 25 | /* might hold one of these in a register. */ 26 | 27 | /* Arguments */ 28 | /* ========= */ 29 | 30 | /* A (input) DOUBLE PRECISION */ 31 | /* B (input) DOUBLE PRECISION */ 32 | /* The values A and B. */ 33 | 34 | /* ===================================================================== */ 35 | 36 | /* .. Executable Statements .. */ 37 | 38 | ret_val = *a + *b; 39 | 40 | return ret_val; 41 | 42 | /* End of DLAMC3 */ 43 | 44 | } /* dlamc3_ */ 45 | 46 | 47 | /* simpler version of dlamch for the case of IEEE754-compliant FPU module by Piotr Luszczek S. 48 | taken from http://www.mail-archive.com/numpy-discussion@lists.sourceforge.net/msg02448.html */ 49 | 50 | #ifndef DBL_DIGITS 51 | #define DBL_DIGITS 53 52 | #endif 53 | 54 | const doublereal lapack_dlamch_tab[] = 55 | { 56 | 0, FLT_RADIX, DBL_EPSILON, DBL_MAX_EXP, DBL_MIN_EXP, DBL_DIGITS, DBL_MAX, 57 | DBL_EPSILON*FLT_RADIX, 1, DBL_MIN*(1 + DBL_EPSILON), DBL_MIN 58 | }; 59 | -------------------------------------------------------------------------------- /src/lapack/slapy2.c: -------------------------------------------------------------------------------- 1 | /* slapy2.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | doublereal slapy2_(real *x, real *y) 17 | { 18 | /* System generated locals */ 19 | real ret_val, r__1; 20 | 21 | /* Builtin functions */ 22 | double sqrt(doublereal); 23 | 24 | /* Local variables */ 25 | real w, z__, xabs, yabs; 26 | 27 | 28 | /* -- LAPACK auxiliary routine (version 3.2) -- */ 29 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 30 | /* November 2006 */ 31 | 32 | /* .. Scalar Arguments .. */ 33 | /* .. */ 34 | 35 | /* Purpose */ 36 | /* ======= */ 37 | 38 | /* SLAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary */ 39 | /* overflow. */ 40 | 41 | /* Arguments */ 42 | /* ========= */ 43 | 44 | /* X (input) REAL */ 45 | /* Y (input) REAL */ 46 | /* X and Y specify the values x and y. */ 47 | 48 | /* ===================================================================== */ 49 | 50 | /* .. Parameters .. */ 51 | /* .. */ 52 | /* .. Local Scalars .. */ 53 | /* .. */ 54 | /* .. Intrinsic Functions .. */ 55 | /* .. */ 56 | /* .. Executable Statements .. */ 57 | 58 | xabs = dabs(*x); 59 | yabs = dabs(*y); 60 | w = dmax(xabs,yabs); 61 | z__ = dmin(xabs,yabs); 62 | if (z__ == 0.f) { 63 | ret_val = w; 64 | } else { 65 | /* Computing 2nd power */ 66 | r__1 = z__ / w; 67 | ret_val = w * sqrt(r__1 * r__1 + 1.f); 68 | } 69 | return ret_val; 70 | 71 | /* End of SLAPY2 */ 72 | 73 | } /* slapy2_ */ 74 | -------------------------------------------------------------------------------- /src/lapack/slaisnan.c: -------------------------------------------------------------------------------- 1 | /* slaisnan.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | logical slaisnan_(real *sin1, real *sin2) 17 | { 18 | /* System generated locals */ 19 | logical ret_val; 20 | 21 | 22 | /* -- LAPACK auxiliary routine (version 3.2) -- */ 23 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 24 | /* November 2006 */ 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | 29 | /* Purpose */ 30 | /* ======= */ 31 | 32 | /* This routine is not for general use. It exists solely to avoid */ 33 | /* over-optimization in SISNAN. */ 34 | 35 | /* SLAISNAN checks for NaNs by comparing its two arguments for */ 36 | /* inequality. NaN is the only floating-point value where NaN != NaN */ 37 | /* returns .TRUE. To check for NaNs, pass the same variable as both */ 38 | /* arguments. */ 39 | 40 | /* A compiler must assume that the two arguments are */ 41 | /* not the same variable, and the test will not be optimized away. */ 42 | /* Interprocedural or whole-program optimization may delete this */ 43 | /* test. The ISNAN functions will be replaced by the correct */ 44 | /* Fortran 03 intrinsic once the intrinsic is widely available. */ 45 | 46 | /* Arguments */ 47 | /* ========= */ 48 | 49 | /* SIN1 (input) REAL */ 50 | /* SIN2 (input) REAL */ 51 | /* Two numbers to compare for inequality. */ 52 | 53 | /* ===================================================================== */ 54 | 55 | /* .. Executable Statements .. */ 56 | ret_val = *sin1 != *sin2; 57 | return ret_val; 58 | } /* slaisnan_ */ 59 | -------------------------------------------------------------------------------- /src/lapack/dlapy2.c: -------------------------------------------------------------------------------- 1 | /* dlapy2.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | doublereal dlapy2_(doublereal *x, doublereal *y) 17 | { 18 | /* System generated locals */ 19 | doublereal ret_val, d__1; 20 | 21 | /* Builtin functions */ 22 | double sqrt(doublereal); 23 | 24 | /* Local variables */ 25 | doublereal w, z__, xabs, yabs; 26 | 27 | 28 | /* -- LAPACK auxiliary routine (version 3.2) -- */ 29 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 30 | /* November 2006 */ 31 | 32 | /* .. Scalar Arguments .. */ 33 | /* .. */ 34 | 35 | /* Purpose */ 36 | /* ======= */ 37 | 38 | /* DLAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary */ 39 | /* overflow. */ 40 | 41 | /* Arguments */ 42 | /* ========= */ 43 | 44 | /* X (input) DOUBLE PRECISION */ 45 | /* Y (input) DOUBLE PRECISION */ 46 | /* X and Y specify the values x and y. */ 47 | 48 | /* ===================================================================== */ 49 | 50 | /* .. Parameters .. */ 51 | /* .. */ 52 | /* .. Local Scalars .. */ 53 | /* .. */ 54 | /* .. Intrinsic Functions .. */ 55 | /* .. */ 56 | /* .. Executable Statements .. */ 57 | 58 | xabs = abs(*x); 59 | yabs = abs(*y); 60 | w = max(xabs,yabs); 61 | z__ = min(xabs,yabs); 62 | if (z__ == 0.) { 63 | ret_val = w; 64 | } else { 65 | /* Computing 2nd power */ 66 | d__1 = z__ / w; 67 | ret_val = w * sqrt(d__1 * d__1 + 1.); 68 | } 69 | return ret_val; 70 | 71 | /* End of DLAPY2 */ 72 | 73 | } /* dlapy2_ */ 74 | -------------------------------------------------------------------------------- /src/lapack/dlaisnan.c: -------------------------------------------------------------------------------- 1 | /* dlaisnan.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | logical dlaisnan_(doublereal *din1, doublereal *din2) 17 | { 18 | /* System generated locals */ 19 | logical ret_val; 20 | 21 | 22 | /* -- LAPACK auxiliary routine (version 3.2) -- */ 23 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 24 | /* November 2006 */ 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | 29 | /* Purpose */ 30 | /* ======= */ 31 | 32 | /* This routine is not for general use. It exists solely to avoid */ 33 | /* over-optimization in DISNAN. */ 34 | 35 | /* DLAISNAN checks for NaNs by comparing its two arguments for */ 36 | /* inequality. NaN is the only floating-point value where NaN != NaN */ 37 | /* returns .TRUE. To check for NaNs, pass the same variable as both */ 38 | /* arguments. */ 39 | 40 | /* A compiler must assume that the two arguments are */ 41 | /* not the same variable, and the test will not be optimized away. */ 42 | /* Interprocedural or whole-program optimization may delete this */ 43 | /* test. The ISNAN functions will be replaced by the correct */ 44 | /* Fortran 03 intrinsic once the intrinsic is widely available. */ 45 | 46 | /* Arguments */ 47 | /* ========= */ 48 | 49 | /* DIN1 (input) DOUBLE PRECISION */ 50 | /* DIN2 (input) DOUBLE PRECISION */ 51 | /* Two numbers to compare for inequality. */ 52 | 53 | /* ===================================================================== */ 54 | 55 | /* .. Executable Statements .. */ 56 | ret_val = *din1 != *din2; 57 | return ret_val; 58 | } /* dlaisnan_ */ 59 | -------------------------------------------------------------------------------- /src/zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (Bytef*)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if (err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if (err != Z_STREAM_END) { 50 | inflateEnd(&stream); 51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 52 | return Z_DATA_ERROR; 53 | return err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = inflateEnd(&stream); 58 | return err; 59 | } 60 | -------------------------------------------------------------------------------- /src/lapack/drot.c: -------------------------------------------------------------------------------- 1 | /* drot.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int drot_(integer *n, doublereal *dx, integer *incx, 17 | doublereal *dy, integer *incy, doublereal *c__, doublereal *s) 18 | { 19 | /* System generated locals */ 20 | integer i__1; 21 | 22 | /* Local variables */ 23 | integer i__, ix, iy; 24 | doublereal dtemp; 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | /* .. Array Arguments .. */ 29 | /* .. */ 30 | 31 | /* Purpose */ 32 | /* ======= */ 33 | 34 | /* applies a plane rotation. */ 35 | /* jack dongarra, linpack, 3/11/78. */ 36 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 37 | 38 | 39 | /* .. Local Scalars .. */ 40 | /* .. */ 41 | /* Parameter adjustments */ 42 | --dy; 43 | --dx; 44 | 45 | /* Function Body */ 46 | if (*n <= 0) { 47 | return 0; 48 | } 49 | if (*incx == 1 && *incy == 1) { 50 | goto L20; 51 | } 52 | 53 | /* code for unequal increments or equal increments not equal */ 54 | /* to 1 */ 55 | 56 | ix = 1; 57 | iy = 1; 58 | if (*incx < 0) { 59 | ix = (-(*n) + 1) * *incx + 1; 60 | } 61 | if (*incy < 0) { 62 | iy = (-(*n) + 1) * *incy + 1; 63 | } 64 | i__1 = *n; 65 | for (i__ = 1; i__ <= i__1; ++i__) { 66 | dtemp = *c__ * dx[ix] + *s * dy[iy]; 67 | dy[iy] = *c__ * dy[iy] - *s * dx[ix]; 68 | dx[ix] = dtemp; 69 | ix += *incx; 70 | iy += *incy; 71 | /* L10: */ 72 | } 73 | return 0; 74 | 75 | /* code for both increments equal to 1 */ 76 | 77 | L20: 78 | i__1 = *n; 79 | for (i__ = 1; i__ <= i__1; ++i__) { 80 | dtemp = *c__ * dx[i__] + *s * dy[i__]; 81 | dy[i__] = *c__ * dy[i__] - *s * dx[i__]; 82 | dx[i__] = dtemp; 83 | /* L30: */ 84 | } 85 | return 0; 86 | } /* drot_ */ 87 | -------------------------------------------------------------------------------- /src/lapack/srot.c: -------------------------------------------------------------------------------- 1 | /* srot.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int srot_(integer *n, real *sx, integer *incx, real *sy, 17 | integer *incy, real *c__, real *s) 18 | { 19 | /* System generated locals */ 20 | integer i__1; 21 | 22 | /* Local variables */ 23 | integer i__, ix, iy; 24 | real stemp; 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | /* .. Array Arguments .. */ 29 | /* .. */ 30 | 31 | /* Purpose */ 32 | /* ======= */ 33 | 34 | /* applies a plane rotation. */ 35 | 36 | /* Further Details */ 37 | /* =============== */ 38 | 39 | /* jack dongarra, linpack, 3/11/78. */ 40 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 41 | 42 | 43 | /* .. Local Scalars .. */ 44 | /* .. */ 45 | /* Parameter adjustments */ 46 | --sy; 47 | --sx; 48 | 49 | /* Function Body */ 50 | if (*n <= 0) { 51 | return 0; 52 | } 53 | if (*incx == 1 && *incy == 1) { 54 | goto L20; 55 | } 56 | 57 | /* code for unequal increments or equal increments not equal */ 58 | /* to 1 */ 59 | 60 | ix = 1; 61 | iy = 1; 62 | if (*incx < 0) { 63 | ix = (-(*n) + 1) * *incx + 1; 64 | } 65 | if (*incy < 0) { 66 | iy = (-(*n) + 1) * *incy + 1; 67 | } 68 | i__1 = *n; 69 | for (i__ = 1; i__ <= i__1; ++i__) { 70 | stemp = *c__ * sx[ix] + *s * sy[iy]; 71 | sy[iy] = *c__ * sy[iy] - *s * sx[ix]; 72 | sx[ix] = stemp; 73 | ix += *incx; 74 | iy += *incy; 75 | /* L10: */ 76 | } 77 | return 0; 78 | 79 | /* code for both increments equal to 1 */ 80 | 81 | L20: 82 | i__1 = *n; 83 | for (i__ = 1; i__ <= i__1; ++i__) { 84 | stemp = *c__ * sx[i__] + *s * sy[i__]; 85 | sy[i__] = *c__ * sy[i__] - *s * sx[i__]; 86 | sx[i__] = stemp; 87 | /* L30: */ 88 | } 89 | return 0; 90 | } /* srot_ */ 91 | -------------------------------------------------------------------------------- /include/opencv/cvwimage.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 3 | // 4 | // By downloading, copying, installing or using the software you agree to 5 | // this license. If you do not agree to this license, do not download, 6 | // install, copy or use the software. 7 | // 8 | // License Agreement 9 | // For Open Source Computer Vision Library 10 | // 11 | // Copyright (C) 2008, Google, all rights reserved. 12 | // Third party copyrights are property of their respective owners. 13 | // 14 | // Redistribution and use in source and binary forms, with or without 15 | // modification, are permitted provided that the following conditions are met: 16 | // 17 | // * Redistribution's of source code must retain the above copyright notice, 18 | // this list of conditions and the following disclaimer. 19 | // 20 | // * Redistribution's in binary form must reproduce the above copyright notice, 21 | // this list of conditions and the following disclaimer in the documentation 22 | // and/or other materials provided with the distribution. 23 | // 24 | // * The name of Intel Corporation or contributors may not be used to endorse 25 | // or promote products derived from this software without specific 26 | // prior written permission. 27 | // 28 | // This software is provided by the copyright holders and contributors "as is" 29 | // and any express or implied warranties, including, but not limited to, the 30 | // implied warranties of merchantability and fitness for a particular purpose 31 | // are disclaimed. In no event shall the Intel Corporation or contributors be 32 | // liable for any direct, indirect, incidental, special, exemplary, or 33 | // consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | 40 | 41 | #ifndef __OPENCV_OLD_WIMAGE_HPP__ 42 | #define __OPENCV_OLD_WIMAGE_HPP__ 43 | 44 | #include "opencv2/core/wimage.hpp" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/opencv/ml.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // 12 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 13 | // Third party copyrights are property of their respective owners. 14 | // 15 | // Redistribution and use in source and binary forms, with or without modification, 16 | // are permitted provided that the following conditions are met: 17 | // 18 | // * Redistribution's of source code must retain the above copyright notice, 19 | // this list of conditions and the following disclaimer. 20 | // 21 | // * Redistribution's in binary form must reproduce the above copyright notice, 22 | // this list of conditions and the following disclaimer in the documentation 23 | // and/or other materials provided with the distribution. 24 | // 25 | // * The name of Intel Corporation may not be used to endorse or promote products 26 | // derived from this software without specific prior written permission. 27 | // 28 | // This software is provided by the copyright holders and contributors "as is" and 29 | // any express or implied warranties, including, but not limited to, the implied 30 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 31 | // In no event shall the Intel Corporation or contributors be liable for any direct, 32 | // indirect, incidental, special, exemplary, or consequential damages 33 | // (including, but not limited to, procurement of substitute goods or services; 34 | // loss of use, data, or profits; or business interruption) however caused 35 | // and on any theory of liability, whether in contract, strict liability, 36 | // or tort (including negligence or otherwise) arising in any way out of 37 | // the use of this software, even if advised of the possibility of such damage. 38 | // 39 | //M*/ 40 | 41 | #ifndef __OPENCV_OLD_ML_H__ 42 | #define __OPENCV_OLD_ML_H__ 43 | 44 | #include "opencv2/core/core_c.h" 45 | #include "opencv2/core/core.hpp" 46 | #include "opencv2/ml/ml.hpp" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/lapack/isamax.c: -------------------------------------------------------------------------------- 1 | /* isamax.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | integer isamax_(integer *n, real *sx, integer *incx) 17 | { 18 | /* System generated locals */ 19 | integer ret_val, i__1; 20 | real r__1; 21 | 22 | /* Local variables */ 23 | integer i__, ix; 24 | real smax; 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | /* .. Array Arguments .. */ 29 | /* .. */ 30 | 31 | /* Purpose */ 32 | /* ======= */ 33 | 34 | /* finds the index of element having max. absolute value. */ 35 | /* jack dongarra, linpack, 3/11/78. */ 36 | /* modified 3/93 to return if incx .le. 0. */ 37 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 38 | 39 | 40 | /* .. Local Scalars .. */ 41 | /* .. */ 42 | /* .. Intrinsic Functions .. */ 43 | /* .. */ 44 | /* Parameter adjustments */ 45 | --sx; 46 | 47 | /* Function Body */ 48 | ret_val = 0; 49 | if (*n < 1 || *incx <= 0) { 50 | return ret_val; 51 | } 52 | ret_val = 1; 53 | if (*n == 1) { 54 | return ret_val; 55 | } 56 | if (*incx == 1) { 57 | goto L20; 58 | } 59 | 60 | /* code for increment not equal to 1 */ 61 | 62 | ix = 1; 63 | smax = dabs(sx[1]); 64 | ix += *incx; 65 | i__1 = *n; 66 | for (i__ = 2; i__ <= i__1; ++i__) { 67 | if ((r__1 = sx[ix], dabs(r__1)) <= smax) { 68 | goto L5; 69 | } 70 | ret_val = i__; 71 | smax = (r__1 = sx[ix], dabs(r__1)); 72 | L5: 73 | ix += *incx; 74 | /* L10: */ 75 | } 76 | return ret_val; 77 | 78 | /* code for increment equal to 1 */ 79 | 80 | L20: 81 | smax = dabs(sx[1]); 82 | i__1 = *n; 83 | for (i__ = 2; i__ <= i__1; ++i__) { 84 | if ((r__1 = sx[i__], dabs(r__1)) <= smax) { 85 | goto L30; 86 | } 87 | ret_val = i__; 88 | smax = (r__1 = sx[i__], dabs(r__1)); 89 | L30: 90 | ; 91 | } 92 | return ret_val; 93 | } /* isamax_ */ 94 | -------------------------------------------------------------------------------- /src/lapack/idamax.c: -------------------------------------------------------------------------------- 1 | /* idamax.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | integer idamax_(integer *n, doublereal *dx, integer *incx) 17 | { 18 | /* System generated locals */ 19 | integer ret_val, i__1; 20 | doublereal d__1; 21 | 22 | /* Local variables */ 23 | integer i__, ix; 24 | doublereal dmax__; 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | /* .. Array Arguments .. */ 29 | /* .. */ 30 | 31 | /* Purpose */ 32 | /* ======= */ 33 | 34 | /* finds the index of element having max. absolute value. */ 35 | /* jack dongarra, linpack, 3/11/78. */ 36 | /* modified 3/93 to return if incx .le. 0. */ 37 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 38 | 39 | 40 | /* .. Local Scalars .. */ 41 | /* .. */ 42 | /* .. Intrinsic Functions .. */ 43 | /* .. */ 44 | /* Parameter adjustments */ 45 | --dx; 46 | 47 | /* Function Body */ 48 | ret_val = 0; 49 | if (*n < 1 || *incx <= 0) { 50 | return ret_val; 51 | } 52 | ret_val = 1; 53 | if (*n == 1) { 54 | return ret_val; 55 | } 56 | if (*incx == 1) { 57 | goto L20; 58 | } 59 | 60 | /* code for increment not equal to 1 */ 61 | 62 | ix = 1; 63 | dmax__ = abs(dx[1]); 64 | ix += *incx; 65 | i__1 = *n; 66 | for (i__ = 2; i__ <= i__1; ++i__) { 67 | if ((d__1 = dx[ix], abs(d__1)) <= dmax__) { 68 | goto L5; 69 | } 70 | ret_val = i__; 71 | dmax__ = (d__1 = dx[ix], abs(d__1)); 72 | L5: 73 | ix += *incx; 74 | /* L10: */ 75 | } 76 | return ret_val; 77 | 78 | /* code for increment equal to 1 */ 79 | 80 | L20: 81 | dmax__ = abs(dx[1]); 82 | i__1 = *n; 83 | for (i__ = 2; i__ <= i__1; ++i__) { 84 | if ((d__1 = dx[i__], abs(d__1)) <= dmax__) { 85 | goto L30; 86 | } 87 | ret_val = i__; 88 | dmax__ = (d__1 = dx[i__], abs(d__1)); 89 | L30: 90 | ; 91 | } 92 | return ret_val; 93 | } /* idamax_ */ 94 | -------------------------------------------------------------------------------- /include/opencv/cxeigen.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_EIGEN_HPP__ 44 | #define __OPENCV_OLD_EIGEN_HPP__ 45 | 46 | #include "opencv2/core/eigen.hpp" 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /include/opencv/highgui.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_OLD_HIGHGUI_H__ 43 | #define __OPENCV_OLD_HIGHGUI_H__ 44 | 45 | #include "opencv2/core/core_c.h" 46 | #include "opencv2/core/core.hpp" 47 | #include "opencv2/highgui/highgui_c.h" 48 | #include "opencv2/highgui/highgui.hpp" 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/lapack/sscal.c: -------------------------------------------------------------------------------- 1 | /* sscal.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int sscal_(integer *n, real *sa, real *sx, integer *incx) 17 | { 18 | /* System generated locals */ 19 | integer i__1, i__2; 20 | 21 | /* Local variables */ 22 | integer i__, m, mp1, nincx; 23 | 24 | /* .. Scalar Arguments .. */ 25 | /* .. */ 26 | /* .. Array Arguments .. */ 27 | /* .. */ 28 | 29 | /* Purpose */ 30 | /* ======= */ 31 | 32 | /* scales a vector by a constant. */ 33 | /* uses unrolled loops for increment equal to 1. */ 34 | /* jack dongarra, linpack, 3/11/78. */ 35 | /* modified 3/93 to return if incx .le. 0. */ 36 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 37 | 38 | 39 | /* .. Local Scalars .. */ 40 | /* .. */ 41 | /* .. Intrinsic Functions .. */ 42 | /* .. */ 43 | /* Parameter adjustments */ 44 | --sx; 45 | 46 | /* Function Body */ 47 | if (*n <= 0 || *incx <= 0) { 48 | return 0; 49 | } 50 | if (*incx == 1) { 51 | goto L20; 52 | } 53 | 54 | /* code for increment not equal to 1 */ 55 | 56 | nincx = *n * *incx; 57 | i__1 = nincx; 58 | i__2 = *incx; 59 | for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) { 60 | sx[i__] = *sa * sx[i__]; 61 | /* L10: */ 62 | } 63 | return 0; 64 | 65 | /* code for increment equal to 1 */ 66 | 67 | 68 | /* clean-up loop */ 69 | 70 | L20: 71 | m = *n % 5; 72 | if (m == 0) { 73 | goto L40; 74 | } 75 | i__2 = m; 76 | for (i__ = 1; i__ <= i__2; ++i__) { 77 | sx[i__] = *sa * sx[i__]; 78 | /* L30: */ 79 | } 80 | if (*n < 5) { 81 | return 0; 82 | } 83 | L40: 84 | mp1 = m + 1; 85 | i__2 = *n; 86 | for (i__ = mp1; i__ <= i__2; i__ += 5) { 87 | sx[i__] = *sa * sx[i__]; 88 | sx[i__ + 1] = *sa * sx[i__ + 1]; 89 | sx[i__ + 2] = *sa * sx[i__ + 2]; 90 | sx[i__ + 3] = *sa * sx[i__ + 3]; 91 | sx[i__ + 4] = *sa * sx[i__ + 4]; 92 | /* L50: */ 93 | } 94 | return 0; 95 | } /* sscal_ */ 96 | -------------------------------------------------------------------------------- /src/lapack/xerbla.c: -------------------------------------------------------------------------------- 1 | /* xerbla.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Table of constant values */ 17 | 18 | static integer c__1 = 1; 19 | 20 | /* Subroutine */ int xerbla_(char *srname, integer *info) 21 | { 22 | /* Format strings */ 23 | static char fmt_9999[] = "(\002 ** On entry to \002,a,\002 parameter num" 24 | "ber \002,i2,\002 had \002,\002an illegal value\002)"; 25 | 26 | /* Builtin functions */ 27 | integer s_wsfe(cilist *), i_len_trim(char *, ftnlen), do_fio(integer *, 28 | char *, ftnlen), e_wsfe(void); 29 | /* Subroutine */ int s_stop(char *, ftnlen); 30 | 31 | /* Fortran I/O blocks */ 32 | static cilist io___1 = { 0, 6, 0, fmt_9999, 0 }; 33 | 34 | 35 | 36 | /* -- LAPACK auxiliary routine (preliminary version) -- */ 37 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 38 | /* November 2006 */ 39 | 40 | /* .. Scalar Arguments .. */ 41 | /* .. */ 42 | 43 | /* Purpose */ 44 | /* ======= */ 45 | 46 | /* XERBLA is an error handler for the LAPACK routines. */ 47 | /* It is called by an LAPACK routine if an input parameter has an */ 48 | /* invalid value. A message is printed and execution stops. */ 49 | 50 | /* Installers may consider modifying the STOP statement in order to */ 51 | /* call system-specific exception-handling facilities. */ 52 | 53 | /* Arguments */ 54 | /* ========= */ 55 | 56 | /* SRNAME (input) CHARACTER*(*) */ 57 | /* The name of the routine which called XERBLA. */ 58 | 59 | /* INFO (input) INTEGER */ 60 | /* The position of the invalid parameter in the parameter list */ 61 | /* of the calling routine. */ 62 | 63 | /* ===================================================================== */ 64 | 65 | /* .. Intrinsic Functions .. */ 66 | /* .. */ 67 | /* .. Executable Statements .. */ 68 | 69 | printf("** On entry to %6s, parameter number %2i had an illegal value\n", 70 | srname, *info); 71 | 72 | 73 | /* End of XERBLA */ 74 | 75 | return 0; 76 | } /* xerbla_ */ 77 | -------------------------------------------------------------------------------- /include/opencv/cvaux.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_OLD_AUX_HPP__ 43 | #define __OPENCV_OLD_AUX_HPP__ 44 | 45 | //#if defined(__GNUC__) 46 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 47 | //#endif 48 | 49 | #include 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/lapack/dscal.c: -------------------------------------------------------------------------------- 1 | /* dscal.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int dscal_(integer *n, doublereal *da, doublereal *dx, 17 | integer *incx) 18 | { 19 | /* System generated locals */ 20 | integer i__1, i__2; 21 | 22 | /* Local variables */ 23 | integer i__, m, mp1, nincx; 24 | 25 | /* .. Scalar Arguments .. */ 26 | /* .. */ 27 | /* .. Array Arguments .. */ 28 | /* .. */ 29 | 30 | /* Purpose */ 31 | /* ======= */ 32 | /* * */ 33 | /* scales a vector by a constant. */ 34 | /* uses unrolled loops for increment equal to one. */ 35 | /* jack dongarra, linpack, 3/11/78. */ 36 | /* modified 3/93 to return if incx .le. 0. */ 37 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 38 | 39 | 40 | /* .. Local Scalars .. */ 41 | /* .. */ 42 | /* .. Intrinsic Functions .. */ 43 | /* .. */ 44 | /* Parameter adjustments */ 45 | --dx; 46 | 47 | /* Function Body */ 48 | if (*n <= 0 || *incx <= 0) { 49 | return 0; 50 | } 51 | if (*incx == 1) { 52 | goto L20; 53 | } 54 | 55 | /* code for increment not equal to 1 */ 56 | 57 | nincx = *n * *incx; 58 | i__1 = nincx; 59 | i__2 = *incx; 60 | for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) { 61 | dx[i__] = *da * dx[i__]; 62 | /* L10: */ 63 | } 64 | return 0; 65 | 66 | /* code for increment equal to 1 */ 67 | 68 | 69 | /* clean-up loop */ 70 | 71 | L20: 72 | m = *n % 5; 73 | if (m == 0) { 74 | goto L40; 75 | } 76 | i__2 = m; 77 | for (i__ = 1; i__ <= i__2; ++i__) { 78 | dx[i__] = *da * dx[i__]; 79 | /* L30: */ 80 | } 81 | if (*n < 5) { 82 | return 0; 83 | } 84 | L40: 85 | mp1 = m + 1; 86 | i__2 = *n; 87 | for (i__ = mp1; i__ <= i__2; i__ += 5) { 88 | dx[i__] = *da * dx[i__]; 89 | dx[i__ + 1] = *da * dx[i__ + 1]; 90 | dx[i__ + 2] = *da * dx[i__ + 2]; 91 | dx[i__ + 3] = *da * dx[i__ + 3]; 92 | dx[i__ + 4] = *da * dx[i__ + 4]; 93 | /* L50: */ 94 | } 95 | return 0; 96 | } /* dscal_ */ 97 | -------------------------------------------------------------------------------- /include/cblas.h: -------------------------------------------------------------------------------- 1 | /* CLAPACK 3.0 BLAS wrapper macros and functions 2 | * Feb 5, 2000 3 | */ 4 | 5 | #ifndef __CBLAS_H 6 | #define __CBLAS_H 7 | 8 | #include "f2c.h" 9 | 10 | #if defined _MSC_VER && _MSC_VER >= 1400 11 | #pragma warning(disable: 4244 4554) 12 | #endif 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | static __inline double r_lg10(real *x) 19 | { 20 | return 0.43429448190325182765*log(*x); 21 | } 22 | 23 | static __inline double d_lg10(doublereal *x) 24 | { 25 | return 0.43429448190325182765*log(*x); 26 | } 27 | 28 | static __inline double d_sign(doublereal *a, doublereal *b) 29 | { 30 | double x = fabs(*a); 31 | return *b >= 0 ? x : -x; 32 | } 33 | 34 | static __inline double r_sign(real *a, real *b) 35 | { 36 | double x = fabs((double)*a); 37 | return *b >= 0 ? x : -x; 38 | } 39 | 40 | extern const unsigned char lapack_toupper_tab[]; 41 | #define lapack_toupper(c) ((char)lapack_toupper_tab[(unsigned char)(c)]) 42 | 43 | extern const unsigned char lapack_lamch_tab[]; 44 | extern const doublereal lapack_dlamch_tab[]; 45 | extern const doublereal lapack_slamch_tab[]; 46 | 47 | static __inline logical lsame_(char *ca, char *cb) 48 | { 49 | return lapack_toupper(ca[0]) == lapack_toupper(cb[0]); 50 | } 51 | 52 | static __inline doublereal dlamch_(char* cmach) 53 | { 54 | return lapack_dlamch_tab[lapack_lamch_tab[(unsigned char)cmach[0]]]; 55 | } 56 | 57 | static __inline doublereal slamch_(char* cmach) 58 | { 59 | return lapack_slamch_tab[lapack_lamch_tab[(unsigned char)cmach[0]]]; 60 | } 61 | 62 | static __inline integer i_nint(real *x) 63 | { 64 | return (integer)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x)); 65 | } 66 | 67 | static __inline void exit_(integer *rc) 68 | { 69 | exit(*rc); 70 | } 71 | 72 | integer pow_ii(integer *ap, integer *bp); 73 | double pow_ri(real *ap, integer *bp); 74 | double pow_di(doublereal *ap, integer *bp); 75 | 76 | static __inline double pow_dd(doublereal *ap, doublereal *bp) 77 | { 78 | return pow(*ap, *bp); 79 | } 80 | 81 | logical slaisnan_(real *in1, real *in2); 82 | logical dlaisnan_(doublereal *din1, doublereal *din2); 83 | 84 | static __inline logical sisnan_(real *in1) 85 | { 86 | return slaisnan_(in1, in1); 87 | } 88 | 89 | static __inline logical disnan_(doublereal *din1) 90 | { 91 | return dlaisnan_(din1, din1); 92 | } 93 | 94 | char *F77_aloc(ftnlen, char*); 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | 100 | #endif /* __BLASWRAP_H */ 101 | -------------------------------------------------------------------------------- /include/opencv/cv.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CV_HPP__ 44 | #define __OPENCV_OLD_CV_HPP__ 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/lapack/dnrm2.c: -------------------------------------------------------------------------------- 1 | /* dnrm2.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | doublereal dnrm2_(integer *n, doublereal *x, integer *incx) 17 | { 18 | /* System generated locals */ 19 | integer i__1, i__2; 20 | doublereal ret_val, d__1; 21 | 22 | /* Builtin functions */ 23 | double sqrt(doublereal); 24 | 25 | /* Local variables */ 26 | integer ix; 27 | doublereal ssq, norm, scale, absxi; 28 | 29 | /* .. Scalar Arguments .. */ 30 | /* .. */ 31 | /* .. Array Arguments .. */ 32 | /* .. */ 33 | 34 | /* Purpose */ 35 | /* ======= */ 36 | 37 | /* DNRM2 returns the euclidean norm of a vector via the function */ 38 | /* name, so that */ 39 | 40 | /* DNRM2 := sqrt( x'*x ) */ 41 | 42 | 43 | /* -- This version written on 25-October-1982. */ 44 | /* Modified on 14-October-1993 to inline the call to DLASSQ. */ 45 | /* Sven Hammarling, Nag Ltd. */ 46 | 47 | 48 | /* .. Parameters .. */ 49 | /* .. */ 50 | /* .. Local Scalars .. */ 51 | /* .. */ 52 | /* .. Intrinsic Functions .. */ 53 | /* .. */ 54 | /* Parameter adjustments */ 55 | --x; 56 | 57 | /* Function Body */ 58 | if (*n < 1 || *incx < 1) { 59 | norm = 0.; 60 | } else if (*n == 1) { 61 | norm = abs(x[1]); 62 | } else { 63 | scale = 0.; 64 | ssq = 1.; 65 | /* The following loop is equivalent to this call to the LAPACK */ 66 | /* auxiliary routine: */ 67 | /* CALL DLASSQ( N, X, INCX, SCALE, SSQ ) */ 68 | 69 | i__1 = (*n - 1) * *incx + 1; 70 | i__2 = *incx; 71 | for (ix = 1; i__2 < 0 ? ix >= i__1 : ix <= i__1; ix += i__2) { 72 | if (x[ix] != 0.) { 73 | absxi = (d__1 = x[ix], abs(d__1)); 74 | if (scale < absxi) { 75 | /* Computing 2nd power */ 76 | d__1 = scale / absxi; 77 | ssq = ssq * (d__1 * d__1) + 1.; 78 | scale = absxi; 79 | } else { 80 | /* Computing 2nd power */ 81 | d__1 = absxi / scale; 82 | ssq += d__1 * d__1; 83 | } 84 | } 85 | /* L10: */ 86 | } 87 | norm = scale * sqrt(ssq); 88 | } 89 | 90 | ret_val = norm; 91 | return ret_val; 92 | 93 | /* End of DNRM2. */ 94 | 95 | } /* dnrm2_ */ 96 | -------------------------------------------------------------------------------- /flash/camlib.cpp: -------------------------------------------------------------------------------- 1 | #include "AS3.h" 2 | #include "opencv/cv.h" 3 | #include 4 | #include "lrint.cpp" 5 | //screen buffer size 6 | long bufferSize; 7 | char* buffer; 8 | int frameWidth, frameHeight, frameChannels; 9 | 10 | //FLASH: C memory init function 11 | static AS3_Val initByteArray(void* self, AS3_Val args) 12 | { 13 | //read buffer size as int from input 14 | AS3_ArrayValue(args,"IntType",&bufferSize); 15 | //allocate buffer size 16 | buffer=new char[bufferSize]; 17 | //return ptr to buffer location in memory 18 | return AS3_Ptr(buffer); 19 | } 20 | 21 | //FLASH: C memory free function 22 | static AS3_Val freeByteArray(void* self, AS3_Val args) 23 | { 24 | delete[] buffer; 25 | *buffer=0; 26 | bufferSize=-1; 27 | return 0; 28 | } 29 | 30 | //FLASH: Camera parameters setup 31 | static AS3_Val setFrameParams(void* self, AS3_Val args) 32 | { 33 | AS3_ArrayValue(args,"IntType, IntType, IntType",&frameWidth,&frameHeight,&frameChannels); 34 | return 0; 35 | } 36 | 37 | static AS3_Val setFramePtr(void* self, AS3_Val args) 38 | { 39 | //parse parameters 40 | AS3_Val byteArr; 41 | long szByteArr; 42 | AS3_ArrayValue(args,"AS3ValType, IntType",&byteArr,&szByteArr); 43 | 44 | //alloc memory for transfers 45 | uchar *dst = new uchar[szByteArr]; 46 | 47 | //read data 48 | AS3_ByteArray_readBytes((void*)dst,byteArr,szByteArr); 49 | 50 | //convert to RGB from RGBA 51 | cv::Mat frame(640,480,CV_8UC4,(void*)dst); 52 | 53 | cv::Mat gs_frame; 54 | 55 | cv::cvtColor(frame,gs_frame,CV_RGBA2GRAY); 56 | 57 | int from_to[]={0,1, 0,2, 0,3}; 58 | mixChannels(&gs_frame,1,&frame,1,from_to,3); 59 | 60 | AS3_ByteArray_seek(byteArr,0,SEEK_SET); 61 | AS3_ByteArray_writeBytes(byteArr,frame.data,szByteArr); 62 | 63 | delete[] dst; 64 | 65 | return byteArr; 66 | } 67 | 68 | //entry point 69 | int main() 70 | { 71 | AS3_Val initByteArrayMethod=AS3_Function(NULL, initByteArray); 72 | AS3_Val freeByteArrayMethod=AS3_Function(NULL, freeByteArray); 73 | AS3_Val setFrameParamsMethod=AS3_Function(NULL, setFrameParams); 74 | AS3_Val setFramePtrMethod = AS3_Function(NULL,setFramePtr); 75 | 76 | AS3_Val result = AS3_Object("initByteArray: AS3ValType,\ 77 | freeByteArray: AS3ValType,\ 78 | setFrameParams: AS3ValType,\ 79 | setFramePtr: AS3ValType", 80 | initByteArrayMethod,freeByteArrayMethod,setFrameParamsMethod, 81 | setFramePtrMethod); 82 | 83 | AS3_Release(initByteArrayMethod); 84 | AS3_Release(freeByteArrayMethod); 85 | AS3_Release(setFrameParamsMethod); 86 | AS3_Release(setFramePtrMethod); 87 | 88 | AS3_LibInit(result); 89 | 90 | return 0; 91 | } 92 | -------------------------------------------------------------------------------- /include/opencv/cxcore.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CXCORE_HPP__ 44 | #define __OPENCV_OLD_CXCORE_HPP__ 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/lapack/snrm2.c: -------------------------------------------------------------------------------- 1 | /* snrm2.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | doublereal snrm2_(integer *n, real *x, integer *incx) 17 | { 18 | /* System generated locals */ 19 | integer i__1, i__2; 20 | real ret_val, r__1; 21 | 22 | /* Builtin functions */ 23 | double sqrt(doublereal); 24 | 25 | /* Local variables */ 26 | integer ix; 27 | real ssq, norm, scale, absxi; 28 | 29 | /* .. Scalar Arguments .. */ 30 | /* .. */ 31 | /* .. Array Arguments .. */ 32 | /* .. */ 33 | 34 | /* Purpose */ 35 | /* ======= */ 36 | 37 | /* SNRM2 returns the euclidean norm of a vector via the function */ 38 | /* name, so that */ 39 | 40 | /* SNRM2 := sqrt( x'*x ). */ 41 | 42 | /* Further Details */ 43 | /* =============== */ 44 | 45 | /* -- This version written on 25-October-1982. */ 46 | /* Modified on 14-October-1993 to inline the call to SLASSQ. */ 47 | /* Sven Hammarling, Nag Ltd. */ 48 | 49 | 50 | /* .. Parameters .. */ 51 | /* .. */ 52 | /* .. Local Scalars .. */ 53 | /* .. */ 54 | /* .. Intrinsic Functions .. */ 55 | /* .. */ 56 | /* Parameter adjustments */ 57 | --x; 58 | 59 | /* Function Body */ 60 | if (*n < 1 || *incx < 1) { 61 | norm = 0.f; 62 | } else if (*n == 1) { 63 | norm = dabs(x[1]); 64 | } else { 65 | scale = 0.f; 66 | ssq = 1.f; 67 | /* The following loop is equivalent to this call to the LAPACK */ 68 | /* auxiliary routine: */ 69 | /* CALL SLASSQ( N, X, INCX, SCALE, SSQ ) */ 70 | 71 | i__1 = (*n - 1) * *incx + 1; 72 | i__2 = *incx; 73 | for (ix = 1; i__2 < 0 ? ix >= i__1 : ix <= i__1; ix += i__2) { 74 | if (x[ix] != 0.f) { 75 | absxi = (r__1 = x[ix], dabs(r__1)); 76 | if (scale < absxi) { 77 | /* Computing 2nd power */ 78 | r__1 = scale / absxi; 79 | ssq = ssq * (r__1 * r__1) + 1.f; 80 | scale = absxi; 81 | } else { 82 | /* Computing 2nd power */ 83 | r__1 = absxi / scale; 84 | ssq += r__1 * r__1; 85 | } 86 | } 87 | /* L10: */ 88 | } 89 | norm = scale * sqrt(ssq); 90 | } 91 | 92 | ret_val = norm; 93 | return ret_val; 94 | 95 | /* End of SNRM2. */ 96 | 97 | } /* snrm2_ */ 98 | -------------------------------------------------------------------------------- /src/lapack/slabad.c: -------------------------------------------------------------------------------- 1 | /* slabad.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int slabad_(real *small, real *large) 17 | { 18 | /* Builtin functions */ 19 | double r_lg10(real *), sqrt(doublereal); 20 | 21 | 22 | /* -- LAPACK auxiliary routine (version 3.2) -- */ 23 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 24 | /* November 2006 */ 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | 29 | /* Purpose */ 30 | /* ======= */ 31 | 32 | /* SLABAD takes as input the values computed by SLAMCH for underflow and */ 33 | /* overflow, and returns the square root of each of these values if the */ 34 | /* log of LARGE is sufficiently large. This subroutine is intended to */ 35 | /* identify machines with a large exponent range, such as the Crays, and */ 36 | /* redefine the underflow and overflow limits to be the square roots of */ 37 | /* the values computed by SLAMCH. This subroutine is needed because */ 38 | /* SLAMCH does not compensate for poor arithmetic in the upper half of */ 39 | /* the exponent range, as is found on a Cray. */ 40 | 41 | /* Arguments */ 42 | /* ========= */ 43 | 44 | /* SMALL (input/output) REAL */ 45 | /* On entry, the underflow threshold as computed by SLAMCH. */ 46 | /* On exit, if LOG10(LARGE) is sufficiently large, the square */ 47 | /* root of SMALL, otherwise unchanged. */ 48 | 49 | /* LARGE (input/output) REAL */ 50 | /* On entry, the overflow threshold as computed by SLAMCH. */ 51 | /* On exit, if LOG10(LARGE) is sufficiently large, the square */ 52 | /* root of LARGE, otherwise unchanged. */ 53 | 54 | /* ===================================================================== */ 55 | 56 | /* .. Intrinsic Functions .. */ 57 | /* .. */ 58 | /* .. Executable Statements .. */ 59 | 60 | /* If it looks like we're on a Cray, take the square root of */ 61 | /* SMALL and LARGE to avoid overflow and underflow problems. */ 62 | 63 | if (r_lg10(large) > 2e3f) { 64 | *small = sqrt(*small); 65 | *large = sqrt(*large); 66 | } 67 | 68 | return 0; 69 | 70 | /* End of SLABAD */ 71 | 72 | } /* slabad_ */ 73 | -------------------------------------------------------------------------------- /include/mm_malloc.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Free Software Foundation, Inc. 2 | 3 | This file is part of GCC. 4 | 5 | GCC is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | GCC is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with GCC; see the file COPYING. If not, write to 17 | the Free Software Foundation, 59 Temple Place - Suite 330, 18 | Boston, MA 02111-1307, USA. */ 19 | 20 | /* As a special exception, if you include this header file into source 21 | files compiled by GCC, this header file does not by itself cause 22 | the resulting executable to be covered by the GNU General Public 23 | License. This exception does not however invalidate any other 24 | reasons why the executable file might be covered by the GNU General 25 | Public License. */ 26 | 27 | #ifndef _MM_MALLOC_H_INCLUDED 28 | #define _MM_MALLOC_H_INCLUDED 29 | 30 | #include 31 | #include 32 | 33 | static __inline__ void* 34 | _mm_malloc (size_t size, size_t align) 35 | { 36 | void * malloc_ptr; 37 | void * aligned_ptr; 38 | 39 | /* Error if align is not a power of two. */ 40 | if (align & (align - 1)) 41 | { 42 | errno = EINVAL; 43 | return ((void*) 0); 44 | } 45 | 46 | if (size == 0) 47 | return ((void *) 0); 48 | 49 | /* Assume malloc'd pointer is aligned at least to sizeof (void*). 50 | If necessary, add another sizeof (void*) to store the value 51 | returned by malloc. Effectively this enforces a minimum alignment 52 | of sizeof double. */ 53 | if (align < 2 * sizeof (void *)) 54 | align = 2 * sizeof (void *); 55 | 56 | malloc_ptr = malloc (size + align); 57 | if (!malloc_ptr) 58 | return ((void *) 0); 59 | 60 | /* Align We have at least sizeof (void *) space below malloc'd ptr. */ 61 | aligned_ptr = (void *) (((size_t) malloc_ptr + align) 62 | & ~((size_t) (align) - 1)); 63 | 64 | /* Store the original pointer just before p. */ 65 | ((void **) aligned_ptr) [-1] = malloc_ptr; 66 | 67 | return aligned_ptr; 68 | } 69 | 70 | static __inline__ void 71 | _mm_free (void * aligned_ptr) 72 | { 73 | if (aligned_ptr) 74 | free (((void **) aligned_ptr) [-1]); 75 | } 76 | 77 | #endif /* _MM_MALLOC_H_INCLUDED */ 78 | -------------------------------------------------------------------------------- /src/lapack/dlabad.c: -------------------------------------------------------------------------------- 1 | /* dlabad.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int dlabad_(doublereal *small, doublereal *large) 17 | { 18 | /* Builtin functions */ 19 | double d_lg10(doublereal *), sqrt(doublereal); 20 | 21 | 22 | /* -- LAPACK auxiliary routine (version 3.2) -- */ 23 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 24 | /* November 2006 */ 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | 29 | /* Purpose */ 30 | /* ======= */ 31 | 32 | /* DLABAD takes as input the values computed by DLAMCH for underflow and */ 33 | /* overflow, and returns the square root of each of these values if the */ 34 | /* log of LARGE is sufficiently large. This subroutine is intended to */ 35 | /* identify machines with a large exponent range, such as the Crays, and */ 36 | /* redefine the underflow and overflow limits to be the square roots of */ 37 | /* the values computed by DLAMCH. This subroutine is needed because */ 38 | /* DLAMCH does not compensate for poor arithmetic in the upper half of */ 39 | /* the exponent range, as is found on a Cray. */ 40 | 41 | /* Arguments */ 42 | /* ========= */ 43 | 44 | /* SMALL (input/output) DOUBLE PRECISION */ 45 | /* On entry, the underflow threshold as computed by DLAMCH. */ 46 | /* On exit, if LOG10(LARGE) is sufficiently large, the square */ 47 | /* root of SMALL, otherwise unchanged. */ 48 | 49 | /* LARGE (input/output) DOUBLE PRECISION */ 50 | /* On entry, the overflow threshold as computed by DLAMCH. */ 51 | /* On exit, if LOG10(LARGE) is sufficiently large, the square */ 52 | /* root of LARGE, otherwise unchanged. */ 53 | 54 | /* ===================================================================== */ 55 | 56 | /* .. Intrinsic Functions .. */ 57 | /* .. */ 58 | /* .. Executable Statements .. */ 59 | 60 | /* If it looks like we're on a Cray, take the square root of */ 61 | /* SMALL and LARGE to avoid overflow and underflow problems. */ 62 | 63 | if (d_lg10(large) > 2e3) { 64 | *small = sqrt(*small); 65 | *large = sqrt(*large); 66 | } 67 | 68 | return 0; 69 | 70 | /* End of DLABAD */ 71 | 72 | } /* dlabad_ */ 73 | -------------------------------------------------------------------------------- /include/opencv/cxcore.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CXCORE_H__ 44 | #define __OPENCV_OLD_CXCORE_H__ 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include "opencv2/core/core_c.h" 51 | #include "opencv2/core/core.hpp" 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/opencv/calib3d/precomp.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | #ifndef __OPENCV_PRECOMP_H__ 43 | #define __OPENCV_PRECOMP_H__ 44 | 45 | #if _MSC_VER >= 1200 46 | #pragma warning( disable: 4251 4710 4711 4514 4996 ) 47 | #endif 48 | 49 | #ifdef HAVE_CONFIG_H 50 | #include 51 | #endif 52 | 53 | #include "opencv2/calib3d/calib3d.hpp" 54 | #include "opencv2/imgproc/imgproc.hpp" 55 | #include "opencv2/imgproc/imgproc_c.h" 56 | #include "opencv2/core/internal.hpp" 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/lapack/ilaslc.c: -------------------------------------------------------------------------------- 1 | /* ilaslc.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | integer ilaslc_(integer *m, integer *n, real *a, integer *lda) 17 | { 18 | /* System generated locals */ 19 | integer a_dim1, a_offset, ret_val, i__1; 20 | 21 | /* Local variables */ 22 | integer i__; 23 | 24 | 25 | /* -- LAPACK auxiliary routine (version 3.2.1) -- */ 26 | 27 | /* -- April 2009 -- */ 28 | 29 | /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ 30 | /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */ 31 | 32 | /* .. Scalar Arguments .. */ 33 | /* .. */ 34 | /* .. Array Arguments .. */ 35 | /* .. */ 36 | 37 | /* Purpose */ 38 | /* ======= */ 39 | 40 | /* ILASLC scans A for its last non-zero column. */ 41 | 42 | /* Arguments */ 43 | /* ========= */ 44 | 45 | /* M (input) INTEGER */ 46 | /* The number of rows of the matrix A. */ 47 | 48 | /* N (input) INTEGER */ 49 | /* The number of columns of the matrix A. */ 50 | 51 | /* A (input) REAL array, dimension (LDA,N) */ 52 | /* The m by n matrix A. */ 53 | 54 | /* LDA (input) INTEGER */ 55 | /* The leading dimension of the array A. LDA >= max(1,M). */ 56 | 57 | /* ===================================================================== */ 58 | 59 | /* .. Parameters .. */ 60 | /* .. */ 61 | /* .. Local Scalars .. */ 62 | /* .. */ 63 | /* .. Executable Statements .. */ 64 | 65 | /* Quick test for the common case where one corner is non-zero. */ 66 | /* Parameter adjustments */ 67 | a_dim1 = *lda; 68 | a_offset = 1 + a_dim1; 69 | a -= a_offset; 70 | 71 | /* Function Body */ 72 | if (*n == 0) { 73 | ret_val = *n; 74 | } else if (a[*n * a_dim1 + 1] != 0.f || a[*m + *n * a_dim1] != 0.f) { 75 | ret_val = *n; 76 | } else { 77 | /* Now scan each column from the end, returning with the first non-zero. */ 78 | for (ret_val = *n; ret_val >= 1; --ret_val) { 79 | i__1 = *m; 80 | for (i__ = 1; i__ <= i__1; ++i__) { 81 | if (a[i__ + ret_val * a_dim1] != 0.f) { 82 | return ret_val; 83 | } 84 | } 85 | } 86 | } 87 | return ret_val; 88 | } /* ilaslc_ */ 89 | -------------------------------------------------------------------------------- /include/opencv2/core/version.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright( C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | //(including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort(including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | /* 43 | definition of the current version of OpenCV 44 | Usefull to test in user programs 45 | */ 46 | 47 | #ifndef __OPENCV_VERSION_HPP__ 48 | #define __OPENCV_VERSION_HPP__ 49 | 50 | #define CV_MAJOR_VERSION 2 51 | #define CV_MINOR_VERSION 2 52 | #define CV_SUBMINOR_VERSION 0 53 | 54 | #define CVAUX_STR_EXP(__A) #__A 55 | #define CVAUX_STR(__A) CVAUX_STR_EXP(__A) 56 | #define CV_VERSION CVAUX_STR(CV_MAJOR_VERSION) "." CVAUX_STR(CV_MINOR_VERSION) "." CVAUX_STR(CV_SUBMINOR_VERSION) 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/lapack/ilaslr.c: -------------------------------------------------------------------------------- 1 | /* ilaslr.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | integer ilaslr_(integer *m, integer *n, real *a, integer *lda) 17 | { 18 | /* System generated locals */ 19 | integer a_dim1, a_offset, ret_val, i__1; 20 | 21 | /* Local variables */ 22 | integer i__, j; 23 | 24 | 25 | /* -- LAPACK auxiliary routine (version 3.2.1) -- */ 26 | 27 | /* -- April 2009 -- */ 28 | 29 | /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ 30 | /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */ 31 | 32 | /* .. Scalar Arguments .. */ 33 | /* .. */ 34 | /* .. Array Arguments .. */ 35 | /* .. */ 36 | 37 | /* Purpose */ 38 | /* ======= */ 39 | 40 | /* ILASLR scans A for its last non-zero row. */ 41 | 42 | /* Arguments */ 43 | /* ========= */ 44 | 45 | /* M (input) INTEGER */ 46 | /* The number of rows of the matrix A. */ 47 | 48 | /* N (input) INTEGER */ 49 | /* The number of columns of the matrix A. */ 50 | 51 | /* A (input) REAL array, dimension (LDA,N) */ 52 | /* The m by n matrix A. */ 53 | 54 | /* LDA (input) INTEGER */ 55 | /* The leading dimension of the array A. LDA >= max(1,M). */ 56 | 57 | /* ===================================================================== */ 58 | 59 | /* .. Parameters .. */ 60 | /* .. */ 61 | /* .. Local Scalars .. */ 62 | /* .. */ 63 | /* .. Executable Statements .. */ 64 | 65 | /* Quick test for the common case where one corner is non-zero. */ 66 | /* Parameter adjustments */ 67 | a_dim1 = *lda; 68 | a_offset = 1 + a_dim1; 69 | a -= a_offset; 70 | 71 | /* Function Body */ 72 | if (*m == 0) { 73 | ret_val = *m; 74 | } else if (a[*m + a_dim1] != 0.f || a[*m + *n * a_dim1] != 0.f) { 75 | ret_val = *m; 76 | } else { 77 | /* Scan up each column tracking the last zero row seen. */ 78 | ret_val = 0; 79 | i__1 = *n; 80 | for (j = 1; j <= i__1; ++j) { 81 | for (i__ = *m; i__ >= 1; --i__) { 82 | if (a[i__ + j * a_dim1] != 0.f) { 83 | break; 84 | } 85 | } 86 | ret_val = max(ret_val,i__); 87 | } 88 | } 89 | return ret_val; 90 | } /* ilaslr_ */ 91 | -------------------------------------------------------------------------------- /src/lapack/iladlc.c: -------------------------------------------------------------------------------- 1 | /* iladlc.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | integer iladlc_(integer *m, integer *n, doublereal *a, integer *lda) 17 | { 18 | /* System generated locals */ 19 | integer a_dim1, a_offset, ret_val, i__1; 20 | 21 | /* Local variables */ 22 | integer i__; 23 | 24 | 25 | /* -- LAPACK auxiliary routine (version 3.2.1) -- */ 26 | 27 | /* -- April 2009 -- */ 28 | 29 | /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ 30 | /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */ 31 | 32 | /* .. Scalar Arguments .. */ 33 | /* .. */ 34 | /* .. Array Arguments .. */ 35 | /* .. */ 36 | 37 | /* Purpose */ 38 | /* ======= */ 39 | 40 | /* ILADLC scans A for its last non-zero column. */ 41 | 42 | /* Arguments */ 43 | /* ========= */ 44 | 45 | /* M (input) INTEGER */ 46 | /* The number of rows of the matrix A. */ 47 | 48 | /* N (input) INTEGER */ 49 | /* The number of columns of the matrix A. */ 50 | 51 | /* A (input) DOUBLE PRECISION array, dimension (LDA,N) */ 52 | /* The m by n matrix A. */ 53 | 54 | /* LDA (input) INTEGER */ 55 | /* The leading dimension of the array A. LDA >= max(1,M). */ 56 | 57 | /* ===================================================================== */ 58 | 59 | /* .. Parameters .. */ 60 | /* .. */ 61 | /* .. Local Scalars .. */ 62 | /* .. */ 63 | /* .. Executable Statements .. */ 64 | 65 | /* Quick test for the common case where one corner is non-zero. */ 66 | /* Parameter adjustments */ 67 | a_dim1 = *lda; 68 | a_offset = 1 + a_dim1; 69 | a -= a_offset; 70 | 71 | /* Function Body */ 72 | if (*n == 0) { 73 | ret_val = *n; 74 | } else if (a[*n * a_dim1 + 1] != 0. || a[*m + *n * a_dim1] != 0.) { 75 | ret_val = *n; 76 | } else { 77 | /* Now scan each column from the end, returning with the first non-zero. */ 78 | for (ret_val = *n; ret_val >= 1; --ret_val) { 79 | i__1 = *m; 80 | for (i__ = 1; i__ <= i__1; ++i__) { 81 | if (a[i__ + ret_val * a_dim1] != 0.) { 82 | return ret_val; 83 | } 84 | } 85 | } 86 | } 87 | return ret_val; 88 | } /* iladlc_ */ 89 | -------------------------------------------------------------------------------- /src/lapack/iladlr.c: -------------------------------------------------------------------------------- 1 | /* iladlr.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | integer iladlr_(integer *m, integer *n, doublereal *a, integer *lda) 17 | { 18 | /* System generated locals */ 19 | integer a_dim1, a_offset, ret_val, i__1; 20 | 21 | /* Local variables */ 22 | integer i__, j; 23 | 24 | 25 | /* -- LAPACK auxiliary routine (version 3.2.1) -- */ 26 | 27 | /* -- April 2009 -- */ 28 | 29 | /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ 30 | /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */ 31 | 32 | /* .. Scalar Arguments .. */ 33 | /* .. */ 34 | /* .. Array Arguments .. */ 35 | /* .. */ 36 | 37 | /* Purpose */ 38 | /* ======= */ 39 | 40 | /* ILADLR scans A for its last non-zero row. */ 41 | 42 | /* Arguments */ 43 | /* ========= */ 44 | 45 | /* M (input) INTEGER */ 46 | /* The number of rows of the matrix A. */ 47 | 48 | /* N (input) INTEGER */ 49 | /* The number of columns of the matrix A. */ 50 | 51 | /* A (input) DOUBLE PRECISION array, dimension (LDA,N) */ 52 | /* The m by n matrix A. */ 53 | 54 | /* LDA (input) INTEGER */ 55 | /* The leading dimension of the array A. LDA >= max(1,M). */ 56 | 57 | /* ===================================================================== */ 58 | 59 | /* .. Parameters .. */ 60 | /* .. */ 61 | /* .. Local Scalars .. */ 62 | /* .. */ 63 | /* .. Executable Statements .. */ 64 | 65 | /* Quick test for the common case where one corner is non-zero. */ 66 | /* Parameter adjustments */ 67 | a_dim1 = *lda; 68 | a_offset = 1 + a_dim1; 69 | a -= a_offset; 70 | 71 | /* Function Body */ 72 | if (*m == 0) { 73 | ret_val = *m; 74 | } else if (a[*m + a_dim1] != 0. || a[*m + *n * a_dim1] != 0.) { 75 | ret_val = *m; 76 | } else { 77 | /* Scan up each column tracking the last zero row seen. */ 78 | ret_val = 0; 79 | i__1 = *n; 80 | for (j = 1; j <= i__1; ++j) { 81 | for (i__ = *m; i__ >= 1; --i__) { 82 | if (a[i__ + j * a_dim1] != 0.) { 83 | break; 84 | } 85 | } 86 | ret_val = max(ret_val,i__); 87 | } 88 | } 89 | return ret_val; 90 | } /* iladlr_ */ 91 | -------------------------------------------------------------------------------- /src/lapack/scopy.c: -------------------------------------------------------------------------------- 1 | /* scopy.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int scopy_(integer *n, real *sx, integer *incx, real *sy, 17 | integer *incy) 18 | { 19 | /* System generated locals */ 20 | integer i__1; 21 | 22 | /* Local variables */ 23 | integer i__, m, ix, iy, mp1; 24 | 25 | /* .. Scalar Arguments .. */ 26 | /* .. */ 27 | /* .. Array Arguments .. */ 28 | /* .. */ 29 | 30 | /* Purpose */ 31 | /* ======= */ 32 | 33 | /* copies a vector, x, to a vector, y. */ 34 | /* uses unrolled loops for increments equal to 1. */ 35 | /* jack dongarra, linpack, 3/11/78. */ 36 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 37 | 38 | 39 | /* .. Local Scalars .. */ 40 | /* .. */ 41 | /* .. Intrinsic Functions .. */ 42 | /* .. */ 43 | /* Parameter adjustments */ 44 | --sy; 45 | --sx; 46 | 47 | /* Function Body */ 48 | if (*n <= 0) { 49 | return 0; 50 | } 51 | if (*incx == 1 && *incy == 1) { 52 | goto L20; 53 | } 54 | 55 | /* code for unequal increments or equal increments */ 56 | /* not equal to 1 */ 57 | 58 | ix = 1; 59 | iy = 1; 60 | if (*incx < 0) { 61 | ix = (-(*n) + 1) * *incx + 1; 62 | } 63 | if (*incy < 0) { 64 | iy = (-(*n) + 1) * *incy + 1; 65 | } 66 | i__1 = *n; 67 | for (i__ = 1; i__ <= i__1; ++i__) { 68 | sy[iy] = sx[ix]; 69 | ix += *incx; 70 | iy += *incy; 71 | /* L10: */ 72 | } 73 | return 0; 74 | 75 | /* code for both increments equal to 1 */ 76 | 77 | 78 | /* clean-up loop */ 79 | 80 | L20: 81 | m = *n % 7; 82 | if (m == 0) { 83 | goto L40; 84 | } 85 | i__1 = m; 86 | for (i__ = 1; i__ <= i__1; ++i__) { 87 | sy[i__] = sx[i__]; 88 | /* L30: */ 89 | } 90 | if (*n < 7) { 91 | return 0; 92 | } 93 | L40: 94 | mp1 = m + 1; 95 | i__1 = *n; 96 | for (i__ = mp1; i__ <= i__1; i__ += 7) { 97 | sy[i__] = sx[i__]; 98 | sy[i__ + 1] = sx[i__ + 1]; 99 | sy[i__ + 2] = sx[i__ + 2]; 100 | sy[i__ + 3] = sx[i__ + 3]; 101 | sy[i__ + 4] = sx[i__ + 4]; 102 | sy[i__ + 5] = sx[i__ + 5]; 103 | sy[i__ + 6] = sx[i__ + 6]; 104 | /* L50: */ 105 | } 106 | return 0; 107 | } /* scopy_ */ 108 | -------------------------------------------------------------------------------- /src/lapack/dcopy.c: -------------------------------------------------------------------------------- 1 | /* dcopy.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int dcopy_(integer *n, doublereal *dx, integer *incx, 17 | doublereal *dy, integer *incy) 18 | { 19 | /* System generated locals */ 20 | integer i__1; 21 | 22 | /* Local variables */ 23 | integer i__, m, ix, iy, mp1; 24 | 25 | /* .. Scalar Arguments .. */ 26 | /* .. */ 27 | /* .. Array Arguments .. */ 28 | /* .. */ 29 | 30 | /* Purpose */ 31 | /* ======= */ 32 | 33 | /* copies a vector, x, to a vector, y. */ 34 | /* uses unrolled loops for increments equal to one. */ 35 | /* jack dongarra, linpack, 3/11/78. */ 36 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 37 | 38 | 39 | /* .. Local Scalars .. */ 40 | /* .. */ 41 | /* .. Intrinsic Functions .. */ 42 | /* .. */ 43 | /* Parameter adjustments */ 44 | --dy; 45 | --dx; 46 | 47 | /* Function Body */ 48 | if (*n <= 0) { 49 | return 0; 50 | } 51 | if (*incx == 1 && *incy == 1) { 52 | goto L20; 53 | } 54 | 55 | /* code for unequal increments or equal increments */ 56 | /* not equal to 1 */ 57 | 58 | ix = 1; 59 | iy = 1; 60 | if (*incx < 0) { 61 | ix = (-(*n) + 1) * *incx + 1; 62 | } 63 | if (*incy < 0) { 64 | iy = (-(*n) + 1) * *incy + 1; 65 | } 66 | i__1 = *n; 67 | for (i__ = 1; i__ <= i__1; ++i__) { 68 | dy[iy] = dx[ix]; 69 | ix += *incx; 70 | iy += *incy; 71 | /* L10: */ 72 | } 73 | return 0; 74 | 75 | /* code for both increments equal to 1 */ 76 | 77 | 78 | /* clean-up loop */ 79 | 80 | L20: 81 | m = *n % 7; 82 | if (m == 0) { 83 | goto L40; 84 | } 85 | i__1 = m; 86 | for (i__ = 1; i__ <= i__1; ++i__) { 87 | dy[i__] = dx[i__]; 88 | /* L30: */ 89 | } 90 | if (*n < 7) { 91 | return 0; 92 | } 93 | L40: 94 | mp1 = m + 1; 95 | i__1 = *n; 96 | for (i__ = mp1; i__ <= i__1; i__ += 7) { 97 | dy[i__] = dx[i__]; 98 | dy[i__ + 1] = dx[i__ + 1]; 99 | dy[i__ + 2] = dx[i__ + 2]; 100 | dy[i__ + 3] = dx[i__ + 3]; 101 | dy[i__ + 4] = dx[i__ + 4]; 102 | dy[i__ + 5] = dx[i__ + 5]; 103 | dy[i__ + 6] = dx[i__ + 6]; 104 | /* L50: */ 105 | } 106 | return 0; 107 | } /* dcopy_ */ 108 | -------------------------------------------------------------------------------- /src/lapack/saxpy.c: -------------------------------------------------------------------------------- 1 | /* saxpy.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int saxpy_(integer *n, real *sa, real *sx, integer *incx, 17 | real *sy, integer *incy) 18 | { 19 | /* System generated locals */ 20 | integer i__1; 21 | 22 | /* Local variables */ 23 | integer i__, m, ix, iy, mp1; 24 | 25 | /* .. Scalar Arguments .. */ 26 | /* .. */ 27 | /* .. Array Arguments .. */ 28 | /* .. */ 29 | 30 | /* Purpose */ 31 | /* ======= */ 32 | 33 | /* SAXPY constant times a vector plus a vector. */ 34 | /* uses unrolled loop for increments equal to one. */ 35 | /* jack dongarra, linpack, 3/11/78. */ 36 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 37 | 38 | 39 | /* .. Local Scalars .. */ 40 | /* .. */ 41 | /* .. Intrinsic Functions .. */ 42 | /* .. */ 43 | /* Parameter adjustments */ 44 | --sy; 45 | --sx; 46 | 47 | /* Function Body */ 48 | if (*n <= 0) { 49 | return 0; 50 | } 51 | if (*sa == 0.f) { 52 | return 0; 53 | } 54 | if (*incx == 1 && *incy == 1) { 55 | goto L20; 56 | } 57 | 58 | /* code for unequal increments or equal increments */ 59 | /* not equal to 1 */ 60 | 61 | ix = 1; 62 | iy = 1; 63 | if (*incx < 0) { 64 | ix = (-(*n) + 1) * *incx + 1; 65 | } 66 | if (*incy < 0) { 67 | iy = (-(*n) + 1) * *incy + 1; 68 | } 69 | i__1 = *n; 70 | for (i__ = 1; i__ <= i__1; ++i__) { 71 | sy[iy] += *sa * sx[ix]; 72 | ix += *incx; 73 | iy += *incy; 74 | /* L10: */ 75 | } 76 | return 0; 77 | 78 | /* code for both increments equal to 1 */ 79 | 80 | 81 | /* clean-up loop */ 82 | 83 | L20: 84 | m = *n % 4; 85 | if (m == 0) { 86 | goto L40; 87 | } 88 | i__1 = m; 89 | for (i__ = 1; i__ <= i__1; ++i__) { 90 | sy[i__] += *sa * sx[i__]; 91 | /* L30: */ 92 | } 93 | if (*n < 4) { 94 | return 0; 95 | } 96 | L40: 97 | mp1 = m + 1; 98 | i__1 = *n; 99 | for (i__ = mp1; i__ <= i__1; i__ += 4) { 100 | sy[i__] += *sa * sx[i__]; 101 | sy[i__ + 1] += *sa * sx[i__ + 1]; 102 | sy[i__ + 2] += *sa * sx[i__ + 2]; 103 | sy[i__ + 3] += *sa * sx[i__ + 3]; 104 | /* L50: */ 105 | } 106 | return 0; 107 | } /* saxpy_ */ 108 | -------------------------------------------------------------------------------- /src/lapack/daxpy.c: -------------------------------------------------------------------------------- 1 | /* daxpy.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int daxpy_(integer *n, doublereal *da, doublereal *dx, 17 | integer *incx, doublereal *dy, integer *incy) 18 | { 19 | /* System generated locals */ 20 | integer i__1; 21 | 22 | /* Local variables */ 23 | integer i__, m, ix, iy, mp1; 24 | 25 | /* .. Scalar Arguments .. */ 26 | /* .. */ 27 | /* .. Array Arguments .. */ 28 | /* .. */ 29 | 30 | /* Purpose */ 31 | /* ======= */ 32 | 33 | /* constant times a vector plus a vector. */ 34 | /* uses unrolled loops for increments equal to one. */ 35 | /* jack dongarra, linpack, 3/11/78. */ 36 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 37 | 38 | 39 | /* .. Local Scalars .. */ 40 | /* .. */ 41 | /* .. Intrinsic Functions .. */ 42 | /* .. */ 43 | /* Parameter adjustments */ 44 | --dy; 45 | --dx; 46 | 47 | /* Function Body */ 48 | if (*n <= 0) { 49 | return 0; 50 | } 51 | if (*da == 0.) { 52 | return 0; 53 | } 54 | if (*incx == 1 && *incy == 1) { 55 | goto L20; 56 | } 57 | 58 | /* code for unequal increments or equal increments */ 59 | /* not equal to 1 */ 60 | 61 | ix = 1; 62 | iy = 1; 63 | if (*incx < 0) { 64 | ix = (-(*n) + 1) * *incx + 1; 65 | } 66 | if (*incy < 0) { 67 | iy = (-(*n) + 1) * *incy + 1; 68 | } 69 | i__1 = *n; 70 | for (i__ = 1; i__ <= i__1; ++i__) { 71 | dy[iy] += *da * dx[ix]; 72 | ix += *incx; 73 | iy += *incy; 74 | /* L10: */ 75 | } 76 | return 0; 77 | 78 | /* code for both increments equal to 1 */ 79 | 80 | 81 | /* clean-up loop */ 82 | 83 | L20: 84 | m = *n % 4; 85 | if (m == 0) { 86 | goto L40; 87 | } 88 | i__1 = m; 89 | for (i__ = 1; i__ <= i__1; ++i__) { 90 | dy[i__] += *da * dx[i__]; 91 | /* L30: */ 92 | } 93 | if (*n < 4) { 94 | return 0; 95 | } 96 | L40: 97 | mp1 = m + 1; 98 | i__1 = *n; 99 | for (i__ = mp1; i__ <= i__1; i__ += 4) { 100 | dy[i__] += *da * dx[i__]; 101 | dy[i__ + 1] += *da * dx[i__ + 1]; 102 | dy[i__ + 2] += *da * dx[i__ + 2]; 103 | dy[i__ + 3] += *da * dx[i__ + 3]; 104 | /* L50: */ 105 | } 106 | return 0; 107 | } /* daxpy_ */ 108 | -------------------------------------------------------------------------------- /src/opencv/objdetect/precomp.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_PRECOMP_H__ 44 | #define __OPENCV_PRECOMP_H__ 45 | 46 | #if _MSC_VER >= 1200 47 | #pragma warning( disable: 4251 4710 4711 4514 4996 ) 48 | #endif 49 | 50 | #ifdef HAVE_CONFIG_H 51 | #include 52 | #endif 53 | 54 | #include "opencv2/objdetect/objdetect.hpp" 55 | #include "opencv2/imgproc/imgproc.hpp" 56 | #include "opencv2/imgproc/imgproc_c.h" 57 | #include "opencv2/core/core_c.h" 58 | #include "opencv2/highgui/highgui.hpp" 59 | #include "opencv2/core/internal.hpp" 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/opencv2/flann/timer.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef _OPENCV_TIMER_H_ 32 | #define _OPENCV_TIMER_H_ 33 | 34 | #include 35 | 36 | 37 | namespace cvflann 38 | { 39 | 40 | /** 41 | * A start-stop timer class. 42 | * 43 | * Can be used to time portions of code. 44 | */ 45 | class CV_EXPORTS StartStopTimer 46 | { 47 | clock_t startTime; 48 | 49 | public: 50 | /** 51 | * Value of the timer. 52 | */ 53 | double value; 54 | 55 | 56 | /** 57 | * Constructor. 58 | */ 59 | StartStopTimer() 60 | { 61 | reset(); 62 | } 63 | 64 | /** 65 | * Starts the timer. 66 | */ 67 | void start() { 68 | startTime = clock(); 69 | } 70 | 71 | /** 72 | * Stops the timer and updates timer value. 73 | */ 74 | void stop() { 75 | clock_t stopTime = clock(); 76 | value += ( (double)stopTime - startTime) / CLOCKS_PER_SEC; 77 | } 78 | 79 | /** 80 | * Resets the timer value to 0. 81 | */ 82 | void reset() { 83 | value = 0; 84 | } 85 | 86 | }; 87 | 88 | }// namespace cvflann 89 | 90 | #endif // _OPENCV_TIMER_H_ 91 | -------------------------------------------------------------------------------- /src/zlib/compress.c: -------------------------------------------------------------------------------- 1 | /* compress.c -- compress a memory buffer 2 | * Copyright (C) 1995-2005 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Compresses the source buffer into the destination buffer. The level 13 | parameter has the same meaning as in deflateInit. sourceLen is the byte 14 | length of the source buffer. Upon entry, destLen is the total size of the 15 | destination buffer, which must be at least 0.1% larger than sourceLen plus 16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. 17 | 18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, 20 | Z_STREAM_ERROR if the level parameter is invalid. 21 | */ 22 | int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) 23 | Bytef *dest; 24 | uLongf *destLen; 25 | const Bytef *source; 26 | uLong sourceLen; 27 | int level; 28 | { 29 | z_stream stream; 30 | int err; 31 | 32 | stream.next_in = (Bytef*)source; 33 | stream.avail_in = (uInt)sourceLen; 34 | #ifdef MAXSEG_64K 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | #endif 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | stream.opaque = (voidpf)0; 45 | 46 | err = deflateInit(&stream, level); 47 | if (err != Z_OK) return err; 48 | 49 | err = deflate(&stream, Z_FINISH); 50 | if (err != Z_STREAM_END) { 51 | deflateEnd(&stream); 52 | return err == Z_OK ? Z_BUF_ERROR : err; 53 | } 54 | *destLen = stream.total_out; 55 | 56 | err = deflateEnd(&stream); 57 | return err; 58 | } 59 | 60 | /* =========================================================================== 61 | */ 62 | int ZEXPORT compress (dest, destLen, source, sourceLen) 63 | Bytef *dest; 64 | uLongf *destLen; 65 | const Bytef *source; 66 | uLong sourceLen; 67 | { 68 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 69 | } 70 | 71 | /* =========================================================================== 72 | If the default memLevel or windowBits for deflateInit() is changed, then 73 | this function needs to be updated. 74 | */ 75 | uLong ZEXPORT compressBound (sourceLen) 76 | uLong sourceLen; 77 | { 78 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 79 | (sourceLen >> 25) + 13; 80 | } 81 | -------------------------------------------------------------------------------- /src/lapack/dasum.c: -------------------------------------------------------------------------------- 1 | /* dasum.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | doublereal dasum_(integer *n, doublereal *dx, integer *incx) 17 | { 18 | /* System generated locals */ 19 | integer i__1, i__2; 20 | doublereal ret_val, d__1, d__2, d__3, d__4, d__5, d__6; 21 | 22 | /* Local variables */ 23 | integer i__, m, mp1; 24 | doublereal dtemp; 25 | integer nincx; 26 | 27 | /* .. Scalar Arguments .. */ 28 | /* .. */ 29 | /* .. Array Arguments .. */ 30 | /* .. */ 31 | 32 | /* Purpose */ 33 | /* ======= */ 34 | 35 | /* takes the sum of the absolute values. */ 36 | /* jack dongarra, linpack, 3/11/78. */ 37 | /* modified 3/93 to return if incx .le. 0. */ 38 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 39 | 40 | 41 | /* .. Local Scalars .. */ 42 | /* .. */ 43 | /* .. Intrinsic Functions .. */ 44 | /* .. */ 45 | /* Parameter adjustments */ 46 | --dx; 47 | 48 | /* Function Body */ 49 | ret_val = 0.; 50 | dtemp = 0.; 51 | if (*n <= 0 || *incx <= 0) { 52 | return ret_val; 53 | } 54 | if (*incx == 1) { 55 | goto L20; 56 | } 57 | 58 | /* code for increment not equal to 1 */ 59 | 60 | nincx = *n * *incx; 61 | i__1 = nincx; 62 | i__2 = *incx; 63 | for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) { 64 | dtemp += (d__1 = dx[i__], abs(d__1)); 65 | /* L10: */ 66 | } 67 | ret_val = dtemp; 68 | return ret_val; 69 | 70 | /* code for increment equal to 1 */ 71 | 72 | 73 | /* clean-up loop */ 74 | 75 | L20: 76 | m = *n % 6; 77 | if (m == 0) { 78 | goto L40; 79 | } 80 | i__2 = m; 81 | for (i__ = 1; i__ <= i__2; ++i__) { 82 | dtemp += (d__1 = dx[i__], abs(d__1)); 83 | /* L30: */ 84 | } 85 | if (*n < 6) { 86 | goto L60; 87 | } 88 | L40: 89 | mp1 = m + 1; 90 | i__2 = *n; 91 | for (i__ = mp1; i__ <= i__2; i__ += 6) { 92 | dtemp = dtemp + (d__1 = dx[i__], abs(d__1)) + (d__2 = dx[i__ + 1], 93 | abs(d__2)) + (d__3 = dx[i__ + 2], abs(d__3)) + (d__4 = dx[i__ 94 | + 3], abs(d__4)) + (d__5 = dx[i__ + 4], abs(d__5)) + (d__6 = 95 | dx[i__ + 5], abs(d__6)); 96 | /* L50: */ 97 | } 98 | L60: 99 | ret_val = dtemp; 100 | return ret_val; 101 | } /* dasum_ */ 102 | -------------------------------------------------------------------------------- /src/lapack/sasum.c: -------------------------------------------------------------------------------- 1 | /* sasum.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | doublereal sasum_(integer *n, real *sx, integer *incx) 17 | { 18 | /* System generated locals */ 19 | integer i__1, i__2; 20 | real ret_val, r__1, r__2, r__3, r__4, r__5, r__6; 21 | 22 | /* Local variables */ 23 | integer i__, m, mp1, nincx; 24 | real stemp; 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | /* .. Array Arguments .. */ 29 | /* .. */ 30 | 31 | /* Purpose */ 32 | /* ======= */ 33 | 34 | /* takes the sum of the absolute values. */ 35 | /* uses unrolled loops for increment equal to one. */ 36 | /* jack dongarra, linpack, 3/11/78. */ 37 | /* modified 3/93 to return if incx .le. 0. */ 38 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 39 | 40 | 41 | /* .. Local Scalars .. */ 42 | /* .. */ 43 | /* .. Intrinsic Functions .. */ 44 | /* .. */ 45 | /* Parameter adjustments */ 46 | --sx; 47 | 48 | /* Function Body */ 49 | ret_val = 0.f; 50 | stemp = 0.f; 51 | if (*n <= 0 || *incx <= 0) { 52 | return ret_val; 53 | } 54 | if (*incx == 1) { 55 | goto L20; 56 | } 57 | 58 | /* code for increment not equal to 1 */ 59 | 60 | nincx = *n * *incx; 61 | i__1 = nincx; 62 | i__2 = *incx; 63 | for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) { 64 | stemp += (r__1 = sx[i__], dabs(r__1)); 65 | /* L10: */ 66 | } 67 | ret_val = stemp; 68 | return ret_val; 69 | 70 | /* code for increment equal to 1 */ 71 | 72 | 73 | /* clean-up loop */ 74 | 75 | L20: 76 | m = *n % 6; 77 | if (m == 0) { 78 | goto L40; 79 | } 80 | i__2 = m; 81 | for (i__ = 1; i__ <= i__2; ++i__) { 82 | stemp += (r__1 = sx[i__], dabs(r__1)); 83 | /* L30: */ 84 | } 85 | if (*n < 6) { 86 | goto L60; 87 | } 88 | L40: 89 | mp1 = m + 1; 90 | i__2 = *n; 91 | for (i__ = mp1; i__ <= i__2; i__ += 6) { 92 | stemp = stemp + (r__1 = sx[i__], dabs(r__1)) + (r__2 = sx[i__ + 1], 93 | dabs(r__2)) + (r__3 = sx[i__ + 2], dabs(r__3)) + (r__4 = sx[ 94 | i__ + 3], dabs(r__4)) + (r__5 = sx[i__ + 4], dabs(r__5)) + ( 95 | r__6 = sx[i__ + 5], dabs(r__6)); 96 | /* L50: */ 97 | } 98 | L60: 99 | ret_val = stemp; 100 | return ret_val; 101 | } /* sasum_ */ 102 | -------------------------------------------------------------------------------- /src/opencv/contrib/precomp.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_PRECOMP_H__ 44 | #define __OPENCV_PRECOMP_H__ 45 | 46 | #if _MSC_VER >= 1200 47 | #pragma warning( disable: 4251 4710 4711 4514 4996 ) 48 | #endif 49 | 50 | #ifdef HAVE_CONFIG_H 51 | #include 52 | #endif 53 | 54 | #ifdef HAVE_CONFIG_H 55 | #include 56 | #endif 57 | 58 | #include "opencv2/contrib/contrib.hpp" 59 | #include "opencv2/features2d/features2d.hpp" 60 | #include "opencv2/objdetect/objdetect.hpp" 61 | #include "opencv2/imgproc/imgproc.hpp" 62 | #include "opencv2/imgproc/imgproc_c.h" 63 | #include "opencv2/core/internal.hpp" 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/lapack/sdot.c: -------------------------------------------------------------------------------- 1 | /* sdot.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | doublereal sdot_(integer *n, real *sx, integer *incx, real *sy, integer *incy) 17 | { 18 | /* System generated locals */ 19 | integer i__1; 20 | real ret_val; 21 | 22 | /* Local variables */ 23 | integer i__, m, ix, iy, mp1; 24 | real stemp; 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | /* .. Array Arguments .. */ 29 | /* .. */ 30 | 31 | /* Purpose */ 32 | /* ======= */ 33 | 34 | /* forms the dot product of two vectors. */ 35 | /* uses unrolled loops for increments equal to one. */ 36 | /* jack dongarra, linpack, 3/11/78. */ 37 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 38 | 39 | 40 | /* .. Local Scalars .. */ 41 | /* .. */ 42 | /* .. Intrinsic Functions .. */ 43 | /* .. */ 44 | /* Parameter adjustments */ 45 | --sy; 46 | --sx; 47 | 48 | /* Function Body */ 49 | stemp = 0.f; 50 | ret_val = 0.f; 51 | if (*n <= 0) { 52 | return ret_val; 53 | } 54 | if (*incx == 1 && *incy == 1) { 55 | goto L20; 56 | } 57 | 58 | /* code for unequal increments or equal increments */ 59 | /* not equal to 1 */ 60 | 61 | ix = 1; 62 | iy = 1; 63 | if (*incx < 0) { 64 | ix = (-(*n) + 1) * *incx + 1; 65 | } 66 | if (*incy < 0) { 67 | iy = (-(*n) + 1) * *incy + 1; 68 | } 69 | i__1 = *n; 70 | for (i__ = 1; i__ <= i__1; ++i__) { 71 | stemp += sx[ix] * sy[iy]; 72 | ix += *incx; 73 | iy += *incy; 74 | /* L10: */ 75 | } 76 | ret_val = stemp; 77 | return ret_val; 78 | 79 | /* code for both increments equal to 1 */ 80 | 81 | 82 | /* clean-up loop */ 83 | 84 | L20: 85 | m = *n % 5; 86 | if (m == 0) { 87 | goto L40; 88 | } 89 | i__1 = m; 90 | for (i__ = 1; i__ <= i__1; ++i__) { 91 | stemp += sx[i__] * sy[i__]; 92 | /* L30: */ 93 | } 94 | if (*n < 5) { 95 | goto L60; 96 | } 97 | L40: 98 | mp1 = m + 1; 99 | i__1 = *n; 100 | for (i__ = mp1; i__ <= i__1; i__ += 5) { 101 | stemp = stemp + sx[i__] * sy[i__] + sx[i__ + 1] * sy[i__ + 1] + sx[ 102 | i__ + 2] * sy[i__ + 2] + sx[i__ + 3] * sy[i__ + 3] + sx[i__ + 103 | 4] * sy[i__ + 4]; 104 | /* L50: */ 105 | } 106 | L60: 107 | ret_val = stemp; 108 | return ret_val; 109 | } /* sdot_ */ 110 | -------------------------------------------------------------------------------- /src/lapack/sswap.c: -------------------------------------------------------------------------------- 1 | /* sswap.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int sswap_(integer *n, real *sx, integer *incx, real *sy, 17 | integer *incy) 18 | { 19 | /* System generated locals */ 20 | integer i__1; 21 | 22 | /* Local variables */ 23 | integer i__, m, ix, iy, mp1; 24 | real stemp; 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | /* .. Array Arguments .. */ 29 | /* .. */ 30 | 31 | /* Purpose */ 32 | /* ======= */ 33 | 34 | /* interchanges two vectors. */ 35 | /* uses unrolled loops for increments equal to 1. */ 36 | /* jack dongarra, linpack, 3/11/78. */ 37 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 38 | 39 | 40 | /* .. Local Scalars .. */ 41 | /* .. */ 42 | /* .. Intrinsic Functions .. */ 43 | /* .. */ 44 | /* Parameter adjustments */ 45 | --sy; 46 | --sx; 47 | 48 | /* Function Body */ 49 | if (*n <= 0) { 50 | return 0; 51 | } 52 | if (*incx == 1 && *incy == 1) { 53 | goto L20; 54 | } 55 | 56 | /* code for unequal increments or equal increments not equal */ 57 | /* to 1 */ 58 | 59 | ix = 1; 60 | iy = 1; 61 | if (*incx < 0) { 62 | ix = (-(*n) + 1) * *incx + 1; 63 | } 64 | if (*incy < 0) { 65 | iy = (-(*n) + 1) * *incy + 1; 66 | } 67 | i__1 = *n; 68 | for (i__ = 1; i__ <= i__1; ++i__) { 69 | stemp = sx[ix]; 70 | sx[ix] = sy[iy]; 71 | sy[iy] = stemp; 72 | ix += *incx; 73 | iy += *incy; 74 | /* L10: */ 75 | } 76 | return 0; 77 | 78 | /* code for both increments equal to 1 */ 79 | 80 | 81 | /* clean-up loop */ 82 | 83 | L20: 84 | m = *n % 3; 85 | if (m == 0) { 86 | goto L40; 87 | } 88 | i__1 = m; 89 | for (i__ = 1; i__ <= i__1; ++i__) { 90 | stemp = sx[i__]; 91 | sx[i__] = sy[i__]; 92 | sy[i__] = stemp; 93 | /* L30: */ 94 | } 95 | if (*n < 3) { 96 | return 0; 97 | } 98 | L40: 99 | mp1 = m + 1; 100 | i__1 = *n; 101 | for (i__ = mp1; i__ <= i__1; i__ += 3) { 102 | stemp = sx[i__]; 103 | sx[i__] = sy[i__]; 104 | sy[i__] = stemp; 105 | stemp = sx[i__ + 1]; 106 | sx[i__ + 1] = sy[i__ + 1]; 107 | sy[i__ + 1] = stemp; 108 | stemp = sx[i__ + 2]; 109 | sx[i__ + 2] = sy[i__ + 2]; 110 | sy[i__ + 2] = stemp; 111 | /* L50: */ 112 | } 113 | return 0; 114 | } /* sswap_ */ 115 | -------------------------------------------------------------------------------- /src/lapack/dswap.c: -------------------------------------------------------------------------------- 1 | /* dswap.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int dswap_(integer *n, doublereal *dx, integer *incx, 17 | doublereal *dy, integer *incy) 18 | { 19 | /* System generated locals */ 20 | integer i__1; 21 | 22 | /* Local variables */ 23 | integer i__, m, ix, iy, mp1; 24 | doublereal dtemp; 25 | 26 | /* .. Scalar Arguments .. */ 27 | /* .. */ 28 | /* .. Array Arguments .. */ 29 | /* .. */ 30 | 31 | /* Purpose */ 32 | /* ======= */ 33 | 34 | /* interchanges two vectors. */ 35 | /* uses unrolled loops for increments equal one. */ 36 | /* jack dongarra, linpack, 3/11/78. */ 37 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 38 | 39 | 40 | /* .. Local Scalars .. */ 41 | /* .. */ 42 | /* .. Intrinsic Functions .. */ 43 | /* .. */ 44 | /* Parameter adjustments */ 45 | --dy; 46 | --dx; 47 | 48 | /* Function Body */ 49 | if (*n <= 0) { 50 | return 0; 51 | } 52 | if (*incx == 1 && *incy == 1) { 53 | goto L20; 54 | } 55 | 56 | /* code for unequal increments or equal increments not equal */ 57 | /* to 1 */ 58 | 59 | ix = 1; 60 | iy = 1; 61 | if (*incx < 0) { 62 | ix = (-(*n) + 1) * *incx + 1; 63 | } 64 | if (*incy < 0) { 65 | iy = (-(*n) + 1) * *incy + 1; 66 | } 67 | i__1 = *n; 68 | for (i__ = 1; i__ <= i__1; ++i__) { 69 | dtemp = dx[ix]; 70 | dx[ix] = dy[iy]; 71 | dy[iy] = dtemp; 72 | ix += *incx; 73 | iy += *incy; 74 | /* L10: */ 75 | } 76 | return 0; 77 | 78 | /* code for both increments equal to 1 */ 79 | 80 | 81 | /* clean-up loop */ 82 | 83 | L20: 84 | m = *n % 3; 85 | if (m == 0) { 86 | goto L40; 87 | } 88 | i__1 = m; 89 | for (i__ = 1; i__ <= i__1; ++i__) { 90 | dtemp = dx[i__]; 91 | dx[i__] = dy[i__]; 92 | dy[i__] = dtemp; 93 | /* L30: */ 94 | } 95 | if (*n < 3) { 96 | return 0; 97 | } 98 | L40: 99 | mp1 = m + 1; 100 | i__1 = *n; 101 | for (i__ = mp1; i__ <= i__1; i__ += 3) { 102 | dtemp = dx[i__]; 103 | dx[i__] = dy[i__]; 104 | dy[i__] = dtemp; 105 | dtemp = dx[i__ + 1]; 106 | dx[i__ + 1] = dy[i__ + 1]; 107 | dy[i__ + 1] = dtemp; 108 | dtemp = dx[i__ + 2]; 109 | dx[i__ + 2] = dy[i__ + 2]; 110 | dy[i__ + 2] = dtemp; 111 | /* L50: */ 112 | } 113 | return 0; 114 | } /* dswap_ */ 115 | -------------------------------------------------------------------------------- /src/lapack/ddot.c: -------------------------------------------------------------------------------- 1 | /* ddot.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | doublereal ddot_(integer *n, doublereal *dx, integer *incx, doublereal *dy, 17 | integer *incy) 18 | { 19 | /* System generated locals */ 20 | integer i__1; 21 | doublereal ret_val; 22 | 23 | /* Local variables */ 24 | integer i__, m, ix, iy, mp1; 25 | doublereal dtemp; 26 | 27 | /* .. Scalar Arguments .. */ 28 | /* .. */ 29 | /* .. Array Arguments .. */ 30 | /* .. */ 31 | 32 | /* Purpose */ 33 | /* ======= */ 34 | 35 | /* forms the dot product of two vectors. */ 36 | /* uses unrolled loops for increments equal to one. */ 37 | /* jack dongarra, linpack, 3/11/78. */ 38 | /* modified 12/3/93, array(1) declarations changed to array(*) */ 39 | 40 | 41 | /* .. Local Scalars .. */ 42 | /* .. */ 43 | /* .. Intrinsic Functions .. */ 44 | /* .. */ 45 | /* Parameter adjustments */ 46 | --dy; 47 | --dx; 48 | 49 | /* Function Body */ 50 | ret_val = 0.; 51 | dtemp = 0.; 52 | if (*n <= 0) { 53 | return ret_val; 54 | } 55 | if (*incx == 1 && *incy == 1) { 56 | goto L20; 57 | } 58 | 59 | /* code for unequal increments or equal increments */ 60 | /* not equal to 1 */ 61 | 62 | ix = 1; 63 | iy = 1; 64 | if (*incx < 0) { 65 | ix = (-(*n) + 1) * *incx + 1; 66 | } 67 | if (*incy < 0) { 68 | iy = (-(*n) + 1) * *incy + 1; 69 | } 70 | i__1 = *n; 71 | for (i__ = 1; i__ <= i__1; ++i__) { 72 | dtemp += dx[ix] * dy[iy]; 73 | ix += *incx; 74 | iy += *incy; 75 | /* L10: */ 76 | } 77 | ret_val = dtemp; 78 | return ret_val; 79 | 80 | /* code for both increments equal to 1 */ 81 | 82 | 83 | /* clean-up loop */ 84 | 85 | L20: 86 | m = *n % 5; 87 | if (m == 0) { 88 | goto L40; 89 | } 90 | i__1 = m; 91 | for (i__ = 1; i__ <= i__1; ++i__) { 92 | dtemp += dx[i__] * dy[i__]; 93 | /* L30: */ 94 | } 95 | if (*n < 5) { 96 | goto L60; 97 | } 98 | L40: 99 | mp1 = m + 1; 100 | i__1 = *n; 101 | for (i__ = mp1; i__ <= i__1; i__ += 5) { 102 | dtemp = dtemp + dx[i__] * dy[i__] + dx[i__ + 1] * dy[i__ + 1] + dx[ 103 | i__ + 2] * dy[i__ + 2] + dx[i__ + 3] * dy[i__ + 3] + dx[i__ + 104 | 4] * dy[i__ + 4]; 105 | /* L50: */ 106 | } 107 | L60: 108 | ret_val = dtemp; 109 | return ret_val; 110 | } /* ddot_ */ 111 | -------------------------------------------------------------------------------- /include/opencv2/opencv.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2010, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_ALL_HPP__ 44 | #define __OPENCV_ALL_HPP__ 45 | 46 | #include "opencv2/core/core_c.h" 47 | #include "opencv2/core/core.hpp" 48 | #include "opencv2/flann/flann.hpp" 49 | #include "opencv2/imgproc/imgproc_c.h" 50 | #include "opencv2/imgproc/imgproc.hpp" 51 | #include "opencv2/video/tracking.hpp" 52 | #include "opencv2/video/background_segm.hpp" 53 | #include "opencv2/features2d/features2d.hpp" 54 | #include "opencv2/objdetect/objdetect.hpp" 55 | #include "opencv2/calib3d/calib3d.hpp" 56 | #include "opencv2/ml/ml.hpp" 57 | #include "opencv2/highgui/highgui_c.h" 58 | #include "opencv2/highgui/highgui.hpp" 59 | #include "opencv2/contrib/contrib.hpp" 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/opencv2/flann/logger.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef _OPENCV_LOGGER_H_ 32 | #define _OPENCV_LOGGER_H_ 33 | 34 | 35 | #include 36 | #include 37 | #include "opencv2/flann/general.h" 38 | 39 | using namespace std; 40 | 41 | namespace cvflann 42 | { 43 | 44 | class CV_EXPORTS Logger 45 | { 46 | FILE* stream; 47 | int logLevel; 48 | 49 | public: 50 | 51 | Logger() : stream(stdout), logLevel(LOG_WARN) {}; 52 | 53 | ~Logger() 54 | { 55 | if (stream!=NULL && stream!=stdout) { 56 | fclose(stream); 57 | } 58 | } 59 | 60 | void setDestination(const char* name) 61 | { 62 | if (name==NULL) { 63 | stream = stdout; 64 | } 65 | else { 66 | stream = fopen(name,"w"); 67 | if (stream == NULL) { 68 | stream = stdout; 69 | } 70 | } 71 | } 72 | 73 | void setLevel(int level) { logLevel = level; } 74 | 75 | int log(int level, const char* fmt, ...); 76 | 77 | int log(int level, const char* fmt, va_list arglist); 78 | 79 | int fatal(const char* fmt, ...); 80 | 81 | int error(const char* fmt, ...); 82 | 83 | int warn(const char* fmt, ...); 84 | 85 | int info(const char* fmt, ...); 86 | }; 87 | 88 | CV_EXPORTS Logger& logger(); 89 | 90 | } // namespace cvflann 91 | 92 | #endif //_OPENCV_LOGGER_H_ 93 | -------------------------------------------------------------------------------- /include/opencv/cvaux.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_OLD_AUX_H__ 43 | #define __OPENCV_OLD_AUX_H__ 44 | 45 | //#if defined(__GNUC__) 46 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 47 | //#endif 48 | 49 | #include "opencv2/core/core_c.h" 50 | #include "opencv2/core/core.hpp" 51 | #include "opencv2/imgproc/imgproc_c.h" 52 | #include "opencv2/imgproc/imgproc.hpp" 53 | #include "opencv2/video/tracking.hpp" 54 | #include "opencv2/video/background_segm.hpp" 55 | #include "opencv2/features2d/features2d.hpp" 56 | #include "opencv2/calib3d/calib3d.hpp" 57 | #include "opencv2/objdetect/objdetect.hpp" 58 | #include "opencv2/legacy/legacy.hpp" 59 | #include "opencv2/legacy/compat.hpp" 60 | #include "opencv2/legacy/blobtrack.hpp" 61 | #include "opencv2/contrib/contrib.hpp" 62 | 63 | #endif 64 | 65 | /* End of file. */ 66 | -------------------------------------------------------------------------------- /include/opencv2/flann/all_indices.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef _OPENCV_ALL_INDICES_H_ 31 | #define _OPENCV_ALL_INDICES_H_ 32 | 33 | #include "opencv2/flann/general.h" 34 | 35 | #include "opencv2/flann/nn_index.h" 36 | #include "opencv2/flann/kdtree_index.h" 37 | #include "opencv2/flann/kmeans_index.h" 38 | #include "opencv2/flann/composite_index.h" 39 | #include "opencv2/flann/linear_index.h" 40 | #include "opencv2/flann/autotuned_index.h" 41 | 42 | namespace cvflann 43 | { 44 | 45 | template 46 | NNIndex* create_index_by_type(const Matrix& dataset, const IndexParams& params) 47 | { 48 | flann_algorithm_t index_type = params.getIndexType(); 49 | 50 | NNIndex* nnIndex; 51 | switch (index_type) { 52 | case LINEAR: 53 | nnIndex = new LinearIndex(dataset, (const LinearIndexParams&)params); 54 | break; 55 | case KDTREE: 56 | nnIndex = new KDTreeIndex(dataset, (const KDTreeIndexParams&)params); 57 | break; 58 | case KMEANS: 59 | nnIndex = new KMeansIndex(dataset, (const KMeansIndexParams&)params); 60 | break; 61 | case COMPOSITE: 62 | nnIndex = new CompositeIndex(dataset, (const CompositeIndexParams&) params); 63 | break; 64 | case AUTOTUNED: 65 | nnIndex = new AutotunedIndex(dataset, (const AutotunedIndexParams&) params); 66 | break; 67 | default: 68 | throw FLANNException("Unknown index type"); 69 | } 70 | 71 | return nnIndex; 72 | } 73 | 74 | } //namespace cvflann 75 | 76 | #endif /* _OPENCV_ALL_INDICES_H_ */ 77 | -------------------------------------------------------------------------------- /src/zlib/inftrees.h: -------------------------------------------------------------------------------- 1 | /* inftrees.h -- header to use inftrees.c 2 | * Copyright (C) 1995-2005, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 0001eeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1444, which is the sum of 852 for literal/length codes and 592 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribtution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 30 6 15" for distance codes returns 592. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in inflate.c and infback.c. If the root table size is 47 | changed, then these maximum sizes would be need to be recalculated and 48 | updated. */ 49 | #define ENOUGH_LENS 852 50 | #define ENOUGH_DISTS 592 51 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 52 | 53 | /* Type of code to build for inflate_table() */ 54 | typedef enum { 55 | CODES, 56 | LENS, 57 | DISTS 58 | } codetype; 59 | 60 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, 61 | unsigned codes, code FAR * FAR *table, 62 | unsigned FAR *bits, unsigned short FAR *work)); 63 | -------------------------------------------------------------------------------- /src/opencv/imgproc/_geom.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef _CV_GEOM_H_ 43 | #define _CV_GEOM_H_ 44 | 45 | /* Finds distance between two points */ 46 | CV_INLINE float icvDistanceL2_32f( CvPoint2D32f pt1, CvPoint2D32f pt2 ) 47 | { 48 | float dx = pt2.x - pt1.x; 49 | float dy = pt2.y - pt1.y; 50 | 51 | return std::sqrt( dx*dx + dy*dy ); 52 | } 53 | 54 | 55 | int icvIntersectLines( double x1, double dx1, double y1, double dy1, 56 | double x2, double dx2, double y2, double dy2, 57 | double* t2 ); 58 | 59 | 60 | void icvCreateCenterNormalLine( CvSubdiv2DEdge edge, double* a, double* b, double* c ); 61 | 62 | void icvIntersectLines3( double* a0, double* b0, double* c0, 63 | double* a1, double* b1, double* c1, 64 | CvPoint2D32f* point ); 65 | 66 | 67 | /* curvature: 0 - 1-curvature, 1 - k-cosine curvature. */ 68 | CvSeq* icvApproximateChainTC89( CvChain* chain, int header_size, CvMemStorage* storage, int method ); 69 | 70 | #endif /*_IPCVGEOM_H_*/ 71 | 72 | /* End of file. */ 73 | -------------------------------------------------------------------------------- /include/opencv2/flann/object_factory.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef _OPENCV_OBJECT_FACTORY_H_ 32 | #define _OPENCV_OBJECT_FACTORY_H_ 33 | 34 | #include "opencv2/core/types_c.h" 35 | #include 36 | 37 | namespace cvflann 38 | { 39 | 40 | template 41 | BaseClass* createObject() 42 | { 43 | return new DerivedClass(); 44 | } 45 | 46 | template 47 | class ObjectFactory 48 | { 49 | typedef BaseClass* (*CreateObjectFunc)(); 50 | std::map object_registry; 51 | 52 | // singleton class, private constructor 53 | //ObjectFactory() {}; 54 | 55 | public: 56 | typedef typename std::map::iterator Iterator; 57 | 58 | 59 | template 60 | bool register_(UniqueIdType id) 61 | { 62 | if (object_registry.find(id) != object_registry.end()) 63 | return false; 64 | 65 | object_registry[id] = &createObject; 66 | return true; 67 | } 68 | 69 | bool unregister(UniqueIdType id) 70 | { 71 | return (object_registry.erase(id) == 1); 72 | } 73 | 74 | BaseClass* create(UniqueIdType id) 75 | { 76 | Iterator iter = object_registry.find(id); 77 | 78 | if (iter == object_registry.end()) 79 | return NULL; 80 | 81 | return ((*iter).second)(); 82 | } 83 | 84 | /*static ObjectFactory& instance() 85 | { 86 | static ObjectFactory the_factory; 87 | return the_factory; 88 | }*/ 89 | 90 | }; 91 | 92 | } // namespace cvflann 93 | 94 | #endif /* OBJECT_FACTORY_H_ */ 95 | -------------------------------------------------------------------------------- /include/opencv2/flann/sampling.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef _OPENCV_SAMPLING_H_ 31 | #define _OPENCV_SAMPLING_H_ 32 | 33 | 34 | #include "opencv2/flann/matrix.h" 35 | #include "opencv2/flann/random.h" 36 | 37 | 38 | namespace cvflann 39 | { 40 | 41 | template 42 | Matrix random_sample(Matrix& srcMatrix, long size, bool remove = false) 43 | { 44 | UniqueRandom rand((int)srcMatrix.rows); 45 | Matrix newSet(new T[size * srcMatrix.cols], size, (long)srcMatrix.cols); 46 | 47 | T *src,*dest; 48 | for (long i=0;i 74 | Matrix random_sample(const Matrix& srcMatrix, size_t size) 75 | { 76 | UniqueRandom rand((int)srcMatrix.rows); 77 | Matrix newSet(new T[size * srcMatrix.cols], (long)size, (long)srcMatrix.cols); 78 | 79 | T *src,*dest; 80 | for (size_t i=0;i 41 | void find_nearest(const Matrix& dataset, T* query, int* matches, int nn, int skip = 0) 42 | { 43 | int n = nn + skip; 44 | 45 | T* query_end = query + dataset.cols; 46 | 47 | long* match = new long[n]; 48 | T* dists = new T[n]; 49 | 50 | dists[0] = (float)flann_dist(query, query_end, dataset[0]); 51 | match[0] = 0; 52 | int dcnt = 1; 53 | 54 | for (size_t i=1;i=1 && dists[j] 85 | void compute_ground_truth(const Matrix& dataset, const Matrix& testset, Matrix& matches, int skip=0) 86 | { 87 | for (size_t i=0;i 35 | 36 | #include "opencv2/flann/general.h" 37 | #include "opencv2/flann/matrix.h" 38 | 39 | using namespace std; 40 | 41 | namespace cvflann 42 | { 43 | 44 | 45 | template 46 | class ResultSet; 47 | 48 | /** 49 | * Nearest-neighbour index base class 50 | */ 51 | template 52 | class NNIndex 53 | { 54 | public: 55 | 56 | virtual ~NNIndex() {}; 57 | 58 | /** 59 | Method responsible with building the index. 60 | */ 61 | virtual void buildIndex() = 0; 62 | 63 | /** 64 | Saves the index to a stream 65 | */ 66 | virtual void saveIndex(FILE* stream) = 0; 67 | 68 | /** 69 | Loads the index from a stream 70 | */ 71 | virtual void loadIndex(FILE* stream) = 0; 72 | 73 | /** 74 | Method that searches for nearest-neighbors 75 | */ 76 | virtual void findNeighbors(ResultSet& result, const ELEM_TYPE* vec, const SearchParams& searchParams) = 0; 77 | 78 | /** 79 | Number of features in this index. 80 | */ 81 | virtual size_t size() const = 0; 82 | 83 | /** 84 | The length of each vector in this index. 85 | */ 86 | virtual size_t veclen() const = 0; 87 | 88 | /** 89 | The amount of memory (in bytes) this index uses. 90 | */ 91 | virtual int usedMemory() const = 0; 92 | 93 | /** 94 | * Algorithm name 95 | */ 96 | virtual flann_algorithm_t getType() const = 0; 97 | 98 | /** 99 | * Returns the parameters used for the index 100 | */ 101 | virtual const IndexParams* getParameters() const = 0; 102 | 103 | }; 104 | 105 | 106 | } // namespace cvflann 107 | 108 | #endif //_OPENCV_NNINDEX_H_ 109 | -------------------------------------------------------------------------------- /include/opencv2/flann/matrix.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef _OPENCV_DATASET_H_ 32 | #define _OPENCV_DATASET_H_ 33 | 34 | #include 35 | 36 | #include "opencv2/flann/general.h" 37 | 38 | 39 | namespace cvflann 40 | { 41 | 42 | /** 43 | * Class that implements a simple rectangular matrix stored in a memory buffer and 44 | * provides convenient matrix-like access using the [] operators. 45 | */ 46 | template 47 | class Matrix { 48 | public: 49 | size_t rows; 50 | size_t cols; 51 | T* data; 52 | 53 | Matrix() : rows(0), cols(0), data(NULL) 54 | { 55 | } 56 | 57 | Matrix(T* data_, long rows_, long cols_) : 58 | rows(rows_), cols(cols_), data(data_) 59 | { 60 | } 61 | 62 | /** 63 | * Convenience function for deallocating the storage data. 64 | */ 65 | void release() 66 | { 67 | if (data!=NULL) delete[] data; 68 | } 69 | 70 | ~Matrix() 71 | { 72 | } 73 | 74 | /** 75 | * Operator that return a (pointer to a) row of the data. 76 | */ 77 | T* operator[](size_t index) 78 | { 79 | return data+index*cols; 80 | } 81 | 82 | T* operator[](size_t index) const 83 | { 84 | return data+index*cols; 85 | } 86 | }; 87 | 88 | 89 | class UntypedMatrix 90 | { 91 | public: 92 | size_t rows; 93 | size_t cols; 94 | void* data; 95 | flann_datatype_t type; 96 | 97 | UntypedMatrix(void* data_, long rows_, long cols_) : 98 | rows(rows_), cols(cols_), data(data_) 99 | { 100 | } 101 | 102 | ~UntypedMatrix() 103 | { 104 | } 105 | 106 | 107 | template 108 | Matrix as() 109 | { 110 | return Matrix((T*)data, rows, cols); 111 | } 112 | }; 113 | 114 | 115 | 116 | } // namespace cvflann 117 | 118 | #endif //_OPENCV_DATASET_H_ 119 | -------------------------------------------------------------------------------- /include/opencv/cv.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CV_H__ 44 | #define __OPENCV_OLD_CV_H__ 45 | 46 | #if defined(_MSC_VER) 47 | #define CV_DO_PRAGMA(x) __pragma(x) 48 | #define __CVSTR2__(x) #x 49 | #define __CVSTR1__(x) __CVSTR2__(x) 50 | #define __CVMSVCLOC__ __FILE__ "("__CVSTR1__(__LINE__)") : " 51 | #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (__CVMSVCLOC__ _msg)) 52 | #elif defined(__GNUC__) 53 | #define CV_DO_PRAGMA(x) _Pragma (#x) 54 | #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (_msg)) 55 | #else 56 | #define CV_DO_PRAGMA(x) 57 | #define CV_MSG_PRAGMA(_msg) 58 | #endif 59 | #define CV_WARNING(x) CV_MSG_PRAGMA("Warning: " #x) 60 | 61 | //CV_WARNING("This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module") 62 | 63 | #include "opencv2/core/core_c.h" 64 | #include "opencv2/core/core.hpp" 65 | #include "opencv2/imgproc/imgproc_c.h" 66 | #include "opencv2/imgproc/imgproc.hpp" 67 | #include "opencv2/video/tracking.hpp" 68 | #include "opencv2/features2d/features2d.hpp" 69 | #include "opencv2/flann/flann.hpp" 70 | #include "opencv2/calib3d/calib3d.hpp" 71 | #include "opencv2/objdetect/objdetect.hpp" 72 | #include "opencv2/legacy/compat.hpp" 73 | 74 | #if !defined(CV_IMPL) 75 | #define CV_IMPL extern "C" 76 | #endif //CV_IMPL 77 | 78 | #if defined(__cplusplus) 79 | #include "opencv2/core/internal.hpp" 80 | #endif //__cplusplus 81 | 82 | #endif // __OPENCV_OLD_CV_H_ 83 | 84 | -------------------------------------------------------------------------------- /include/opencv2/flann/linear_index.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef _OPENCV_LINEARSEARCH_H_ 32 | #define _OPENCV_LINEARSEARCH_H_ 33 | 34 | #include "opencv2/flann/general.h" 35 | #include "opencv2/flann/nn_index.h" 36 | 37 | 38 | namespace cvflann 39 | { 40 | 41 | struct CV_EXPORTS LinearIndexParams : public IndexParams { 42 | LinearIndexParams() : IndexParams(LINEAR) {}; 43 | 44 | flann_algorithm_t getIndexType() const { return algorithm; } 45 | 46 | void print() const 47 | { 48 | logger().info("Index type: %d\n",(int)algorithm); 49 | } 50 | }; 51 | 52 | 53 | template ::type > 54 | class LinearIndex : public NNIndex 55 | { 56 | const Matrix dataset; 57 | const LinearIndexParams& index_params; 58 | 59 | public: 60 | 61 | LinearIndex(const Matrix& inputData, const LinearIndexParams& params = LinearIndexParams() ) : 62 | dataset(inputData), index_params(params) 63 | { 64 | } 65 | 66 | flann_algorithm_t getType() const 67 | { 68 | return LINEAR; 69 | } 70 | 71 | 72 | size_t size() const 73 | { 74 | return dataset.rows; 75 | } 76 | 77 | size_t veclen() const 78 | { 79 | return dataset.cols; 80 | } 81 | 82 | 83 | int usedMemory() const 84 | { 85 | return 0; 86 | } 87 | 88 | void buildIndex() 89 | { 90 | /* nothing to do here for linear search */ 91 | } 92 | 93 | void saveIndex(FILE*) 94 | { 95 | /* nothing to do here for linear search */ 96 | } 97 | 98 | 99 | void loadIndex(FILE*) 100 | { 101 | /* nothing to do here for linear search */ 102 | } 103 | 104 | void findNeighbors(ResultSet& resultSet, const ELEM_TYPE*, const SearchParams&) 105 | { 106 | for (size_t i=0;i 0. */ 67 | 68 | /* SCALE (input/output) REAL */ 69 | /* On entry, the value scale in the equation above. */ 70 | /* On exit, SCALE is overwritten with scl , the scaling factor */ 71 | /* for the sum of squares. */ 72 | 73 | /* SUMSQ (input/output) REAL */ 74 | /* On entry, the value sumsq in the equation above. */ 75 | /* On exit, SUMSQ is overwritten with smsq , the basic sum of */ 76 | /* squares from which scl has been factored out. */ 77 | 78 | /* ===================================================================== */ 79 | 80 | /* .. Parameters .. */ 81 | /* .. */ 82 | /* .. Local Scalars .. */ 83 | /* .. */ 84 | /* .. Intrinsic Functions .. */ 85 | /* .. */ 86 | /* .. Executable Statements .. */ 87 | 88 | /* Parameter adjustments */ 89 | --x; 90 | 91 | /* Function Body */ 92 | if (*n > 0) { 93 | i__1 = (*n - 1) * *incx + 1; 94 | i__2 = *incx; 95 | for (ix = 1; i__2 < 0 ? ix >= i__1 : ix <= i__1; ix += i__2) { 96 | if (x[ix] != 0.f) { 97 | absxi = (r__1 = x[ix], dabs(r__1)); 98 | if (*scale < absxi) { 99 | /* Computing 2nd power */ 100 | r__1 = *scale / absxi; 101 | *sumsq = *sumsq * (r__1 * r__1) + 1; 102 | *scale = absxi; 103 | } else { 104 | /* Computing 2nd power */ 105 | r__1 = absxi / *scale; 106 | *sumsq += r__1 * r__1; 107 | } 108 | } 109 | /* L10: */ 110 | } 111 | } 112 | return 0; 113 | 114 | /* End of SLASSQ */ 115 | 116 | } /* slassq_ */ 117 | -------------------------------------------------------------------------------- /src/opencv/calib3d/_modelest.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | 43 | #ifndef _CV_MODEL_EST_H_ 44 | #define _CV_MODEL_EST_H_ 45 | 46 | #include "precomp.hpp" 47 | 48 | class CvModelEstimator2 49 | { 50 | public: 51 | CvModelEstimator2(int _modelPoints, CvSize _modelSize, int _maxBasicSolutions); 52 | virtual ~CvModelEstimator2(); 53 | 54 | virtual int runKernel( const CvMat* m1, const CvMat* m2, CvMat* model )=0; 55 | virtual bool runLMeDS( const CvMat* m1, const CvMat* m2, CvMat* model, 56 | CvMat* mask, double confidence=0.99, int maxIters=2000 ); 57 | virtual bool runRANSAC( const CvMat* m1, const CvMat* m2, CvMat* model, 58 | CvMat* mask, double threshold, 59 | double confidence=0.99, int maxIters=2000 ); 60 | virtual bool refine( const CvMat*, const CvMat*, CvMat*, int ) { return true; } 61 | virtual void setSeed( int64 seed ); 62 | 63 | protected: 64 | virtual void computeReprojError( const CvMat* m1, const CvMat* m2, 65 | const CvMat* model, CvMat* error ) = 0; 66 | virtual int findInliers( const CvMat* m1, const CvMat* m2, 67 | const CvMat* model, CvMat* error, 68 | CvMat* mask, double threshold ); 69 | virtual bool getSubset( const CvMat* m1, const CvMat* m2, 70 | CvMat* ms1, CvMat* ms2, int maxAttempts=1000 ); 71 | virtual bool checkSubset( const CvMat* ms1, int count ); 72 | 73 | CvRNG rng; 74 | int modelPoints; 75 | CvSize modelSize; 76 | int maxBasicSolutions; 77 | bool checkPartialSubsets; 78 | }; 79 | 80 | #endif // _CV_MODEL_EST_H_ 81 | 82 | -------------------------------------------------------------------------------- /src/lapack/dlassq.c: -------------------------------------------------------------------------------- 1 | /* dlassq.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int dlassq_(integer *n, doublereal *x, integer *incx, 17 | doublereal *scale, doublereal *sumsq) 18 | { 19 | /* System generated locals */ 20 | integer i__1, i__2; 21 | doublereal d__1; 22 | 23 | /* Local variables */ 24 | integer ix; 25 | doublereal absxi; 26 | 27 | 28 | /* -- LAPACK auxiliary routine (version 3.2) -- */ 29 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 30 | /* November 2006 */ 31 | 32 | /* .. Scalar Arguments .. */ 33 | /* .. */ 34 | /* .. Array Arguments .. */ 35 | /* .. */ 36 | 37 | /* Purpose */ 38 | /* ======= */ 39 | 40 | /* DLASSQ returns the values scl and smsq such that */ 41 | 42 | /* ( scl**2 )*smsq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq, */ 43 | 44 | /* where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is */ 45 | /* assumed to be non-negative and scl returns the value */ 46 | 47 | /* scl = max( scale, abs( x( i ) ) ). */ 48 | 49 | /* scale and sumsq must be supplied in SCALE and SUMSQ and */ 50 | /* scl and smsq are overwritten on SCALE and SUMSQ respectively. */ 51 | 52 | /* The routine makes only one pass through the vector x. */ 53 | 54 | /* Arguments */ 55 | /* ========= */ 56 | 57 | /* N (input) INTEGER */ 58 | /* The number of elements to be used from the vector X. */ 59 | 60 | /* X (input) DOUBLE PRECISION array, dimension (N) */ 61 | /* The vector for which a scaled sum of squares is computed. */ 62 | /* x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n. */ 63 | 64 | /* INCX (input) INTEGER */ 65 | /* The increment between successive values of the vector X. */ 66 | /* INCX > 0. */ 67 | 68 | /* SCALE (input/output) DOUBLE PRECISION */ 69 | /* On entry, the value scale in the equation above. */ 70 | /* On exit, SCALE is overwritten with scl , the scaling factor */ 71 | /* for the sum of squares. */ 72 | 73 | /* SUMSQ (input/output) DOUBLE PRECISION */ 74 | /* On entry, the value sumsq in the equation above. */ 75 | /* On exit, SUMSQ is overwritten with smsq , the basic sum of */ 76 | /* squares from which scl has been factored out. */ 77 | 78 | /* ===================================================================== */ 79 | 80 | /* .. Parameters .. */ 81 | /* .. */ 82 | /* .. Local Scalars .. */ 83 | /* .. */ 84 | /* .. Intrinsic Functions .. */ 85 | /* .. */ 86 | /* .. Executable Statements .. */ 87 | 88 | /* Parameter adjustments */ 89 | --x; 90 | 91 | /* Function Body */ 92 | if (*n > 0) { 93 | i__1 = (*n - 1) * *incx + 1; 94 | i__2 = *incx; 95 | for (ix = 1; i__2 < 0 ? ix >= i__1 : ix <= i__1; ix += i__2) { 96 | if (x[ix] != 0.) { 97 | absxi = (d__1 = x[ix], abs(d__1)); 98 | if (*scale < absxi) { 99 | /* Computing 2nd power */ 100 | d__1 = *scale / absxi; 101 | *sumsq = *sumsq * (d__1 * d__1) + 1; 102 | *scale = absxi; 103 | } else { 104 | /* Computing 2nd power */ 105 | d__1 = absxi / *scale; 106 | *sumsq += d__1 * d__1; 107 | } 108 | } 109 | /* L10: */ 110 | } 111 | } 112 | return 0; 113 | 114 | /* End of DLASSQ */ 115 | 116 | } /* dlassq_ */ 117 | -------------------------------------------------------------------------------- /src/lapack/slamrg.c: -------------------------------------------------------------------------------- 1 | /* slamrg.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int slamrg_(integer *n1, integer *n2, real *a, integer * 17 | strd1, integer *strd2, integer *index) 18 | { 19 | /* System generated locals */ 20 | integer i__1; 21 | 22 | /* Local variables */ 23 | integer i__, ind1, ind2, n1sv, n2sv; 24 | 25 | 26 | /* -- LAPACK routine (version 3.2) -- */ 27 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 28 | /* November 2006 */ 29 | 30 | /* .. Scalar Arguments .. */ 31 | /* .. */ 32 | /* .. Array Arguments .. */ 33 | /* .. */ 34 | 35 | /* Purpose */ 36 | /* ======= */ 37 | 38 | /* SLAMRG will create a permutation list which will merge the elements */ 39 | /* of A (which is composed of two independently sorted sets) into a */ 40 | /* single set which is sorted in ascending order. */ 41 | 42 | /* Arguments */ 43 | /* ========= */ 44 | 45 | /* N1 (input) INTEGER */ 46 | /* N2 (input) INTEGER */ 47 | /* These arguements contain the respective lengths of the two */ 48 | /* sorted lists to be merged. */ 49 | 50 | /* A (input) REAL array, dimension (N1+N2) */ 51 | /* The first N1 elements of A contain a list of numbers which */ 52 | /* are sorted in either ascending or descending order. Likewise */ 53 | /* for the final N2 elements. */ 54 | 55 | /* STRD1 (input) INTEGER */ 56 | /* STRD2 (input) INTEGER */ 57 | /* These are the strides to be taken through the array A. */ 58 | /* Allowable strides are 1 and -1. They indicate whether a */ 59 | /* subset of A is sorted in ascending (STRDx = 1) or descending */ 60 | /* (STRDx = -1) order. */ 61 | 62 | /* INDEX (output) INTEGER array, dimension (N1+N2) */ 63 | /* On exit this array will contain a permutation such that */ 64 | /* if B( I ) = A( INDEX( I ) ) for I=1,N1+N2, then B will be */ 65 | /* sorted in ascending order. */ 66 | 67 | /* ===================================================================== */ 68 | 69 | /* .. Local Scalars .. */ 70 | /* .. */ 71 | /* .. Executable Statements .. */ 72 | 73 | /* Parameter adjustments */ 74 | --index; 75 | --a; 76 | 77 | /* Function Body */ 78 | n1sv = *n1; 79 | n2sv = *n2; 80 | if (*strd1 > 0) { 81 | ind1 = 1; 82 | } else { 83 | ind1 = *n1; 84 | } 85 | if (*strd2 > 0) { 86 | ind2 = *n1 + 1; 87 | } else { 88 | ind2 = *n1 + *n2; 89 | } 90 | i__ = 1; 91 | /* while ( (N1SV > 0) & (N2SV > 0) ) */ 92 | L10: 93 | if (n1sv > 0 && n2sv > 0) { 94 | if (a[ind1] <= a[ind2]) { 95 | index[i__] = ind1; 96 | ++i__; 97 | ind1 += *strd1; 98 | --n1sv; 99 | } else { 100 | index[i__] = ind2; 101 | ++i__; 102 | ind2 += *strd2; 103 | --n2sv; 104 | } 105 | goto L10; 106 | } 107 | /* end while */ 108 | if (n1sv == 0) { 109 | i__1 = n2sv; 110 | for (n1sv = 1; n1sv <= i__1; ++n1sv) { 111 | index[i__] = ind2; 112 | ++i__; 113 | ind2 += *strd2; 114 | /* L20: */ 115 | } 116 | } else { 117 | /* N2SV .EQ. 0 */ 118 | i__1 = n1sv; 119 | for (n2sv = 1; n2sv <= i__1; ++n2sv) { 120 | index[i__] = ind1; 121 | ++i__; 122 | ind1 += *strd1; 123 | /* L30: */ 124 | } 125 | } 126 | 127 | return 0; 128 | 129 | /* End of SLAMRG */ 130 | 131 | } /* slamrg_ */ 132 | -------------------------------------------------------------------------------- /src/lapack/slacpy.c: -------------------------------------------------------------------------------- 1 | /* slacpy.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int slacpy_(char *uplo, integer *m, integer *n, real *a, 17 | integer *lda, real *b, integer *ldb) 18 | { 19 | /* System generated locals */ 20 | integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2; 21 | 22 | /* Local variables */ 23 | integer i__, j; 24 | extern logical lsame_(char *, char *); 25 | 26 | 27 | /* -- LAPACK auxiliary routine (version 3.2) -- */ 28 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 29 | /* November 2006 */ 30 | 31 | /* .. Scalar Arguments .. */ 32 | /* .. */ 33 | /* .. Array Arguments .. */ 34 | /* .. */ 35 | 36 | /* Purpose */ 37 | /* ======= */ 38 | 39 | /* SLACPY copies all or part of a two-dimensional matrix A to another */ 40 | /* matrix B. */ 41 | 42 | /* Arguments */ 43 | /* ========= */ 44 | 45 | /* UPLO (input) CHARACTER*1 */ 46 | /* Specifies the part of the matrix A to be copied to B. */ 47 | /* = 'U': Upper triangular part */ 48 | /* = 'L': Lower triangular part */ 49 | /* Otherwise: All of the matrix A */ 50 | 51 | /* M (input) INTEGER */ 52 | /* The number of rows of the matrix A. M >= 0. */ 53 | 54 | /* N (input) INTEGER */ 55 | /* The number of columns of the matrix A. N >= 0. */ 56 | 57 | /* A (input) REAL array, dimension (LDA,N) */ 58 | /* The m by n matrix A. If UPLO = 'U', only the upper triangle */ 59 | /* or trapezoid is accessed; if UPLO = 'L', only the lower */ 60 | /* triangle or trapezoid is accessed. */ 61 | 62 | /* LDA (input) INTEGER */ 63 | /* The leading dimension of the array A. LDA >= max(1,M). */ 64 | 65 | /* B (output) REAL array, dimension (LDB,N) */ 66 | /* On exit, B = A in the locations specified by UPLO. */ 67 | 68 | /* LDB (input) INTEGER */ 69 | /* The leading dimension of the array B. LDB >= max(1,M). */ 70 | 71 | /* ===================================================================== */ 72 | 73 | /* .. Local Scalars .. */ 74 | /* .. */ 75 | /* .. External Functions .. */ 76 | /* .. */ 77 | /* .. Intrinsic Functions .. */ 78 | /* .. */ 79 | /* .. Executable Statements .. */ 80 | 81 | /* Parameter adjustments */ 82 | a_dim1 = *lda; 83 | a_offset = 1 + a_dim1; 84 | a -= a_offset; 85 | b_dim1 = *ldb; 86 | b_offset = 1 + b_dim1; 87 | b -= b_offset; 88 | 89 | /* Function Body */ 90 | if (lsame_(uplo, "U")) { 91 | i__1 = *n; 92 | for (j = 1; j <= i__1; ++j) { 93 | i__2 = min(j,*m); 94 | for (i__ = 1; i__ <= i__2; ++i__) { 95 | b[i__ + j * b_dim1] = a[i__ + j * a_dim1]; 96 | /* L10: */ 97 | } 98 | /* L20: */ 99 | } 100 | } else if (lsame_(uplo, "L")) { 101 | i__1 = *n; 102 | for (j = 1; j <= i__1; ++j) { 103 | i__2 = *m; 104 | for (i__ = j; i__ <= i__2; ++i__) { 105 | b[i__ + j * b_dim1] = a[i__ + j * a_dim1]; 106 | /* L30: */ 107 | } 108 | /* L40: */ 109 | } 110 | } else { 111 | i__1 = *n; 112 | for (j = 1; j <= i__1; ++j) { 113 | i__2 = *m; 114 | for (i__ = 1; i__ <= i__2; ++i__) { 115 | b[i__ + j * b_dim1] = a[i__ + j * a_dim1]; 116 | /* L50: */ 117 | } 118 | /* L60: */ 119 | } 120 | } 121 | return 0; 122 | 123 | /* End of SLACPY */ 124 | 125 | } /* slacpy_ */ 126 | -------------------------------------------------------------------------------- /src/lapack/dlamrg.c: -------------------------------------------------------------------------------- 1 | /* dlamrg.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int dlamrg_(integer *n1, integer *n2, doublereal *a, integer 17 | *dtrd1, integer *dtrd2, integer *index) 18 | { 19 | /* System generated locals */ 20 | integer i__1; 21 | 22 | /* Local variables */ 23 | integer i__, ind1, ind2, n1sv, n2sv; 24 | 25 | 26 | /* -- LAPACK routine (version 3.2) -- */ 27 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 28 | /* November 2006 */ 29 | 30 | /* .. Scalar Arguments .. */ 31 | /* .. */ 32 | /* .. Array Arguments .. */ 33 | /* .. */ 34 | 35 | /* Purpose */ 36 | /* ======= */ 37 | 38 | /* DLAMRG will create a permutation list which will merge the elements */ 39 | /* of A (which is composed of two independently sorted sets) into a */ 40 | /* single set which is sorted in ascending order. */ 41 | 42 | /* Arguments */ 43 | /* ========= */ 44 | 45 | /* N1 (input) INTEGER */ 46 | /* N2 (input) INTEGER */ 47 | /* These arguements contain the respective lengths of the two */ 48 | /* sorted lists to be merged. */ 49 | 50 | /* A (input) DOUBLE PRECISION array, dimension (N1+N2) */ 51 | /* The first N1 elements of A contain a list of numbers which */ 52 | /* are sorted in either ascending or descending order. Likewise */ 53 | /* for the final N2 elements. */ 54 | 55 | /* DTRD1 (input) INTEGER */ 56 | /* DTRD2 (input) INTEGER */ 57 | /* These are the strides to be taken through the array A. */ 58 | /* Allowable strides are 1 and -1. They indicate whether a */ 59 | /* subset of A is sorted in ascending (DTRDx = 1) or descending */ 60 | /* (DTRDx = -1) order. */ 61 | 62 | /* INDEX (output) INTEGER array, dimension (N1+N2) */ 63 | /* On exit this array will contain a permutation such that */ 64 | /* if B( I ) = A( INDEX( I ) ) for I=1,N1+N2, then B will be */ 65 | /* sorted in ascending order. */ 66 | 67 | /* ===================================================================== */ 68 | 69 | /* .. Local Scalars .. */ 70 | /* .. */ 71 | /* .. Executable Statements .. */ 72 | 73 | /* Parameter adjustments */ 74 | --index; 75 | --a; 76 | 77 | /* Function Body */ 78 | n1sv = *n1; 79 | n2sv = *n2; 80 | if (*dtrd1 > 0) { 81 | ind1 = 1; 82 | } else { 83 | ind1 = *n1; 84 | } 85 | if (*dtrd2 > 0) { 86 | ind2 = *n1 + 1; 87 | } else { 88 | ind2 = *n1 + *n2; 89 | } 90 | i__ = 1; 91 | /* while ( (N1SV > 0) & (N2SV > 0) ) */ 92 | L10: 93 | if (n1sv > 0 && n2sv > 0) { 94 | if (a[ind1] <= a[ind2]) { 95 | index[i__] = ind1; 96 | ++i__; 97 | ind1 += *dtrd1; 98 | --n1sv; 99 | } else { 100 | index[i__] = ind2; 101 | ++i__; 102 | ind2 += *dtrd2; 103 | --n2sv; 104 | } 105 | goto L10; 106 | } 107 | /* end while */ 108 | if (n1sv == 0) { 109 | i__1 = n2sv; 110 | for (n1sv = 1; n1sv <= i__1; ++n1sv) { 111 | index[i__] = ind2; 112 | ++i__; 113 | ind2 += *dtrd2; 114 | /* L20: */ 115 | } 116 | } else { 117 | /* N2SV .EQ. 0 */ 118 | i__1 = n1sv; 119 | for (n2sv = 1; n2sv <= i__1; ++n2sv) { 120 | index[i__] = ind1; 121 | ++i__; 122 | ind1 += *dtrd1; 123 | /* L30: */ 124 | } 125 | } 126 | 127 | return 0; 128 | 129 | /* End of DLAMRG */ 130 | 131 | } /* dlamrg_ */ 132 | -------------------------------------------------------------------------------- /src/lapack/slamch_custom.c: -------------------------------------------------------------------------------- 1 | #include "clapack.h" 2 | #include 3 | #include 4 | 5 | /* *********************************************************************** */ 6 | 7 | doublereal slamc3_(real *a, real *b) 8 | { 9 | /* System generated locals */ 10 | real ret_val; 11 | 12 | 13 | /* -- LAPACK auxiliary routine (version 3.1) -- */ 14 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 15 | /* November 2006 */ 16 | 17 | /* .. Scalar Arguments .. */ 18 | /* .. */ 19 | 20 | /* Purpose */ 21 | /* ======= */ 22 | 23 | /* SLAMC3 is intended to force A and B to be stored prior to doing */ 24 | /* the addition of A and B , for use in situations where optimizers */ 25 | /* might hold one of these in a register. */ 26 | 27 | /* Arguments */ 28 | /* ========= */ 29 | 30 | /* A (input) REAL */ 31 | /* B (input) REAL */ 32 | /* The values A and B. */ 33 | 34 | /* ===================================================================== */ 35 | 36 | /* .. Executable Statements .. */ 37 | 38 | ret_val = *a + *b; 39 | 40 | return ret_val; 41 | 42 | /* End of SLAMC3 */ 43 | 44 | } /* slamc3_ */ 45 | 46 | 47 | const unsigned char lapack_toupper_tab[] = 48 | { 49 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 50 | 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 51 | 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 52 | 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 53 | 90, 91, 92, 93, 94, 95, 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 54 | 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127, 128, 129, 130, 131, 55 | 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 56 | 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 57 | 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 58 | 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 59 | 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 60 | 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 61 | 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 62 | }; 63 | 64 | /* simpler version of dlamch for the case of IEEE754-compliant FPU module by Piotr Luszczek S. 65 | taken from http://www.mail-archive.com/numpy-discussion@lists.sourceforge.net/msg02448.html */ 66 | 67 | #ifndef FLT_DIGITS 68 | #define FLT_DIGITS 24 69 | #endif 70 | 71 | const unsigned char lapack_lamch_tab[] = 72 | { 73 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75 | 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, 0, 8, 9, 0, 10, 0, 76 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, 0, 8, 9, 77 | 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 82 | }; 83 | 84 | const doublereal lapack_slamch_tab[] = 85 | { 86 | 0, FLT_RADIX, FLT_EPSILON, FLT_MAX_EXP, FLT_MIN_EXP, FLT_DIGITS, FLT_MAX, 87 | FLT_EPSILON*FLT_RADIX, 1, FLT_MIN*(1 + FLT_EPSILON), FLT_MIN 88 | }; 89 | -------------------------------------------------------------------------------- /src/lapack/dlacpy.c: -------------------------------------------------------------------------------- 1 | /* dlacpy.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int dlacpy_(char *uplo, integer *m, integer *n, doublereal * 17 | a, integer *lda, doublereal *b, integer *ldb) 18 | { 19 | /* System generated locals */ 20 | integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2; 21 | 22 | /* Local variables */ 23 | integer i__, j; 24 | extern logical lsame_(char *, char *); 25 | 26 | 27 | /* -- LAPACK auxiliary routine (version 3.2) -- */ 28 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 29 | /* November 2006 */ 30 | 31 | /* .. Scalar Arguments .. */ 32 | /* .. */ 33 | /* .. Array Arguments .. */ 34 | /* .. */ 35 | 36 | /* Purpose */ 37 | /* ======= */ 38 | 39 | /* DLACPY copies all or part of a two-dimensional matrix A to another */ 40 | /* matrix B. */ 41 | 42 | /* Arguments */ 43 | /* ========= */ 44 | 45 | /* UPLO (input) CHARACTER*1 */ 46 | /* Specifies the part of the matrix A to be copied to B. */ 47 | /* = 'U': Upper triangular part */ 48 | /* = 'L': Lower triangular part */ 49 | /* Otherwise: All of the matrix A */ 50 | 51 | /* M (input) INTEGER */ 52 | /* The number of rows of the matrix A. M >= 0. */ 53 | 54 | /* N (input) INTEGER */ 55 | /* The number of columns of the matrix A. N >= 0. */ 56 | 57 | /* A (input) DOUBLE PRECISION array, dimension (LDA,N) */ 58 | /* The m by n matrix A. If UPLO = 'U', only the upper triangle */ 59 | /* or trapezoid is accessed; if UPLO = 'L', only the lower */ 60 | /* triangle or trapezoid is accessed. */ 61 | 62 | /* LDA (input) INTEGER */ 63 | /* The leading dimension of the array A. LDA >= max(1,M). */ 64 | 65 | /* B (output) DOUBLE PRECISION array, dimension (LDB,N) */ 66 | /* On exit, B = A in the locations specified by UPLO. */ 67 | 68 | /* LDB (input) INTEGER */ 69 | /* The leading dimension of the array B. LDB >= max(1,M). */ 70 | 71 | /* ===================================================================== */ 72 | 73 | /* .. Local Scalars .. */ 74 | /* .. */ 75 | /* .. External Functions .. */ 76 | /* .. */ 77 | /* .. Intrinsic Functions .. */ 78 | /* .. */ 79 | /* .. Executable Statements .. */ 80 | 81 | /* Parameter adjustments */ 82 | a_dim1 = *lda; 83 | a_offset = 1 + a_dim1; 84 | a -= a_offset; 85 | b_dim1 = *ldb; 86 | b_offset = 1 + b_dim1; 87 | b -= b_offset; 88 | 89 | /* Function Body */ 90 | if (lsame_(uplo, "U")) { 91 | i__1 = *n; 92 | for (j = 1; j <= i__1; ++j) { 93 | i__2 = min(j,*m); 94 | for (i__ = 1; i__ <= i__2; ++i__) { 95 | b[i__ + j * b_dim1] = a[i__ + j * a_dim1]; 96 | /* L10: */ 97 | } 98 | /* L20: */ 99 | } 100 | } else if (lsame_(uplo, "L")) { 101 | i__1 = *n; 102 | for (j = 1; j <= i__1; ++j) { 103 | i__2 = *m; 104 | for (i__ = j; i__ <= i__2; ++i__) { 105 | b[i__ + j * b_dim1] = a[i__ + j * a_dim1]; 106 | /* L30: */ 107 | } 108 | /* L40: */ 109 | } 110 | } else { 111 | i__1 = *n; 112 | for (j = 1; j <= i__1; ++j) { 113 | i__2 = *m; 114 | for (i__ = 1; i__ <= i__2; ++i__) { 115 | b[i__ + j * b_dim1] = a[i__ + j * a_dim1]; 116 | /* L50: */ 117 | } 118 | /* L60: */ 119 | } 120 | } 121 | return 0; 122 | 123 | /* End of DLACPY */ 124 | 125 | } /* dlacpy_ */ 126 | -------------------------------------------------------------------------------- /src/lapack/spotri.c: -------------------------------------------------------------------------------- 1 | /* spotri.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int spotri_(char *uplo, integer *n, real *a, integer *lda, 17 | integer *info) 18 | { 19 | /* System generated locals */ 20 | integer a_dim1, a_offset, i__1; 21 | 22 | /* Local variables */ 23 | extern logical lsame_(char *, char *); 24 | extern /* Subroutine */ int xerbla_(char *, integer *), slauum_( 25 | char *, integer *, real *, integer *, integer *), strtri_( 26 | char *, char *, integer *, real *, integer *, integer *); 27 | 28 | 29 | /* -- LAPACK routine (version 3.2) -- */ 30 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 31 | /* November 2006 */ 32 | 33 | /* .. Scalar Arguments .. */ 34 | /* .. */ 35 | /* .. Array Arguments .. */ 36 | /* .. */ 37 | 38 | /* Purpose */ 39 | /* ======= */ 40 | 41 | /* SPOTRI computes the inverse of a real symmetric positive definite */ 42 | /* matrix A using the Cholesky factorization A = U**T*U or A = L*L**T */ 43 | /* computed by SPOTRF. */ 44 | 45 | /* Arguments */ 46 | /* ========= */ 47 | 48 | /* UPLO (input) CHARACTER*1 */ 49 | /* = 'U': Upper triangle of A is stored; */ 50 | /* = 'L': Lower triangle of A is stored. */ 51 | 52 | /* N (input) INTEGER */ 53 | /* The order of the matrix A. N >= 0. */ 54 | 55 | /* A (input/output) REAL array, dimension (LDA,N) */ 56 | /* On entry, the triangular factor U or L from the Cholesky */ 57 | /* factorization A = U**T*U or A = L*L**T, as computed by */ 58 | /* SPOTRF. */ 59 | /* On exit, the upper or lower triangle of the (symmetric) */ 60 | /* inverse of A, overwriting the input factor U or L. */ 61 | 62 | /* LDA (input) INTEGER */ 63 | /* The leading dimension of the array A. LDA >= max(1,N). */ 64 | 65 | /* INFO (output) INTEGER */ 66 | /* = 0: successful exit */ 67 | /* < 0: if INFO = -i, the i-th argument had an illegal value */ 68 | /* > 0: if INFO = i, the (i,i) element of the factor U or L is */ 69 | /* zero, and the inverse could not be computed. */ 70 | 71 | /* ===================================================================== */ 72 | 73 | /* .. External Functions .. */ 74 | /* .. */ 75 | /* .. External Subroutines .. */ 76 | /* .. */ 77 | /* .. Intrinsic Functions .. */ 78 | /* .. */ 79 | /* .. Executable Statements .. */ 80 | 81 | /* Test the input parameters. */ 82 | 83 | /* Parameter adjustments */ 84 | a_dim1 = *lda; 85 | a_offset = 1 + a_dim1; 86 | a -= a_offset; 87 | 88 | /* Function Body */ 89 | *info = 0; 90 | if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { 91 | *info = -1; 92 | } else if (*n < 0) { 93 | *info = -2; 94 | } else if (*lda < max(1,*n)) { 95 | *info = -4; 96 | } 97 | if (*info != 0) { 98 | i__1 = -(*info); 99 | xerbla_("SPOTRI", &i__1); 100 | return 0; 101 | } 102 | 103 | /* Quick return if possible */ 104 | 105 | if (*n == 0) { 106 | return 0; 107 | } 108 | 109 | /* Invert the triangular Cholesky factor U or L. */ 110 | 111 | strtri_(uplo, "Non-unit", n, &a[a_offset], lda, info); 112 | if (*info > 0) { 113 | return 0; 114 | } 115 | 116 | /* Form inv(U)*inv(U)' or inv(L)'*inv(L). */ 117 | 118 | slauum_(uplo, n, &a[a_offset], lda, info); 119 | 120 | return 0; 121 | 122 | /* End of SPOTRI */ 123 | 124 | } /* spotri_ */ 125 | -------------------------------------------------------------------------------- /src/lapack/dpotri.c: -------------------------------------------------------------------------------- 1 | /* dpotri.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int dpotri_(char *uplo, integer *n, doublereal *a, integer * 17 | lda, integer *info) 18 | { 19 | /* System generated locals */ 20 | integer a_dim1, a_offset, i__1; 21 | 22 | /* Local variables */ 23 | extern logical lsame_(char *, char *); 24 | extern /* Subroutine */ int xerbla_(char *, integer *), dlauum_( 25 | char *, integer *, doublereal *, integer *, integer *), 26 | dtrtri_(char *, char *, integer *, doublereal *, integer *, 27 | integer *); 28 | 29 | 30 | /* -- LAPACK routine (version 3.2) -- */ 31 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 32 | /* November 2006 */ 33 | 34 | /* .. Scalar Arguments .. */ 35 | /* .. */ 36 | /* .. Array Arguments .. */ 37 | /* .. */ 38 | 39 | /* Purpose */ 40 | /* ======= */ 41 | 42 | /* DPOTRI computes the inverse of a real symmetric positive definite */ 43 | /* matrix A using the Cholesky factorization A = U**T*U or A = L*L**T */ 44 | /* computed by DPOTRF. */ 45 | 46 | /* Arguments */ 47 | /* ========= */ 48 | 49 | /* UPLO (input) CHARACTER*1 */ 50 | /* = 'U': Upper triangle of A is stored; */ 51 | /* = 'L': Lower triangle of A is stored. */ 52 | 53 | /* N (input) INTEGER */ 54 | /* The order of the matrix A. N >= 0. */ 55 | 56 | /* A (input/output) DOUBLE PRECISION array, dimension (LDA,N) */ 57 | /* On entry, the triangular factor U or L from the Cholesky */ 58 | /* factorization A = U**T*U or A = L*L**T, as computed by */ 59 | /* DPOTRF. */ 60 | /* On exit, the upper or lower triangle of the (symmetric) */ 61 | /* inverse of A, overwriting the input factor U or L. */ 62 | 63 | /* LDA (input) INTEGER */ 64 | /* The leading dimension of the array A. LDA >= max(1,N). */ 65 | 66 | /* INFO (output) INTEGER */ 67 | /* = 0: successful exit */ 68 | /* < 0: if INFO = -i, the i-th argument had an illegal value */ 69 | /* > 0: if INFO = i, the (i,i) element of the factor U or L is */ 70 | /* zero, and the inverse could not be computed. */ 71 | 72 | /* ===================================================================== */ 73 | 74 | /* .. External Functions .. */ 75 | /* .. */ 76 | /* .. External Subroutines .. */ 77 | /* .. */ 78 | /* .. Intrinsic Functions .. */ 79 | /* .. */ 80 | /* .. Executable Statements .. */ 81 | 82 | /* Test the input parameters. */ 83 | 84 | /* Parameter adjustments */ 85 | a_dim1 = *lda; 86 | a_offset = 1 + a_dim1; 87 | a -= a_offset; 88 | 89 | /* Function Body */ 90 | *info = 0; 91 | if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { 92 | *info = -1; 93 | } else if (*n < 0) { 94 | *info = -2; 95 | } else if (*lda < max(1,*n)) { 96 | *info = -4; 97 | } 98 | if (*info != 0) { 99 | i__1 = -(*info); 100 | xerbla_("DPOTRI", &i__1); 101 | return 0; 102 | } 103 | 104 | /* Quick return if possible */ 105 | 106 | if (*n == 0) { 107 | return 0; 108 | } 109 | 110 | /* Invert the triangular Cholesky factor U or L. */ 111 | 112 | dtrtri_(uplo, "Non-unit", n, &a[a_offset], lda, info); 113 | if (*info > 0) { 114 | return 0; 115 | } 116 | 117 | /* Form inv(U)*inv(U)' or inv(L)'*inv(L). */ 118 | 119 | dlauum_(uplo, n, &a[a_offset], lda, info); 120 | 121 | return 0; 122 | 123 | /* End of DPOTRI */ 124 | 125 | } /* dpotri_ */ 126 | -------------------------------------------------------------------------------- /src/lapack/slasdt.c: -------------------------------------------------------------------------------- 1 | /* slasdt.f -- translated by f2c (version 20061008). 2 | You must link the resulting object file with libf2c: 3 | on Microsoft Windows system, link with libf2c.lib; 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm 6 | -- in that order, at the end of the command line, as in 7 | cc *.o -lf2c -lm 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 9 | 10 | http://www.netlib.org/f2c/libf2c.zip 11 | */ 12 | 13 | #include "clapack.h" 14 | 15 | 16 | /* Subroutine */ int slasdt_(integer *n, integer *lvl, integer *nd, integer * 17 | inode, integer *ndiml, integer *ndimr, integer *msub) 18 | { 19 | /* System generated locals */ 20 | integer i__1, i__2; 21 | 22 | /* Builtin functions */ 23 | double log(doublereal); 24 | 25 | /* Local variables */ 26 | integer i__, il, ir, maxn; 27 | real temp; 28 | integer nlvl, llst, ncrnt; 29 | 30 | 31 | /* -- LAPACK auxiliary routine (version 3.2) -- */ 32 | /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 33 | /* November 2006 */ 34 | 35 | /* .. Scalar Arguments .. */ 36 | /* .. */ 37 | /* .. Array Arguments .. */ 38 | /* .. */ 39 | 40 | /* Purpose */ 41 | /* ======= */ 42 | 43 | /* SLASDT creates a tree of subproblems for bidiagonal divide and */ 44 | /* conquer. */ 45 | 46 | /* Arguments */ 47 | /* ========= */ 48 | 49 | /* N (input) INTEGER */ 50 | /* On entry, the number of diagonal elements of the */ 51 | /* bidiagonal matrix. */ 52 | 53 | /* LVL (output) INTEGER */ 54 | /* On exit, the number of levels on the computation tree. */ 55 | 56 | /* ND (output) INTEGER */ 57 | /* On exit, the number of nodes on the tree. */ 58 | 59 | /* INODE (output) INTEGER array, dimension ( N ) */ 60 | /* On exit, centers of subproblems. */ 61 | 62 | /* NDIML (output) INTEGER array, dimension ( N ) */ 63 | /* On exit, row dimensions of left children. */ 64 | 65 | /* NDIMR (output) INTEGER array, dimension ( N ) */ 66 | /* On exit, row dimensions of right children. */ 67 | 68 | /* MSUB (input) INTEGER. */ 69 | /* On entry, the maximum row dimension each subproblem at the */ 70 | /* bottom of the tree can be of. */ 71 | 72 | /* Further Details */ 73 | /* =============== */ 74 | 75 | /* Based on contributions by */ 76 | /* Ming Gu and Huan Ren, Computer Science Division, University of */ 77 | /* California at Berkeley, USA */ 78 | 79 | /* ===================================================================== */ 80 | 81 | /* .. Parameters .. */ 82 | /* .. */ 83 | /* .. Local Scalars .. */ 84 | /* .. */ 85 | /* .. Intrinsic Functions .. */ 86 | /* .. */ 87 | /* .. Executable Statements .. */ 88 | 89 | /* Find the number of levels on the tree. */ 90 | 91 | /* Parameter adjustments */ 92 | --ndimr; 93 | --ndiml; 94 | --inode; 95 | 96 | /* Function Body */ 97 | maxn = max(1,*n); 98 | temp = log((real) maxn / (real) (*msub + 1)) / log(2.f); 99 | *lvl = (integer) temp + 1; 100 | 101 | i__ = *n / 2; 102 | inode[1] = i__ + 1; 103 | ndiml[1] = i__; 104 | ndimr[1] = *n - i__ - 1; 105 | il = 0; 106 | ir = 1; 107 | llst = 1; 108 | i__1 = *lvl - 1; 109 | for (nlvl = 1; nlvl <= i__1; ++nlvl) { 110 | 111 | /* Constructing the tree at (NLVL+1)-st level. The number of */ 112 | /* nodes created on this level is LLST * 2. */ 113 | 114 | i__2 = llst - 1; 115 | for (i__ = 0; i__ <= i__2; ++i__) { 116 | il += 2; 117 | ir += 2; 118 | ncrnt = llst + i__; 119 | ndiml[il] = ndiml[ncrnt] / 2; 120 | ndimr[il] = ndiml[ncrnt] - ndiml[il] - 1; 121 | inode[il] = inode[ncrnt] - ndimr[il] - 1; 122 | ndiml[ir] = ndimr[ncrnt] / 2; 123 | ndimr[ir] = ndimr[ncrnt] - ndiml[ir] - 1; 124 | inode[ir] = inode[ncrnt] + ndiml[ir] + 1; 125 | /* L10: */ 126 | } 127 | llst <<= 1; 128 | /* L20: */ 129 | } 130 | *nd = (llst << 1) - 1; 131 | 132 | return 0; 133 | 134 | /* End of SLASDT */ 135 | 136 | } /* slasdt_ */ 137 | --------------------------------------------------------------------------------