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
#pragma once | |
#include <atomic> | |
#include <type_traits> | |
template<typename T, size_t Capacity> | |
struct lfstack { | |
struct node_t final { | |
T value; | |
node_t *next; |
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
// we only allow no more than 8 worker in pool | |
std::atomic_uint_fast8_t idle_mask = {0}; | |
// this function is called by each thread when it is about to sleep | |
void register_idle(const size_t thread_id) | |
{ | |
idle_mask.fetch_or(1u << thread_id, std::memory_order_release); | |
} | |
// this function can be called from anywhere at anytime |
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
#import <Foundation/Foundation.h> | |
@interface LinkedBlockingQueue : NSObject | |
{ | |
// NOP | |
} | |
@property(nonatomic, readonly) NSUInteger count; | |
@property(nonatomic, readonly) NSUInteger freeCount; |
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
#pragma once | |
#ifndef CONVOLUTION_H_INCLUDED | |
#define CONVOLUTION_H_INCLUDED | |
/** | |
* Separable Convolution routines with SSE and NEON intrinsics | |
* | |
* this implementation is based on OpenCV Filter Class | |
* with template optimizations and SIMD intrinsic | |
* |
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
function cholesky_solve(A:Vector.<Number>, size:int, b:Vector.<Number>):Boolean | |
{ | |
var col:int, row:int, col2:int; | |
var val:Number; | |
for (col = 0; col < size; ++col) | |
{ | |
var inv_diag:Number = 1; | |
var cs:int = (col * size); | |
var rs:int = cs; |
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
void box_blur_noscale(const uint8_t* input, int32_t* out, const int w, const int h, int hwin) | |
{ | |
const int win = 2*hwin+1; | |
int *_buf = (int*)alloca((w*win+w) * sizeof(int)); | |
int* sums = _buf + w*win; | |
int* next_row = _buf; | |
int* oldest_row = _buf; | |
int i, j; | |
memset(sums, 0, w*sizeof(int)); |
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
var __x:uint = 123456789; | |
var __y:uint = 362436069; | |
var __z:uint = 21288629; | |
var __w:uint = 14921776; | |
var __c:uint = 0; | |
function rnd():uint | |
{ | |
__x = __x + 545925293; | |
__y = __y ^ (__y<<13); |
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
/** | |
* LU decomposition/solve is used for NxN (square) matrices | |
* but using additional computations we can use LU decomposition | |
* to solve MxN system (since LU routines less computation expensive) | |
*/ | |
// u can find LU and MatrixMath Classes at my Google repo | |
var lu:LU = new LU(); |
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
package ru.inspirit.asfeat.struct | |
{ | |
/** | |
* Simple but fast Dual Linked List approach | |
* Core implementation idea grabbed from Linux Kernel C source | |
* | |
* @author Eugene Zatepyakin | |
*/ | |
public final class LList | |
{ |
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
var intrinsic:Vector.<Number> = new Vector.<Number>(9, true); | |
var intrinsicInverse:Vector.<Number> = new Vector.<Number>(9, true); | |
var R:Vector.<Number> = new Vector.<Number>( 9, true ); | |
var t:Vector.<Number> = new Vector.<Number>( 3, true ); | |
// SVD routine | |
var svd:SVD = new SVD(); | |
// input homography[9] - 3x3 Matrix |