wgetis installedtaris installed
If you really don't want to install Nix under /nix (or you can't) then you can install Nix
| function d = distancePointsAffineSpace(Points, Space) | |
| lengths = @(X) sqrt(sum(X.^2,2)); | |
| d = lengths(Points - projectPointsOntoAffineSpace(Points, Space)); | |
| end | |
| function [projectedPoints, coordinates] = projectPointsOntoAffineSpace(Points, Space) | |
| %coordinates are with respect to an orthonormal base located in Space(1,:) | |
| dirVecs = bsxfun(@minus, Space(2:end,:), Space(1,:)); | |
| % Orthonormalize the direction vectors; | |
| dirVecs = orth(dirVecs.').'; |
| %% %% Requirements: | |
| %% distancePointsAffineSpace: | |
| %% https://gist.github.com/knedlsepp/3e37f147cb4c94ae6223 | |
| %% affineSpaceIntersection: | |
| %% https://github.com/knedlsepp/affineSpaceIntersection/blob/master/affineSpaceIntersection.m | |
| %% uniquetol: | |
| %% http://www.mathworks.com/matlabcentral/fileexchange/27498-unique-with-tolerance/content/uniquetol.m | |
| %% // Read dataset |
| clear; | |
| data = [ 475. , 605.75, 1.; | |
| 571. , 586.5 , 2.; | |
| 233. , 558.5 , 3.; | |
| 669.5 , 562.75, 4.; | |
| 291.25, 546.25, 5.; | |
| 759. , 536.25, 6.; | |
| 362.5 , 531.5 , 7.; | |
| 448. , 513.5 , 8.; | |
| 834.5 , 510. , 9.; |
| {nixpkgs ? null}: | |
| let | |
| sysPkg = import <nixpkgs> { }; | |
| pinnedPkg = sysPkg.fetchFromGitHub { | |
| owner = "NixOS"; | |
| repo = "nixpkgs"; | |
| rev = "cf62a27a326a9cdbb01d627b1faaea3a0d5e886c"; | |
| sha256 = "1q74ciqq5r17vidw2025x8idsncz9k7w60warrij4q7piaffgvd7"; | |
| }; | |
| pkgs = if nixpkgs==null then |
| let | |
| lib = (import <nixpkgs> { overlays = []; }).lib; | |
| composeOverlays = lib.foldl' lib.composeExtensions (self: super: {}); | |
| in | |
| composeOverlays [(import ./overlay1.nix) | |
| (import ./overlay2.nix) | |
| (self: super: {package30 = self.htop; }) | |
| ] |
| {nixpkgs, ngsolveSrc}: | |
| rec { | |
| build = with import <nixpkgs> { }; | |
| releaseTools.nixBuild { | |
| name = "ngsolve"; | |
| src = ngsolveSrc; | |
| doCheck = true; | |
| preConfigure = '' | |
| echo "Prevent ngsolve from downloading catch manually" | |
| substituteInPlace CMakeLists.txt \ |
| #!/usr/bin/env $SHELL | |
| alias lsblk="lsblk -o MODEL,VENDOR,NAME,LABEL,SIZE,MOUNTPOINT,FSTYPE" | |
| alias gramps="nix-env -p /nix/var/nix/profiles/system --list-generations" | |
| alias nixos-rebuild="nixos-rebuild -j 6 --cores 8" | |
| # | |
| # -j is how many "jobs" or simultaneous computational processes run in tandem | |
| # --cores is how many CPU cores you want to use | |
| # How do you get these values? `cat /proc/cpuinfo` and look at the number of | |
| # returned "CPUs". They're zero indexed, so if you get the last one as object | |
| # number seven (7), you have 8 cores. |
| # Examples taken from: | |
| # https://github.com/NixOS/nixpkgs/blob/c58b11d229f63a85ee1d05fc9940a20fa2b73975/pkgs/build-support/docker/examples.nix | |
| # Usage: | |
| # $ nix-build -A redis | |
| # $ docker load < result | |
| { nixpkgs ? (builtins.fetchGit { | |
| url = git://github.com/NixOS/nixpkgs-channels; | |
| ref = "nixos-18.09"; | |
| rev = "c58b11d229f63a85ee1d05fc9940a20fa2b73975"; | |
| }) |