[Highfrequency-commits] r53 - pkg/highfrequency/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Sep 24 14:17:16 CEST 2013


Author: kboudt
Date: 2013-09-24 14:17:16 +0200 (Tue, 24 Sep 2013)
New Revision: 53

Modified:
   pkg/highfrequency/src/highfrequency.c
   pkg/highfrequency/src/highfrequency.h
Log:


Modified: pkg/highfrequency/src/highfrequency.c
===================================================================
--- pkg/highfrequency/src/highfrequency.c	2013-09-24 12:17:08 UTC (rev 52)
+++ pkg/highfrequency/src/highfrequency.c	2013-09-24 12:17:16 UTC (rev 53)
@@ -1,500 +1,1276 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <R.h>
 
-#include "highfrequency.h"
-#include <math.h>
 
 
+<!DOCTYPE html>
+<html>
+  <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# githubog: http://ogp.me/ns/fb/githubog#">
+    <meta charset='utf-8'>
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+        <title>highfrequency/src/highfrequency.c at master · jonathancornelissen/highfrequency · GitHub</title>
+    <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
+    <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub" />
+    <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-114.png" />
+    <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114.png" />
+    <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-144.png" />
+    <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144.png" />
+    <link rel="logo" type="image/svg" href="https://github-media-downloads.s3.amazonaws.com/github-logo.svg" />
+    <meta property="og:image" content="https://github.global.ssl.fastly.net/images/modules/logos_page/Octocat.png">
+    <meta name="hostname" content="github-fe112-cp1-prd.iad.github.net">
+    <meta name="ruby" content="ruby 1.9.3p194-tcs-github-tcmalloc (2012-05-25, TCS patched 2012-05-27, GitHub v1.0.36) [x86_64-linux]">
+    <link rel="assets" href="https://github.global.ssl.fastly.net/">
+    <link rel="conduit-xhr" href="https://ghconduit.com:25035/">
+    <link rel="xhr-socket" href="/_sockets" />
+    
 
-void justKernel(double *x, int *type, double *ans)
-{
-    ans[0] = K(x[0], type[0]);
 
-}
-double K(double x, int type)
-{
-//    double thex = x[0];
-    double thex = x;
-	switch(type)
-	{
-      case 0:  // Rectangular
-         return(1);
-         break;
+    <meta name="msapplication-TileImage" content="/windows-tile.png" />
+    <meta name="msapplication-TileColor" content="#ffffff" />
+    <meta name="selected-link" value="repo_source" data-pjax-transient />
+    <meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="4E166160:32FC:FBA4F2:5241811A" name="octolytics-dimension-request_id" />
+    
 
-	  case 1: // Bartlett
-	    return(1-thex);
-	    break;
+    
+    
+    <link rel="icon" type="image/x-icon" href="/favicon.ico" />
 
-	  case 2: //2nd Order
-	    return(1-2*thex+thex*thex);
-	    break;
+    <meta content="authenticity_token" name="csrf-param" />
+<meta content="ybm8kGOPneZiMmAw1ZYxjQySvyZmn8CZN6HGTIyowDw=" name="csrf-token" />
 
-	  case 3: //Epanechnikov
-	    return(1-thex*thex);
-	    break;
+    <link href="https://github.global.ssl.fastly.net/assets/github-e503554bd5ad06674d1b10d72e423102f78ab1d2.css" media="all" rel="stylesheet" type="text/css" />
+    <link href="https://github.global.ssl.fastly.net/assets/github2-2357359f6823a4e414d202ebd002ff1d34492325.css" media="all" rel="stylesheet" type="text/css" />
+    
 
-	  case 4: //Cubic
-	    return(1-3*thex*thex+2*thex*thex*thex);
-	    break;
+    
 
-	  case 5: //5th Order
-	    return(1-10*thex*thex*thex + 15*thex*thex*thex*thex - 6*thex*thex*thex*thex*thex);
-	    break;
+      <script src="https://github.global.ssl.fastly.net/assets/frameworks-8db79d6d3d61c3bdec72ede901c2b6dbd4a79dad.js" type="text/javascript"></script>
+      <script src="https://github.global.ssl.fastly.net/assets/github-c6ea436c6358b0518da3cb5c492124ea04237ad2.js" type="text/javascript"></script>
+      
+      <meta http-equiv="x-pjax-version" content="df85b9c2dad3983d1e25edab2835ede3">
 
-	  case 6: //6th Order
-	    return(1 - 15*thex*thex*thex*thex + 24*thex*thex*thex*thex*thex - 10*thex*thex*thex*thex*thex*thex);
-	    break;
+        <link data-pjax-transient rel='permalink' href='/jonathancornelissen/highfrequency/blob/3b3f88ccde3e84c746f5acc924ac366297bf2ba9/src/highfrequency.c'>
+  <meta property="og:title" content="highfrequency"/>
+  <meta property="og:type" content="githubog:gitrepository"/>
+  <meta property="og:url" content="https://github.com/jonathancornelissen/highfrequency"/>
+  <meta property="og:image" content="https://github.global.ssl.fastly.net/images/gravatars/gravatar-user-420.png"/>
+  <meta property="og:site_name" content="GitHub"/>
+  <meta property="og:description" content="The highfrequency package contains an extensive toolkit for the use of highfrequency financial data in R. It contains functionality to manage, clean and match highfrequency trades and quotes data. Furthermore, it enables users to: calculate easily various liquidity measures, estimate and forecast volatility, and investigate microstructure noise and intraday periodicity."/>
 
-	  case 7: //7th Order
-	    return(1 - 21*thex*thex*thex*thex*thex + 35*thex*thex*thex*thex*thex*thex - 15*thex*thex*thex*thex*thex*thex*thex);
-	    break;
+  <meta name="description" content="The highfrequency package contains an extensive toolkit for the use of highfrequency financial data in R. It contains functionality to manage, clean and match highfrequency trades and quotes data. Furthermore, it enables users to: calculate easily various liquidity measures, estimate and forecast volatility, and investigate microstructure noise and intraday periodicity." />
 
-	  case 8: //8th Order
-	    return(1 - 28*thex*thex*thex*thex*thex*thex + 48*thex*thex*thex*thex*thex*thex*thex - 21*thex*thex*thex*thex*thex*thex*thex*thex);
-	    break;
+  <meta content="1909644" name="octolytics-dimension-user_id" /><meta content="jonathancornelissen" name="octolytics-dimension-user_login" /><meta content="7306202" name="octolytics-dimension-repository_id" /><meta content="jonathancornelissen/highfrequency" name="octolytics-dimension-repository_nwo" /><meta content="true" name="octolytics-dimension-repository_public" /><meta content="false" name="octolytics-dimension-repository_is_fork" /><meta content="7306202" name="octolytics-dimension-repository_network_root_id" /><meta content="jonathancornelissen/highfrequency" name="octolytics-dimension-repository_network_root_nwo" />
+  <link href="https://github.com/jonathancornelissen/highfrequency/commits/master.atom" rel="alternate" title="Recent Commits to highfrequency:master" type="application/atom+xml" />
 
-	  case 9: //Parzen
-	    if(thex > .5)
-	    {
-	        return( 2*(1-thex)*(1-thex)*(1-thex));
-	    }
-	    else
-	    {
-	    	return(1- 6*thex*thex +6*thex*thex*thex);
-	    }
-	    break;
+  </head>
 
-	  case 10: //Tukey-Hanning
-	    return((1 + sin(M_PI_2 - M_PI * thex))/2);
-	    break;
 
-	  case 11: //Modified Tukey-Hanning
-	    return((1 - sin(M_PI_2 - M_PI *(1 - thex) *(1 - thex)) )/2);
-	    break;
-	}
-	return(-999);
-}
+  <body class="logged_out  env-production windows vis-public page-blob">
+    <div class="wrapper">
+      
+      
+      
 
 
-void kernel(double *a, int *na, int *q, int *adj, int *nw, double *ab, double *ans)
-{
-     	int i, j,lags = *q, nab = *na - 1;
-        double theadj, nwadj;
+      
+      <div class="header header-logged-out">
+  <div class="container clearfix">
 
-        if(*nw == 1)
-                lags = 2*lags;
+    <a class="header-logo-wordmark" href="https://github.com/">
+      <span class="mega-octicon octicon-logo-github"></span>
+    </a>
 
-        for(j = 0; j <= lags; j++)
-		{
+    <div class="header-actions">
+        <a class="button primary" href="/signup">Sign up</a>
+      <a class="button signin" href="/login?return_to=%2Fjonathancornelissen%2Fhighfrequency%2Fblob%2Fmaster%2Fsrc%2Fhighfrequency.c">Sign in</a>
+    </div>
 
-        	for(i = 0; i <= nab-j; i++)
-			     ab[j] += a[i] * a[i+j];
-		}
-        for(i = 0; i <= lags; i ++)
-        {
+    <div class="command-bar js-command-bar  in-repository">
 
-              nwadj = 1;
-              if(i > *q && *nw == 1)
-              {
+      <ul class="top-nav">
+          <li class="explore"><a href="/explore">Explore</a></li>
+        <li class="features"><a href="/features">Features</a></li>
+          <li class="enterprise"><a href="https://enterprise.github.com/">Enterprise</a></li>
+          <li class="blog"><a href="/blog">Blog</a></li>
+      </ul>
+        <form accept-charset="UTF-8" action="/search" class="command-bar-form" id="top_search_form" method="get">
 
-                  nwadj = ((double)*q - ((double)i - (double)*q))/((double)*q);
-              }
+<input type="text" data-hotkey=" s" name="q" id="js-command-bar-field" placeholder="Search or type a command" tabindex="1" autocapitalize="off"
+    
+    
+      data-repo="jonathancornelissen/highfrequency"
+      data-branch="master"
+      data-sha="752903926e365dd8e31b17c10589e5ca0e29e49f"
+  >
 
-              if(*adj == 0)
-	     	 {
-                  theadj = 1;
-              }
-              else
-              {
-                  theadj =  ((double)(nab+1)/((double)(nab+1)-(double)i));
-	          }
-              if(i == 0)
-	      	  {
-              		ans[0] += theadj * ab[i];
-              }
-              else
-              {
-	                ans[0] += 2 * nwadj *  theadj * ab[i];
-              }
-        }
-}
+    <input type="hidden" name="nwo" value="jonathancornelissen/highfrequency" />
 
-void kernelEstimator(double *a, double *b, int *na, int *q, int *adj, int *type, double *ab,  double *ab2, double *ans)
-{
-     	int i, j,lags = *q, nab = *na - 1;
-        double theadj, w;
+    <div class="select-menu js-menu-container js-select-menu search-context-select-menu">
+      <span class="minibutton select-menu-button js-menu-target">
+        <span class="js-select-button">This repository</span>
+      </span>
 
+      <div class="select-menu-modal-holder js-menu-content js-navigation-container">
+        <div class="select-menu-modal">
 
-        for(j = 0; j <= lags; j++)
-		{
+          <div class="select-menu-item js-navigation-item js-this-repository-navigation-item selected">
+            <span class="select-menu-item-icon octicon octicon-check"></span>
+            <input type="radio" class="js-search-this-repository" name="search_target" value="repository" checked="checked" />
+            <div class="select-menu-item-text js-select-button-text">This repository</div>
+          </div> <!-- /.select-menu-item -->
 
-        	for(i = 0; i <= nab-j; i++)
-			     ab[j] += a[i] * b[i+j];
-        	for(i = j; i <= nab; i++)
-			     ab2[j] += a[i] * b[i-j];
+          <div class="select-menu-item js-navigation-item js-all-repositories-navigation-item">
+            <span class="select-menu-item-icon octicon octicon-check"></span>
+            <input type="radio" name="search_target" value="global" />
+            <div class="select-menu-item-text js-select-button-text">All repositories</div>
+          </div> <!-- /.select-menu-item -->
 
-		}
-        for(i = 0; i <= lags; i ++)
-        {
-             if(i == 0)
-             {
-                 w = 1;
-             }
-             else
-             {
-             	w = K( ((double)i-1.0)/(double)lags, type[0]);
-             }
+        </div>
+      </div>
+    </div>
 
+  <span class="octicon help tooltipped downwards" title="Show command bar help">
+    <span class="octicon octicon-question"></span>
+  </span>
 
-             if(*adj == 0)
-	     	 {
-                  theadj = 1;
-             }
-             else
-             {
-                  theadj =  ((double)(nab+1)/((double)(nab+1)-(double)i));
-	         }
 
-              if(i == 0)
-	      	  {
-              		ans[0] += w * theadj * ab[i];
-              }
-              else
-              {
-	                ans[0] += w* ( theadj * ab[i] + theadj * ab2[i]);
-              }
-        }
-}
+  <input type="hidden" name="ref" value="cmdform">
 
-void kernel2(double *a, double *b, int *na, int *q, int *adj, int *nw, double *ab,  double *ab2, double *ans)
-{
-     	int i, j,lags = *q, nab = *na - 1;
-        double theadj, nwadj;
+</form>
+    </div>
 
-        if(*nw == 1)
-                lags = 2*lags;
+  </div>
+</div>
 
-        for(j = 0; j <= lags; j++)
-		{
 
-        	for(i = 0; i <= nab-j; i++)
-			     ab[j] += a[i] * b[i+j];
-        	for(i = j; i <= nab; i++)
-			     ab2[j] += a[i] * b[i-j];
+      
 
-		}
-        for(i = 0; i <= lags; i ++)
-        {
 
-              nwadj = 1;
-              if(i > *q && *nw == 1)
-              {
+          <div class="site" itemscope itemtype="http://schema.org/WebPage">
+    
+    <div class="pagehead repohead instapaper_ignore readability-menu">
+      <div class="container">
+        
 
-                  nwadj = ((double)*q - ((double)i - (double)*q))/((double)*q);
-              }
+<ul class="pagehead-actions">
 
-              if(*adj == 0)
-	     	 {
-                  theadj = 1;
-              }
-              else
-              {
-                  theadj =  ((double)(nab+1)/((double)(nab+1)-(double)i));
-	          }
-              if(i == 0)
-	      	  {
-              		ans[0] += theadj * ab[i];
-              }
-              else
-              {
-	                ans[0] += nwadj *  theadj * ab[i];
-	                ans[0] += nwadj *  theadj * ab2[i];
-              }
-        }
-}
 
+  <li>
+  <a href="/login?return_to=%2Fjonathancornelissen%2Fhighfrequency"
+  class="minibutton with-count js-toggler-target star-button entice tooltipped upwards"
+  title="You must be signed in to use this feature" rel="nofollow">
+  <span class="octicon octicon-star"></span>Star
+</a>
+<a class="social-count js-social-count" href="/jonathancornelissen/highfrequency/stargazers">
+  2
+</a>
 
+  </li>
 
-void subsample(double *a, double *b, int *na, int *m, int *period, double *tmpa, double *tmpb, int *tmpna, double *ans)
-{
-    int i,j,k;
-    double starta, startb;
+    <li>
+      <a href="/login?return_to=%2Fjonathancornelissen%2Fhighfrequency"
+        class="minibutton with-count js-toggler-target fork-button entice tooltipped upwards"
+        title="You must be signed in to fork a repository" rel="nofollow">
+        <span class="octicon octicon-git-branch"></span>Fork
+      </a>
+      <a href="/jonathancornelissen/highfrequency/network" class="social-count">
+        0
+      </a>
+    </li>
+</ul>
 
-    for(i = 0; i <= *period -1 ; i++)
-    {
-        starta = 0.0;
-        startb = 0.0;
-        for(j = 0; j < *tmpna; j++)
-        {
-             tmpa[j] = 0;
-             tmpb[j] = 0;
-        }
-        for(j = 0; j <= *na-i-1; j++)
-        {
-        	tmpa[j/ *period] += a[j + i];
-        	tmpb[j/ *period] += b[j + i];
-        }
-        for(j = 0; j < i; j++)
-        {
-            starta += a[j];
-            startb += b[j];
-        }
-        for(k = 0; k < *tmpna; k++)
-        {
-            ans[i] += tmpa[k]*tmpb[k];
-        }
-        ans[i] += starta*startb;
-	}
-}
+        <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-title public">
+          <span class="repo-label"><span>public</span></span>
+          <span class="mega-octicon octicon-repo"></span>
+          <span class="author">
+            <a href="/jonathancornelissen" class="url fn" itemprop="url" rel="author"><span itemprop="title">jonathancornelissen</span></a></span
+          ><span class="repohead-name-divider">/</span><strong
+          ><a href="/jonathancornelissen/highfrequency" class="js-current-repository js-repo-home-link">highfrequency</a></strong>
 
-void rv(double *a, double *b, int *na, int *period, double *tmpa, double *tmpb, int *tmpna, double *ans)
-{
-    int j,k;
+          <span class="page-context-loader">
+            <img alt="Octocat-spinner-32" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
+          </span>
 
-        for(j = 0; j <= *na-1; j++)
-        {
-        	tmpa[j/ *period] += a[j];
-        	tmpb[j/ *period] += b[j];
-        }
-        for(k = 0; k < *tmpna; k++)
-        {
-            ans[0] += tmpa[k]*tmpb[k];
-        }
-}
+        </h1>
+      </div><!-- /.container -->
+    </div><!-- /.repohead -->
 
-void rvperiod(double *a, double *b, int *na, int *period, double *tmpa, double *tmpb, int *tmpna, double *ans)
-{
-    int j,k;
+    <div class="container">
 
-        for(j = 0; j <= *na-1; j++)
-        {
-        	tmpa[j/ *period] = a[j];
-        	tmpb[j/ *period] = b[j];
-        }
-        for(k = 0; k < *tmpna; k++)
-        {
-            ans[0] += tmpa[k]*tmpb[k];
-        }
-}
+      <div class="repository-with-sidebar repo-container ">
 
+        <div class="repository-sidebar">
+            
 
-void rfourth(double *a, double *b, int *na, int *period, double *tmpa, double *tmpb, int *tmpna, double *ans)
-{
-    int j,k;
+<div class="repo-nav repo-nav-full js-repository-container-pjax js-octicon-loaders">
+  <div class="repo-nav-contents">
+    <ul class="repo-menu">
+      <li class="tooltipped leftwards" title="Code">
+        <a href="/jonathancornelissen/highfrequency" aria-label="Code" class="js-selected-navigation-item selected" data-gotokey="c" data-pjax="true" data-selected-links="repo_source repo_downloads repo_commits repo_tags repo_branches /jonathancornelissen/highfrequency">
+          <span class="octicon octicon-code"></span> <span class="full-word">Code</span>
+          <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
+</a>      </li>
 
-        for(j = 0; j <= *na-1; j++)
-        {
-        	tmpa[j/ *period] += a[j];
-        	tmpb[j/ *period] += b[j];
-        }
-        for(k = 0; k < *tmpna; k++)
-        {
-            ans[0] += tmpa[k]*tmpb[k]*tmpa[k]*tmpb[k];
-        }
-}
+        <li class="tooltipped leftwards" title="Issues">
+          <a href="/jonathancornelissen/highfrequency/issues" aria-label="Issues" class="js-selected-navigation-item js-disable-pjax" data-gotokey="i" data-selected-links="repo_issues /jonathancornelissen/highfrequency/issues">
+            <span class="octicon octicon-issue-opened"></span> <span class="full-word">Issues</span>
+            <span class='counter'>0</span>
+            <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
+</a>        </li>
 
-void rfourthlead(double *a, double *b, int *na, int *period, double *tmpa, double *tmpb, int *tmpna, double *ans)
-{
-    int j,k;
+      <li class="tooltipped leftwards" title="Pull Requests"><a href="/jonathancornelissen/highfrequency/pulls" aria-label="Pull Requests" class="js-selected-navigation-item js-disable-pjax" data-gotokey="p" data-selected-links="repo_pulls /jonathancornelissen/highfrequency/pulls">
+            <span class="octicon octicon-git-pull-request"></span> <span class="full-word">Pull Requests</span>
+            <span class='counter'>0</span>
+            <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
+</a>      </li>
 
-        for(j = 0; j <= *na-1; j++)
-        {
-        	tmpa[j/ *period] += a[j];
-        	tmpb[j/ *period] += b[j];
-        }
-        for(k = 0; k < *tmpna-1; k++)
-        {
-            ans[0] += tmpa[k]*tmpb[k]*tmpa[k+1]*tmpb[k+1];
-        }
-}
 
-void covkernel(double *a, double *b, int *na, int *q, int *adj, double *ans)
-{
-     	int i, j,lags = *q, nab = *na - 1;
-        double theadj;
+        <li class="tooltipped leftwards" title="Wiki">
+          <a href="/jonathancornelissen/highfrequency/wiki" aria-label="Wiki" class="js-selected-navigation-item " data-pjax="true" data-selected-links="repo_wiki /jonathancornelissen/highfrequency/wiki">
+            <span class="octicon octicon-book"></span> <span class="full-word">Wiki</span>
+            <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
+</a>        </li>
+    </ul>
+    <div class="repo-menu-separator"></div>
+    <ul class="repo-menu">
 
-		for(i = lags; i <= nab-lags; i++)
-        {
-		    for(j =0; j<=lags; j++)
-		       ans[0] += a[i] * b[i-j];
-        }
-        if(*adj == 0)
-	    {
-            theadj = 1;
-        }
-        else
-        {
-             theadj =  ((double)(nab+1)/((double)(nab+1)-(double)(2*lags)));
-	    }
-        ans[0] = ans[0] * theadj;
+      <li class="tooltipped leftwards" title="Pulse">
+        <a href="/jonathancornelissen/highfrequency/pulse" aria-label="Pulse" class="js-selected-navigation-item " data-pjax="true" data-selected-links="pulse /jonathancornelissen/highfrequency/pulse">
+          <span class="octicon octicon-pulse"></span> <span class="full-word">Pulse</span>
+          <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
+</a>      </li>
 
-}
+      <li class="tooltipped leftwards" title="Graphs">
+        <a href="/jonathancornelissen/highfrequency/graphs" aria-label="Graphs" class="js-selected-navigation-item " data-pjax="true" data-selected-links="repo_graphs repo_contributors /jonathancornelissen/highfrequency/graphs">
+          <span class="octicon octicon-graph"></span> <span class="full-word">Graphs</span>
+          <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
+</a>      </li>
 
-void covcc(double *a, double *b, double *at, double *bt, int *na, int *nb, double *ans)
-{
-        int i, prevj = 0, j, nbi=*nb, nai = *na;
-        double tmpRet=0;
+      <li class="tooltipped leftwards" title="Network">
+        <a href="/jonathancornelissen/highfrequency/network" aria-label="Network" class="js-selected-navigation-item js-disable-pjax" data-selected-links="repo_network /jonathancornelissen/highfrequency/network">
+          <span class="octicon octicon-git-branch"></span> <span class="full-word">Network</span>
+          <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
+</a>      </li>
+    </ul>
 
-        for(i = 0; i < nai; i++)
-        {
-            tmpRet=0;
-            for(j=prevj; j < nbi; j++)
-            {
-                tmpRet += b[j];
-                if(bt[j] > at[i])
-                {
-                    prevj = j;
-                    j = nbi;
-                }
-                else if(bt[j] == at[i])
-                {
-                    prevj = j+1;
-                    j = nbi;
-                }
-            }
-            ans[i] = a[i]* tmpRet;
-        }
-}
 
-void pcovcc(double *a, double *ap, double *b, double *at,double *atp, double *bt, int *na, int *nap, int *nb, int *period, double *ans)
-{
-        int i, prevj = 0, j, nbi=*nb, nai = *na, napi = *nap;
-        double tmpRet=0;
+  </div>
+</div>
 
-        for(i = 0; i < nai; i++)
-        {
-            ap[i/ *period] += a[i];
-            atp[i/ *period] = at[i];
-        }
-        for(i = 0; i < napi; i++)
-        {
-            tmpRet=0;
-            for(j=prevj; j < nbi; j++)
-            {
-                tmpRet += b[j];
-                if(bt[j] > atp[i])
-                {
-                    prevj = j;
-                    j = nbi;
-                }
-                else if(bt[j] == atp[i])
-                {
-                    prevj = j+1;
-                    j = nbi;
-                }
-            }
-            ans[i] = ap[i]* tmpRet;
-        }
-}
+            <div class="only-with-full-nav">
+              
 
+  
 
-void sametime(double *a, int *na, int *millis, double *tts)
-{
-    int prev = -1, i, j=0;
-    for(i = 0; i < *na; i ++)
-    {
-    	if(millis[i] != prev)
-    	{
-    	    prev = millis[i];
-    	    tts[j] = a[i];
-    	    j = j +1;
-    	}
-    }
-}
+<div class="clone-url open"
+  data-protocol-type="http"
+  data-url="/users/set_protocol?protocol_selector=http&protocol_type=clone">
+  <h3><strong>HTTPS</strong> clone URL</h3>
+  <div class="clone-url-box">
+    <input type="text" class="clone js-url-field"
+           value="https://github.com/jonathancornelissen/highfrequency.git" readonly="readonly">
 
-void tocts(double *a, int *na, int *millis, int *millisstart, int *millisend, double *cts)
-{
-//	array cts is passed from R having length (millisend-millisstart)/1000
-//	loop tries to write (*millisend - *millisstart)/1000 +1 values into the
-//	array -> C runs out of memory and throws segfault error
-//    int n = (*millisend - *millisstart)/1000 +1,i, j=0;
-//	Still need to carefully check if the correction below works correctly, maybe
-//  you rather need to increase the size of the array on the R side
-    int n = (*millisend - *millisstart)/1000,i, j=0;
-   for(i = 0; i < n; i ++)
-    {
-    	if((j < *na) && (millis[j] == ((i*1000) + *millisstart)))
-    	{
-    	    cts[i] = a[j];
-    	    j = j+1;
-    	}
-    	else
-    	{
-    	   cts[i] = 0;
-    	}
-    }
- }
+    <span class="js-zeroclipboard url-box-clippy minibutton zeroclipboard-button" data-clipboard-text="https://github.com/jonathancornelissen/highfrequency.git" data-copied-hint="copied!" title="copy to clipboard"><span class="octicon octicon-clippy"></span></span>
+  </div>
+</div>
 
-void portfolio(double *a, double *b, int *na, int *nb, int *millisa, int *millisb, int *millis,int *milliesn, double *port)
-{
-    int i, j=0, k=0;
-    for(i = 0; i < *milliesn; i ++)
-    {
-    	if((j < *na) && (millisa[j] == millis[i]))
-    	{
-    	    port[i] = a[j];
-    	    j = j+1;
-    	}
-    	else
-    	{
-    	   port[i] = 0;
-    	}
-        if((k < *nb) && (millisb[k] == millis[i]))
-    	{
-    	    port[i] += b[k];
-    	    k = k+1;
-    	}
-    }
- }
+  
 
-int nsmaller(int *times, int *lengths, int start, int end, int max)
-{
-int i=0;
-while ( (i < (lengths[end] - lengths[start])) && (*(times+ (lengths[start]+i)) <= max)){
-i++;
-}
-return i;
-}
+<div class="clone-url "
+  data-protocol-type="subversion"
+  data-url="/users/set_protocol?protocol_selector=subversion&protocol_type=clone">
+  <h3><strong>Subversion</strong> checkout URL</h3>
+  <div class="clone-url-box">
+    <input type="text" class="clone js-url-field"
+           value="https://github.com/jonathancornelissen/highfrequency" readonly="readonly">
 
-void refreshpoints( int *times, int *lengths, int *ttau, int *dim, int *aa, int *indices, int *lindex){
-  //my first C program, so probably improvable..
-  //length start with all starting points: from zero and upto last endpoint +1
-  // getting variables declared
-int  t_max=0, i, j,a,b;;
-int condition = 1;
-int Ntau[*dim];
-int tnext[*dim];
-  //int xx tau[*lindex];
-  // getting starting values before looping
- *ttau = 0;
- for(i = 0; i<*dim ; i++){
-     if( *ttau < *(times + lengths[i]) )
-     { *ttau = *(times + lengths[i] ); }
-     }
+    <span class="js-zeroclipboard url-box-clippy minibutton zeroclipboard-button" data-clipboard-text="https://github.com/jonathancornelissen/highfrequency" data-copied-hint="copied!" title="copy to clipboard"><span class="octicon octicon-clippy"></span></span>
+  </div>
+</div>
 
- for(i = 0; i < *dim; i++){
-    Ntau[i] = nsmaller(times, lengths, i, (i+1), *ttau);
-    *(indices + i * (*lindex))  = Ntau[i];}
- j=0;
- // start the loop over all observations
-while( condition >= 1 ){
 
- for(i = 0; i<*dim; i++){
-    tnext[i] = *(times + Ntau[i] + lengths[i]);
-    if( tnext[i] > t_max ){ t_max = tnext[i]; }
-    }
-    j++;
-    *(ttau+j) = t_max;
- for(i = 0; i<*dim; i++){
-    Ntau[i] = nsmaller(times, lengths, i, (i+1), *(ttau+j));
-    *(indices + i* (*lindex) + j)  = Ntau[i];
-    a = lengths[i+1];
-    b =  (Ntau[i] + lengths[i]);
-    if( a <= b ){ condition = 0; }
-    }
-    t_max = 0;
+<p class="clone-options">You can clone with
+      <a href="#" class="js-clone-selector" data-protocol="http">HTTPS</a>,
+      or <a href="#" class="js-clone-selector" data-protocol="subversion">Subversion</a>.
+  <span class="octicon help tooltipped upwards" title="Get help on which URL is right for you.">
+    <a href="https://help.github.com/articles/which-remote-url-should-i-use">
+    <span class="octicon octicon-question"></span>
+    </a>
+  </span>
+</p>
 
- }
- *aa = j+1;
-}
+
+  <a href="http://windows.github.com" class="minibutton sidebar-button">
+    <span class="octicon octicon-device-desktop"></span>
+    Clone in Desktop
+  </a>
+
+                <a href="/jonathancornelissen/highfrequency/archive/master.zip"
+                   class="minibutton sidebar-button"
+                   title="Download this repository as a zip file"
+                   rel="nofollow">
+                  <span class="octicon octicon-cloud-download"></span>
+                  Download ZIP
+                </a>
+            </div>
+        </div><!-- /.repository-sidebar -->
+
+        <div id="js-repo-pjax-container" class="repository-content context-loader-container" data-pjax-container>
+          
+
+
+<!-- blob contrib key: blob_contributors:v21:3a2c168585f2d2dc228024adc987799e -->
+<!-- blob contrib frag key: views10/v8/blob_contributors:v21:3a2c168585f2d2dc228024adc987799e -->
+
+<p title="This is a placeholder element" class="js-history-link-replace hidden"></p>
+
+<a href="/jonathancornelissen/highfrequency/find/master" data-pjax data-hotkey="t" class="js-show-file-finder" style="display:none">Show File Finder</a>
+
+<div class="file-navigation">
+  
+
+
+<div class="select-menu js-menu-container js-select-menu" >
+  <span class="minibutton select-menu-button js-menu-target" data-hotkey="w"
+    data-master-branch="master"
+    data-ref="master"
+    role="button" aria-label="Switch branches or tags" tabindex="0">
+    <span class="octicon octicon-git-branch"></span>
+    <i>branch:</i>
+    <span class="js-select-button">master</span>
+  </span>
+
+  <div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax>
+
+    <div class="select-menu-modal">
+      <div class="select-menu-header">
+        <span class="select-menu-title">Switch branches/tags</span>
+        <span class="octicon octicon-remove-close js-menu-close"></span>
+      </div> <!-- /.select-menu-header -->
+
+      <div class="select-menu-filters">
+        <div class="select-menu-text-filter">
+          <input type="text" aria-label="Filter branches/tags" id="context-commitish-filter-field" class="js-filterable-field js-navigation-enable" placeholder="Filter branches/tags">
+        </div>
+        <div class="select-menu-tabs">
+          <ul>
+            <li class="select-menu-tab">
+              <a href="#" data-tab-filter="branches" class="js-select-menu-tab">Branches</a>
+            </li>
+            <li class="select-menu-tab">
+              <a href="#" data-tab-filter="tags" class="js-select-menu-tab">Tags</a>
+            </li>
+          </ul>
+        </div><!-- /.select-menu-tabs -->
+      </div><!-- /.select-menu-filters -->
+
+      <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches">
+
+        <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
+
+
+            <div class="select-menu-item js-navigation-item selected">
+              <span class="select-menu-item-icon octicon octicon-check"></span>
+              <a href="/jonathancornelissen/highfrequency/blob/master/src/highfrequency.c" class="js-navigation-open select-menu-item-text js-select-button-text css-truncate-target" data-name="master" data-skip-pjax="true" rel="nofollow" title="master">master</a>
+            </div> <!-- /.select-menu-item -->
+        </div>
+
+          <div class="select-menu-no-results">Nothing to show</div>
+      </div> <!-- /.select-menu-list -->
+
+      <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags">
+        <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
+
+
+        </div>
+
+        <div class="select-menu-no-results">Nothing to show</div>
+      </div> <!-- /.select-menu-list -->
+
+    </div> <!-- /.select-menu-modal -->
+  </div> <!-- /.select-menu-modal-holder -->
+</div> <!-- /.select-menu -->
+
+  <div class="breadcrumb">
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/highfrequency -r 53


More information about the Highfrequency-commits mailing list