Add native vector_lenght() function which calculates the euclidean distance 80%
faster. See https://github.com/matiasdelellis/pdlib/pull/2. Increase the version to 1.0.2 since this is a required function for our application and we must control it. Add more compilation info in php-info(), and print a final message with the build options when configure. Fix that when dlib is not installed, the configuration returns that it cannot find pkgconfig. See https://github.com/matiasdelellis/facerecognition/issues/261 Also implement the test on travis. See for example: (https://travis-ci.com/github/matiasdelellis/pdlib/builds/161854044)
This commit is contained in:
20
tests/vector_length.phpt
Normal file
20
tests/vector_length.phpt
Normal file
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Basic tests for dlib_vector_length
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pdlib")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$vectorAL = [0.0, 0.0];
|
||||
$vectorAR = [0.0, 1.0];
|
||||
var_dump(dlib_vector_length($vectorAL, $vectorAR));
|
||||
$vectorBL = [0.0, 0.0, -1.0];
|
||||
$vectorBR = [0.0, 0.0, 1.0];
|
||||
var_dump(dlib_vector_length($vectorBL, $vectorBR));
|
||||
$vectorCL = [0.0, 2.5, 1.0];
|
||||
$vectorCR = [0.0, 1.0, 1.0];
|
||||
var_dump(dlib_vector_length($vectorCL, $vectorCR));
|
||||
?>
|
||||
--EXPECT--
|
||||
float(1)
|
||||
float(2)
|
||||
float(1.5)
|
||||
10
tests/version.phpt
Normal file
10
tests/version.phpt
Normal file
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Just test php extension version
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pdlib")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(phpversion('pdlib'));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(5) "1.0.2"
|
||||
Reference in New Issue
Block a user