This file contains hidden or 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
% H = A'*A; | |
% D = diag(1 ./ sqrt(diag(H))); | |
% L = chol(D*H*D)'; | |
% cholupd_norm(L, A_new_row, H) | |
%% http://math.stackexchange.com/a/1345569/61331 | |
function [Lx] = cholupdate_norm(L, x, H) | |
n = 1 ./ sqrt(diag(H)); | |
D = diag(n); | |
nx = 1 ./ sqrt(diag(H + x*x')); |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <uv.h> | |
void alloc_buffer(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) | |
{ | |
buf->base = (char*)malloc(suggested_size); | |
buf->len = suggested_size; | |
} |
This file contains hidden or 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
cocurrent 'H' | |
fst =: [: > 0&{ | |
snd =: [: > 1&{ | |
nop =: ''"_ | |
pos =: 1: i.~ [: ; (([: # ]) = [: +/ (] = [: fst [) :: 0:) each | |
add =: ;~ | |
unsafe_get =: [: snd ([: > [) {~ pos | |
get =: (unsafe_get <) :: nop |
This file contains hidden or 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
prefix([], [X|Xs], [X|Xs]). | |
prefix([X|Prefix], [X|List], Rest) :- prefix(Prefix, List, Rest). | |
refal([X | Pat], [X|Xs]) :- refal(Pat, Xs). | |
refal([e(X) | Pat], Xs) :- prefix(X, Xs, Rest), refal(Pat, Rest). | |
refal([e(X)], X). | |
refal([s(X) | Pat], [X|Xs]) :- refal(Pat, Xs). | |
refal([], []). | |
%% usage example |
This file contains hidden or 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
#include "slu_ddefs.h" | |
#include <vector> | |
struct Interal_SuperLU | |
{ | |
superlu_options_t options; | |
SuperLUStat_t stat; | |
std::vector<int> etree; |
NewerOlder