Created
September 8, 2012 11:42
-
-
Save laclefyoshi/3674068 to your computer and use it in GitHub Desktop.
c code using libpuzzle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Copyright: (c) SAEKI Yoshiyasu | |
License : MIT-style license | |
<http://www.opensource.org/licenses/mit-license.php> | |
last updated: 2012/09/08 | |
**/ | |
#include<stdio.h> | |
#include<stdlib.h> | |
#include<puzzle.h> | |
int main(int argc, char *argv[]) { | |
PuzzleContext context; | |
PuzzleCvec cvec1, cvec2; | |
double distance; | |
puzzle_init_context(&context); | |
puzzle_init_cvec(&context, &cvec1); | |
puzzle_init_cvec(&context, &cvec2); | |
puzzle_fill_cvec_from_file(&context, &cvec1, argv[1]); | |
puzzle_fill_cvec_from_file(&context, &cvec2, argv[2]); | |
distance = puzzle_vector_normalized_distance(&context, &cvec1, &cvec2, 1); | |
printf("distance: %g\n", distance); | |
puzzle_free_cvec(&context, &cvec1); | |
puzzle_free_cvec(&context, &cvec2); | |
puzzle_free_context(&context); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment