To install BLAS and LAPACK on a Debian-based system, run
$ sudo apt install libblas-dev liblapack-devThe LAPACKE library provides a C interface to LAPACK, and can be installed using
$ sudo apt install liblapacke-dev| /* | |
| SPDX-FileCopyrightText: 2014 Marco Martin <[email protected]> | |
| SPDX-FileCopyrightText: 2023 Hugo Manrique <[email protected]> | |
| SPDX-License-Identifier: GPL-2.0-or-later | |
| */ | |
| import QtQuick 2.5 | |
| import QtQuick.Window 2.2 | |
| import org.kde.plasma.core 2.0 as PlasmaCore |
To install BLAS and LAPACK on a Debian-based system, run
$ sudo apt install libblas-dev liblapack-devThe LAPACKE library provides a C interface to LAPACK, and can be installed using
$ sudo apt install liblapacke-dev| MIT License | |
| Copyright (c) 2022 Hugo Manrique | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
| use anyhow::Result; | |
| use bluer::Address; | |
| use std::collections::HashSet; | |
| use std::fs::{File, OpenOptions}; | |
| use std::io::{ErrorKind, Read, Write}; | |
| use std::ops::Deref; | |
| use std::path::PathBuf; | |
| /// A set of paired device addresses, backed by a file. | |
| pub struct PairedDevices { |
| clear; | |
| f = @(x) cos(x); | |
| xa = 0; | |
| xb = 2 * pi; | |
| n = 4; % number of cubic polynomials | |
| x = linspace(xa, xb, n + 1); % x_0, ..., x_n | |
| y = f(x); % y_0, ..., y_n |
| // Every perfect number is represented as p one bits followed by (p - 1) zero bits, | |
| // where p is a Mersenne prime. | |
| // Let x be the largest `MAX_BITS`-bit perfect number. Then ceil(log2(x)) = p + (p - 1). | |
| const MAX_BITS = 32; // Bitwise operators operate on 32-bit integers | |
| const MAX_ONES = Math.floor((MAX_BITS + 1) / 2); // upper bound on p | |
| // Precomputed list of all prime m <= p s.t. 2^m - 1 is prime. | |
| // TODO Compute automatically. | |
| const MERSENNE_EXPS = new Set([2, 3, 5, 7, 13]); |
| package me.hugmanrique.mab; | |
| import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; | |
| import java.nio.ByteBuffer; | |
| import java.util.concurrent.TimeUnit; | |
| import jdk.incubator.foreign.MemoryAccess; | |
| import jdk.incubator.foreign.MemorySegment; | |
| import org.openjdk.jmh.annotations.Benchmark; | |
| import org.openjdk.jmh.annotations.BenchmarkMode; |
| clear; | |
| T = 7; | |
| f = @(x, y) exp(-T * (x.^2 - y.^2)) - exp(-T * (x.^2 + y.^2)); | |
| xa = 0; | |
| xb = 2; | |
| ya = 0; | |
| yb = 3; | |
| S = adapsimpson2(f, xa, xb, ya, yb, 1.e18) |
| clear; | |
| RGB = imread('escher.jpg'); | |
| I = double(rgb2gray(RGB)); | |
| [m, n] = size(I); | |
| [V, S, W] = svd(I); | |
| % Achieves a 2.04 compression ratio while still being visible | |
| slimit = mean(mean(S)) + 4 * std(std(S)); |
| # frozen_string_literal: true | |
| # Based on https://github.com/jekyll/jekyll/blob/master/lib/jekyll/tags/include.rb, | |
| # provides a transclude block that maintains Jekyll include semantics. Files can | |
| # pass parameters to transcludes via the `include` object, with the addition of | |
| # {{ include.content }} which includes the block content. | |
| # | |
| # Transcludes must be located in Jekyll's _includes dir. | |
| # | |
| # Example: |