diff -r 000000000000 -r 2b3e5ec03512 servlib/routing/LinkScheduleEstimator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/servlib/routing/LinkScheduleEstimator.h Thu Apr 21 14:57:45 2011 +0100 @@ -0,0 +1,96 @@ +/* + * Copyright 2005-2006 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#define CONTACT(s, d) { s, d } +#define absdiff(x,y) ((x Log; + + static Log* find_schedule(Log* log); + + LinkScheduleEstimator(); +private: + unsigned int entry_dist(Log &a, unsigned int a_index, unsigned int a_offset, + Log &b, unsigned int b_index, unsigned int b_offset, + unsigned int warping_window); + + unsigned int log_dist_r(Log &a, unsigned int a_index, unsigned int a_offset, + Log &b, unsigned int b_index, unsigned int b_offset, + unsigned int warping_window); + + + unsigned int log_dist(Log &a, unsigned int a_offset, + Log &b, unsigned int b_offset, + unsigned int warping_window, int print_table); + + unsigned int autocorrelation(Log &log, unsigned int phase, int print_table); + void print_log(Log &log, int relative_dates); + + Log* generate_samples(Log &schedule, + unsigned int log_size, + unsigned int start_jitter, + double duration_jitter); + + unsigned int estimate_period(Log &log); + unsigned int seek_to_before_date(Log &log, unsigned int date); + unsigned int closest_entry_to_date(Log &log, unsigned int date); + Log* clone_subsequence(Log &log, unsigned int start, unsigned int len); + + unsigned int badness_of_match(Log &pattern, + Log &log, + unsigned int warping_window, + unsigned int period); + + Log* extract_schedule(Log &log, unsigned int period_estimate); + unsigned int refine_period(Log &log, unsigned int period_estimate); + Log* find_schedule(Log &log); +}; + + +}