Revision: 06.08.2023, https://compute.toys/view/407
fn sdSphere(p: vec3f, r: f32) -> f32 {
return length(p) - r;
}
/* | |
Based on the Anti-aliased Euclidean distance transform described by Stefan Gustavson and | |
Robin Strand. For further information, see https://contourtextures.wikidot.com/ and | |
https://web.archive.org/web/20220503051209/https://weber.itn.liu.se/~stegu/edtaa/ | |
The algorithm is an adapted version of Stefan Gustavson's code, it inherits the copyright | |
statement below, which applies to this file only. | |
The rewrite with Unity Burst support makes the execution 40 times faster by default, | |
and 75 times faster if the passed in textures are both of type TextureFormat.RGBAFloat. |
import Mathlib.LinearAlgebra.CliffordAlgebra.Contraction | |
import Mathlib.LinearAlgebra.ExteriorAlgebra.Grading | |
set_option pp.proofs.withType false | |
variable {R M} [CommRing R] [Invertible (2 : R)] [AddCommGroup M] [Module R M] (Q : QuadraticForm R M) | |
abbrev ExteriorAlgebra.rMultivector (r : ℕ) : Submodule R (ExteriorAlgebra R M) := | |
(LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] _) ^ r) |
/- | |
The original problem is incorrect. Instead, we prove that the statement is true | |
if and only if either A or B is the universe | |
-/ | |
example (h0 : X ⊆ A) (h1 : Y ⊆ B) : | |
A = Set.univ ∨ B = Set.univ ↔ (X ×ˢ Y)ᶜ = A ×ˢ Yᶜ ∪ Xᶜ ×ˢ B := by | |
apply Iff.intro | |
{ | |
intro h2 | |
rw [Set.compl_prod_eq_union, Set.union_comm] |
import Mathlib | |
open Lean Meta Elab Command | |
-- generalized | |
/-- Write an import graph, represented as a an array of `NameMap`s to the ".dot" graph format. | |
If `("style1", graph1)` is in `graphs`, then the edges in `graph1` will be labeled with `[style1]`. | |
Example: `asStyledDotGraph #[("", graph1), ("style=dashed", graph2)]` -/ | |
def asStyledDotGraph [ForIn Id α Name] (graphs : Array (String × NameMap α)) | |
(header := "import_graph") : String := Id.run do |
#!/bin/bash | |
# | |
# Container source: https://github.com/OpenAccess-AI-Collective/axolotl/blob/main/docker/Dockerfile-runpod | |
# | |
# | |
# To run this in RunPod with `winglian/axolotl-runpod:main-cu118-2.0.0`, set | |
# Expose HTTP Ports (Max 10): 7860,8888 | |
# docker command: `bash -c "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/utensil/llm-playground/main/scripts/entry/prepare_ax.sh -sSf | bash"` | |
# JUPYTER_PASSWORD change to your secret | |
# HUGGINGFACE_TOKEN change to your token from https://huggingface.co/settings/tokens |
Revision: 06.08.2023, https://compute.toys/view/407
fn sdSphere(p: vec3f, r: f32) -> f32 {
return length(p) - r;
}
Use https://github.com/jfarley248/iTunes_Backup_Reader
git clone https://github.com/jfarley248/iTunes_Backup_Reader
cd iTunes_Backup_Reader
# apply https://github.com/jfarley248/iTunes_Backup_Reader/pull/12
gh pr checkout https://github.com/jfarley248/iTunes_Backup_Reader/pull/12
import data.finsupp | |
namespace finsupp.eric | |
#check finset.sigma | |
universes u v w | |
def bind_prod {α : Type u} {β : Type v} (sa : finset α) (fb : α → finset β) : finset (α × β) | |
:= (sa.sigma fb).map (equiv.sigma_equiv_prod _ _).to_embedding |
import data.dfinsupp | |
import tactic | |
universes u v w | |
variables {ii : Type u} {jj : Type v} [decidable_eq ii] [decidable_eq jj] | |
variables (β : ii → jj → Type w) [Π i j, decidable_eq (β i j)] | |
variables [Π i j, has_zero (β i j)] | |
def to_fun (x : Π₀ (ij : ii × jj), β ij.1 ij.2) : Π₀ i, Π₀ j, β i j := |